@nestia/sdk 3.0.0-dev.20231209 → 3.0.0-dev.20240412

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 (168) hide show
  1. package/README.md +12 -9
  2. package/assets/config/nestia.config.ts +82 -79
  3. package/lib/INestiaConfig.d.ts +28 -6
  4. package/lib/NestiaSdkApplication.js +12 -10
  5. package/lib/NestiaSdkApplication.js.map +1 -1
  6. package/lib/analyses/ConfigAnalyzer.js +1 -1
  7. package/lib/analyses/ConfigAnalyzer.js.map +1 -1
  8. package/lib/analyses/ControllerAnalyzer.js +30 -15
  9. package/lib/analyses/ControllerAnalyzer.js.map +1 -1
  10. package/lib/analyses/ExceptionAnalyzer.js +35 -6
  11. package/lib/analyses/ExceptionAnalyzer.js.map +1 -1
  12. package/lib/analyses/ImportAnalyzer.d.ts +1 -2
  13. package/lib/analyses/ImportAnalyzer.js +2 -2
  14. package/lib/analyses/ImportAnalyzer.js.map +1 -1
  15. package/lib/analyses/PathAnalyzer.d.ts +2 -4
  16. package/lib/analyses/PathAnalyzer.js +27 -11
  17. package/lib/analyses/PathAnalyzer.js.map +1 -1
  18. package/lib/analyses/ReflectAnalyzer.js +34 -22
  19. package/lib/analyses/ReflectAnalyzer.js.map +1 -1
  20. package/lib/analyses/SecurityAnalyzer.js +13 -8
  21. package/lib/analyses/SecurityAnalyzer.js.map +1 -1
  22. package/lib/executable/internal/NestiaConfigLoader.js +300 -220
  23. package/lib/executable/internal/NestiaConfigLoader.js.map +1 -1
  24. package/lib/executable/sdk.js +11 -11
  25. package/lib/generates/CloneGenerator.d.ts +6 -0
  26. package/lib/generates/CloneGenerator.js +62 -0
  27. package/lib/generates/CloneGenerator.js.map +1 -0
  28. package/lib/generates/E2eGenerator.d.ts +2 -1
  29. package/lib/generates/E2eGenerator.js +2 -2
  30. package/lib/generates/E2eGenerator.js.map +1 -1
  31. package/lib/generates/SdkGenerator.js +3 -11
  32. package/lib/generates/SdkGenerator.js.map +1 -1
  33. package/lib/generates/SwaggerGenerator.d.ts +2 -0
  34. package/lib/generates/SwaggerGenerator.js +119 -62
  35. package/lib/generates/SwaggerGenerator.js.map +1 -1
  36. package/lib/generates/internal/E2eFileProgrammer.d.ts +2 -1
  37. package/lib/generates/internal/E2eFileProgrammer.js +49 -53
  38. package/lib/generates/internal/E2eFileProgrammer.js.map +1 -1
  39. package/lib/generates/internal/FilePrinter.d.ts +10 -0
  40. package/lib/generates/internal/FilePrinter.js +46 -0
  41. package/lib/generates/internal/FilePrinter.js.map +1 -0
  42. package/lib/{utils → generates/internal}/ImportDictionary.d.ts +2 -1
  43. package/lib/{utils → generates/internal}/ImportDictionary.js +20 -14
  44. package/lib/generates/internal/ImportDictionary.js.map +1 -0
  45. package/lib/generates/internal/SdkAliasCollection.d.ts +12 -0
  46. package/lib/generates/internal/SdkAliasCollection.js +97 -0
  47. package/lib/generates/internal/SdkAliasCollection.js.map +1 -0
  48. package/lib/generates/internal/SdkCloneProgrammer.d.ts +12 -0
  49. package/lib/generates/internal/SdkCloneProgrammer.js +99 -0
  50. package/lib/generates/internal/SdkCloneProgrammer.js.map +1 -0
  51. package/lib/generates/internal/SdkFileProgrammer.d.ts +2 -1
  52. package/lib/generates/internal/SdkFileProgrammer.js +27 -28
  53. package/lib/generates/internal/SdkFileProgrammer.js.map +1 -1
  54. package/lib/generates/internal/SdkFunctionProgrammer.d.ts +7 -2
  55. package/lib/generates/internal/SdkFunctionProgrammer.js +115 -322
  56. package/lib/generates/internal/SdkFunctionProgrammer.js.map +1 -1
  57. package/lib/generates/internal/SdkImportWizard.d.ts +1 -1
  58. package/lib/generates/internal/SdkNamespaceProgrammer.d.ts +11 -0
  59. package/lib/generates/internal/SdkNamespaceProgrammer.js +180 -0
  60. package/lib/generates/internal/SdkNamespaceProgrammer.js.map +1 -0
  61. package/lib/generates/internal/SdkRouteProgrammer.d.ts +7 -0
  62. package/lib/generates/internal/SdkRouteProgrammer.js +55 -0
  63. package/lib/generates/internal/SdkRouteProgrammer.js.map +1 -0
  64. package/lib/generates/internal/SdkSimulationProgrammer.d.ts +8 -2
  65. package/lib/generates/internal/SdkSimulationProgrammer.js +103 -89
  66. package/lib/generates/internal/SdkSimulationProgrammer.js.map +1 -1
  67. package/lib/generates/internal/SdkTypeProgrammer.d.ts +9 -0
  68. package/lib/generates/internal/SdkTypeProgrammer.js +228 -0
  69. package/lib/generates/internal/SdkTypeProgrammer.js.map +1 -0
  70. package/lib/generates/internal/SwaggerSchemaGenerator.d.ts +4 -4
  71. package/lib/generates/internal/SwaggerSchemaGenerator.js +30 -28
  72. package/lib/generates/internal/SwaggerSchemaGenerator.js.map +1 -1
  73. package/lib/structures/IController.d.ts +4 -2
  74. package/lib/structures/IRoute.d.ts +5 -4
  75. package/lib/structures/ISwaggerLazyProperty.d.ts +2 -2
  76. package/lib/structures/ISwaggerLazySchema.d.ts +2 -2
  77. package/lib/structures/ParamCategory.d.ts +1 -1
  78. package/lib/structures/TypeEntry.js +2 -2
  79. package/lib/structures/TypeEntry.js.map +1 -1
  80. package/lib/utils/StringUtil.d.ts +3 -0
  81. package/lib/utils/StringUtil.js +8 -0
  82. package/lib/utils/StringUtil.js.map +1 -0
  83. package/package.json +12 -16
  84. package/src/INestiaConfig.ts +30 -6
  85. package/src/NestiaSdkApplication.ts +255 -253
  86. package/src/analyses/AccessorAnalyzer.ts +60 -60
  87. package/src/analyses/ConfigAnalyzer.ts +147 -147
  88. package/src/analyses/ControllerAnalyzer.ts +42 -19
  89. package/src/analyses/ExceptionAnalyzer.ts +148 -115
  90. package/src/analyses/GenericAnalyzer.ts +51 -51
  91. package/src/analyses/ImportAnalyzer.ts +1 -2
  92. package/src/analyses/PathAnalyzer.ts +110 -98
  93. package/src/analyses/ReflectAnalyzer.ts +39 -35
  94. package/src/analyses/SecurityAnalyzer.ts +24 -20
  95. package/src/executable/internal/CommandParser.ts +15 -15
  96. package/src/executable/internal/NestiaConfigLoader.ts +67 -67
  97. package/src/executable/internal/NestiaSdkCommand.ts +60 -60
  98. package/src/executable/sdk.ts +73 -73
  99. package/src/generates/CloneGenerator.ts +62 -0
  100. package/src/generates/E2eGenerator.ts +66 -64
  101. package/src/generates/SdkGenerator.ts +84 -96
  102. package/src/generates/SwaggerGenerator.ts +145 -53
  103. package/src/generates/internal/E2eFileProgrammer.ts +182 -123
  104. package/src/generates/internal/FilePrinter.ts +53 -0
  105. package/src/{utils → generates/internal}/ImportDictionary.ts +35 -13
  106. package/src/generates/internal/SdkAliasCollection.ts +152 -0
  107. package/src/generates/internal/SdkCloneProgrammer.ts +155 -0
  108. package/src/generates/internal/SdkDistributionComposer.ts +91 -91
  109. package/src/generates/internal/SdkFileProgrammer.ts +115 -106
  110. package/src/generates/internal/SdkFunctionProgrammer.ts +298 -518
  111. package/src/generates/internal/SdkImportWizard.ts +55 -55
  112. package/src/generates/internal/SdkNamespaceProgrammer.ts +510 -0
  113. package/src/generates/internal/SdkRouteDirectory.ts +17 -17
  114. package/src/generates/internal/SdkRouteProgrammer.ts +83 -0
  115. package/src/generates/internal/SdkSimulationProgrammer.ts +365 -133
  116. package/src/generates/internal/SdkTypeProgrammer.ts +386 -0
  117. package/src/generates/internal/SwaggerSchemaGenerator.ts +437 -427
  118. package/src/generates/internal/SwaggerSchemaValidator.ts +198 -198
  119. package/src/index.ts +4 -4
  120. package/src/module.ts +2 -2
  121. package/src/structures/IController.ts +94 -95
  122. package/src/structures/IErrorReport.ts +6 -6
  123. package/src/structures/INestiaProject.ts +13 -13
  124. package/src/structures/INormalizedInput.ts +20 -20
  125. package/src/structures/IRoute.ts +53 -53
  126. package/src/structures/ISwaggerLazyProperty.ts +2 -2
  127. package/src/structures/ISwaggerLazySchema.ts +2 -2
  128. package/src/structures/ITypeTuple.ts +6 -6
  129. package/src/structures/MethodType.ts +5 -5
  130. package/src/structures/ParamCategory.ts +1 -1
  131. package/src/structures/TypeEntry.ts +1 -1
  132. package/src/utils/ArrayUtil.ts +26 -26
  133. package/src/utils/FileRetriever.ts +22 -22
  134. package/src/utils/MapUtil.ts +14 -14
  135. package/src/utils/PathUtil.ts +10 -10
  136. package/src/utils/SourceFinder.ts +66 -66
  137. package/src/utils/StringUtil.ts +6 -0
  138. package/src/utils/StripEnums.ts +5 -5
  139. package/assets/bundle/api/utils/NestiaSimulator.ts +0 -70
  140. package/lib/generates/internal/SdkDtoGenerator.d.ts +0 -9
  141. package/lib/generates/internal/SdkDtoGenerator.js +0 -294
  142. package/lib/generates/internal/SdkDtoGenerator.js.map +0 -1
  143. package/lib/generates/internal/SdkTypeDefiner.d.ts +0 -11
  144. package/lib/generates/internal/SdkTypeDefiner.js +0 -82
  145. package/lib/generates/internal/SdkTypeDefiner.js.map +0 -1
  146. package/lib/structures/ISwagger.d.ts +0 -72
  147. package/lib/structures/ISwagger.js +0 -3
  148. package/lib/structures/ISwagger.js.map +0 -1
  149. package/lib/structures/ISwaggerComponents.d.ts +0 -26
  150. package/lib/structures/ISwaggerComponents.js +0 -3
  151. package/lib/structures/ISwaggerComponents.js.map +0 -1
  152. package/lib/structures/ISwaggerInfo.d.ts +0 -71
  153. package/lib/structures/ISwaggerInfo.js +0 -3
  154. package/lib/structures/ISwaggerInfo.js.map +0 -1
  155. package/lib/structures/ISwaggerRoute.d.ts +0 -47
  156. package/lib/structures/ISwaggerRoute.js +0 -3
  157. package/lib/structures/ISwaggerRoute.js.map +0 -1
  158. package/lib/structures/ISwaggerSecurityScheme.d.ts +0 -56
  159. package/lib/structures/ISwaggerSecurityScheme.js +0 -3
  160. package/lib/structures/ISwaggerSecurityScheme.js.map +0 -1
  161. package/lib/utils/ImportDictionary.js.map +0 -1
  162. package/src/generates/internal/SdkDtoGenerator.ts +0 -424
  163. package/src/generates/internal/SdkTypeDefiner.ts +0 -119
  164. package/src/structures/ISwagger.ts +0 -91
  165. package/src/structures/ISwaggerComponents.ts +0 -29
  166. package/src/structures/ISwaggerInfo.ts +0 -80
  167. package/src/structures/ISwaggerRoute.ts +0 -51
  168. package/src/structures/ISwaggerSecurityScheme.ts +0 -65
