mock-config-server 3.3.4 → 3.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.
Files changed (171) hide show
  1. package/README.md +107 -3
  2. package/dist/bin/build.js +1 -1
  3. package/dist/bin/cli.d.ts +1 -1
  4. package/dist/bin/cli.js +25 -16
  5. package/dist/bin/helpers/createTemplate.d.ts +9 -0
  6. package/dist/bin/helpers/createTemplate.js +25 -0
  7. package/dist/bin/helpers/getMostSpecificPathFromError.d.ts +2 -0
  8. package/dist/bin/helpers/getMostSpecificPathFromError.js +36 -0
  9. package/dist/bin/helpers/getValidationMessageFromPath.d.ts +1 -0
  10. package/dist/bin/helpers/getValidationMessageFromPath.js +11 -0
  11. package/dist/bin/helpers/index.d.ts +4 -0
  12. package/dist/bin/helpers/index.js +44 -0
  13. package/dist/bin/helpers/isOnlyRequestedDataResolvingPropertyExists.d.ts +4 -0
  14. package/dist/bin/helpers/isOnlyRequestedDataResolvingPropertyExists.js +9 -0
  15. package/dist/bin/init.d.ts +2 -0
  16. package/dist/bin/init.js +101 -0
  17. package/dist/bin/run.d.ts +1 -1
  18. package/dist/bin/run.js +23 -2
  19. package/dist/bin/templates/.eslintrc.js +14 -0
  20. package/dist/bin/templates/js/full/mock-requests/graphql/index.js +2 -0
  21. package/dist/bin/templates/js/full/mock-requests/graphql/user.js +35 -0
  22. package/dist/bin/templates/js/full/mock-requests/graphql/users.js +12 -0
  23. package/dist/bin/templates/js/full/mock-requests/rest/index.js +2 -0
  24. package/dist/bin/templates/js/full/mock-requests/rest/user.js +35 -0
  25. package/dist/bin/templates/js/full/mock-requests/rest/users.js +12 -0
  26. package/dist/bin/templates/js/full/mock-server.config.js +16 -0
  27. package/dist/bin/templates/js/graphql/mock-requests/index.js +2 -0
  28. package/dist/bin/templates/js/graphql/mock-requests/user.js +35 -0
  29. package/dist/bin/templates/js/graphql/mock-requests/users.js +12 -0
  30. package/dist/bin/templates/js/graphql/mock-server.config.js +9 -0
  31. package/dist/bin/templates/js/rest/mock-requests/index.js +2 -0
  32. package/dist/bin/templates/js/rest/mock-requests/user.js +35 -0
  33. package/dist/bin/templates/js/rest/mock-requests/users.js +12 -0
  34. package/dist/bin/templates/js/rest/mock-server.config.js +9 -0
  35. package/dist/bin/templates/ts/full/mock-requests/graphql/index.ts +2 -0
  36. package/dist/bin/templates/ts/full/mock-requests/graphql/user.ts +37 -0
  37. package/dist/bin/templates/ts/full/mock-requests/graphql/users.ts +14 -0
  38. package/dist/bin/templates/ts/full/mock-requests/rest/index.ts +2 -0
  39. package/dist/bin/templates/ts/full/mock-requests/rest/user.ts +37 -0
  40. package/dist/bin/templates/ts/full/mock-requests/rest/users.ts +14 -0
  41. package/dist/bin/templates/ts/full/mock-server.config.ts +18 -0
  42. package/dist/bin/templates/ts/graphql/mock-requests/index.ts +2 -0
  43. package/dist/bin/templates/ts/graphql/mock-requests/user.ts +37 -0
  44. package/dist/bin/templates/ts/graphql/mock-requests/users.ts +14 -0
  45. package/dist/bin/templates/ts/graphql/mock-server.config.ts +11 -0
  46. package/dist/bin/templates/ts/rest/mock-requests/index.ts +2 -0
  47. package/dist/bin/templates/ts/rest/mock-requests/user.ts +37 -0
  48. package/dist/bin/templates/ts/rest/mock-requests/users.ts +14 -0
  49. package/dist/bin/templates/ts/rest/mock-server.config.ts +11 -0
  50. package/dist/bin/templates/tsconfig.json +11 -0
  51. package/dist/bin/validateMockServerConfig/baseUrlSchema/baseUrlSchema.d.ts +1 -0
  52. package/dist/bin/validateMockServerConfig/baseUrlSchema/baseUrlSchema.js +8 -0
  53. package/dist/bin/validateMockServerConfig/corsSchema/corsSchema.d.ts +23 -0
  54. package/dist/bin/validateMockServerConfig/corsSchema/corsSchema.js +17 -0
  55. package/dist/bin/validateMockServerConfig/databaseConfigSchema/databaseConfigSchema.d.ts +11 -0
  56. package/dist/bin/validateMockServerConfig/databaseConfigSchema/databaseConfigSchema.js +12 -0
  57. package/dist/bin/validateMockServerConfig/graphqlConfigSchema/graphqlConfigSchema.d.ts +248 -0
  58. package/dist/bin/validateMockServerConfig/graphqlConfigSchema/graphqlConfigSchema.js +31 -0
  59. package/dist/bin/validateMockServerConfig/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +61 -0
  60. package/dist/bin/validateMockServerConfig/graphqlConfigSchema/routeConfigSchema/routeConfigSchema.js +37 -0
  61. package/dist/bin/validateMockServerConfig/interceptorsSchema/interceptorsSchema.d.ts +11 -0
  62. package/dist/bin/validateMockServerConfig/interceptorsSchema/interceptorsSchema.js +11 -0
  63. package/dist/bin/validateMockServerConfig/portSchema/portSchema.d.ts +2 -0
  64. package/dist/bin/validateMockServerConfig/portSchema/portSchema.js +9 -0
  65. package/dist/bin/validateMockServerConfig/queueSchema/queueSchema.d.ts +8 -0
  66. package/dist/bin/validateMockServerConfig/queueSchema/queueSchema.js +12 -0
  67. package/dist/bin/validateMockServerConfig/restConfigSchema/restConfigSchema.d.ts +713 -0
  68. package/dist/bin/validateMockServerConfig/restConfigSchema/restConfigSchema.js +23 -0
  69. package/dist/bin/validateMockServerConfig/restConfigSchema/routeConfigSchema/routeConfigSchema.d.ts +77 -0
  70. package/dist/bin/validateMockServerConfig/restConfigSchema/routeConfigSchema/routeConfigSchema.js +52 -0
  71. package/dist/bin/validateMockServerConfig/settingsSchema/settingsSchema.d.ts +14 -0
  72. package/dist/bin/validateMockServerConfig/settingsSchema/settingsSchema.js +12 -0
  73. package/dist/bin/validateMockServerConfig/staticPathSchema/staticPathSchema.d.ts +20 -0
  74. package/dist/bin/validateMockServerConfig/staticPathSchema/staticPathSchema.js +14 -0
  75. package/dist/bin/validateMockServerConfig/utils/checkModeSchema/checkModeSchema.d.ts +5 -0
  76. package/dist/bin/validateMockServerConfig/utils/checkModeSchema/checkModeSchema.js +12 -0
  77. package/dist/bin/validateMockServerConfig/utils/entitiesSchema/entitiesSchema.d.ts +75 -0
  78. package/dist/bin/validateMockServerConfig/utils/entitiesSchema/entitiesSchema.js +67 -0
  79. package/dist/bin/validateMockServerConfig/utils/index.d.ts +6 -0
  80. package/dist/bin/validateMockServerConfig/utils/index.js +71 -0
  81. package/dist/bin/validateMockServerConfig/utils/jsonSchema/jsonSchema.d.ts +8 -0
  82. package/dist/bin/validateMockServerConfig/utils/jsonSchema/jsonSchema.js +13 -0
  83. package/dist/bin/validateMockServerConfig/utils/plainObjectSchema/plainObjectSchema.d.ts +2 -0
  84. package/dist/bin/validateMockServerConfig/utils/plainObjectSchema/plainObjectSchema.js +11 -0
  85. package/dist/bin/validateMockServerConfig/utils/requiredPropertiesSchema/requiredPropertiesSchema.d.ts +3 -0
  86. package/dist/bin/validateMockServerConfig/utils/requiredPropertiesSchema/requiredPropertiesSchema.js +10 -0
  87. package/dist/bin/validateMockServerConfig/utils/sharedSchema/sharedSchema.d.ts +3 -0
  88. package/dist/bin/validateMockServerConfig/utils/sharedSchema/sharedSchema.js +9 -0
  89. package/dist/bin/validateMockServerConfig/validateApiMockServerConfig.d.ts +2 -0
  90. package/dist/bin/validateMockServerConfig/validateApiMockServerConfig.js +44 -0
  91. package/dist/bin/validateMockServerConfig/validateMockServerConfig.js +27 -20
  92. package/dist/src/core/database/createDatabaseRoutes/helpers/createNestedDatabaseRoutes/createNestedDatabaseRoutes.js +27 -16
  93. package/dist/src/core/database/createDatabaseRoutes/helpers/createShallowDatabaseRoutes/createShallowDatabaseRoutes.js +64 -3
  94. package/dist/src/core/database/createDatabaseRoutes/helpers/filter/filter.d.ts +1 -0
  95. package/dist/src/core/database/createDatabaseRoutes/helpers/filter/filter.js +46 -6
  96. package/dist/src/core/database/createDatabaseRoutes/helpers/pagination/pagination.d.ts +1 -0
  97. package/dist/src/core/database/createDatabaseRoutes/helpers/search/search.d.ts +4 -0
  98. package/dist/src/core/database/createDatabaseRoutes/helpers/search/search.js +29 -0
  99. package/dist/src/core/database/createDatabaseRoutes/helpers/sort/sort.d.ts +1 -0
  100. package/dist/src/core/database/createDatabaseRoutes/helpers/sort/sort.js +3 -4
  101. package/dist/src/core/database/createDatabaseRoutes/storages/File/FileWriter.js +2 -2
  102. package/dist/src/core/graphql/createGraphQLRoutes/createGraphQLRoutes.js +13 -7
  103. package/dist/src/core/graphql/createGraphQLRoutes/helpers/prepareGraphQLRequestConfigs/prepareGraphQLRequestConfigs.js +7 -1
  104. package/dist/src/core/rest/createRestRoutes/createRestRoutes.js +27 -10
  105. package/dist/src/core/rest/createRestRoutes/helpers/prepareRestRequestConfigs/prepareRestRequestConfigs.js +6 -0
  106. package/dist/src/server/createGraphQLMockServer/createGraphQLMockServer.js +1 -1
  107. package/dist/src/server/createRestMockServer/createRestMockServer.js +1 -1
  108. package/dist/src/static/views/components/header/index.js +1 -1
  109. package/dist/src/static/views/features/scheme/index.js +31 -31
  110. package/dist/src/static/views/features/tab/index.js +12 -12
  111. package/dist/src/utils/constants/appPath.js +1 -2
  112. package/dist/src/utils/constants/checkModes.d.ts +8 -9
  113. package/dist/src/utils/constants/checkModes.js +8 -16
  114. package/dist/src/utils/constants/default.js +2 -3
  115. package/dist/src/utils/helpers/files/index.d.ts +1 -0
  116. package/dist/src/utils/helpers/files/index.js +16 -0
  117. package/dist/src/utils/helpers/files/isFilePathValid/isFilePathValid.d.ts +1 -0
  118. package/dist/src/utils/helpers/files/isFilePathValid/isFilePathValid.js +19 -0
  119. package/dist/src/utils/helpers/index.d.ts +1 -0
  120. package/dist/src/utils/helpers/index.js +11 -0
  121. package/dist/src/utils/helpers/tests/createTmpDir.d.ts +1 -0
  122. package/dist/src/utils/helpers/tests/createTmpDir.js +12 -0
  123. package/dist/src/utils/helpers/tests/index.d.ts +1 -0
  124. package/dist/{bin/validateMockServerConfig/helpers/isCheckModeValid → src/utils/helpers/tests}/index.js +4 -4
  125. package/dist/src/utils/types/entities.d.ts +48 -0
  126. package/dist/src/utils/types/entities.js +1 -0
  127. package/dist/src/utils/types/graphql.d.ts +11 -45
  128. package/dist/src/utils/types/index.d.ts +1 -0
  129. package/dist/src/utils/types/index.js +11 -0
  130. package/dist/src/utils/types/rest.d.ts +17 -46
  131. package/dist/src/utils/types/server.d.ts +5 -4
  132. package/package.json +35 -27
  133. package/dist/bin/resolveConfigFilePath/resolveConfigFilePath.d.ts +0 -1
  134. package/dist/bin/resolveConfigFilePath/resolveConfigFilePath.js +0 -16
  135. package/dist/bin/validateMockServerConfig/helpers/index.d.ts +0 -2
  136. package/dist/bin/validateMockServerConfig/helpers/index.js +0 -27
  137. package/dist/bin/validateMockServerConfig/helpers/isCheckModeValid/index.d.ts +0 -1
  138. package/dist/bin/validateMockServerConfig/helpers/isCheckModeValid/isCheckModeValid.d.ts +0 -1
  139. package/dist/bin/validateMockServerConfig/helpers/isCheckModeValid/isCheckModeValid.js +0 -12
  140. package/dist/bin/validateMockServerConfig/helpers/isDescriptorValueValid/index.d.ts +0 -1
  141. package/dist/bin/validateMockServerConfig/helpers/isDescriptorValueValid/index.js +0 -16
  142. package/dist/bin/validateMockServerConfig/helpers/isDescriptorValueValid/isDescriptorValueValid.d.ts +0 -2
  143. package/dist/bin/validateMockServerConfig/helpers/isDescriptorValueValid/isDescriptorValueValid.js +0 -43
  144. package/dist/bin/validateMockServerConfig/validateBaseUrl/validateBaseUrl.d.ts +0 -1
  145. package/dist/bin/validateMockServerConfig/validateBaseUrl/validateBaseUrl.js +0 -15
  146. package/dist/bin/validateMockServerConfig/validateCors/validateCors.d.ts +0 -1
  147. package/dist/bin/validateMockServerConfig/validateCors/validateCors.js +0 -84
  148. package/dist/bin/validateMockServerConfig/validateDatabaseConfig/validateDatabaseConfig.d.ts +0 -1
  149. package/dist/bin/validateMockServerConfig/validateDatabaseConfig/validateDatabaseConfig.js +0 -45
  150. package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateGraphqlConfig.d.ts +0 -1
  151. package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateGraphqlConfig.js +0 -58
  152. package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateRoutes/validateRoutes.d.ts +0 -2
  153. package/dist/bin/validateMockServerConfig/validateGraphqlConfig/validateRoutes/validateRoutes.js +0 -153
  154. package/dist/bin/validateMockServerConfig/validateInterceptors/validateInterceptors.d.ts +0 -1
  155. package/dist/bin/validateMockServerConfig/validateInterceptors/validateInterceptors.js +0 -27
  156. package/dist/bin/validateMockServerConfig/validatePort/validatePort.d.ts +0 -1
  157. package/dist/bin/validateMockServerConfig/validatePort/validatePort.js +0 -12
  158. package/dist/bin/validateMockServerConfig/validateQueue/validateQueue.d.ts +0 -1
  159. package/dist/bin/validateMockServerConfig/validateQueue/validateQueue.js +0 -29
  160. package/dist/bin/validateMockServerConfig/validateRestConfig/validateRestConfig.d.ts +0 -1
  161. package/dist/bin/validateMockServerConfig/validateRestConfig/validateRestConfig.js +0 -57
  162. package/dist/bin/validateMockServerConfig/validateRestConfig/validateRoutes/validateRoutes.d.ts +0 -2
  163. package/dist/bin/validateMockServerConfig/validateRestConfig/validateRoutes/validateRoutes.js +0 -157
  164. package/dist/bin/validateMockServerConfig/validateSettings/validateSettings.d.ts +0 -1
  165. package/dist/bin/validateMockServerConfig/validateSettings/validateSettings.js +0 -34
  166. package/dist/bin/validateMockServerConfig/validateStaticPath/validateStaticPath.d.ts +0 -1
  167. package/dist/bin/validateMockServerConfig/validateStaticPath/validateStaticPath.js +0 -53
  168. package/dist/src/core/database/createOrm/createOrm.d.ts +0 -4
  169. package/dist/src/core/database/createOrm/createOrm.js +0 -70
  170. package/dist/src/core/database/createStorage/createStorage.d.ts +0 -2
  171. package/dist/src/core/database/createStorage/createStorage.js +0 -10
