Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 | /* eslint-disable @typescript-eslint/no-var-requires */
/**
* This file handles loading the legacy test server routes.
*/
import { Router } from "express";
import { Category } from "../api";
import { ProjectRoot } from "../constants";
import { MockApiServer } from "../server";
import { CoverageMap, coverageService } from "../services";
const legacyRoutePath = `${ProjectRoot}/legacy/routes`;
const requireLegacy = (filename: string) => require(`${legacyRoutePath}/${filename}`);
const parameterGrouping = requireLegacy("azureParameterGrouping.js");
const azureSpecial = requireLegacy("azureSpecials");
const azureUrl = requireLegacy("azureUrl");
const complex = requireLegacy("complex");
const customUri = requireLegacy("customUri.js");
const date = requireLegacy("date");
const datetime = requireLegacy("datetime");
const datetimeRfc1123 = requireLegacy("datetime-rfc1123");
const dictionary = requireLegacy("dictionary");
const duration = requireLegacy("duration");
const errorStatusCodes = requireLegacy("errorStatusCodes.js");
const extensibleEnums = requireLegacy("extensibleEnums.js");
const files = requireLegacy("files");
const formData = requireLegacy("formData");
const header = requireLegacy("header");
const routes = requireLegacy("index");
const integer = requireLegacy("int");
const lroParameterizedEndpoints = requireLegacy("lroParameterizedEndpoints.js");
const lros = requireLegacy("lros");
const mediatypes = requireLegacy("mediatypes");
const modelFlatten = requireLegacy("model-flatten");
const multiapi = requireLegacy("multiapi");
const multiapiCustomBaseUrl = requireLegacy("multiapiCustomBaseUrl.js");
const multipleInheritance = requireLegacy("multipleInheritance.js");
const nonStringEnums = requireLegacy("nonStringEnums.js");
const number = requireLegacy("number");
const objectType = requireLegacy("objectType.js");
const paging = requireLegacy("paging");
const pathitem = requireLegacy("pathitem");
const queries = requireLegacy("queries");
const time = requireLegacy("time.js");
const validation = requireLegacy("validation.js");
const xml = requireLegacy("xml.js");
const proxyCoverage = (category: Category, coverage: CoverageMap) => {
for (const key of Object.keys(coverage)) {
coverageService.legacyTrack(category, key as string, 0);
}
return new Proxy(coverage, {
get: (_, key) => coverageService.getAllForCategory(category)[key as string],
set: (obj, key, value) => {
coverageService.legacyTrack(category, key as string, value);
obj[key as string] = value;
return true;
},
});
};
export const registerLegacyRoutes = (app: MockApiServer | Router): void => {
const azurecoverage = proxyCoverage("azure", {});
const optionalCoverage = proxyCoverage("optional", {
getDecimalInvalid: 0,
getDecimalBig: 0,
getDecimalSmall: 0,
getDecimalBigPositiveDecimal: 0,
getDecimalBigNegativeDecimal: 0,
putDecimalBig: 0,
putDecimalSmall: 0,
putDecimalBigPositiveDecimal: 0,
putDecimalBigNegativeDecimal: 0,
});
const coverage = proxyCoverage("vanilla", {
getDateNull: 0,
getDateInvalid: 0,
getDateOverflow: 0,
getDateUnderflow: 0,
getDateMax: 0,
putDateMax: 0,
getDateMin: 0,
putDateMin: 0,
getDateTimeNull: 0,
getDateTimeInvalid: 0,
getDateTimeOverflow: 0,
getDateTimeUnderflow: 0,
putDateTimeMaxUtc: 0,
getDateTimeMaxUtcLowercase: 0,
getDateTimeMaxUtcUppercase: 0,
getDateTimeMaxLocalPositiveOffsetLowercase: 0,
getDateTimeMaxLocalPositiveOffsetUppercase: 0,
getDateTimeMaxLocalNegativeOffsetLowercase: 0,
getDateTimeMaxLocalNegativeOffsetUppercase: 0,
getDateTimeMinUtc: 0,
putDateTimeMinUtc: 0,
getDateTimeMinLocalPositiveOffset: 0,
getDateTimeMinLocalNegativeOffset: 0,
getDateTimeRfc1123Null: 0,
getDateTimeRfc1123Invalid: 0,
getDateTimeRfc1123Overflow: 0,
getDateTimeRfc1123Underflow: 0,
getDateTimeRfc1123MinUtc: 0,
putDateTimeRfc1123Max: 0,
putDateTimeRfc1123Min: 0,
getDateTimeRfc1123MaxUtcLowercase: 0,
getDateTimeRfc1123MaxUtcUppercase: 0,
getIntegerNull: 0,
getIntegerInvalid: 0,
getIntegerOverflow: 0,
getIntegerUnderflow: 0,
getLongOverflow: 0,
getLongUnderflow: 0,
putIntegerMax: 0,
putLongMax: 0,
putIntegerMin: 0,
putLongMin: 0,
getNumberNull: 0,
getFloatInvalid: 0,
getDoubleInvalid: 0,
getFloatBigScientificNotation: 0,
putFloatBigScientificNotation: 0,
getDoubleBigScientificNotation: 0,
putDoubleBigScientificNotation: 0,
getDoubleBigPositiveDecimal: 0,
putDoubleBigPositiveDecimal: 0,
getDoubleBigNegativeDecimal: 0,
putDoubleBigNegativeDecimal: 0,
getFloatSmallScientificNotation: 0,
putFloatSmallScientificNotation: 0,
getDoubleSmallScientificNotation: 0,
putDoubleSmallScientificNotation: 0,
putComplexBasicValid: 0,
getComplexBasicValid: 0,
getComplexBasicEmpty: 0,
getComplexBasicNotProvided: 0,
getComplexBasicNull: 0,
getComplexBasicInvalid: 0,
putComplexPrimitiveInteger: 0,
putComplexPrimitiveLong: 0,
putComplexPrimitiveFloat: 0,
putComplexPrimitiveDouble: 0,
putComplexPrimitiveBool: 0,
putComplexPrimitiveString: 0,
putComplexPrimitiveDate: 0,
putComplexPrimitiveDateTime: 0,
putComplexPrimitiveDateTimeRfc1123: 0,
putComplexPrimitiveDuration: 0,
putComplexPrimitiveByte: 0,
getComplexPrimitiveInteger: 0,
getComplexPrimitiveLong: 0,
getComplexPrimitiveFloat: 0,
getComplexPrimitiveDouble: 0,
getComplexPrimitiveBool: 0,
getComplexPrimitiveString: 0,
getComplexPrimitiveDate: 0,
getComplexPrimitiveDateTime: 0,
getComplexPrimitiveDateTimeRfc1123: 0,
getComplexPrimitiveDuration: 0,
getComplexPrimitiveByte: 0,
putComplexArrayValid: 0,
putComplexArrayEmpty: 0,
getComplexArrayValid: 0,
getComplexArrayEmpty: 0,
getComplexArrayNotProvided: 0,
putComplexDictionaryValid: 0,
putComplexDictionaryEmpty: 0,
getComplexDictionaryValid: 0,
getComplexDictionaryEmpty: 0,
getComplexDictionaryNull: 0,
getComplexDictionaryNotProvided: 0,
putComplexInheritanceValid: 0,
getComplexInheritanceValid: 0,
putComplexPolymorphismValid: 0,
getComplexPolymorphismValid: 0,
putComplexPolymorphismComplicated: 0,
getComplexPolymorphismComplicated: 0,
putComplexPolymorphismNoDiscriminator: 0,
putComplexPolymorphicRecursiveValid: 0,
getComplexPolymorphicRecursiveValid: 0,
putComplexReadOnlyPropertyValid: 0,
getComplexReadOnlyPropertyValid: 0,
UrlQueriesBoolFalse: 0,
UrlQueriesBoolTrue: 0,
UrlQueriesBoolNull: 0,
UrlQueriesIntPositive: 0,
UrlQueriesIntNegative: 0,
UrlQueriesIntNull: 0,
UrlQueriesLongPositive: 0,
UrlQueriesLongNegative: 0,
UrlQueriesLongNull: 0,
UrlQueriesFloatPositive: 0,
UrlQueriesFloatNegative: 0,
UrlQueriesFloatNull: 0,
UrlQueriesDoublePositive: 0,
UrlQueriesDoubleNegative: 0,
UrlQueriesDoubleNull: 0,
UrlQueriesStringUrlEncoded: 0,
UrlQueriesStringEmpty: 0,
UrlQueriesStringNull: 0,
UrlQueriesStringUnicode: 0,
UrlQueriesEnumValid: 0,
UrlQueriesEnumNull: 0,
UrlQueriesByteMultiByte: 0,
UrlQueriesByteEmpty: 0,
UrlQueriesByteNull: 0,
UrlQueriesDateValid: 0,
UrlQueriesDateNull: 0,
UrlQueriesDateTimeValid: 0,
UrlQueriesDateTimeNull: 0,
UrlQueriesArrayCsvNull: 0,
UrlQueriesArrayCsvEmpty: 0,
UrlQueriesArrayCsvValid: 0,
UrlQueriesArrayMultiNull: 0,
UrlQueriesArrayMultiEmpty: 0,
UrlQueriesArrayMultiValid: 0,
UrlQueriesArraySsvValid: 0,
UrlQueriesArrayPipesValid: 0,
UrlQueriesArrayTsvValid: 0,
UrlQueriesArrayNoCollectionFormatValid: 0,
UrlPathItemGetAll: 0,
UrlPathItemGetGlobalNull: 0,
UrlPathItemGetGlobalAndLocalNull: 0,
UrlPathItemGetPathItemAndLocalNull: 0,
putDictionaryEmpty: 0,
getDictionaryNull: 0,
getDictionaryEmpty: 0,
getDictionaryInvalid: 0,
getDictionaryNullValue: 0,
getDictionaryNullkey: 0,
getDictionaryKeyEmptyString: 0,
getDictionaryBooleanValid: 0,
getDictionaryBooleanWithNull: 0,
getDictionaryBooleanWithString: 0,
getDictionaryIntegerValid: 0,
getDictionaryIntegerWithNull: 0,
getDictionaryIntegerWithString: 0,
getDictionaryLongValid: 0,
getDictionaryLongWithNull: 0,
getDictionaryLongWithString: 0,
getDictionaryFloatValid: 0,
getDictionaryFloatWithNull: 0,
getDictionaryFloatWithString: 0,
getDictionaryDoubleValid: 0,
getDictionaryDoubleWithNull: 0,
getDictionaryDoubleWithString: 0,
getDictionaryStringValid: 0,
getDictionaryStringWithNull: 0,
getDictionaryStringWithNumber: 0,
getDictionaryDateValid: 0,
getDictionaryDateWithNull: 0,
getDictionaryDateWithInvalidChars: 0,
getDictionaryDateTimeValid: 0,
getDictionaryDateTimeWithNull: 0,
getDictionaryDateTimeWithInvalidChars: 0,
getDictionaryDateTimeRfc1123Valid: 0,
getDictionaryDurationValid: 0,
getDictionaryByteValid: 0,
getDictionaryByteWithNull: 0,
putDictionaryBooleanValid: 0,
putDictionaryIntegerValid: 0,
putDictionaryLongValid: 0,
putDictionaryFloatValid: 0,
putDictionaryDoubleValid: 0,
putDictionaryStringValid: 0,
putDictionaryDateValid: 0,
putDictionaryDateTimeValid: 0,
putDictionaryDateTimeRfc1123Valid: 0,
putDictionaryDurationValid: 0,
putDictionaryByteValid: 0,
getDictionaryComplexNull: 0,
getDictionaryComplexEmpty: 0,
getDictionaryComplexItemNull: 0,
getDictionaryComplexItemEmpty: 0,
getDictionaryComplexValid: 0,
putDictionaryComplexValid: 0,
getDictionaryArrayNull: 0,
getDictionaryArrayEmpty: 0,
getDictionaryArrayItemNull: 0,
getDictionaryArrayItemEmpty: 0,
getDictionaryArrayValid: 0,
putDictionaryArrayValid: 0,
getDictionaryDictionaryNull: 0,
getDictionaryDictionaryEmpty: 0,
getDictionaryDictionaryItemNull: 0,
getDictionaryDictionaryItemEmpty: 0,
getDictionaryDictionaryValid: 0,
putDictionaryDictionaryValid: 0,
putDurationPositive: 0,
getDurationNull: 0,
getDurationInvalid: 0,
getDurationPositive: 0,
HeaderParameterExistingKey: 0,
HeaderResponseExistingKey: 0,
HeaderResponseProtectedKey: 0,
HeaderParameterIntegerPositive: 0,
HeaderParameterIntegerNegative: 0,
HeaderParameterLongPositive: 0,
HeaderParameterLongNegative: 0,
HeaderParameterFloatPositive: 0,
HeaderParameterFloatNegative: 0,
HeaderParameterDoublePositive: 0,
HeaderParameterDoubleNegative: 0,
HeaderParameterBoolTrue: 0,
HeaderParameterBoolFalse: 0,
HeaderParameterStringValid: 0,
HeaderParameterStringNull: 0,
HeaderParameterStringEmpty: 0,
HeaderParameterDateValid: 0,
HeaderParameterDateMin: 0,
HeaderParameterDateTimeValid: 0,
HeaderParameterDateTimeMin: 0,
HeaderParameterDateTimeRfc1123Valid: 0,
HeaderParameterDateTimeRfc1123Min: 0,
HeaderParameterBytesValid: 0,
HeaderParameterDurationValid: 0,
HeaderResponseIntegerPositive: 0,
HeaderResponseIntegerNegative: 0,
HeaderResponseLongPositive: 0,
HeaderResponseLongNegative: 0,
HeaderResponseFloatPositive: 0,
HeaderResponseFloatNegative: 0,
HeaderResponseDoublePositive: 0,
HeaderResponseDoubleNegative: 0,
HeaderResponseBoolTrue: 0,
HeaderResponseBoolFalse: 0,
HeaderResponseStringValid: 0,
HeaderResponseStringNull: 0,
HeaderResponseStringEmpty: 0,
HeaderParameterEnumValid: 0,
HeaderParameterEnumNull: 0,
HeaderResponseEnumValid: 0,
HeaderResponseEnumNull: 0,
HeaderResponseDateValid: 0,
HeaderResponseDateMin: 0,
HeaderResponseDateTimeValid: 0,
HeaderResponseDateTimeMin: 0,
HeaderResponseDateTimeRfc1123Valid: 0,
HeaderResponseDateTimeRfc1123Min: 0,
HeaderResponseBytesValid: 0,
HeaderResponseDurationValid: 0,
ConstantsInPath: 0,
ConstantsInBody: 0,
CustomBaseUri: 0,
CustomBaseUriMoreOptions: 0,
getModelFlattenArray: 0,
putModelFlattenArray: 0,
getModelFlattenDictionary: 0,
putModelFlattenDictionary: 0,
getModelFlattenResourceCollection: 0,
putModelFlattenResourceCollection: 0,
putModelFlattenCustomBase: 0,
postModelFlattenCustomParameter: 0,
putModelFlattenCustomGroupedParameter: 0,
getArrayBase64Url: 0,
getDictionaryBase64Url: 0,
getUnixTime: 0,
getInvalidUnixTime: 0,
getNullUnixTime: 0,
putUnixTime: 0,
expectedEnum: 0,
unexpectedEnum: 0,
allowedValueEnum: 0,
roundTripEnum: 0,
expectedNoErrors: 0,
expectedPetSadError: 0,
expectedPetHungryError: 0,
intError: 0,
stringError: 0,
animalNotFoundError: 0,
linkNotFoundError: 0,
});
app.use("/", routes);
app.use("/int", new integer(coverage).router);
app.use("/number", new number(coverage, optionalCoverage).router);
app.use("/date", new date(coverage).router);
app.use("/datetime", new datetime(coverage, optionalCoverage).router);
app.use("/datetimeRfc1123", new datetimeRfc1123(coverage).router);
app.use("/duration", new duration(coverage, optionalCoverage).router);
app.use("/complex", new complex(coverage).router);
app.use("/dictionary", new dictionary(coverage).router);
app.use("/queries", new queries(coverage).router);
app.use("/pathitem", new pathitem(coverage).router);
app.use("/header", new header(coverage, optionalCoverage).router);
app.use("/files", new files(coverage).router);
app.use("/formdata", new formData(optionalCoverage).router);
app.use("/model-flatten", new modelFlatten(coverage).router);
app.use("/lro", new lros(azurecoverage, optionalCoverage).router);
app.use("/lroParameterizedEndpoints", new lroParameterizedEndpoints(azurecoverage).router);
app.use("/paging", new paging(azurecoverage).router);
app.use("/azurespecials", new azureSpecial(azurecoverage).router);
app.use("/subscriptions", new azureUrl(azurecoverage).router);
app.use("/parameterGrouping", new parameterGrouping(azurecoverage).router);
app.use("/validation", new validation(coverage).router);
app.use("/customUri", new customUri(coverage).router);
app.use("/extensibleEnums", new extensibleEnums(coverage).router);
app.use("/errorStatusCodes", new errorStatusCodes(coverage, optionalCoverage).router);
app.use("/mediatypes", new mediatypes(coverage).router);
app.use("/xml", new xml(coverage).router);
app.use("/multiapi", new multiapi(optionalCoverage).router);
app.use("/objectType", new objectType(coverage).router);
app.use("/nonStringEnums", new nonStringEnums(coverage).router);
app.use("/time", new time(coverage).router);
app.use("/multipleInheritance", new multipleInheritance(coverage).router);
app.use("/multiapiCustomBaseUrl", new multiapiCustomBaseUrl(optionalCoverage).router);
};
|