@@ -79,51 +79,55 @@ var NestiaConfigLoader;
79
79
  ? loaded.default
80
80
  : loaded;
81
81
  try {
82
- return (input => {
82
+ return ((input, errorFactory) => {
83
83
  const __is = input => {
84
84
  const $io0 = input => null !== input.input && undefined !== input.input && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every(elem => "string" === typeof elem) || "object" === typeof input.input && null !== input.input && $io1(input.input))) && (undefined === input.swagger || "object" === typeof input.swagger && null !== input.swagger && $io2(input.swagger)) && (undefined === input.output || "string" === typeof input.output) && (undefined === input.distribute || "string" === typeof input.distribute) && (undefined === input.simulate || "boolean" === typeof input.simulate) && (undefined === input.e2e || "string" === typeof input.e2e) && (undefined === input.propagate || "boolean" === typeof input.propagate) && (undefined === input.clone || "boolean" === typeof input.clone) && (undefined === input.primitive || "boolean" === typeof input.primitive) && (undefined === input.assert || "boolean" === typeof input.assert) && (undefined === input.json || "boolean" === typeof input.json);
85
85
  const $io1 = input => Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem));
86
- const $io2 = input => "string" === typeof input.output && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify) && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && $io3(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io6(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && $io7(input.security)) && (undefined === input.decompose || "boolean" === typeof input.decompose);
87
- const $io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.termsOfService)) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && $io4(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io5(input.license)) && (undefined === input.version || "string" === typeof input.version);
88
- const $io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url)) && (undefined === input.email || "string" === typeof input.email && /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(input.email));
89
- const $io5 = input => "string" === typeof input.name && (undefined === input.url || "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url));
90
- const $io6 = input => "string" === typeof input.url && /^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) && (undefined === input.description || "string" === typeof input.description);
86
+ const $io2 = input => "string" === typeof input.output && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify) && (undefined === input.additional || "boolean" === typeof input.additional) && (undefined === input.info || "object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) && $io3(input.info)) && (undefined === input.servers || Array.isArray(input.servers) && input.servers.every(elem => "object" === typeof elem && null !== elem && $io6(elem))) && (undefined === input.security || "object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) && $io9(input.security)) && (undefined === input.tags || Array.isArray(input.tags) && input.tags.every(elem => "object" === typeof elem && null !== elem && $io20(elem))) && (undefined === input.decompose || "boolean" === typeof input.decompose);
87
+ const $io3 = input => (undefined === input.title || "string" === typeof input.title) && (undefined === input.summary || "string" === typeof input.summary) && (undefined === input.description || "string" === typeof input.description) && (undefined === input.termsOfService || "string" === typeof input.termsOfService) && (undefined === input.contact || "object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) && $io4(input.contact)) && (undefined === input.license || "object" === typeof input.license && null !== input.license && $io5(input.license)) && (undefined === input.version || "string" === typeof input.version);
88
+ const $io4 = input => (undefined === input.name || "string" === typeof input.name) && (undefined === input.url || "string" === typeof input.url) && (undefined === input.email || "string" === typeof input.email);
89
+ const $io5 = input => "string" === typeof input.name && (undefined === input.identifier || "string" === typeof input.identifier) && (undefined === input.url || "string" === typeof input.url);
90
+ const $io6 = input => "string" === typeof input.url && (undefined === input.description || "string" === typeof input.description) && (undefined === input.variables || "object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) && $io7(input.variables));
91
91
  const $io7 = input => Object.keys(input).every(key => {
92
92
  const value = input[key];
93
93
  if (undefined === value)
94
94
  return true;
95
- if (true)
96
- return "object" === typeof value && null !== value && $iu0(value);
97
- return true;
95
+ return "object" === typeof value && null !== value && $io8(value);
98
96
  });
99
- const $io8 = input => "http" === input.type && "basic" === input.scheme;
100
- const $io9 = input => "http" === input.type && "bearer" === input.scheme && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat);
101
- const $io10 = input => "apiKey" === input.type && (undefined === input["in"] || "header" === input["in"] || "query" === input["in"] || "cookie" === input["in"]) && (undefined === input.name || "string" === typeof input.name);
102
- const $io11 = input => "openIdConnect" === input.type && "string" === typeof input.openIdConnectUrl;
103
- const $io12 = input => "oauth2" === input.type && ("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) && $io13(input.flows)) && (undefined === input.description || "string" === typeof input.description);
104
- const $io13 = input => (undefined === input.authorizationCode || "object" === typeof input.authorizationCode && null !== input.authorizationCode && $io14(input.authorizationCode)) && (undefined === input.implicit || "object" === typeof input.implicit && null !== input.implicit && $io16(input.implicit)) && (undefined === input.password || "object" === typeof input.password && null !== input.password && $io17(input.password)) && (undefined === input.clientCredentials || "object" === typeof input.clientCredentials && null !== input.clientCredentials && $io17(input.clientCredentials));
105
- const $io14 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io15(input.scopes));
106
- const $io15 = input => Object.keys(input).every(key => {
97
+ const $io8 = input => "string" === typeof input["default"] && (undefined === input["enum"] || Array.isArray(input["enum"]) && (1 <= input["enum"].length && input["enum"].every(elem => "string" === typeof elem))) && (undefined === input.description || "string" === typeof input.description);
98
+ const $io9 = input => Object.keys(input).every(key => {
107
99
  const value = input[key];
108
100
  if (undefined === value)
109
101
  return true;
110
- if (true)
111
- return "string" === typeof value;
112
- return true;
102
+ return "object" === typeof value && null !== value && $iu0(value);
113
103
  });
114
- const $io16 = input => "string" === typeof input.authorizationUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io15(input.scopes));
115
- const $io17 = input => "string" === typeof input.tokenUrl && "string" === typeof input.refreshUrl && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io15(input.scopes));
104
+ const $io10 = input => "apiKey" === input.type && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"]) && (undefined === input.name || "string" === typeof input.name) && (undefined === input.description || "string" === typeof input.description);
105
+ const $io11 = input => "http" === input.type && "basic" === input.scheme && (undefined === input.description || "string" === typeof input.description);
106
+ const $io12 = input => "http" === input.type && "bearer" === input.scheme && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat) && (undefined === input.description || "string" === typeof input.description);
107
+ const $io13 = input => "oauth2" === input.type && ("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) && $io14(input.flows)) && (undefined === input.description || "string" === typeof input.description);
108
+ const $io14 = input => (undefined === input.authorizationCode || "object" === typeof input.authorizationCode && null !== input.authorizationCode && false === Array.isArray(input.authorizationCode) && $io15(input.authorizationCode)) && (undefined === input.implicit || "object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) && $io17(input.implicit)) && (undefined === input.password || "object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) && $io18(input.password)) && (undefined === input.clientCredentials || "object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) && $io18(input.clientCredentials));
109
+ const $io15 = input => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl) && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io16(input.scopes));
110
+ const $io16 = input => Object.keys(input).every(key => {
111
+ const value = input[key];
112
+ if (undefined === value)
113
+ return true;
114
+ return "string" === typeof value;
115
+ });
116
+ const $io17 = input => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl) && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io16(input.scopes));
117
+ const $io18 = input => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl) && (undefined === input.scopes || "object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) && $io16(input.scopes));
118
+ const $io19 = input => "openIdConnect" === input.type && "string" === typeof input.openIdConnectUrl && (undefined === input.description || "string" === typeof input.description);
119
+ const $io20 = input => "string" === typeof input.name && (undefined === input.description || "string" === typeof input.description);
116
120
  const $iu0 = input => (() => {
117
- if ("basic" === input.scheme)
118
- return $io8(input);
119
- else if ("bearer" === input.scheme)
120
- return $io9(input);
121
- else if ("apiKey" === input.type)
121
+ if ("apiKey" === input.type)
122
122
  return $io10(input);
123
- else if ("openIdConnect" === input.type)
123
+ else if ("basic" === input.scheme)
124
124
  return $io11(input);
125
- else if ("oauth2" === input.type)
125
+ else if ("bearer" === input.scheme)
126
126
  return $io12(input);
127
+ else if ("oauth2" === input.type)
128
+ return $io13(input);
129
+ else if ("openIdConnect" === input.type)
130
+ return $io19(input);
127
131
  else
128
132
  return false;
129
133
  })();
@@ -137,425 +141,501 @@ var NestiaConfigLoader;
137
141
  path: _path + ".input",
138
142
  expected: "(Array<string> | INestiaConfig.IInput | string)",
139
143
  value: input.input
140
- })) && (undefined !== input.input || $guard(_exceptionable, {
144
+ }, errorFactory)) && (undefined !== input.input || $guard(_exceptionable, {
141
145
  path: _path + ".input",
142
146
  expected: "(Array<string> | INestiaConfig.IInput | string)",
143
147
  value: input.input
144
- })) && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
148
+ }, errorFactory)) && ("function" === typeof input.input || "string" === typeof input.input || (Array.isArray(input.input) && input.input.every((elem, _index1) => "string" === typeof elem || $guard(_exceptionable, {
145
149
  path: _path + ".input[" + _index1 + "]",
146
150
  expected: "string",
147
151
  value: elem
148
- })) || "object" === typeof input.input && null !== input.input && $ao1(input.input, _path + ".input", true && _exceptionable) || $guard(_exceptionable, {
152
+ }, errorFactory)) || "object" === typeof input.input && null !== input.input && $ao1(input.input, _path + ".input", true && _exceptionable) || $guard(_exceptionable, {
149
153
  path: _path + ".input",
150
154
  expected: "(Array<string> | INestiaConfig.IInput | string)",
151
155
  value: input.input
152
- })) || $guard(_exceptionable, {
156
+ }, errorFactory)) || $guard(_exceptionable, {
153
157
  path: _path + ".input",
154
158
  expected: "(Array<string> | INestiaConfig.IInput | string)",
155
159
  value: input.input
156
- })) && (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || $guard(_exceptionable, {
160
+ }, errorFactory)) && (undefined === input.swagger || ("object" === typeof input.swagger && null !== input.swagger || $guard(_exceptionable, {
157
161
  path: _path + ".swagger",
158
162
  expected: "(INestiaConfig.ISwaggerConfig | undefined)",
159
163
  value: input.swagger
160
- })) && $ao2(input.swagger, _path + ".swagger", true && _exceptionable) || $guard(_exceptionable, {
164
+ }, errorFactory)) && $ao2(input.swagger, _path + ".swagger", true && _exceptionable) || $guard(_exceptionable, {
161
165
  path: _path + ".swagger",
162
166
  expected: "(INestiaConfig.ISwaggerConfig | undefined)",
163
167
  value: input.swagger
164
- })) && (undefined === input.output || "string" === typeof input.output || $guard(_exceptionable, {
168
+ }, errorFactory)) && (undefined === input.output || "string" === typeof input.output || $guard(_exceptionable, {
165
169
  path: _path + ".output",
166
170
  expected: "(string | undefined)",
167
171
  value: input.output
168
- })) && (undefined === input.distribute || "string" === typeof input.distribute || $guard(_exceptionable, {
172
+ }, errorFactory)) && (undefined === input.distribute || "string" === typeof input.distribute || $guard(_exceptionable, {
169
173
  path: _path + ".distribute",
170
174
  expected: "(string | undefined)",
171
175
  value: input.distribute
172
- })) && (undefined === input.simulate || "boolean" === typeof input.simulate || $guard(_exceptionable, {
176
+ }, errorFactory)) && (undefined === input.simulate || "boolean" === typeof input.simulate || $guard(_exceptionable, {
173
177
  path: _path + ".simulate",
174
178
  expected: "(boolean | undefined)",
175
179
  value: input.simulate
176
- })) && (undefined === input.e2e || "string" === typeof input.e2e || $guard(_exceptionable, {
180
+ }, errorFactory)) && (undefined === input.e2e || "string" === typeof input.e2e || $guard(_exceptionable, {
177
181
  path: _path + ".e2e",
178
182
  expected: "(string | undefined)",
179
183
  value: input.e2e
180
- })) && (undefined === input.propagate || "boolean" === typeof input.propagate || $guard(_exceptionable, {
184
+ }, errorFactory)) && (undefined === input.propagate || "boolean" === typeof input.propagate || $guard(_exceptionable, {
181
185
  path: _path + ".propagate",
182
186
  expected: "(boolean | undefined)",
183
187
  value: input.propagate
184
- })) && (undefined === input.clone || "boolean" === typeof input.clone || $guard(_exceptionable, {
188
+ }, errorFactory)) && (undefined === input.clone || "boolean" === typeof input.clone || $guard(_exceptionable, {
185
189
  path: _path + ".clone",
186
190
  expected: "(boolean | undefined)",
187
191
  value: input.clone
188
- })) && (undefined === input.primitive || "boolean" === typeof input.primitive || $guard(_exceptionable, {
192
+ }, errorFactory)) && (undefined === input.primitive || "boolean" === typeof input.primitive || $guard(_exceptionable, {
189
193
  path: _path + ".primitive",
190
194
  expected: "(boolean | undefined)",
191
195
  value: input.primitive
192
- })) && (undefined === input.assert || "boolean" === typeof input.assert || $guard(_exceptionable, {
196
+ }, errorFactory)) && (undefined === input.assert || "boolean" === typeof input.assert || $guard(_exceptionable, {
193
197
  path: _path + ".assert",
194
198
  expected: "(boolean | undefined)",
195
199
  value: input.assert
196
- })) && (undefined === input.json || "boolean" === typeof input.json || $guard(_exceptionable, {
200
+ }, errorFactory)) && (undefined === input.json || "boolean" === typeof input.json || $guard(_exceptionable, {
197
201
  path: _path + ".json",
198
202
  expected: "(boolean | undefined)",
199
203
  value: input.json
200
- }));
204
+ }, errorFactory));
201
205
  const $ao1 = (input, _path, _exceptionable = true) => ((Array.isArray(input.include) || $guard(_exceptionable, {
202
206
  path: _path + ".include",
203
207
  expected: "Array<string>",
204
208
  value: input.include
205
- })) && input.include.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
209
+ }, errorFactory)) && input.include.every((elem, _index2) => "string" === typeof elem || $guard(_exceptionable, {
206
210
  path: _path + ".include[" + _index2 + "]",
207
211
  expected: "string",
208
212
  value: elem
209
- })) || $guard(_exceptionable, {
213
+ }, errorFactory)) || $guard(_exceptionable, {
210
214
  path: _path + ".include",
211
215
  expected: "Array<string>",
212
216
  value: input.include
213
- })) && (undefined === input.exclude || (Array.isArray(input.exclude) || $guard(_exceptionable, {
217
+ }, errorFactory)) && (undefined === input.exclude || (Array.isArray(input.exclude) || $guard(_exceptionable, {
214
218
  path: _path + ".exclude",
215
219
  expected: "(Array<string> | undefined)",
216
220
  value: input.exclude
217
- })) && input.exclude.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
221
+ }, errorFactory)) && input.exclude.every((elem, _index3) => "string" === typeof elem || $guard(_exceptionable, {
218
222
  path: _path + ".exclude[" + _index3 + "]",
219
223
  expected: "string",
220
224
  value: elem
221
- })) || $guard(_exceptionable, {
225
+ }, errorFactory)) || $guard(_exceptionable, {
222
226
  path: _path + ".exclude",
223
227
  expected: "(Array<string> | undefined)",
224
228
  value: input.exclude
225
- }));
229
+ }, errorFactory));
226
230
  const $ao2 = (input, _path, _exceptionable = true) => ("string" === typeof input.output || $guard(_exceptionable, {
227
231
  path: _path + ".output",
228
232
  expected: "string",
229
233
  value: input.output
230
- })) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify || $guard(_exceptionable, {
234
+ }, errorFactory)) && (undefined === input.beautify || "number" === typeof input.beautify || "boolean" === typeof input.beautify || $guard(_exceptionable, {
231
235
  path: _path + ".beautify",
232
236
  expected: "(boolean | number | undefined)",
233
237
  value: input.beautify
234
- })) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || $guard(_exceptionable, {
238
+ }, errorFactory)) && (undefined === input.additional || "boolean" === typeof input.additional || $guard(_exceptionable, {
239
+ path: _path + ".additional",
240
+ expected: "(boolean | undefined)",
241
+ value: input.additional
242
+ }, errorFactory)) && (undefined === input.info || ("object" === typeof input.info && null !== input.info && false === Array.isArray(input.info) || $guard(_exceptionable, {
235
243
  path: _path + ".info",
236
- expected: "(Partial<ISwaggerInfo> | undefined)",
244
+ expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
237
245
  value: input.info
238
- })) && $ao3(input.info, _path + ".info", true && _exceptionable) || $guard(_exceptionable, {
246
+ }, errorFactory)) && $ao3(input.info, _path + ".info", true && _exceptionable) || $guard(_exceptionable, {
239
247
  path: _path + ".info",
240
- expected: "(Partial<ISwaggerInfo> | undefined)",
248
+ expected: "(Partial<OpenApi.IDocument.IInfo> | undefined)",
241
249
  value: input.info
242
- })) && (undefined === input.servers || (Array.isArray(input.servers) || $guard(_exceptionable, {
250
+ }, errorFactory)) && (undefined === input.servers || (Array.isArray(input.servers) || $guard(_exceptionable, {
243
251
  path: _path + ".servers",
244
- expected: "(Array<ISwagger.IServer> | undefined)",
252
+ expected: "(Array<OpenApi.IServer> | undefined)",
245
253
  value: input.servers
246
- })) && input.servers.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
254
+ }, errorFactory)) && input.servers.every((elem, _index4) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
247
255
  path: _path + ".servers[" + _index4 + "]",
248
- expected: "ISwagger.IServer",
256
+ expected: "OpenApi.IServer",
249
257
  value: elem
250
- })) && $ao6(elem, _path + ".servers[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
258
+ }, errorFactory)) && $ao6(elem, _path + ".servers[" + _index4 + "]", true && _exceptionable) || $guard(_exceptionable, {
251
259
  path: _path + ".servers[" + _index4 + "]",
252
- expected: "ISwagger.IServer",
260
+ expected: "OpenApi.IServer",
253
261
  value: elem
254
- })) || $guard(_exceptionable, {
262
+ }, errorFactory)) || $guard(_exceptionable, {
255
263
  path: _path + ".servers",
256
- expected: "(Array<ISwagger.IServer> | undefined)",
264
+ expected: "(Array<OpenApi.IServer> | undefined)",
257
265
  value: input.servers
258
- })) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || $guard(_exceptionable, {
266
+ }, errorFactory)) && (undefined === input.security || ("object" === typeof input.security && null !== input.security && false === Array.isArray(input.security) || $guard(_exceptionable, {
259
267
  path: _path + ".security",
260
- expected: "(Record<string, ISwaggerSecurityScheme> | undefined)",
268
+ expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
261
269
  value: input.security
262
- })) && $ao7(input.security, _path + ".security", true && _exceptionable) || $guard(_exceptionable, {
270
+ }, errorFactory)) && $ao9(input.security, _path + ".security", true && _exceptionable) || $guard(_exceptionable, {
263
271
  path: _path + ".security",
264
- expected: "(Record<string, ISwaggerSecurityScheme> | undefined)",
272
+ expected: "(Record<string, OpenApi.ISecurityScheme> | undefined)",
265
273
  value: input.security
266
- })) && (undefined === input.decompose || "boolean" === typeof input.decompose || $guard(_exceptionable, {
274
+ }, errorFactory)) && (undefined === input.tags || (Array.isArray(input.tags) || $guard(_exceptionable, {
275
+ path: _path + ".tags",
276
+ expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
277
+ value: input.tags
278
+ }, errorFactory)) && input.tags.every((elem, _index5) => ("object" === typeof elem && null !== elem || $guard(_exceptionable, {
279
+ path: _path + ".tags[" + _index5 + "]",
280
+ expected: "OpenApi.IDocument.ITag",
281
+ value: elem
282
+ }, errorFactory)) && $ao20(elem, _path + ".tags[" + _index5 + "]", true && _exceptionable) || $guard(_exceptionable, {
283
+ path: _path + ".tags[" + _index5 + "]",
284
+ expected: "OpenApi.IDocument.ITag",
285
+ value: elem
286
+ }, errorFactory)) || $guard(_exceptionable, {
287
+ path: _path + ".tags",
288
+ expected: "(Array<OpenApi.IDocument.ITag> | undefined)",
289
+ value: input.tags
290
+ }, errorFactory)) && (undefined === input.decompose || "boolean" === typeof input.decompose || $guard(_exceptionable, {
267
291
  path: _path + ".decompose",
268
292
  expected: "(boolean | undefined)",
269
293
  value: input.decompose
270
- }));
294
+ }, errorFactory));
271
295
  const $ao3 = (input, _path, _exceptionable = true) => (undefined === input.title || "string" === typeof input.title || $guard(_exceptionable, {
272
296
  path: _path + ".title",
273
297
  expected: "(string | undefined)",
274
298
  value: input.title
275
- })) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
299
+ }, errorFactory)) && (undefined === input.summary || "string" === typeof input.summary || $guard(_exceptionable, {
300
+ path: _path + ".summary",
301
+ expected: "(string | undefined)",
302
+ value: input.summary
303
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
276
304
  path: _path + ".description",
277
305
  expected: "(string | undefined)",
278
306
  value: input.description
279
- })) && (undefined === input.termsOfService || "string" === typeof input.termsOfService && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.termsOfService) || $guard(_exceptionable, {
307
+ }, errorFactory)) && (undefined === input.termsOfService || "string" === typeof input.termsOfService || $guard(_exceptionable, {
280
308
  path: _path + ".termsOfService",
281
- expected: "string & Format<\"url\">",
282
- value: input.termsOfService
283
- })) || $guard(_exceptionable, {
284
- path: _path + ".termsOfService",
285
- expected: "((string & Format<\"url\">) | undefined)",
309
+ expected: "(string | undefined)",
286
310
  value: input.termsOfService
287
- })) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || $guard(_exceptionable, {
311
+ }, errorFactory)) && (undefined === input.contact || ("object" === typeof input.contact && null !== input.contact && false === Array.isArray(input.contact) || $guard(_exceptionable, {
288
312
  path: _path + ".contact",
289
- expected: "(ISwaggerInfo.IContact | undefined)",
313
+ expected: "(OpenApi.IDocument.IContact | undefined)",
290
314
  value: input.contact
291
- })) && $ao4(input.contact, _path + ".contact", true && _exceptionable) || $guard(_exceptionable, {
315
+ }, errorFactory)) && $ao4(input.contact, _path + ".contact", true && _exceptionable) || $guard(_exceptionable, {
292
316
  path: _path + ".contact",
293
- expected: "(ISwaggerInfo.IContact | undefined)",
317
+ expected: "(OpenApi.IDocument.IContact | undefined)",
294
318
  value: input.contact
295
- })) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || $guard(_exceptionable, {
319
+ }, errorFactory)) && (undefined === input.license || ("object" === typeof input.license && null !== input.license || $guard(_exceptionable, {
296
320
  path: _path + ".license",
297
- expected: "(ISwaggerInfo.ILicense | undefined)",
321
+ expected: "(OpenApi.IDocument.ILicense | undefined)",
298
322
  value: input.license
299
- })) && $ao5(input.license, _path + ".license", true && _exceptionable) || $guard(_exceptionable, {
323
+ }, errorFactory)) && $ao5(input.license, _path + ".license", true && _exceptionable) || $guard(_exceptionable, {
300
324
  path: _path + ".license",
301
- expected: "(ISwaggerInfo.ILicense | undefined)",
325
+ expected: "(OpenApi.IDocument.ILicense | undefined)",
302
326
  value: input.license
303
- })) && (undefined === input.version || "string" === typeof input.version || $guard(_exceptionable, {
327
+ }, errorFactory)) && (undefined === input.version || "string" === typeof input.version || $guard(_exceptionable, {
304
328
  path: _path + ".version",
305
329
  expected: "(string | undefined)",
306
330
  value: input.version
307
- }));
331
+ }, errorFactory));
308
332
  const $ao4 = (input, _path, _exceptionable = true) => (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
309
333
  path: _path + ".name",
310
334
  expected: "(string | undefined)",
311
335
  value: input.name
312
- })) && (undefined === input.url || "string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
336
+ }, errorFactory)) && (undefined === input.url || "string" === typeof input.url || $guard(_exceptionable, {
313
337
  path: _path + ".url",
314
- expected: "string & Format<\"url\">",
315
- value: input.url
316
- })) || $guard(_exceptionable, {
317
- path: _path + ".url",
318
- expected: "((string & Format<\"url\">) | undefined)",
338
+ expected: "(string | undefined)",
319
339
  value: input.url
320
- })) && (undefined === input.email || "string" === typeof input.email && (/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i.test(input.email) || $guard(_exceptionable, {
321
- path: _path + ".email",
322
- expected: "string & Format<\"email\">",
323
- value: input.email
324
- })) || $guard(_exceptionable, {
340
+ }, errorFactory)) && (undefined === input.email || "string" === typeof input.email || $guard(_exceptionable, {
325
341
  path: _path + ".email",
326
- expected: "((string & Format<\"email\">) | undefined)",
342
+ expected: "(string | undefined)",
327
343
  value: input.email
328
- }));
344
+ }, errorFactory));
329
345
  const $ao5 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