@@ -4,5 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.APP_PATH = void 0;
7
- const APP_PATH = process.cwd();
8
- exports.APP_PATH = APP_PATH;
7
+ const APP_PATH = exports.APP_PATH = process.cwd();
@@ -1,9 +1,8 @@
1
- import type { CalculateByDescriptorValueCheckMode, CheckActualValueCheckMode, CheckMode, CompareWithDescriptorAnyValueCheckMode, CompareWithDescriptorStringValueCheckMode, CompareWithDescriptorValueCheckMode } from '../types';
2
- export declare const CHECK_ACTUAL_VALUE_CHECK_MODES: CheckActualValueCheckMode[];
3
- export declare const COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES: CompareWithDescriptorAnyValueCheckMode[];
4
- export declare const COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES: CompareWithDescriptorStringValueCheckMode[];
5
- export declare const COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES: CompareWithDescriptorValueCheckMode[];
6
- export declare const CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES: CalculateByDescriptorValueCheckMode[];
7
- export declare const CHECK_MODES: CheckMode[];
8
- export declare const PLAIN_ENTITY_CHECK_MODES: CheckMode[];
9
- export declare const NEGATION_CHECK_MODES: CheckMode[];
1
+ export declare const CHECK_ACTUAL_VALUE_CHECK_MODES: readonly ["exists", "notExists"];
2
+ export declare const COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES: readonly ["equals", "notEquals"];
3
+ export declare const COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES: readonly ["includes", "notIncludes", "startsWith", "notStartsWith", "endsWith", "notEndsWith"];
4
+ export declare const COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES: readonly ["equals", "notEquals", "includes", "notIncludes", "startsWith", "notStartsWith", "endsWith", "notEndsWith"];
5
+ export declare const CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES: readonly ["regExp", "function"];
6
+ export declare const CHECK_MODES: readonly ["exists", "notExists", "equals", "notEquals", "includes", "notIncludes", "startsWith", "notStartsWith", "endsWith", "notEndsWith", "regExp", "function"];
7
+ export declare const PLAIN_ENTITY_CHECK_MODES: readonly ["exists", "notExists", "equals", "notEquals", "function"];
8
+ export declare const NEGATION_CHECK_MODES: readonly ["notExists", "notEquals", "notIncludes", "notStartsWith", "notEndsWith"];
@@ -4,19 +4,11 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.PLAIN_ENTITY_CHECK_MODES = exports.NEGATION_CHECK_MODES = exports.COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES = exports.COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES = exports.COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES = exports.CHECK_MODES = exports.CHECK_ACTUAL_VALUE_CHECK_MODES = exports.CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES = void 0;
7
- const CHECK_ACTUAL_VALUE_CHECK_MODES = ['exists', 'notExists'];
8
- exports.CHECK_ACTUAL_VALUE_CHECK_MODES = CHECK_ACTUAL_VALUE_CHECK_MODES;
9
- const COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES = ['equals', 'notEquals'];
10
- exports.COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES = COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES;
11
- const COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES = ['includes', 'notIncludes', 'startsWith', 'notStartsWith', 'endsWith', 'notEndsWith'];
12
- exports.COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES = COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES;
13
- const COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES = [...COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES, ...COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES];
14
- exports.COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES = COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES;
15
- const CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES = ['regExp', 'function'];
16
- exports.CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES = CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES;
17
- const CHECK_MODES = [...CHECK_ACTUAL_VALUE_CHECK_MODES, ...COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES, ...CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES];
18
- exports.CHECK_MODES = CHECK_MODES;
19
- const PLAIN_ENTITY_CHECK_MODES = [...CHECK_ACTUAL_VALUE_CHECK_MODES, ...COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES, 'function'];
20
- exports.PLAIN_ENTITY_CHECK_MODES = PLAIN_ENTITY_CHECK_MODES;
21
- const NEGATION_CHECK_MODES = ['notExists', 'notEquals', 'notIncludes', 'notStartsWith', 'notEndsWith'];
22
- exports.NEGATION_CHECK_MODES = NEGATION_CHECK_MODES;
7
+ const CHECK_ACTUAL_VALUE_CHECK_MODES = exports.CHECK_ACTUAL_VALUE_CHECK_MODES = ['exists', 'notExists'];
8
+ const COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES = exports.COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES = ['equals', 'notEquals'];
9
+ const COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES = exports.COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES = ['includes', 'notIncludes', 'startsWith', 'notStartsWith', 'endsWith', 'notEndsWith'];
10
+ const COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES = exports.COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES = [...COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES, ...COMPARE_WITH_DESCRIPTOR_STRING_VALUE_CHECK_MODES];
11
+ const CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES = exports.CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES = ['regExp', 'function'];
12
+ const CHECK_MODES = exports.CHECK_MODES = [...CHECK_ACTUAL_VALUE_CHECK_MODES, ...COMPARE_WITH_DESCRIPTOR_VALUE_CHECK_MODES, ...CALCULATE_BY_DESCRIPTOR_VALUE_CHECK_MODES];
13
+ const PLAIN_ENTITY_CHECK_MODES = exports.PLAIN_ENTITY_CHECK_MODES = [...CHECK_ACTUAL_VALUE_CHECK_MODES, ...COMPARE_WITH_DESCRIPTOR_ANY_VALUE_CHECK_MODES, 'function'];
14
+ const NEGATION_CHECK_MODES = exports.NEGATION_CHECK_MODES = ['notExists', 'notEquals', 'notIncludes', 'notStartsWith', 'notEndsWith'];
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.DEFAULT = void 0;
7
- const DEFAULT = {
7
+ const DEFAULT = exports.DEFAULT = {
8
8
  PORT: 31299,
9
9
  CORS: {
10
10
  ORIGIN: '*',
@@ -14,5 +14,4 @@ const DEFAULT = {
14
14
  CREDENTIALS: true,
15
15
  MAX_AGE: 3600
16
16
  }
17
- };
18
- exports.DEFAULT = DEFAULT;
17
+ };
@@ -0,0 +1 @@
1
+ export * from './isFilePathValid/isFilePathValid';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _isFilePathValid = require("./isFilePathValid/isFilePathValid");
7
+ Object.keys(_isFilePathValid).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _isFilePathValid[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _isFilePathValid[key];
14
+ }
15
+ });
16
+ });
@@ -0,0 +1 @@
1
+ export declare const isFilePathValid: (path: string) => boolean;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isFilePathValid = void 0;
7
+ var _fs = _interopRequireDefault(require("fs"));
8
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
+ const isFilePathValid = path => {
10
+ try {
11
+ if (!_fs.default.existsSync(path)) return false;
12
+ if (!_fs.default.statSync(path).isFile()) return false;
13
+ return true;
14
+ } catch (error) {
15
+ console.error(error);
16
+ return false;
17
+ }
18
+ };
19
+ exports.isFilePathValid = isFilePathValid;
@@ -1,6 +1,7 @@
1
1
  export * from './asyncHandler';