330
346
  path: _path + ".name",
331
347
  expected: "string",
332
348
  value: input.name
333
- })) && (undefined === input.url || "string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
334
- path: _path + ".url",
335
- expected: "string & Format<\"url\">",
336
- value: input.url
337
- })) || $guard(_exceptionable, {
338
- path: _path + ".url",
339
- expected: "((string & Format<\"url\">) | undefined)",
340
- value: input.url
341
- }));
342
- const $ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url && (/^[a-zA-Z0-9]+:\/\/(?:www.)?[-a-zA-Z0-9@:%._+~#=]{1,256}.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_+.~#?&/=]*)$/.test(input.url) || $guard(_exceptionable, {
349
+ }, errorFactory)) && (undefined === input.identifier || "string" === typeof input.identifier || $guard(_exceptionable, {
350
+ path: _path + ".identifier",
351
+ expected: "(string | undefined)",
352
+ value: input.identifier
353
+ }, errorFactory)) && (undefined === input.url || "string" === typeof input.url || $guard(_exceptionable, {
343
354
  path: _path + ".url",
344
- expected: "string & Format<\"url\">",
355
+ expected: "(string | undefined)",
345
356
  value: input.url
346
- })) || $guard(_exceptionable, {
357
+ }, errorFactory));
358
+ const $ao6 = (input, _path, _exceptionable = true) => ("string" === typeof input.url || $guard(_exceptionable, {
347
359
  path: _path + ".url",
348
- expected: "(string & Format<\"url\">)",
360
+ expected: "string",
349
361
  value: input.url
350
- })) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
362
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
351
363
  path: _path + ".description",
352
364
  expected: "(string | undefined)",
353
365
  value: input.description
354
- }));
366
+ }, errorFactory)) && (undefined === input.variables || ("object" === typeof input.variables && null !== input.variables && false === Array.isArray(input.variables) || $guard(_exceptionable, {
367
+ path: _path + ".variables",
368
+ expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
369
+ value: input.variables
370
+ }, errorFactory)) && $ao7(input.variables, _path + ".variables", true && _exceptionable) || $guard(_exceptionable, {
371
+ path: _path + ".variables",
372
+ expected: "(Record<string, OpenApi.IServer.IVariable> | undefined)",
373
+ value: input.variables
374
+ }, errorFactory));
355
375
  const $ao7 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
356
376
  const value = input[key];
357
377
  if (undefined === value)
358
378
  return true;
359
- if (true)
360
- return ("object" === typeof value && null !== value || $guard(_exceptionable, {
361
- path: _path + $join(key),
362
- expected: "(ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IOAuth2 | ISwaggerSecurityScheme.IOpenId)",
363
- value: value
364
- })) && $au0(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
365
- path: _path + $join(key),
366
- expected: "(ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IOAuth2 | ISwaggerSecurityScheme.IOpenId)",
367
- value: value
368
- });
369
- return true;
379
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
380
+ path: _path + $join(key),
381
+ expected: "OpenApi.IServer.IVariable",
382
+ value: value
383
+ }, errorFactory)) && $ao8(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
384
+ path: _path + $join(key),
385
+ expected: "OpenApi.IServer.IVariable",
386
+ value: value
387
+ }, errorFactory);
388
+ });
389
+ const $ao8 = (input, _path, _exceptionable = true) => ("string" === typeof input["default"] || $guard(_exceptionable, {
390
+ path: _path + "[\"default\"]",
391
+ expected: "string",
392
+ value: input["default"]
393
+ }, errorFactory)) && (undefined === input["enum"] || (Array.isArray(input["enum"]) || $guard(_exceptionable, {
394
+ path: _path + "[\"enum\"]",
395
+ expected: "((Array<string> & MinItems<1>) | undefined)",
396
+ value: input["enum"]
397
+ }, errorFactory)) && ((1 <= input["enum"].length || $guard(_exceptionable, {
398
+ path: _path + "[\"enum\"]",
399
+ expected: "Array<> & MinItems<1>",
400
+ value: input["enum"]
401
+ }, errorFactory)) && input["enum"].every((elem, _index6) => "string" === typeof elem || $guard(_exceptionable, {
402
+ path: _path + "[\"enum\"][" + _index6 + "]",
403
+ expected: "string",
404
+ value: elem
405
+ }, errorFactory))) || $guard(_exceptionable, {
406
+ path: _path + "[\"enum\"]",
407
+ expected: "((Array<string> & MinItems<1>) | undefined)",
408
+ value: input["enum"]
409
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
410
+ path: _path + ".description",
411
+ expected: "(string | undefined)",
412
+ value: input.description
413
+ }, errorFactory));
414
+ const $ao9 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
415
+ const value = input[key];
416
+ if (undefined === value)
417
+ return true;
418
+ return ("object" === typeof value && null !== value || $guard(_exceptionable, {
419
+ path: _path + $join(key),
420
+ expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
421
+ value: value
422
+ }, errorFactory)) && $au0(value, _path + $join(key), true && _exceptionable) || $guard(_exceptionable, {
423
+ path: _path + $join(key),
424
+ expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
425
+ value: value
426
+ }, errorFactory);
370
427
  });