2
2
  export * from './config';
3
3
  export * from './entities';
4
+ export * from './files';
4
5
  export * from './graphql';
5
6
  export * from './interceptors';
6
7
  export * from './isPlainObject/isPlainObject';
@@ -36,6 +36,17 @@ Object.keys(_entities).forEach(function (key) {
36
36
  }
37
37
  });
38
38
  });
39
+ var _files = require("./files");
40
+ Object.keys(_files).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _files[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _files[key];
47
+ }
48
+ });
49
+ });
39
50
  var _graphql = require("./graphql");
40
51
  Object.keys(_graphql).forEach(function (key) {
41
52
  if (key === "default" || key === "__esModule") return;
@@ -0,0 +1 @@
1
+ export declare const createTmpDir: () => string;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createTmpDir = void 0;
7
+ var _fs = _interopRequireDefault(require("fs"));
8
+ var _os = _interopRequireDefault(require("os"));
9
+ var _path = _interopRequireDefault(require("path"));
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ const createTmpDir = () => _fs.default.mkdtempSync(`${_os.default.tmpdir()}${_path.default.sep}`);
12
+ exports.createTmpDir = createTmpDir;
@@ -0,0 +1 @@
1
+ export * from './createTmpDir';
@@ -3,14 +3,14 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- var _isCheckModeValid = require("./isCheckModeValid");
7
- Object.keys(_isCheckModeValid).forEach(function (key) {
6
+ var _createTmpDir = require("./createTmpDir");
7
+ Object.keys(_createTmpDir).forEach(function (key) {
8
8
  if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _isCheckModeValid[key]) return;
9
+ if (key in exports && exports[key] === _createTmpDir[key]) return;
10
10
  Object.defineProperty(exports, key, {
11
11
  enumerable: true,
12
12
  get: function () {
13
- return _isCheckModeValid[key];
13
+ return _createTmpDir[key];
14
14
  }
15
15
  });
16
16
  });
@@ -0,0 +1,48 @@
1
+ import type { CheckActualValueCheckMode, CheckFunction, CheckMode, CompareWithDescriptorAnyValueCheckMode, CompareWithDescriptorStringValueCheckMode, CompareWithDescriptorValueCheckMode } from './checkModes';
2
+ import type { NestedObjectOrArray } from './utils';
3
+ type PlainEntityValue = string | number | boolean | null;
4
+ export type TopLevelPlainEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
5
+ checkMode: Check;
6
+ value: (actualValue: NestedObjectOrArray<PlainEntityValue>, checkFunction: CheckFunction) => boolean;
7
+ } : Check extends CompareWithDescriptorAnyValueCheckMode ? {
8
+ checkMode: Check;
9
+ value: NestedObjectOrArray<PlainEntityValue>;
10
+ } : Check extends CheckActualValueCheckMode ? {
11
+ checkMode: Check;
12
+ } : never;
13
+ type PropertyLevelPlainEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
14
+ checkMode: Check;
15
+ value: (actualValue: PlainEntityValue | NestedObjectOrArray<PlainEntityValue>, checkFunction: CheckFunction) => boolean;
16
+ } : Check extends CompareWithDescriptorAnyValueCheckMode ? {
17
+ checkMode: Check;
18
+ value: PlainEntityValue | NestedObjectOrArray<PlainEntityValue>;
19
+ } : Check extends 'regExp' ? {
20
+ checkMode: Check;
21
+ value: RegExp | RegExp[];
22
+ } : Check extends CompareWithDescriptorStringValueCheckMode ? {
23
+ checkMode: Check;
24
+ value: PlainEntityValue | PlainEntityValue[];
25
+ } : Check extends CheckActualValueCheckMode ? {
26
+ checkMode: Check;
27
+ } : never;
28
+ type NonCheckMode<T extends object> = T & {
29
+ checkMode?: never;
30
+ };
31
+ type TopLevelPlainEntityRecord = NonCheckMode<Record<string, PropertyLevelPlainEntityDescriptor | NonCheckMode<NestedObjectOrArray<PlainEntityValue>> | PlainEntityValue>>;
32
+ export type TopLevelPlainEntityArray = Array<NestedObjectOrArray<PlainEntityValue>>;
33
+ export type PlainEntity = TopLevelPlainEntityDescriptor | TopLevelPlainEntityRecord | TopLevelPlainEntityArray;
34
+ type MappedEntityValue = string | number | boolean;
35
+ type MappedEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
36
+ checkMode: Check;
37
+ value: (actualValue: MappedEntityValue, checkFunction: CheckFunction) => boolean;
38
+ } : Check extends 'regExp' ? {
39
+ checkMode: Check;
40
+ value: RegExp | RegExp[];
41
+ } : Check extends CompareWithDescriptorValueCheckMode ? {
42
+ checkMode: Check;
43
+ value: MappedEntityValue | MappedEntityValue[];
44
+ } : Check extends CheckActualValueCheckMode ? {
45
+ checkMode: Check;
46
+ } : never;
47
+ export type MappedEntity = Record<string, MappedEntityDescriptor | MappedEntityValue | MappedEntityValue[]>;
48
+ export {};
@@ -0,0 +1 @@
1
+ "use strict";
@@ -1,58 +1,24 @@
1
1
  import type { Request } from 'express';