371
- const $ao8 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
428
+ const $ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || $guard(_exceptionable, {
429
+ path: _path + ".type",
430
+ expected: "\"apiKey\"",
431
+ value: input.type
432
+ }, errorFactory)) && (undefined === input["in"] || "query" === input["in"] || "header" === input["in"] || "cookie" === input["in"] || $guard(_exceptionable, {
433
+ path: _path + "[\"in\"]",
434
+ expected: "(\"cookie\" | \"header\" | \"query\" | undefined)",
435
+ value: input["in"]
436
+ }, errorFactory)) && (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
437
+ path: _path + ".name",
438
+ expected: "(string | undefined)",
439
+ value: input.name
440
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
441
+ path: _path + ".description",
442
+ expected: "(string | undefined)",
443
+ value: input.description
444
+ }, errorFactory));
445
+ const $ao11 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
372
446
  path: _path + ".type",
373
447
  expected: "\"http\"",
374
448
  value: input.type
375
- })) && ("basic" === input.scheme || $guard(_exceptionable, {
449
+ }, errorFactory)) && ("basic" === input.scheme || $guard(_exceptionable, {
376
450
  path: _path + ".scheme",
377
451
  expected: "\"basic\"",
378
452
  value: input.scheme
379
- }));
380
- const $ao9 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
453
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
454
+ path: _path + ".description",
455
+ expected: "(string | undefined)",
456
+ value: input.description
457
+ }, errorFactory));
458
+ const $ao12 = (input, _path, _exceptionable = true) => ("http" === input.type || $guard(_exceptionable, {
381
459
  path: _path + ".type",
382
460
  expected: "\"http\"",
383
461
  value: input.type
384
- })) && ("bearer" === input.scheme || $guard(_exceptionable, {
462
+ }, errorFactory)) && ("bearer" === input.scheme || $guard(_exceptionable, {
385
463
  path: _path + ".scheme",
386
464
  expected: "\"bearer\"",
387
465
  value: input.scheme
388
- })) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || $guard(_exceptionable, {
466
+ }, errorFactory)) && (undefined === input.bearerFormat || "string" === typeof input.bearerFormat || $guard(_exceptionable, {
389
467
  path: _path + ".bearerFormat",
390
468
  expected: "(string | undefined)",
391
469
  value: input.bearerFormat
392
- }));
393
- const $ao10 = (input, _path, _exceptionable = true) => ("apiKey" === input.type || $guard(_exceptionable, {
394
- path: _path + ".type",
395
- expected: "\"apiKey\"",
396
- value: input.type
397
- })) && (undefined === input["in"] || "header" === input["in"] || "query" === input["in"] || "cookie" === input["in"] || $guard(_exceptionable, {
398
- path: _path + "[\"in\"]",
399
- expected: "(\"cookie\" | \"header\" | \"query\" | undefined)",
400
- value: input["in"]
401
- })) && (undefined === input.name || "string" === typeof input.name || $guard(_exceptionable, {
402
- path: _path + ".name",
470
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
471
+ path: _path + ".description",
403
472
  expected: "(string | undefined)",
404
- value: input.name
405
- }));
406
- const $ao11 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || $guard(_exceptionable, {
407
- path: _path + ".type",
408
- expected: "\"openIdConnect\"",
409
- value: input.type
410
- })) && ("string" === typeof input.openIdConnectUrl || $guard(_exceptionable, {
411
- path: _path + ".openIdConnectUrl",
412
- expected: "string",
413
- value: input.openIdConnectUrl
414
- }));
415
- const $ao12 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || $guard(_exceptionable, {
473
+ value: input.description
474
+ }, errorFactory));
475
+ const $ao13 = (input, _path, _exceptionable = true) => ("oauth2" === input.type || $guard(_exceptionable, {
416
476
  path: _path + ".type",
417
477
  expected: "\"oauth2\"",
418
478
  value: input.type
419
- })) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || $guard(_exceptionable, {
479
+ }, errorFactory)) && (("object" === typeof input.flows && null !== input.flows && false === Array.isArray(input.flows) || $guard(_exceptionable, {
420
480
  path: _path + ".flows",
421
- expected: "ISwaggerSecurityScheme.IOAuth2.IFlowSet",
481
+ expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
422
482
  value: input.flows
423
- })) && $ao13(input.flows, _path + ".flows", true && _exceptionable) || $guard(_exceptionable, {
483
+ }, errorFactory)) && $ao14(input.flows, _path + ".flows", true && _exceptionable) || $guard(_exceptionable, {
424
484
  path: _path + ".flows",
425
- expected: "ISwaggerSecurityScheme.IOAuth2.IFlowSet",
485
+ expected: "OpenApi.ISecurityScheme.IOAuth2.IFlowSet",
426
486
  value: input.flows
427
- })) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
487
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
428
488
  path: _path + ".description",
429
489
  expected: "(string | undefined)",
430
490
  value: input.description
431
- }));
432
- const $ao13 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode || $guard(_exceptionable, {
491
+ }, errorFactory));
492
+ const $ao14 = (input, _path, _exceptionable = true) => (undefined === input.authorizationCode || ("object" === typeof input.authorizationCode && null !== input.authorizationCode && false === Array.isArray(input.authorizationCode) || $guard(_exceptionable, {
433
493
  path: _path + ".authorizationCode",
434
- expected: "(ISwaggerSecurityScheme.IOAuth2.IFlow | undefined)",
494
+ expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
435
495
  value: input.authorizationCode
436
- })) && $ao14(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || $guard(_exceptionable, {
496
+ }, errorFactory)) && $ao15(input.authorizationCode, _path + ".authorizationCode", true && _exceptionable) || $guard(_exceptionable, {
437
497
  path: _path + ".authorizationCode",
438
- expected: "(ISwaggerSecurityScheme.IOAuth2.IFlow | undefined)",
498
+ expected: "(OpenApi.ISecurityScheme.IOAuth2.IFlow | undefined)",
439
499
  value: input.authorizationCode
440
- })) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit || $guard(_exceptionable, {
500
+ }, errorFactory)) && (undefined === input.implicit || ("object" === typeof input.implicit && null !== input.implicit && false === Array.isArray(input.implicit) || $guard(_exceptionable, {
441
501
  path: _path + ".implicit",
442
- expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
502
+ expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
443
503
  value: input.implicit
444
- })) && $ao16(input.implicit, _path + ".implicit", true && _exceptionable) || $guard(_exceptionable, {
504
+ }, errorFactory)) && $ao17(input.implicit, _path + ".implicit", true && _exceptionable) || $guard(_exceptionable, {
445
505
  path: _path + ".implicit",
446
- expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
506
+ expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"tokenUrl\"> | undefined)",
447
507
  value: input.implicit
448
- })) && (undefined === input.password || ("object" === typeof input.password && null !== input.password || $guard(_exceptionable, {
508
+ }, errorFactory)) && (undefined === input.password || ("object" === typeof input.password && null !== input.password && false === Array.isArray(input.password) || $guard(_exceptionable, {
449
509
  path: _path + ".password",
450
- expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
510
+ expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
451
511
  value: input.password
452
- })) && $ao17(input.password, _path + ".password", true && _exceptionable) || $guard(_exceptionable, {
512
+ }, errorFactory)) && $ao18(input.password, _path + ".password", true && _exceptionable) || $guard(_exceptionable, {
453
513
  path: _path + ".password",
454
- expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
514
+ expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
455
515
  value: input.password
456
- })) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials || $guard(_exceptionable, {
516
+ }, errorFactory)) && (undefined === input.clientCredentials || ("object" === typeof input.clientCredentials && null !== input.clientCredentials && false === Array.isArray(input.clientCredentials) || $guard(_exceptionable, {
457
517
  path: _path + ".clientCredentials",
458
- expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
518
+ expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
459
519
  value: input.clientCredentials
460
- })) && $ao17(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || $guard(_exceptionable, {
520
+ }, errorFactory)) && $ao18(input.clientCredentials, _path + ".clientCredentials", true && _exceptionable) || $guard(_exceptionable, {
461
521
  path: _path + ".clientCredentials",
462
- expected: "(Omit<ISwaggerSecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
522
+ expected: "(Omit<OpenApi.ISecurityScheme.IOAuth2.IFlow, \"authorizationUrl\"> | undefined)",
463
523
  value: input.clientCredentials
464
- }));
465
- const $ao14 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
524
+ }, errorFactory));
525
+ const $ao15 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || $guard(_exceptionable, {
466
526
  path: _path + ".authorizationUrl",
467
- expected: "string",
527
+ expected: "(string | undefined)",
468
528
  value: input.authorizationUrl
469
- })) && ("string" === typeof input.tokenUrl || $guard(_exceptionable, {
529
+ }, errorFactory)) && (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || $guard(_exceptionable, {
470
530
  path: _path + ".tokenUrl",
471
- expected: "string",
531
+ expected: "(string | undefined)",
472
532
  value: input.tokenUrl
473
- })) && ("string" === typeof input.refreshUrl || $guard(_exceptionable, {
533
+ }, errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || $guard(_exceptionable, {
474
534
  path: _path + ".refreshUrl",
475
- expected: "string",
535
+ expected: "(string | undefined)",
476
536
  value: input.refreshUrl
477
- })) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
537
+ }, errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
478
538
  path: _path + ".scopes",