2
- import type { CheckActualValueCheckMode, CheckFunction, CheckMode, CompareWithDescriptorAnyValueCheckMode, CompareWithDescriptorValueCheckMode } from './checkModes';
2
+ import type { MappedEntity, PlainEntity } from './entities';
3
3
  import type { Interceptors } from './interceptors';
4
- import type { NestedObjectOrArray } from './utils';
5
4
  import type { Data } from './values';
6
5
  export type GraphQLEntityName = 'headers' | 'cookies' | 'query' | 'variables';
7
- type GraphQLPlainEntityValue = string | number | boolean | null;
8
- type GraphQLMappedEntityValue = string | number | boolean;
9
- export type GraphQLTopLevelPlainEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
10
- checkMode: Check;
11
- value: (actualValue: NestedObjectOrArray<GraphQLPlainEntityValue>, checkFunction: CheckFunction) => boolean;
12
- } : Check extends CompareWithDescriptorAnyValueCheckMode ? {
13
- checkMode: Check;
14
- value: NestedObjectOrArray<GraphQLPlainEntityValue>;
15
- } : Check extends CheckActualValueCheckMode ? {
16
- checkMode: Check;
17
- value?: never;
18
- } : never;
19
- type GraphQLPropertyLevelPlainEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
20
- checkMode: Check;
21
- value: (actualValue: GraphQLPlainEntityValue | NestedObjectOrArray<GraphQLPlainEntityValue>, checkFunction: CheckFunction) => boolean;
22
- } : Check extends CompareWithDescriptorAnyValueCheckMode ? {
23
- checkMode: Check;
24
- value: GraphQLPlainEntityValue | NestedObjectOrArray<GraphQLPlainEntityValue>;
25
- } : Check extends CheckActualValueCheckMode ? {
26
- checkMode: Check;
27
- value?: never;
28
- } : never;
29
- type GraphQLMappedEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
30
- checkMode: Check;
31
- value: (actualValue: GraphQLMappedEntityValue, checkFunction: CheckFunction) => boolean;
32
- } : Check extends 'regExp' ? {
33
- checkMode: Check;
34
- value: RegExp | RegExp[];
35
- } : Check extends CompareWithDescriptorValueCheckMode ? {
36
- checkMode: Check;
37
- value: GraphQLMappedEntityValue | GraphQLMappedEntityValue[];
38
- } : Check extends CheckActualValueCheckMode ? {
39
- checkMode: Check;
40
- value?: never;
41
- } : never;
42
- export type GraphQLEntityDescriptorOrValue<EntityName extends GraphQLEntityName = GraphQLEntityName> = EntityName extends 'variables' ? GraphQLTopLevelPlainEntityDescriptor | Record<string, GraphQLPropertyLevelPlainEntityDescriptor> | NestedObjectOrArray<GraphQLPlainEntityValue> : Record<string, GraphQLMappedEntityDescriptor | GraphQLMappedEntityValue | GraphQLMappedEntityValue[]>;
6
+ export type GraphQLEntity<EntityName extends GraphQLEntityName = GraphQLEntityName> = EntityName extends 'variables' ? PlainEntity : MappedEntity;
43
7
  export type GraphQLOperationType = 'query' | 'mutation';