479
539
  expected: "(Record<string, string> | undefined)",
480
540
  value: input.scopes
481
- })) && $ao15(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
541
+ }, errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
482
542
  path: _path + ".scopes",
483
543
  expected: "(Record<string, string> | undefined)",
484
544
  value: input.scopes
485
- }));
486
- const $ao15 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
545
+ }, errorFactory));
546
+ const $ao16 = (input, _path, _exceptionable = true) => false === _exceptionable || Object.keys(input).every(key => {
487
547
  const value = input[key];
488
548
  if (undefined === value)
489
549
  return true;
490
- if (true)
491
- return "string" === typeof value || $guard(_exceptionable, {
492
- path: _path + $join(key),
493
- expected: "string",
494
- value: value
495
- });
496
- return true;
550
+ return "string" === typeof value || $guard(_exceptionable, {
551
+ path: _path + $join(key),
552
+ expected: "string",
553
+ value: value
554
+ }, errorFactory);
497
555
  });
498
- const $ao16 = (input, _path, _exceptionable = true) => ("string" === typeof input.authorizationUrl || $guard(_exceptionable, {
556
+ const $ao17 = (input, _path, _exceptionable = true) => (undefined === input.authorizationUrl || "string" === typeof input.authorizationUrl || $guard(_exceptionable, {
499
557
  path: _path + ".authorizationUrl",
500
- expected: "string",
558
+ expected: "(string | undefined)",
501
559
  value: input.authorizationUrl
502
- })) && ("string" === typeof input.refreshUrl || $guard(_exceptionable, {
560
+ }, errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || $guard(_exceptionable, {
503
561
  path: _path + ".refreshUrl",
504
- expected: "string",
562
+ expected: "(string | undefined)",
505
563
  value: input.refreshUrl
506
- })) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
564
+ }, errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
507
565
  path: _path + ".scopes",
508
566
  expected: "(Record<string, string> | undefined)",
509
567
  value: input.scopes
510
- })) && $ao15(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
568
+ }, errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
511
569
  path: _path + ".scopes",
512
570
  expected: "(Record<string, string> | undefined)",
513
571
  value: input.scopes
514
- }));
515
- const $ao17 = (input, _path, _exceptionable = true) => ("string" === typeof input.tokenUrl || $guard(_exceptionable, {
572
+ }, errorFactory));
573
+ const $ao18 = (input, _path, _exceptionable = true) => (undefined === input.tokenUrl || "string" === typeof input.tokenUrl || $guard(_exceptionable, {
516
574
  path: _path + ".tokenUrl",
517
- expected: "string",
575
+ expected: "(string | undefined)",
518
576
  value: input.tokenUrl
519
- })) && ("string" === typeof input.refreshUrl || $guard(_exceptionable, {
577
+ }, errorFactory)) && (undefined === input.refreshUrl || "string" === typeof input.refreshUrl || $guard(_exceptionable, {
520
578
  path: _path + ".refreshUrl",
521
- expected: "string",
579
+ expected: "(string | undefined)",
522
580
  value: input.refreshUrl
523
- })) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
581
+ }, errorFactory)) && (undefined === input.scopes || ("object" === typeof input.scopes && null !== input.scopes && false === Array.isArray(input.scopes) || $guard(_exceptionable, {
524
582
  path: _path + ".scopes",
525
583
  expected: "(Record<string, string> | undefined)",
526
584
  value: input.scopes
527
- })) && $ao15(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
585
+ }, errorFactory)) && $ao16(input.scopes, _path + ".scopes", true && _exceptionable) || $guard(_exceptionable, {
528
586
  path: _path + ".scopes",
529
587
  expected: "(Record<string, string> | undefined)",
530
588
  value: input.scopes
531
- }));
589
+ }, errorFactory));
590
+ const $ao19 = (input, _path, _exceptionable = true) => ("openIdConnect" === input.type || $guard(_exceptionable, {
591
+ path: _path + ".type",
592
+ expected: "\"openIdConnect\"",
593
+ value: input.type
594
+ }, errorFactory)) && ("string" === typeof input.openIdConnectUrl || $guard(_exceptionable, {
595
+ path: _path + ".openIdConnectUrl",
596
+ expected: "string",
597
+ value: input.openIdConnectUrl
598
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
599
+ path: _path + ".description",
600
+ expected: "(string | undefined)",
601
+ value: input.description
602
+ }, errorFactory));
603
+ const $ao20 = (input, _path, _exceptionable = true) => ("string" === typeof input.name || $guard(_exceptionable, {
604
+ path: _path + ".name",
605
+ expected: "string",
606
+ value: input.name
607
+ }, errorFactory)) && (undefined === input.description || "string" === typeof input.description || $guard(_exceptionable, {
608
+ path: _path + ".description",
609
+ expected: "(string | undefined)",
610
+ value: input.description
611
+ }, errorFactory));
532
612
  const $au0 = (input, _path, _exceptionable = true) => (() => {
533
- if ("basic" === input.scheme)
534
- return $ao8(input, _path, true && _exceptionable);
535
- else if ("bearer" === input.scheme)
536
- return $ao9(input, _path, true && _exceptionable);
537
- else if ("apiKey" === input.type)
613
+ if ("apiKey" === input.type)
538
614
  return $ao10(input, _path, true && _exceptionable);
539
- else if ("openIdConnect" === input.type)
615
+ else if ("basic" === input.scheme)
540
616
  return $ao11(input, _path, true && _exceptionable);
541
- else if ("oauth2" === input.type)
617
+ else if ("bearer" === input.scheme)
542
618
  return $ao12(input, _path, true && _exceptionable);
619
+ else if ("oauth2" === input.type)
620
+ return $ao13(input, _path, true && _exceptionable);
621
+ else if ("openIdConnect" === input.type)
622
+ return $ao19(input, _path, true && _exceptionable);
543
623
  else
544
624
  return $guard(_exceptionable, {
545
625
  path: _path,
546
- expected: "(ISwaggerSecurityScheme.IHttpBasic | ISwaggerSecurityScheme.IHttpBearer | ISwaggerSecurityScheme.IApiKey | ISwaggerSecurityScheme.IOpenId | ISwaggerSecurityScheme.IOAuth2)",
626
+ expected: "(OpenApi.ISecurityScheme.IApiKey | OpenApi.ISecurityScheme.IHttpBasic | OpenApi.ISecurityScheme.IHttpBearer | OpenApi.ISecurityScheme.IOAuth2 | OpenApi.ISecurityScheme.IOpenId)",
547
627
  value: input
548
- });
628
+ }, errorFactory);
549
629
  })();
550
630
  return ("object" === typeof input && null !== input || $guard(true, {
551
631
  path: _path + "",
552
632
  expected: "INestiaConfig",
553
633
  value: input
554
- })) && $ao0(input, _path + "", true) || $guard(true, {
634
+ }, errorFactory)) && $ao0(input, _path + "", true) || $guard(true, {
555
635
  path: _path + "",
556
636
  expected: "INestiaConfig",
557
637
  value: input
558
- });
638
+ }, errorFactory);
559
639
  })(input, "$input", true);
560
640
  return input;
561
641
  })(config);