44
8
  export type GraphQLOperationName = string | RegExp;
45
9
  export type GraphQLEntityNamesByOperationType = {
46
10
  [operationType in GraphQLOperationType]: GraphQLEntityName;
47
11
  };
48
12
  export type GraphQLEntitiesByEntityName = {
49
- [EntityName in GraphQLEntityName]?: GraphQLEntityDescriptorOrValue<EntityName>;
13
+ [EntityName in GraphQLEntityName]?: GraphQLEntity<EntityName>;
50
14
  };
51
- type GraphQLSettings = {
52
- readonly polling: boolean;
53
- };
54
- export type GraphQLRouteConfig<Settings extends GraphQLSettings = GraphQLSettings> = ({
55
- settings: Settings & {
15
+ interface GraphQLSettings {
16
+ readonly polling?: boolean;
17
+ readonly status?: number;
18
+ readonly delay?: number;
19
+ }
20
+ export type GraphQLRouteConfig = ({
21
+ settings: GraphQLSettings & {
56
22
  polling: true;
57
23
  };
58
24
  queue: Array<{
@@ -60,7 +26,7 @@ export type GraphQLRouteConfig<Settings extends GraphQLSettings = GraphQLSetting
60
26
  data: ((request: Request, entities: GraphQLEntitiesByEntityName) => Data | Promise<Data>) | Data;
61
27
  }>;
62
28
  } | {
63
- settings?: Settings & {
29
+ settings?: GraphQLSettings & {
64
30
  polling?: false;
65
31
  };
66
32
  data: ((request: Request, entities: GraphQLEntitiesByEntityName) => Data | Promise<Data>) | Data;
@@ -1,5 +1,6 @@
1
1
  export * from './checkModes';
2
2
  export * from './database';
3
+ export * from './entities';
3
4
  export * from './graphql';
4
5
  export * from './interceptors';
5
6
  export * from './rest';
@@ -25,6 +25,17 @@ Object.keys(_database).forEach(function (key) {
25
25
  }
26
26
  });
27
27
  });
28
+ var _entities = require("./entities");
29
+ Object.keys(_entities).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _entities[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _entities[key];
36
+ }
37
+ });
38
+ });
28
39
  var _graphql = require("./graphql");
29
40
  Object.keys(_graphql).forEach(function (key) {
30
41
  if (key === "default" || key === "__esModule") return;
@@ -1,70 +1,41 @@
1
1
  import type { Request } from 'express';
2
- import type { CheckActualValueCheckMode, CheckFunction, CheckMode, CompareWithDescriptorAnyValueCheckMode, CompareWithDescriptorValueCheckMode } from './checkModes';
2
+ import type { MappedEntity, PlainEntity } from './entities';
3
3
  import type { Interceptors } from './interceptors';
4
- import type { NestedObjectOrArray } from './utils';
5
4
  import type { Data } from './values';
6
5
  export type RestMethod = 'get' | 'post' | 'delete' | 'put' | 'patch' | 'options';
7
6
  export type RestEntityName = 'headers' | 'cookies' | 'query' | 'params' | 'body';
8
- type RestPlainEntityValue = string | number | boolean | null;
9
- type RestMappedEntityValue = string | number | boolean;
10
- export type RestTopLevelPlainEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
11
- checkMode: Check;
12
- value: (actualValue: NestedObjectOrArray<RestPlainEntityValue>, checkFunction: CheckFunction) => boolean;
13
- } : Check extends CompareWithDescriptorAnyValueCheckMode ? {
14
- checkMode: Check;
15
- value: NestedObjectOrArray<RestPlainEntityValue>;
16
- } : Check extends CheckActualValueCheckMode ? {
17
- checkMode: Check;
18
- value?: never;
19
- } : never;
20
- type RestPropertyLevelPlainEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
21
- checkMode: Check;
22
- value: (actualValue: RestPlainEntityValue | NestedObjectOrArray<RestPlainEntityValue>, checkFunction: CheckFunction) => boolean;
23
- } : Check extends CompareWithDescriptorAnyValueCheckMode ? {
24
- checkMode: Check;
25
- value: RestPlainEntityValue | NestedObjectOrArray<RestPlainEntityValue>;
26
- } : Check extends CheckActualValueCheckMode ? {
27
- checkMode: Check;
28
- value?: never;
29
- } : never;
30
- type RestMappedEntityDescriptor<Check extends CheckMode = CheckMode> = Check extends 'function' ? {
31
- checkMode: Check;
32
- value: (actualValue: RestMappedEntityValue, checkFunction: CheckFunction) => boolean;
33
- } : Check extends 'regExp' ? {
34
- checkMode: Check;
35
- value: RegExp | RegExp[];
36
- } : Check extends CompareWithDescriptorValueCheckMode ? {
37
- checkMode: Check;
38
- value: RestMappedEntityValue | RestMappedEntityValue[];
39
- } : Check extends CheckActualValueCheckMode ? {
40
- checkMode: Check;
41
- value?: never;
42
- } : never;
43
- export type RestEntityDescriptorOrValue<EntityName extends RestEntityName = RestEntityName> = EntityName extends 'body' ? RestTopLevelPlainEntityDescriptor | Record<string, RestPropertyLevelPlainEntityDescriptor> | NestedObjectOrArray<RestPlainEntityValue> : Record<string, RestMappedEntityDescriptor | RestMappedEntityValue | RestMappedEntityValue[]>;
7
+ export type RestEntity<EntityName extends RestEntityName = RestEntityName> = EntityName extends 'body' ? PlainEntity : MappedEntity;
44
8
  export type RestEntityNamesByMethod = {
45
9
  [key in RestMethod]: key extends 'get' | 'delete' | 'options' ? Exclude<RestEntityName, 'body'> : RestEntityName;
46
10
  };
47
11
  export type RestEntitiesByEntityName<Method extends RestMethod = RestMethod> = {
48
- [EntityName in RestEntityNamesByMethod[Method]]?: RestEntityDescriptorOrValue<EntityName>;
12
+ [EntityName in RestEntityNamesByMethod[Method]]?: RestEntity<EntityName>;
49
13
  };
50
14
  interface RestSettings {
51
15
  readonly polling?: boolean;
16
+ readonly status?: number;
17
+ readonly delay?: number;
52
18
  }
53
- export type RestRouteConfig<Method extends RestMethod, Entities extends RestEntitiesByEntityName<Method> = RestEntitiesByEntityName<Method>, Settings extends RestSettings = RestSettings> = ({
54
- settings: Settings & {
19
+ export type RestRouteConfig<Method extends RestMethod> = ({
20
+ settings: RestSettings & {
55
21
  polling: true;
56
22
  };
57
23
  queue: Array<{
58
24
  time?: number;
59
- data: ((request: Request, entities: Entities) => Data | Promise<Data>) | Data;
25
+ data: ((request: Request, entities: RestEntitiesByEntityName<Method>) => Data | Promise<Data>) | Data;
60
26
  }>;
61
27
  } | {
62
- settings?: Settings & {
63
- polling: false;
28
+ settings?: RestSettings & {
29
+ polling?: false;
64
30
  };
65
- data: ((request: Request, entities: Entities) => Data | Promise<Data>) | Data;
31
+ data: ((request: Request, entities: RestEntitiesByEntityName<Method>) => Data | Promise<Data>) | Data;
32
+ } | {
33
+ settings?: RestSettings & {
34
+ polling?: false;
35
+ };
36
+ file: string;
66
37
  }) & {
67
- entities?: Entities;
38
+ entities?: RestEntitiesByEntityName<Method>;
68
39
  interceptors?: Pick<Interceptors, 'response'>;
69
40
  };
70
41
  export type RestPathString = `/${string}`;
@@ -1,4 +1,5 @@
1
1
  import type { Request } from 'express';
2
+ import type { Arguments } from 'yargs';
2
3
  import type { GraphQLRequestConfig } from './graphql';
3
4
  import type { Interceptors } from './interceptors';
4
5
  import type { RestMethod, RestRequestConfig } from './rest';
@@ -46,22 +47,22 @@ export interface MockServerConfig extends BaseMockServerConfig {
46
47
  database?: DatabaseConfig;
47
48
  }
48
49
  export interface RestMockServerConfig extends BaseMockServerConfig {
49
- configs: RestRequestConfig[];
50
+ configs?: RestRequestConfig[];
50
51
  database?: DatabaseConfig;
51
52
  }
52
53
  export interface GraphQLMockServerConfig extends BaseMockServerConfig {
53
- configs: GraphQLRequestConfig[];
54
+ configs?: GraphQLRequestConfig[];
54
55
  database?: DatabaseConfig;
55
56
  }
56
57
  export interface DatabaseMockServerConfig extends BaseMockServerConfig {
57
58
  data: Record<string, unknown> | `${string}.json`;
58
59
  routes?: Record<`/${string}`, `/${string}`> | `${string}.json`;
59
60
  }
60
- export interface MockServerConfigArgv {
61
+ export type MockServerConfigArgv = Arguments<{
61
62
  baseUrl?: string;
62
63
  port?: number;
63
64
  staticPath?: string;
64
65
  config?: string;
65
66
  watch?: boolean;
66
- }
67
+ }>;
67
68
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mock-config-server",
3
- "version": "3.3.4",
3
+ "version": "3.4.0",
4
4
  "description": "Tool that easily and quickly imitates server operation, create full fake api in few steps",
5
5
  "author": {
6
6
  "name": "SIBERIA CAN CODE 🧊",
@@ -22,6 +22,10 @@
22
22
  {
23
23
  "name": "Alexander Vasilchuk",
24
24
  "url": "https://github.com/anv296"
25
+ },
26
+ {
27
+ "name": "Daria Bortsova",
28
+ "url": "https://github.com/kvelian"
25
29
  }
26
30
  ],
27
31
  "license": "MIT",
@@ -40,7 +44,7 @@
40
44
  "scripts": {
41
45
  "prepare": "husky install && yarn build",
42
46
  "build:types": "tsc -p tsconfig.production.json && tsc-alias -p tsconfig.production.json",
43
- "build:babel": "babel --delete-dir-on-start bin --out-dir dist/bin --extensions \".ts,.tsx\" && babel src --out-dir dist/src --extensions \".ts,.tsx\" --copy-files --no-copy-ignored && babel ./index.ts --out-dir dist --extensions \".ts\"",
47
+ "build:babel": "babel --delete-dir-on-start bin --out-dir dist/bin --extensions .ts && shx cp -r bin/templates dist/bin/templates && babel --delete-dir-on-start src --out-dir dist/src --extensions .ts --copy-files --no-copy-ignored && babel ./index.ts --out-dir dist --extensions .ts",
44
48
  "build": "yarn build:babel && yarn build:types",
45
49
  "start": "yarn build && node ./dist/bin/bin.js",
46
50
  "dev": "nodemon --watch src --watch bin --watch mock-server.config.* -e js,ts,ejs --exec \"yarn start\"",
@@ -64,40 +68,44 @@
64
68
  ]
65
69
  },
66
70
  "dependencies": {
67
- "@types/body-parser": "^1.19.2",
68
- "@types/express": "^4.17.17",
71
+ "@types/body-parser": "^1.19.5",
72
+ "@types/express": "^4.17.21",
69
73
  "@types/flat": "^5.0.2",
70
- "@types/yargs": "^17.0.24",
74
+ "@types/prompts": "^2.4.9",
75
+ "@types/yargs": "^17.0.32",
71
76
  "ansi-colors": "^4.1.3",
72
- "body-parser": "^1.20.0",
77
+ "body-parser": "^1.20.2",
73
78
  "ejs": "^3.1.9",
74
- "esbuild": "^0.18.17",
75
- "express": "^4.18.1",
79
+ "esbuild": "^0.19.11",
80
+ "express": "^4.18.2",
76
81
  "express-urlrewrite": "^2.0.1",
77
82
  "flat": "^5.0.2",
78
83
  "graphql": "^16.6.0",
79
84
  "please-upgrade-node": "^3.2.0",
80
- "yargs": "^17.7.1"
85
+ "prompts": "^2.4.2",
86
+ "yargs": "^17.7.2",
87
+ "zod": "^3.22.4"
81
88
  },
82
89
  "devDependencies": {
83
- "@babel/cli": "^7.22.10",
84
- "@babel/core": "^7.22.10",
85
- "@babel/preset-env": "^7.22.10",
86
- "@babel/preset-typescript": "^7.22.5",
87
- "@siberiacancode/eslint": "^1.0.1",
88
- "@siberiacancode/jest": "^1.0.1",
89
- "@siberiacancode/prettier": "^1.0.0",
90
- "@siberiacancode/stylelint": "^1.0.1",
91
- "@types/jest": "^29.4.0",
92
- "@types/supertest": "^2.0.12",
93
- "husky": "^8.0.1",
94
- "lint-staged": "^13.1.1",
95
- "nodemon": "^3.0.1",
96
- "style-loader": "^3.3.2",
97
- "supertest": "^6.3.3",
98
- "ts-jest": "^29.0.3",
99
- "tsc-alias": "^1.8.5",
100
- "typescript": "^5.1.6"
90
+ "@babel/cli": "^7.23.4",
91
+ "@babel/core": "^7.23.7",
92
+ "@babel/preset-env": "^7.23.8",
93
+ "@babel/preset-typescript": "^7.23.3",
94
+ "@siberiacancode/eslint": "^1.0.3",
95
+ "@siberiacancode/jest": "^1.0.2",
96
+ "@siberiacancode/prettier": "^1.0.1",
97
+ "@siberiacancode/stylelint": "^1.0.2",
98
+ "@types/jest": "^29.5.11",
99
+ "@types/supertest": "^6.0.2",
100
+ "husky": "^8.0.3",
101
+ "lint-staged": "^15.2.0",
102
+ "nodemon": "^3.0.3",
103
+ "shx": "^0.3.4",
104
+ "style-loader": "^3.3.4",
105
+ "supertest": "^6.3.4",
106
+ "ts-jest": "^29.1.1",
107
+ "tsc-alias": "^1.8.8",
108
+ "typescript": "^5.3.3"
101
109
  },
102
110
  "homepage": "https://github.com/siberiacancode/mock-config-server",
103
111
  "repository": {
@@ -1 +0,0 @@
1
- export declare const resolveConfigFilePath: (cliConfigFilePath?: string) => string | undefined;
@@ -1,16 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.resolveConfigFilePath = void 0;
7
- var _fs = _interopRequireDefault(require("fs"));
8
- var _path = _interopRequireDefault(require("path"));
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
- const resolveConfigFilePath = cliConfigFilePath => {
11
- const appPath = process.cwd();
12
- if (cliConfigFilePath) return _path.default.resolve(appPath, cliConfigFilePath);
13
- const configFileNameRegex = /mock-server.config.(?:ts|mts|cts|js|mjs|cjs)/;
14
- return _fs.default.readdirSync(appPath).find(fileName => configFileNameRegex.test(fileName));
15
- };
16
- exports.resolveConfigFilePath = resolveConfigFilePath;
@@ -1,2 +0,0 @@
1
- export * from './isCheckModeValid';
2
- export * from './isDescriptorValueValid';
@@ -1,27 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _isCheckModeValid = require("./isCheckModeValid");
7
- Object.keys(_isCheckModeValid).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _isCheckModeValid[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _isCheckModeValid[key];
14
- }
15
- });
16
- });
17
- var _isDescriptorValueValid = require("./isDescriptorValueValid");
18
- Object.keys(_isDescriptorValueValid).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _isDescriptorValueValid[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _isDescriptorValueValid[key];
25
- }
26
- });
27
- });
@@ -1 +0,0 @@
1
- export * from './isCheckModeValid';
@@ -1 +0,0 @@
1
- export declare const isCheckModeValid: (checkMode: unknown, entityName?: unknown) => boolean;