diff --git a/api-tests/Makefile b/api-tests/Makefile new file mode 100644 index 00000000..efd91f8f --- /dev/null +++ b/api-tests/Makefile @@ -0,0 +1,3 @@ +start: + npm install + npm test \ No newline at end of file diff --git a/api-tests/app.ts b/api-tests/app.ts new file mode 100644 index 00000000..7e4a220e --- /dev/null +++ b/api-tests/app.ts @@ -0,0 +1,62 @@ +var settings = require("./settings"); +//import { toExport as settings } from "./settings"; +//var app = require("../../server.ts"); +//import { app } from "../../server"; +var request = require("supertest"); + +import * as fs from 'fs'; +import * as path from 'path'; + +// List of all the test files you want to import +const testFiles = [ + 'carto_small.ts', + 'columns.ts', + 'defs.ts', + 'defs_columns.ts', + 'defs_econs.ts', + 'defs_environments.ts', + 'defs_groups.ts', + 'defs_intervals.ts', + 'defs_lithologies.ts', + 'defs_lithology_attributes.ts', + 'defs_measurements.ts', + 'defs_minerals.ts', + 'defs_plates.ts', + 'defs_projects.ts', + 'defs_refs.ts', + 'defs_sources.ts', + 'defs_strat_name_concepts.ts', + 'defs_strat_names.ts', + 'defs_structures.ts', + 'defs_timescales.ts', + 'fossils.ts', + 'geologic_units_burwell.ts', + 'geologic_units_gmna.ts', + 'geologic_units_gmus.ts', + 'index.ts', + 'mancos_test_cases.ts', + 'mobile_fossil_collections.ts', + 'mobile_macro_summary.ts', + 'mobile_map_query.ts', + 'mobile_point.ts', + 'mobile_point_details.ts', + 'paleogeography.ts', + 'root.ts', + 'sections.ts', + 'stats.ts', + 'tiles.ts', + 'units.ts' +]; + +// Path to the v2Tests directory +const testDir = path.join(__dirname, 'v2Tests'); + +// Mocha `describe` block to group all tests +describe('API Tests', function () { + // Iterate through the test files and require each one + testFiles.forEach((file) => { + console.log(`Loading test file: ${file}`); + require(path.join(testDir, file)); // Dynamically require each test file + }); +}); + diff --git a/api-tests/package-lock.json b/api-tests/package-lock.json new file mode 100644 index 00000000..fc068bc3 --- /dev/null +++ b/api-tests/package-lock.json @@ -0,0 +1,1722 @@ +{ + "name": "typescript-app-tests", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "requires": { + "@jridgewell/trace-mapping": "0.3.9" + } + }, + "@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true + }, + "@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true + }, + "@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "requires": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true + }, + "@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true + }, + "@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true + }, + "@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true + }, + "@types/body-parser": { + "version": "1.19.5", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", + "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, + "requires": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/cookiejar": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@types/cookiejar/-/cookiejar-2.1.5.tgz", + "integrity": "sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==", + "dev": true + }, + "@types/express": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", + "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.33", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "@types/express-serve-static-core": { + "version": "4.19.5", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.5.tgz", + "integrity": "sha512-y6W03tvrACO72aijJ5uF02FRq5cgDR9lUxddQ8vyF+GvmjJQqbzDcJngEjURc+ZsG31VI3hODNZJ2URj86pzmg==", + "dev": true, + "requires": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*", + "@types/send": "*" + } + }, + "@types/http-errors": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true + }, + "@types/methods": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@types/methods/-/methods-1.1.4.tgz", + "integrity": "sha512-ymXWVrDiCxTBE3+RIrrP533E70eA+9qu7zdWoHuOmGujkYtzf4HQF96b8nwHLqhuf4ykX61IGRIB38CC6/sImQ==", + "dev": true + }, + "@types/mime": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true + }, + "@types/mocha": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", + "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", + "dev": true + }, + "@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "dev": true, + "requires": { + "undici-types": "~6.19.2" + } + }, + "@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true + }, + "@types/range-parser": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true + }, + "@types/send": { + "version": "0.17.4", + "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", + "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, + "requires": { + "@types/mime": "^1", + "@types/node": "*" + } + }, + "@types/serve-static": { + "version": "1.15.7", + "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.7.tgz", + "integrity": "sha512-W8Ym+h8nhuRwaKPaDw34QUkwsGi6Rc4yYqvKFo5rm2FUEhCFbzVWrxXUxuKK8TASjWsysJY0nsmNCGhCOIsrOw==", + "dev": true, + "requires": { + "@types/http-errors": "*", + "@types/node": "*", + "@types/send": "*" + } + }, + "@types/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==", + "dev": true + }, + "@types/strip-json-comments": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", + "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", + "dev": true + }, + "@types/superagent": { + "version": "8.1.9", + "resolved": "https://registry.npmjs.org/@types/superagent/-/superagent-8.1.9.tgz", + "integrity": "sha512-pTVjI73witn+9ILmoJdajHGW2jkSaOzhiFYF1Rd3EQ94kymLqB9PjD9ISg7WaALC7+dCHT0FGe9T2LktLq/3GQ==", + "dev": true, + "requires": { + "@types/cookiejar": "^2.1.5", + "@types/methods": "^1.1.4", + "@types/node": "*", + "form-data": "^4.0.0" + } + }, + "@types/supertest": { + "version": "2.0.16", + "resolved": "https://registry.npmjs.org/@types/supertest/-/supertest-2.0.16.tgz", + "integrity": "sha512-6c2ogktZ06tr2ENoZivgm7YnprnhYE4ZoXGMY+oA7IuAf17M8FWvujXZGmxLv8y0PTyts4x5A+erSwVUFA8XSg==", + "dev": true, + "requires": { + "@types/superagent": "*" + } + }, + "@ungap/promise-all-settled": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", + "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==" + }, + "accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "requires": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + } + }, + "acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true + }, + "acorn-walk": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.4.tgz", + "integrity": "sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g==", + "dev": true, + "requires": { + "acorn": "^8.11.0" + } + }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "requires": { + "color-convert": "^2.0.1" + } + }, + "anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "array-flatten": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz", + "integrity": "sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==" + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==" + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" + }, + "binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==" + }, + "body-parser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.0.1.tgz", + "integrity": "sha512-PagxbjvuPH6tv0f/kdVbFGcb79D236SLcDTs6DrQ7GizJ88S1UWP4nMXFEo/I4fdhGRGabvFfFjVGm3M7U8JwA==", + "requires": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "3.1.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.5.2", + "on-finished": "2.4.1", + "qs": "6.13.0", + "raw-body": "^3.0.0", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + } + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "requires": { + "fill-range": "^7.1.1" + } + }, + "browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" + }, + "buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + }, + "call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + } + }, + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==" + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "chokidar": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "requires": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "fsevents": "~2.3.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + } + }, + "cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" + }, + "content-disposition": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz", + "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==", + "requires": { + "safe-buffer": "5.2.1" + } + }, + "content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==" + }, + "cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==" + }, + "cookie-signature": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.1.tgz", + "integrity": "sha512-78KWk9T26NhzXtuL26cIJ8/qNHANyJ/ZYrmEXFzUmhZdjpBv+DlWlOANRTGBt48YcyslsLrj0bMLFTmXvLRCOw==" + }, + "cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==" + }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, + "debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==" + }, + "define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "requires": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==" + }, + "depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==" + }, + "destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==" + }, + "dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "requires": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "diff": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", + "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==" + }, + "dynamic-dedupe": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/dynamic-dedupe/-/dynamic-dedupe-0.3.0.tgz", + "integrity": "sha512-ssuANeD+z97meYOqd50e04Ze5qp4bPqo8cCkI4TRjZkzAUgIDTrXV1R8QCdINpiI+hw14+rYazvTRdQrz0/rFQ==", + "dev": true, + "requires": { + "xtend": "^4.0.0" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==" + }, + "es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "requires": { + "get-intrinsic": "^1.2.4" + } + }, + "es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==" + }, + "escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==" + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" + }, + "express": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/express/-/express-5.0.0.tgz", + "integrity": "sha512-V4UkHQc+B7ldh1YC84HCXHwf60M4BOMvp9rkvTUWCK5apqDC1Esnbid4wm6nFyVuDy8XMfETsJw5lsIGBWyo0A==", + "requires": { + "accepts": "^2.0.0", + "body-parser": "^2.0.1", + "content-disposition": "^1.0.0", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "^1.2.1", + "debug": "4.3.6", + "depd": "2.0.0", + "encodeurl": "~2.0.0", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "^2.0.0", + "fresh": "2.0.0", + "http-errors": "2.0.0", + "merge-descriptors": "^2.0.0", + "methods": "~1.1.2", + "mime-types": "^3.0.0", + "on-finished": "2.4.1", + "once": "1.4.0", + "parseurl": "~1.3.3", + "proxy-addr": "~2.0.7", + "qs": "6.13.0", + "range-parser": "~1.2.1", + "router": "^2.0.0", + "safe-buffer": "5.2.1", + "send": "^1.1.0", + "serve-static": "^2.1.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "^2.0.0", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + } + }, + "fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" + }, + "fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "finalhandler": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.0.0.tgz", + "integrity": "sha512-MX6Zo2adDViYh+GcxxB1dpO43eypOGUOL12rLCOTMQv/DfIbpSJUy4oQIIZhVZkH9e+bZWKMon0XHFEju16tkQ==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==" + } + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "dependencies": { + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + } + } + }, + "formidable": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.2.tgz", + "integrity": "sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==", + "requires": { + "dezalgo": "^1.0.4", + "hexoid": "^1.0.0", + "once": "^1.4.0", + "qs": "^6.11.0" + } + }, + "forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + }, + "fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==" + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" + }, + "fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "optional": true + }, + "function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==" + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + }, + "get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "requires": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + } + }, + "glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "dependencies": { + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "requires": { + "brace-expansion": "^1.1.7" + } + } + } + }, + "glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "requires": { + "is-glob": "^4.0.1" + } + }, + "gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "requires": { + "get-intrinsic": "^1.1.3" + } + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==" + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + }, + "has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "requires": { + "es-define-property": "^1.0.0" + } + }, + "has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==" + }, + "has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==" + }, + "hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "requires": { + "function-bind": "^1.1.2" + } + }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + }, + "hexoid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hexoid/-/hexoid-1.0.0.tgz", + "integrity": "sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==" + }, + "http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "requires": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + } + }, + "iconv-lite": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.2.tgz", + "integrity": "sha512-kERHXvpSaB4aU3eANwidg79K8FlrN77m8G9V+0vOR3HYaRifrlwMEpT7ZBJqLSEIHnEgJTHcWK82wwLwwKwtag==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-core-module": { + "version": "2.15.1", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.15.1.tgz", + "integrity": "sha512-z0vtXSwucUJtANQWldhbtbt7BnL0vxiFjIdDLAatwhDYty2bad6s+rijD6Ri4YuYJubLzIJLUidCh09e1djEVQ==", + "dev": true, + "requires": { + "hasown": "^2.0.2" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==" + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + }, + "is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==" + }, + "is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==" + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "requires": { + "p-locate": "^5.0.0" + } + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==" + }, + "merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==" + }, + "mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==" + }, + "mime-db": { + "version": "1.53.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.53.0.tgz", + "integrity": "sha512-oHlN/w+3MQ3rba9rqFr6V/ypF10LSkdwUysQL7GkXoTgIWeV+tcXGA852TBxH+gsh8UWoyhR1hKcoMJTuWflpg==" + }, + "mime-types": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.0.tgz", + "integrity": "sha512-XqoSHeCGjVClAmoGFG3lVFqQFRIrTVw2OH3axRqAcfaw+gHWIfnASS92AV+Rl/mk0MupgZTRHQOjxY6YVnzK5w==", + "requires": { + "mime-db": "^1.53.0" + } + }, + "minimatch": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-4.2.1.tgz", + "integrity": "sha512-9Uq1ChtSZO+Mxa/CL1eGizn2vRn3MlLgzhT0Iz8zaY8NdvxvB0d5QdPFmCKf7JKA9Lerx5vRrnwO03jsSfGG9g==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true + }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "mocha": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.2.tgz", + "integrity": "sha512-L6XC3EdwT6YrIk0yXpavvLkn8h+EU+Y5UcCHKECyMbdUIxyMuZj4bX4U9e1nvnvUUvQVsV2VHQr5zLdcUkhW/g==", + "requires": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.3", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "4.2.1", + "ms": "2.1.3", + "nanoid": "3.3.1", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "workerpool": "6.2.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "requires": { + "ms": "2.1.2" + }, + "dependencies": { + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + } + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" + }, + "nanoid": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.1.tgz", + "integrity": "sha512-n6Vs/3KGyxPQd6uO0eH4Bv0ojGSUvuLlIHtC3Y0kEO23YRge8H9x1GCzLn28YX0H66pMkxuaeESFq4tKISKwdw==" + }, + "negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==" + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" + }, + "object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==" + }, + "on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "requires": { + "ee-first": "1.1.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "requires": { + "wrappy": "1" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "requires": { + "p-limit": "^3.0.2" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==" + }, + "path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "path-to-regexp": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.1.0.tgz", + "integrity": "sha512-Bqn3vc8CMHty6zuD+tG23s6v2kwxslHEhTj4eYaVKGIEB+YX/2wd0/rgXLFD9G9id9KCtbVy/3ZgmvZjpa0UdQ==" + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + }, + "proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "requires": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + } + }, + "qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "requires": { + "side-channel": "^1.0.6" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "raw-body": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.0.tgz", + "integrity": "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g==", + "requires": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.6.3", + "unpipe": "1.0.0" + }, + "dependencies": { + "iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } + } + } + }, + "readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "requires": { + "picomatch": "^2.2.1" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==" + }, + "resolve": { + "version": "1.22.8", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.8.tgz", + "integrity": "sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw==", + "dev": true, + "requires": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "router": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.0.0.tgz", + "integrity": "sha512-dIM5zVoG8xhC6rnSN8uoAgFARwTE7BQs8YwHEvK0VCmfxQXMaOuA1uiR1IPwsW7JyK5iTt7Od/TC9StasS2NPQ==", + "requires": { + "array-flatten": "3.0.0", + "is-promise": "4.0.0", + "methods": "~1.1.2", + "parseurl": "~1.3.3", + "path-to-regexp": "^8.0.0", + "setprototypeof": "1.2.0", + "utils-merge": "1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==" + }, + "send": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/send/-/send-1.1.0.tgz", + "integrity": "sha512-v67WcEouB5GxbTWL/4NeToqcZiAWEq90N888fczVArY8A79J0L4FD7vj5hm3eUMua5EpoQ59wa/oovY6TLvRUA==", + "requires": { + "debug": "^4.3.5", + "destroy": "^1.2.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^0.5.2", + "http-errors": "^2.0.0", + "mime-types": "^2.1.35", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.1" + }, + "dependencies": { + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==" + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "requires": { + "mime-db": "1.52.0" + } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + } + } + }, + "serialize-javascript": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", + "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", + "requires": { + "randombytes": "^2.1.0" + } + }, + "serve-static": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.1.0.tgz", + "integrity": "sha512-A3We5UfEjG8Z7VkDv6uItWw6HY2bBSBJT1KtVESn6EOoOr2jAxNhxWCLY3jDE2WcuHXByWju74ck3ZgLwL8xmA==", + "requires": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.0.0" + } + }, + "set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "requires": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + } + }, + "setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "requires": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==" + }, + "string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + } + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==" + }, + "superagent": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", + "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "requires": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.4", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.1.2", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.0", + "semver": "^7.3.8" + } + }, + "supertest": { + "version": "6.3.4", + "resolved": "https://registry.npmjs.org/supertest/-/supertest-6.3.4.tgz", + "integrity": "sha512-erY3HFDG0dPnhw4U+udPfrzXa4xhSG+n4rxfRuZWCUvjFWwKl+OxWf/7zk50s84/fAAs7vf5QAb9uRa0cCykxw==", + "requires": { + "methods": "^1.1.2", + "superagent": "^8.1.2" + } + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "requires": { + "has-flag": "^4.0.0" + } + }, + "supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "requires": { + "is-number": "^7.0.0" + } + }, + "toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" + }, + "tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true + }, + "ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "requires": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } + } + }, + "ts-node-dev": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ts-node-dev/-/ts-node-dev-2.0.0.tgz", + "integrity": "sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==", + "dev": true, + "requires": { + "chokidar": "^3.5.1", + "dynamic-dedupe": "^0.3.0", + "minimist": "^1.2.6", + "mkdirp": "^1.0.4", + "resolve": "^1.0.0", + "rimraf": "^2.6.1", + "source-map-support": "^0.5.12", + "tree-kill": "^1.2.2", + "ts-node": "^10.4.0", + "tsconfig": "^7.0.0" + } + }, + "tsconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", + "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", + "dev": true, + "requires": { + "@types/strip-bom": "^3.0.0", + "@types/strip-json-comments": "0.0.30", + "strip-bom": "^3.0.0", + "strip-json-comments": "^2.0.0" + }, + "dependencies": { + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true + } + } + }, + "type-is": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.0.tgz", + "integrity": "sha512-gd0sGezQYCbWSbkZr75mln4YBidWUN60+devscpLF5mtRDUpiaTvKpBNrdaCvel1NdR2k6vclXybU5fBd2i+nw==", + "requires": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "dependencies": { + "media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==" + } + } + }, + "typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "dev": true + }, + "undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==" + }, + "v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true + }, + "vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "requires": { + "isexe": "^2.0.0" + } + }, + "workerpool": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==" + }, + "wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" + }, + "yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + } + }, + "yargs-parser": { + "version": "20.2.4", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", + "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==" + }, + "yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "requires": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + } + }, + "yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==" + } + } +} diff --git a/api-tests/package.json b/api-tests/package.json new file mode 100644 index 00000000..2520ed0f --- /dev/null +++ b/api-tests/package.json @@ -0,0 +1,27 @@ +{ + "name": "typescript-app-tests", + "version": "1.0.0", + "main": "app.ts", + "scripts": { + "start": "ts-node app.ts", + "dev": "ts-node-dev app.ts", + "test": "mocha -r ts-node/register app.ts" + }, + "dependencies": { + "express": "^5.0.0", + "mocha": "^9.0.0", + "supertest": "^6.1.3" + }, + "devDependencies": { + "@types/express": "^4.17.1", + "@types/mocha": "^9.1.1", + "@types/supertest": "^2.0.12", + "ts-node": "^10.0.0", + "ts-node-dev": "^2.0.0", + "typescript": "^4.0.0" + }, + "keywords": [], + "author": "", + "license": "ISC", + "description": "" +} diff --git a/api-tests/settings.ts b/api-tests/settings.ts new file mode 100644 index 00000000..55b3d788 --- /dev/null +++ b/api-tests/settings.ts @@ -0,0 +1,3 @@ +module.exports = { + host: "http://localhost:5000/v2" // API server running on port 5000 +}; diff --git a/api-tests/tsconfig.json b/api-tests/tsconfig.json new file mode 100644 index 00000000..6776f3c0 --- /dev/null +++ b/api-tests/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "target": "es6", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "types": ["node", "mocha"], // Add "mocha" here so TypeScript recognizes the global functions + "skipLibCheck": true + }, + "include": ["./v2Tests/**/*.ts"], // Ensure your test files are included + "exclude": ["node_modules"] +} diff --git a/api-tests/v2Tests/carto_small.ts b/api-tests/v2Tests/carto_small.ts new file mode 100644 index 00000000..b05cb756 --- /dev/null +++ b/api-tests/v2Tests/carto_small.ts @@ -0,0 +1,69 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/carto/small") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/carto/small?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + request(settings.host) + .get("/carto/small?lat=43&lng=-89.3") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return geometry when asked", function (done) { + request(settings.host) + .get("/carto/small?lat=43&lng=-89.3&format=geojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.geoJSON) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a shape", function (done) { + this.timeout(5000); + + request(settings.host) + .get( + "/carto/small?shape=POLYGON((-95.44921875 41.3355759731239,-95.44921875 43.0929606771163,-92.79052734375 43.0929606771163,-92.79052734375 41.3355759731239,-95.44921875 41.3355759731239))", + ) + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/columns.ts b/api-tests/v2Tests/columns.ts new file mode 100644 index 00000000..e3fbe1ce --- /dev/null +++ b/api-tests/v2Tests/columns.ts @@ -0,0 +1,157 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/v2/columns") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/v2/columns?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an interval name", function (done) { + request(settings.host) + .get("/v2/columns?interval_name=Permian") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an age", function (done) { + request(settings.host) + .get("/columns?age=271") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an age_top and age_bottom", function (done) { + request(settings.host) + .get("/columns?age_top=200&age_bottom=250") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a strat_name parameter", function (done) { + request(settings.host) + .get("/columns?strat_name=mancos") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a strat_name_id parameter", function (done) { + request(settings.host) + .get("/columns?strat_name_id=1205") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return topojson", function (done) { + request(settings.host) + .get("/columns?age=2&format=topojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.topoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return csv", function (done) { + request(settings.host) + .get("/columns?age=2&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + request(settings.host) + .get("/columns?lat=43.3&lng=-89.3") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: { col_id: number; }[]; }; }; }) { + if (res.body.success.data[0].col_id != 187) { + throw new Error("Columns returning the wrong column for the lat/lng"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a project_id", function (done) { + request(settings.host) + .get("/columns?project_id=4") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a lat/lng and return all adjacent columns", function (done) { + request(settings.host) + .get("/columns?lat=43.3&lng=-89.3&adjacents=true") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length != 6) { + throw new Error("Wrong number of adjacent columns being returned"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs.ts b/api-tests/v2Tests/defs.ts new file mode 100644 index 00000000..72271e98 --- /dev/null +++ b/api-tests/v2Tests/defs.ts @@ -0,0 +1,21 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return available routes", function (done) { + request(settings.host) + .get("/defs") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { routes: string | any[]; }; }; }) { + if (res.body.success.routes.length < 5) { + throw new Error("Wrong number of definition routes"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_columns.ts b/api-tests/v2Tests/defs_columns.ts new file mode 100644 index 00000000..167c14be --- /dev/null +++ b/api-tests/v2Tests/defs_columns.ts @@ -0,0 +1,118 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/columns") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/columns?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a col_group_id", function (done) { + request(settings.host) + .get("/defs/columns?col_group_id=17") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept multiple col_group_ids", function (done) { + request(settings.host) + .get("/defs/columns?col_group_id=17,18") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 60) { + throw new Error( + "Wrong number of columns returned with multiple col_group_ids", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a col_id", function (done) { + request(settings.host) + .get("/defs/columns?col_id=17") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept multiple col_ids", function (done) { + request(settings.host) + .get("/defs/columns?col_id=3,4") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 2) { + throw new Error( + "Wrong number of columns returned with multiple col_ids", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a col_name", function (done) { + request(settings.host) + .get("/defs/columns?col_name=Eastern%20Kentucky") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all columns", function (done) { + request(settings.host) + .get("/defs/columns?id=1") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 1500) { + throw new Error("Not enough results returned on defs/columns"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_econs.ts b/api-tests/v2Tests/defs_econs.ts new file mode 100644 index 00000000..9ae62e60 --- /dev/null +++ b/api-tests/v2Tests/defs_econs.ts @@ -0,0 +1,106 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/econs") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/econs?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an econ_class", function (done) { + request(settings.host) + .get("/defs/econs?econ_class=energy") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an econ_type", function (done) { + request(settings.host) + .get("/defs/econs?econ_type=hydrocarbon") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an econ", function (done) { + request(settings.host) + .get("/defs/econs?environ=oil%20shale") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an econ_id", function (done) { + request(settings.host) + .get("/defs/econs?id=1") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all econ definitions", function (done) { + request(settings.host) + .get("/defs/econs?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 15) { + throw new Error("Not enough results returned on defs/econs"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return CSV", function (done) { + request(settings.host) + .get("/defs/econs?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_environments.ts b/api-tests/v2Tests/defs_environments.ts new file mode 100644 index 00000000..ee7a21c5 --- /dev/null +++ b/api-tests/v2Tests/defs_environments.ts @@ -0,0 +1,101 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/environments") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/environments?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an environment class", function (done) { + request(settings.host) + .get("/defs/environments?environ_class=non-marine") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an environment type", function (done) { + request(settings.host) + .get("/defs/environments?environ_type=carbonate") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an environment", function (done) { + request(settings.host) + .get("/defs/environments?environ=open%20shallow%20subtidal") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an environment id", function (done) { + request(settings.host) + .get("/defs/environments?environ_id=1") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all environment definitions", function (done) { + request(settings.host) + .get("/defs/environments?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return CSV", function (done) { + request(settings.host) + .get("/defs/environments?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_groups.ts b/api-tests/v2Tests/defs_groups.ts new file mode 100644 index 00000000..7e9c2c95 --- /dev/null +++ b/api-tests/v2Tests/defs_groups.ts @@ -0,0 +1,53 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/groups") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/groups?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all column groups", function (done) { + request(settings.host) + .get("/defs/groups?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/groups?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_intervals.ts b/api-tests/v2Tests/defs_intervals.ts new file mode 100644 index 00000000..feff1b5b --- /dev/null +++ b/api-tests/v2Tests/defs_intervals.ts @@ -0,0 +1,130 @@ +var request = require("supertest"), +validators = require("../validators"), +settings = require("../settings"); + +it("/defs/intervals should return metadata", function (done) { +request(settings.host) + .get("/defs/intervals") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("/defs/intervals?sample should return a sample", function (done) { +request(settings.host) + .get("/defs/intervals?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + + +//need to pass all other parameters through this test to ensure outputs are valid. +it("t_age and b_age should have the correct format and data types", function (done) { +request(settings.host) + .get("/defs/intervals?id=366") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(validators.correctDataTypes) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("/defs/intervals?timescale= should accept a timescale parameter", function (done) { +request(settings.host) + .get("/defs/intervals?timescale=new%20zealand%20ages") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("/defs/intervals?id= should accept an interval id", function (done) { +request(settings.host) + .get("/defs/intervals?id=366") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + + +it("/defs/intervals?all should return all definitions", function (done) { +request(settings.host) + .get("/defs/intervals?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("/defs/intervals?timescale=...&format=csv should return CSV", function (done) { +request(settings.host) + .get("/defs/intervals?timescale=new%20zealand%20ages&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("/defs/intervals?late_age=...&early_age=... should accept an early and late age", function (done) { +request(settings.host) + .get("/defs/intervals?late_age=0&early_age=130") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("/defs/intervals?age=... should accept an age", function (done) { +request(settings.host) + .get("/defs/intervals?age=200") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + + +it("should accept an interval_name", function (done) { +request(settings.host) + .get("/intervals?name=Permian") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + + diff --git a/api-tests/v2Tests/defs_lithologies.ts b/api-tests/v2Tests/defs_lithologies.ts new file mode 100644 index 00000000..a275e8eb --- /dev/null +++ b/api-tests/v2Tests/defs_lithologies.ts @@ -0,0 +1,104 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/lithologies") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/lithologies?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a lith_id", function (done) { + request(settings.host) + .get("/defs/lithologies?lith_id=3") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 1) { + throw new Error( + "Should have returned 1 lith definition but returned more or less", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept multiple lith_ids", function (done) { + request(settings.host) + .get("/defs/lithologies?lith_id=3,4,5") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 3) { + throw new Error( + "Should have returned 3 lith definitions but returned more or less", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a lith class", function (done) { + request(settings.host) + .get("/defs/lithologies?lith_class=sedimentary") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should show all lith definitions when asked", function (done) { + request(settings.host) + .get("/defs/lithologies?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 2) { + throw new Error("Should have returned more than 2 lith_definitions"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/lithologies?lith_id=3&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_lithology_attributes.ts b/api-tests/v2Tests/defs_lithology_attributes.ts new file mode 100644 index 00000000..b155b7ec --- /dev/null +++ b/api-tests/v2Tests/defs_lithology_attributes.ts @@ -0,0 +1,107 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/lithology_attributes") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/lithology_attributes?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an att_type", function (done) { + request(settings.host) + .get("/defs/lithology_attributes?att_type=bedform") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a lith_att", function (done) { + request(settings.host) + .get("/defs/lithology_attributes?lith_att=mounds") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a lith_att_id", function (done) { + request(settings.host) + .get("/defs/lithology_attributes?lith_att_id=1") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept multiple lith_att_ids", function (done) { + request(settings.host) + .get("/defs/lithology_attributes?lith_att_id=3,4,5") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 3) { + throw new Error( + "Should have returned 3 lithology attribute definitions but returned more or less", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all records", function (done) { + request(settings.host) + .get("/defs/lithology_attributes?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/lithology_attributes?lith_att=mounds&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_measurements.ts b/api-tests/v2Tests/defs_measurements.ts new file mode 100644 index 00000000..7d78c63a --- /dev/null +++ b/api-tests/v2Tests/defs_measurements.ts @@ -0,0 +1,110 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/measurements") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/measurements?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept measurement IDs", function (done) { + request(settings.host) + .get("/defs/measurements?measure_id=3,4") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 2) { + throw new Error("Should have returned 2 measurements but did not"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a measurement class", function (done) { + request(settings.host) + .get("/defs/measurements?measurement_class=geochemical") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + if (d.class != "geochemical") { + throw new Error("Wrong measurement class returned"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a measurement type", function (done) { + request(settings.host) + .get("/defs/measurements?measurement_type=geochronological") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + if (d.type != "geochronological") { + throw new Error("Wrong measurement type returned"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all definitions", function (done) { + request(settings.host) + .get("/defs/measurements?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return CSV", function (done) { + request(settings.host) + .get( + "/defs/measurements?measurement_type=geochronological&format=csv", + ) + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_minerals.ts b/api-tests/v2Tests/defs_minerals.ts new file mode 100644 index 00000000..d00ec114 --- /dev/null +++ b/api-tests/v2Tests/defs_minerals.ts @@ -0,0 +1,89 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/minerals") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/minerals?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a mineral_id", function (done) { + request(settings.host) + .get("/defs/minerals?mineral_id=1") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a mineral name", function (done) { + request(settings.host) + .get("/defs/minerals?mineral=abhurite") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a mineral type", function (done) { + request(settings.host) + .get("/defs/minerals?minerals?mineral_type=clinopyroxene") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all definitions", function (done) { + request(settings.host) + .get("/defs/minerals?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return CSV", function (done) { + request(settings.host) + .get("/defs/minerals?mineral=abhurite&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_plates.ts b/api-tests/v2Tests/defs_plates.ts new file mode 100644 index 00000000..6966ae3f --- /dev/null +++ b/api-tests/v2Tests/defs_plates.ts @@ -0,0 +1,53 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/plates") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/plates?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all plates", function (done) { + request(settings.host) + .get("/defs/plates?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/plates?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_projects.ts b/api-tests/v2Tests/defs_projects.ts new file mode 100644 index 00000000..10d91219 --- /dev/null +++ b/api-tests/v2Tests/defs_projects.ts @@ -0,0 +1,53 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/projects") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/projects?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all projects", function (done) { + request(settings.host) + .get("/defs/projects?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/projects?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_refs.ts b/api-tests/v2Tests/defs_refs.ts new file mode 100644 index 00000000..4a9502d0 --- /dev/null +++ b/api-tests/v2Tests/defs_refs.ts @@ -0,0 +1,72 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/refs") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/refs?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all refs", function (done) { + request(settings.host) + .get("/defs/refs?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a ref_id", function (done) { + request(settings.host) + .get("/defs/refs?ref_id=1,2,3") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 3) { + throw new Error( + "Should have returned 3 ref definitions but returned more or less", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/refs?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_sources.ts b/api-tests/v2Tests/defs_sources.ts new file mode 100644 index 00000000..c12a0bcf --- /dev/null +++ b/api-tests/v2Tests/defs_sources.ts @@ -0,0 +1,127 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/sources") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/sources?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all sources", function (done) { + request(settings.host) + .get("/defs/sources?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/sources?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a source_id", function (done) { + request(settings.host) + .get("/defs/sources?source_id=1,2,3") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length != 3) { + throw new Error("Wrong number of sources returned with source_id"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + /* + it("should return all sources as GeoJSON", function(done) { + request(settings.host) + .get("/defs/sources?all&format=geojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.geoJSON) + .end(function(error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + */ + + it("should accept a scale", function (done) { + request(settings.host) + .get("/defs/sources?scale=medium") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + if (d.scale != "medium") { + throw new Error("Wrong scale returned when filtering by scale"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + request(settings.host) + .get("/defs/sources?lat=43&lng=-89") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a WKT shape", function (done) { + request(settings.host) + .get( + "/defs/sources?shape=LINESTRING(-122.3438%2037,-89.3527%2043.0582)&buffer=100", + ) + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_strat_name_concepts.ts b/api-tests/v2Tests/defs_strat_name_concepts.ts new file mode 100644 index 00000000..2ebb1269 --- /dev/null +++ b/api-tests/v2Tests/defs_strat_name_concepts.ts @@ -0,0 +1,53 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/strat_name_concepts") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/strat_name_concepts?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a concept_id", function (done) { + request(settings.host) + .get("/defs/strat_name_concepts?concept_id=1,2") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/strat_name_concepts?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_strat_names.ts b/api-tests/v2Tests/defs_strat_names.ts new file mode 100644 index 00000000..f42cd44c --- /dev/null +++ b/api-tests/v2Tests/defs_strat_names.ts @@ -0,0 +1,108 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/strat_names") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/strat_names?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a strat id", function (done) { + request(settings.host) + .get("/defs/strat_names?strat_name_id=1") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept multiple strat ids", function (done) { + request(settings.host) + .get("/defs/strat_names?strat_name_id=2188,7145") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length != 2) { + throw new Error( + "defs/strat_names does not return two results as expected", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a strat name", function (done) { + request(settings.host) + .get("/defs/strat_names?strat_name=Abercrombie") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a strat rank", function (done) { + request(settings.host) + .get("/defs/strat_names?rank=Gp") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all strat names", function (done) { + request(settings.host) + .get("/defs/strat_names?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/strat_names?strat_name=Abercrombie&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_structures.ts b/api-tests/v2Tests/defs_structures.ts new file mode 100644 index 00000000..b36dc283 --- /dev/null +++ b/api-tests/v2Tests/defs_structures.ts @@ -0,0 +1,108 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/structures") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/structures?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept structure IDs", function (done) { + request(settings.host) + .get("/defs/structures?structure_id=3,4") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 2) { + throw new Error("Should have returned 2 structures but did not"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a structure class", function (done) { + request(settings.host) + .get("/defs/structures?structure_class=fabric") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + if (d.class != "fabric") { + throw new Error("Wrong structure class returned"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a structure type", function (done) { + request(settings.host) + .get("/defs/structures?structure_type=fault") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + if (d.structure_type != "fault") { + throw new Error("Wrong structure type returned"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all definitions", function (done) { + request(settings.host) + .get("/defs/structures?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return CSV", function (done) { + request(settings.host) + .get("/defs/structures?structure_type=fabric&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/defs_timescales.ts b/api-tests/v2Tests/defs_timescales.ts new file mode 100644 index 00000000..d65de276 --- /dev/null +++ b/api-tests/v2Tests/defs_timescales.ts @@ -0,0 +1,53 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/defs/timescales") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/defs/timescales?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return all timescales", function (done) { + request(settings.host) + .get("/defs/timescales?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output CSV", function (done) { + request(settings.host) + .get("/defs/timescales?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/fossils.ts b/api-tests/v2Tests/fossils.ts new file mode 100644 index 00000000..e1a4db2c --- /dev/null +++ b/api-tests/v2Tests/fossils.ts @@ -0,0 +1,121 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/fossils") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/fossils?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a time_interval", function (done) { + this.timeout(4000); + + request(settings.host) + .get("/fossils?interval_name=Permian") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an age", function (done) { + request(settings.host) + .get("/fossils?age=123") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an age_top and age_bottom", function (done) { + request(settings.host) + .get("/fossils?age_top=100&age_bottom=120") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a col_id", function (done) { + request(settings.host) + .get("/fossils?col_id=446") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept multiple col_ids", function (done) { + request(settings.host) + .get("/fossils?col_id=446,56") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 29) { + throw new Error( + "Wrong number of fossil collections returned with multiple IDs supplied", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept one or more unit_ids", function (done) { + request(settings.host) + .get("/fossils?unit_id=14777,14949,15018,15211,15210") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output Topojson", function (done) { + request(settings.host) + .get("/fossils?interval_name=Permian&format=topojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.topoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/geologic_units_burwell.ts b/api-tests/v2Tests/geologic_units_burwell.ts new file mode 100644 index 00000000..10f9e5a0 --- /dev/null +++ b/api-tests/v2Tests/geologic_units_burwell.ts @@ -0,0 +1,111 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/geologic_units/burwell") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/geologic_units/burwell?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + request(settings.host) + .get("/geologic_units/burwell?lat=43&lng=-89.3&scale=large") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a map_id", function (done) { + request(settings.host) + .get("/geologic_units/burwell?map_id=605211&scale=medium") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept multiple map_ids", function (done) { + request(settings.host) + .get( + "/geologic_units/burwell?map_id=605211,605210,605209&scale=medium", + ) + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length != 3) { + throw new Error( + "Wrong number of features returned with multiple map_ids", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a strat_name_id", function (done) { + request(settings.host) + .get("/geologic_units/burwell?strat_name_id=1205&scale=medium") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a unit_id", function (done) { + request(settings.host) + .get("/geologic_units/burwell?unit_id=6124&scale=medium") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return geometry when asked", function (done) { + request(settings.host) + .get( + "/geologic_units/burwell?lat=43&lng=-89.3&format=geojson&scale=medium", + ) + .expect(validators.aSuccessfulRequest) + .expect(validators.geoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/geologic_units_gmna.ts b/api-tests/v2Tests/geologic_units_gmna.ts new file mode 100644 index 00000000..cfc90017 --- /dev/null +++ b/api-tests/v2Tests/geologic_units_gmna.ts @@ -0,0 +1,93 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/geologic_units/gmna") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/geologic_units/gmna?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + this.timeout(3000); + + request(settings.host) + .get("/geologic_units/gmna?lat=43&lng=-89.3") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a GID ", function (done) { + request(settings.host) + .get("/geologic_units/gmna?gid=1234") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a time interval_name", function (done) { + request(settings.host) + .get("/geologic_units/gmna?interval_name=Permian") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return geometry when asked", function (done) { + request(settings.host) + .get("/geologic_units/gmna?lat=43&lng=-89.3&format=geojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a shape", function (done) { + this.timeout(4500); + + request(settings.host) + .get("/geologic_units/gmna?shape=LINESTRING(-88%2043,%20-90%2043)") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/geologic_units_gmus.ts b/api-tests/v2Tests/geologic_units_gmus.ts new file mode 100644 index 00000000..23a66301 --- /dev/null +++ b/api-tests/v2Tests/geologic_units_gmus.ts @@ -0,0 +1,185 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/geologic_units/gmus") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/geologic_units/gmus?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + this.timeout(3000); + + request(settings.host) + .get("/geologic_units/gmus?lat=43&lng=-89.3") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept adjacents with a latitude and longitude", function (done) { + request(settings.host) + .get( + "/geologic_units/gmus?lat=43.40205&lng=-89.82112&adjacents=true", + ) + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 3) { + throw new Error( + "Wrong number of units returned with lat/lng and adjacents", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a time interval_name", function (done) { + this.timeout(5000); + + request(settings.host) + .get("/geologic_units/gmus?interval_name=Pliocene") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a search", function (done) { + this.timeout(4000); + + request(settings.host) + .get("/geologic_units/gmus?search=Mancos%20Shale") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a unit_link", function (done) { + request(settings.host) + .get("/geologic_units/gmus?unit_link=WIOp;0") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a GID", function (done) { + request(settings.host) + .get("/geologic_units/gmus?gid=184506") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept adjacents with a GID", function (done) { + request(settings.host) + .get("/geologic_units/gmus?gid=184448&adjacents=true") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 3) { + throw new Error( + "Wrong number of units returned with gid and adjacents", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a unit_id", function (done) { + request(settings.host) + .get("/geologic_units/gmus?unit_id=2470,38484") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a strat_name_id", function (done) { + request(settings.host) + .get("/geologic_units/gmus?strat_name_id=1205") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return geometry when asked", function (done) { + request(settings.host) + .get("/geologic_units/gmus?lat=43&lng=-89.3&format=geojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a shape", function (done) { + this.timeout(3500); + + request(settings.host) + .get("/geologic_units/gmus?shape=LINESTRING(-88%2043,%20-90%2043)") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/index.ts b/api-tests/v2Tests/index.ts new file mode 100644 index 00000000..84f78cc1 --- /dev/null +++ b/api-tests/v2Tests/index.ts @@ -0,0 +1,43 @@ +module.exports = function () { + describe("root", require("./root")); + describe("columns", require("./columns")); + describe("sections", require("./sections")); + describe("units", require("./units")); + describe("fossils", require("./fossils")); + describe("stats", require("./stats")); + + describe("defs", require("./defs")); + describe("defs/lithologies", require("./defs_lithologies")); + describe("defs/lithology_attributes", require("./defs_lithology_attributes")); + describe("defs/columns", require("./defs_columns")); + describe("defs/econs", require("./defs_econs")); + describe("defs/environments", require("./defs_environments")); + describe("defs/intervals", require("./defs_intervals")); + describe("defs/measurements", require("./defs_measurements")); + describe("defs/minerals", require("./defs_minerals")); + describe("defs/timescales", require("./defs_timescales")); + describe("defs/plates", require("./defs_plates")); + describe("defs/projects", require("./defs_projects")); + describe("defs/groups", require("./defs_groups")); + describe("defs/strat_names", require("./defs_strat_names")); + describe("defs/strat_name_concepts", require("./defs_strat_name_concepts")); + describe("defs/structures", require("./defs_structures")); + describe("defs/refs", require("./defs_refs")); + describe("defs/sources", require("./defs_sources")); + + describe("paleogeography", require("./paleogeography")); + describe("geologic_units/gmna", require("./geologic_units_gmna")); + describe("geologic_units/gmus", require("./geologic_units_gmus")); + describe("geologic_units/burwell", require("./geologic_units_burwell")); + + describe("carto/small", require("./carto_small")); + + describe("tiles", require("./tiles")); + + describe("mobile/point", require("./mobile_point")); + describe("mobile/point_details", require("./mobile_point_details")); + describe("mobile/fossil_collections", require("./mobile_fossil_collections")); + describe("mobile/macro_summary", require("./mobile_macro_summary")); + describe("mobile/map_query", require("./mobile_map_query")); + describe("Mancos test cases", require("./mancos_test_cases")); +}; diff --git a/api-tests/v2Tests/mancos_test_cases.ts b/api-tests/v2Tests/mancos_test_cases.ts new file mode 100644 index 00000000..d24ac155 --- /dev/null +++ b/api-tests/v2Tests/mancos_test_cases.ts @@ -0,0 +1,169 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return point data for Detroit", function (done) { + request(settings.host) + .get("/mobile/point?lat=42.331427&lng=-83.045754") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: { uid: number; rocktype: string | any[]; age: string; name: string | any[]; desc: string | any[]; comm: string | any[]; strat_unit: string | any[]; col_id: number; }; }; }; }) { + if (res.body.success.data.uid !== 1114738) { + throw new Error("Wrong unit returned for Detroit"); + } + if (res.body.success.data.rocktype.length < 2) { + throw new Error("Invalid rocktypes returned for Detroit"); + } + if (res.body.success.data.age !== "Middle Devonian") { + throw new Error("Invalid age returned for Detroit"); + } + if ( + res.body.success.data.name.length < 2 || + res.body.success.data.desc.length < 2 || + res.body.success.data.comm.length < 2 + ) { + throw new Error("Invalid data returned for Detroit"); + } + if (res.body.success.data.strat_unit.length > 0) { + throw new Error("Invalid strat unit returned for Detroit"); + } + if (res.body.success.data.col_id !== 1594) { + throw new Error("Invalid column returned for Detroit"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return point details for Detroit", function (done) { + request(settings.host) + .get("/mobile/point_details?lat=42.331427&lng=-83.045754") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: { column: { units: string | any[]; }; }[]; }; }; }) { + if ( + !res.body.success.data[0].column + ) { + throw new Error("Missing details for Detroit"); + } + if (res.body.success.data[0].column.units.length < 5) { + throw new Error("Missing units from details for Detroit"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return point data for Toronto", function (done) { + request(settings.host) + .get("/mobile/point?lat=43.651893&lng=-79.381713") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: { uid: number; rocktype: string | any[]; age: string; name: string | any[]; strat_unit: string | any[]; desc: string | any[]; comm: string | any[]; col_id: number; }; }; }; }) { + if (res.body.success.data.uid !== 619176) { + throw new Error("Wrong unit returned for Toronto"); + } + if (res.body.success.data.rocktype.length < 1) { + throw new Error("Invalid rocktypes returned for Toronto"); + } + if (res.body.success.data.age !== "Late Ordovician") { + throw new Error("Invalid age returned for Toronto"); + } + if (res.body.success.data.name.length < 2) { + throw new Error("Invalid data returned for Toronto"); + } + if ( + res.body.success.data.strat_unit.length > 0 || + res.body.success.data.desc.length > 0 || + res.body.success.data.comm.length > 0 + ) { + throw new Error("Invalid data returned for Toronto"); + } + if (res.body.success.data.col_id !== 1598) { + throw new Error("Invalid column returned for Toronto"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return point details for Toronto", function (done) { + request(settings.host) + .get("/mobile/point_details?lat=43.651893&lng=-79.381713") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: { column: { units: string | any[]; }; }[]; }; }; }) { + if (!res.body.success.data[0].column) { + throw new Error("Missing details for Toronto"); + } + if (res.body.success.data[0].column.units.length < 5) { + throw new Error("Missing units from details for Toronto"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return point data for Buenos Aires", function (done) { + request(settings.host) + .get("/mobile/point?lat=-34.565383&lng=-58.452759") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: { uid: string | any[]; rocktype: string | any[]; age: string | any[]; name: string | any[]; strat_unit: string | any[]; desc: string | any[]; comm: string | any[]; col_id: string | any[]; }; }; }; }) { + if (res.body.success.data.uid.length > 0) { + throw new Error("Wrong unit returned for Buenos Aires"); + } + if (res.body.success.data.rocktype.length > 0) { + throw new Error("Invalid rocktypes returned for Buenos Aires"); + } + if (res.body.success.data.age.length > 0) { + throw new Error("Invalid age returned for Buenos Aires"); + } + if (res.body.success.data.name.length > 0) { + throw new Error("Invalid data returned for Buenos Aires"); + } + if ( + res.body.success.data.strat_unit.length > 0 || + res.body.success.data.desc.length > 0 || + res.body.success.data.comm.length > 0 + ) { + throw new Error("Invalid data returned for Buenos Aires"); + } + if (res.body.success.data.col_id.length > 0) { + throw new Error("Invalid column returned for Buenos Aires"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return point details for Buenos Aires", function (done) { + request(settings.host) + .get("/mobile/point_details?lat=-34.565383&lng=-58.452759") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: { column: any; }[]; }; }; }) { + if (!res.body.success.data[0].column) { + throw new Error("Missing empty column for Buenos Aires"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/mobile_fossil_collections.ts b/api-tests/v2Tests/mobile_fossil_collections.ts new file mode 100644 index 00000000..236919d3 --- /dev/null +++ b/api-tests/v2Tests/mobile_fossil_collections.ts @@ -0,0 +1,44 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/mobile/fossil_collections") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a unit_id", function (done) { + request(settings.host) + .get("/mobile/fossil_collections?unit_id=154") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 2) { + throw new Error("PBDB collections not returned"); + } + if (res.body.success.data[0].cltn_id !== 111035) { + throw new Error( + "Wrong collections returned on moble/fossil_collections", + ); + } + if (res.body.success.data[1].cltn_name !== "Lookout Mountain") { + throw new Error( + "Wrong collections returned on moble/fossil_collections", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/mobile_macro_summary.ts b/api-tests/v2Tests/mobile_macro_summary.ts new file mode 100644 index 00000000..5634197e --- /dev/null +++ b/api-tests/v2Tests/mobile_macro_summary.ts @@ -0,0 +1,41 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/mobile/macro_summary") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + request(settings.host) + .get("/mobile/macro_summary?lat=43.0706192&lng=-89.406167") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any; }; }; }) { + var response = res.body.success.data; + if ( + !response.lith.length || + !response.environ.length || + !response.econs.length || + !response.strat_names.length || + !response.strat_name_ids.length + ) { + throw new Error("Bad response"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/mobile_map_query.ts b/api-tests/v2Tests/mobile_map_query.ts new file mode 100644 index 00000000..03de5321 --- /dev/null +++ b/api-tests/v2Tests/mobile_map_query.ts @@ -0,0 +1,98 @@ +module.exports = function () { + var request = require("supertest"); + var validators = require("../validators"); + var settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/mobile/map_query") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude, longitude, and z", function (done) { + request(settings.host) + .get("/mobile/map_query?lat=43.0706192&lng=-89.406167&z=8") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: any) { + var response = res.body.success.data; + if (!response.hasOwnProperty("elevation")) { + throw new Error("Missing elevation from response"); + } + if (!response.hasOwnProperty("burwell")) { + throw new Error("Missing burwell from response"); + } + if (!response.hasOwnProperty("macrostrat")) { + throw new Error("Missing macrostrata from response"); + } + if (!response.hasOwnProperty("lines")) { + throw new Error("Missing lines from response"); + } + if (!response.burwell.length) { + throw new Error("Bad response"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should require a lat, lng, and z", function (done) { + request(settings.host) + .get("/mobile/map_query?lat=1&lng=1") + .expect(validators.json) + .expect(function (res: { statusCode: any; body: { hasOwnProperty: (arg0: string) => any; }; }) { + // var response = res.body.success.data + if (res.statusCode != 400) { + throw new Error("Wrong status code"); + } + if (!res.body.hasOwnProperty("error")) { + throw new Error("No error returned when one was expected"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should not choke on a fractional zoom", function (done) { + request(settings.host) + .get( + "/mobile/map_query?lat=43.0706192&lng=-89.406167&z=8.984324234", + ) + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: any) { + var response = res.body.success.data; + if (!response.hasOwnProperty("elevation")) { + throw new Error("Missing elevation from response"); + } + if (!response.hasOwnProperty("burwell")) { + throw new Error("Missing burwell from response"); + } + if (!response.hasOwnProperty("macrostrat")) { + throw new Error("Missing macrostrata from response"); + } + if (!response.hasOwnProperty("lines")) { + throw new Error("Missing lines from response"); + } + if (!response.burwell.length) { + throw new Error("Bad response"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/mobile_point.ts b/api-tests/v2Tests/mobile_point.ts new file mode 100644 index 00000000..77483b58 --- /dev/null +++ b/api-tests/v2Tests/mobile_point.ts @@ -0,0 +1,29 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/mobile/point") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a latitude and longitude", function (done) { + request(settings.host) + .get("/mobile/point?lat=43&lng=-89") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/mobile_point_details.ts b/api-tests/v2Tests/mobile_point_details.ts new file mode 100644 index 00000000..353097d0 --- /dev/null +++ b/api-tests/v2Tests/mobile_point_details.ts @@ -0,0 +1,56 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/mobile/point_details") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a lat and lng", function (done) { + request(settings.host) + .get("/mobile/point_details?lat=43&lng=-89") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: { gmus: any; }[]; }; }; }) { + if ( + !res.body.success.data[0].gmus + ) { + throw new Error("Response missing a data type"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a col_id and unit_id", function (done) { + request(settings.host) + .get("/mobile/point_details?col_id=187&unit_id=184506") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: any) { + if ( + !res.body.success.data[0].column || + !res.body.success.data[0].gmus + ) { + throw new Error("Response missing a data type"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/paleogeography.ts b/api-tests/v2Tests/paleogeography.ts new file mode 100644 index 00000000..812f927e --- /dev/null +++ b/api-tests/v2Tests/paleogeography.ts @@ -0,0 +1,62 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/paleogeography") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/paleogeography?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an age parameter", function (done) { + request(settings.host) + .get("/paleogeography?age=271") + .expect(validators.aSuccessfulRequest) + .expect(validators.geoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept an interval name", function (done) { + request(settings.host) + .get("/paleogeography?interval_name=Permian") + .expect(validators.aSuccessfulRequest) + .expect(validators.geoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return topojson", function (done) { + request(settings.host) + .get("/paleogeography?interval_name=Permian&format=topojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.topoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/root.ts b/api-tests/v2Tests/root.ts new file mode 100644 index 00000000..b8ea29ac --- /dev/null +++ b/api-tests/v2Tests/root.ts @@ -0,0 +1,16 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return a list of all visible routes", function (done) { + request(settings.host) + .get("") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/sections.ts b/api-tests/v2Tests/sections.ts new file mode 100644 index 00000000..6350988a --- /dev/null +++ b/api-tests/v2Tests/sections.ts @@ -0,0 +1,51 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/sections") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a sample", function (done) { + request(settings.host) + .get("/sections?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should accept a column id", function (done) { + request(settings.host) + .get("/sections?col_id=49") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return csv", function (done) { + request(settings.host) + .get("/sections?col_id=17&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/stats.ts b/api-tests/v2Tests/stats.ts new file mode 100644 index 00000000..22861c31 --- /dev/null +++ b/api-tests/v2Tests/stats.ts @@ -0,0 +1,40 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return metadata", function (done) { + request(settings.host) + .get("/stats") + .expect(validators.aSuccessfulRequest) + .expect(validators.metadata) + .expect(validators.json) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should show ALL THE STATS", function (done) { + request(settings.host) + .get("/stats?all") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should output the stats in CSV", function (done) { + request(settings.host) + .get("/stats?all&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .expect("Content-Type", "text/csv; charset=utf-8") + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/tiles.ts b/api-tests/v2Tests/tiles.ts new file mode 100644 index 00000000..c82694d4 --- /dev/null +++ b/api-tests/v2Tests/tiles.ts @@ -0,0 +1,38 @@ +module.exports = function () { + var request = require("supertest"), + validators = require("../validators"), + settings = require("../settings"); + + it("should return a tile for original", function (done) { + request(settings.host) + .get("/maps/burwell/3/2/4/tile.png") + .expect(validators.aSuccessfulRequest) + .expect(validators.tile) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a tile for vanilla", function (done) { + request(settings.host) + .get("/maps/burwell/vanilla/3/2/4/tile.png") + .expect(validators.aSuccessfulRequest) + .expect(validators.tile) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); + + it("should return a tile for emphasized", function (done) { + request(settings.host) + .get("/maps/burwell/emphasized/3/2/4/tile.png") + .expect(validators.aSuccessfulRequest) + .expect(validators.tile) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); + }); +}; diff --git a/api-tests/v2Tests/units.ts b/api-tests/v2Tests/units.ts new file mode 100644 index 00000000..55f6f602 --- /dev/null +++ b/api-tests/v2Tests/units.ts @@ -0,0 +1,481 @@ +var request = require("supertest"), +validators = require("../validators"), +settings = require("../settings"); + +it("should return metadata", function (done) { +request(settings.host) + .get("/units") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.metadata) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should return a sample", function (done) { +request(settings.host) + .get("/units?sample") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.aSample) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + + +//randomize unit_id's for tests +it("t_age, b_age, t_prop, b_prop, b_int_age, and t_int_age should have the correct format and data types", function (done) { + request(settings.host) + .get("/units?unit_id=352,283,382") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(validators.correctDataTypes) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + + +it("should accept an interval_name", function (done) { +request(settings.host) + .get("/units?interval_name=Permian") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept an age", function (done) { +request(settings.host) + .get("/units?age=400") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept an age_top and age_bottom", function (done) { +request(settings.host) + .get("/units?age_top=200&age_bottom=250") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a section_id", function (done) { +request(settings.host) + .get("/units?section_id=107") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a response parameter", function (done) { +request(settings.host) + .get("/units?age_top=200&age_bottom=250&response=long") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(function (res: { body: { success: { data: { b_int_name: any; }[]; }; }; }) { + if (!res.body.success.data[0].b_int_name) { + throw new Error("Extra data missing when requested"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a lith parameter", function (done) { +request(settings.host) + .get("/units?lith=sandstone") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 800) { + throw new Error( + "Not enough results returned when using lith on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a lith_type parameter", function (done) { +request(settings.host) + .get("/units?lith_type=organic") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 600) { + throw new Error( + "Not enough results returned when using lith_type on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a lith_class parameter", function (done) { +request(settings.host) + .get("/units?lith_class=metamorphic") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 1800) { + throw new Error( + "Not enough results returned when using lith_class on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a environ parameter", function (done) { +request(settings.host) + .get("/units?environ=reef") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 100) { + throw new Error( + "Not enough results returned when using environ on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a environ_type parameter", function (done) { +request(settings.host) + .get("/units?environ_type=carbonate") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 100) { + throw new Error( + "Not enough results returned when using environ_type on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a environ_class parameter", function (done) { +this.timeout(5000); + +request(settings.host) + .get("/units?environ_class=marine") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 1000) { + throw new Error( + "Not enough results returned when using environ_class on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a project_id", function (done) { +request(settings.host) + .get("/units?project_id=4") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 130) { + throw new Error( + "Not enough results returned when using project_id on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a strat_name parameter", function (done) { +request(settings.host) + .get("/units?strat_name=mancos") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 22) { + throw new Error( + "Wrong number of units returned when using strat_name on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a strat_name_id parameter", function (done) { +request(settings.host) + .get("/units?strat_name_id=1205") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 10) { + throw new Error( + "Wrong number of units returned when using strat_id on units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should output GeoJSON", function (done) { +request(settings.host) + .get("/units?strat_name_id=1205&format=geojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.geoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should output TopoJSON", function (done) { +request(settings.host) + .get("/units?strat_name_id=1205&format=topojson") + .expect(validators.aSuccessfulRequest) + .expect(validators.topoJSON) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a geom_age parameter", function (done) { +request(settings.host) + .get("/units?strat_name_id=1205&format=geojson&geom_age=top") + .expect(validators.aSuccessfulRequest) + .expect(validators.geoJSON) + .expect(function (res: any) { + var coordLat = + res.body.success.data.features[0].geometry.coordinates[1], + coordLng = res.body.success.data.features[0].geometry.coordinates[0], + topLat = res.body.success.data.features[0].properties.t_plat, + topLng = res.body.success.data.features[0].properties.t_plng; + + if (coordLat != topLat || coordLng != topLng) { + throw new Error( + "Incorrect coordinates used when specifying a geom_age on /units", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should output CSV", function (done) { +request(settings.host) + .get("/units?section_id=107&format=csv") + .expect(validators.aSuccessfulRequest) + .expect(validators.csv) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept an econ_id filter", function (done) { +request(settings.host) + .get("/units?econ_id=4&response=long") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + var found = false; + d.econ.forEach(function (j: { name: string; }) { + if (j.name === "oil reservoir") { + found = true; + } + }); + if (!found) { + throw new Error("Wrong econs returned when filtering by econ_id"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept an econ filter", function (done) { +request(settings.host) + .get("/units?econ=uranium%20ore&response=long") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + var found = false; + d.econ.forEach(function (j: { name: string; }) { + if (j.name === "uranium ore") { + found = true; + } + }); + if (!found) { + throw new Error("Wrong econs returned when filtering by econ"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept an econ_type filter", function (done) { +request(settings.host) + .get("/units?econ_type=nuclear&response=long") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + var found = false; + d.econ.forEach(function (j: { type: string; }) { + if (j.type === "nuclear") { + found = true; + } + }); + if (!found) { + throw new Error("Wrong econs returned when filtering by econ_type"); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept an econ_class filter", function (done) { +request(settings.host) + .get("/units?econ_class=energy&response=long") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: any[]; }; }; }) { + res.body.success.data.forEach(function (d) { + var found = false; + d.econ.forEach(function (j: { class: string; }) { + if (j.class === "energy") { + found = true; + } + }); + if (!found) { + throw new Error( + "Wrong econs returned when filtering by econ_class", + ); + } + }); + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should accept a PBDB collection filter", function (done) { +request(settings.host) + .get("/units?cltn_id=185,191") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length !== 2) { + throw new Error( + "Wrong number of units returned with PBDB collection filter", + ); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); + +it("should order the output given the input", function (done) { +request(settings.host) + .get("/units?unit_id=138,139,137") + .expect(validators.aSuccessfulRequest) + .expect(validators.json) + .expect(validators.atLeastOneResult) + .expect(function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length != 3) { + throw new Error("Wrong number of units being returned"); + } + if ( + res.body.success.data[0].unit_id != 138 || + res.body.success.data[2].unit_id != 137 + ) { + throw new Error("Wrong order of units returned"); + } + }) + .end(function (error: any, res: any) { + if (error) return done(error); + done(); + }); +}); diff --git a/api-tests/validators.ts b/api-tests/validators.ts new file mode 100644 index 00000000..ef7c2449 --- /dev/null +++ b/api-tests/validators.ts @@ -0,0 +1,148 @@ +//var sizeOf = require("image-size"); + +module.exports = { + aSuccessfulRequest: function (res: { statusCode: number; headers: { [x: string]: string; }; }) { + if (res.statusCode !== 200) { + console.log(res.statusCode); + throw new Error("Bad status code"); + } + if (res.headers["access-control-allow-origin"] !== "*") { + throw new Error("Wrong access-control-allow-origin headers"); + } + }, + + metadata: function (res: { body: { success: { description: any; options: { parameters: {}; output_formats: string | any[]; examples: string | any[]; fields: {}; }; }; }; }) { + // Make sure all the key metadata sections exist + if (!res.body.success.description) { + throw new Error("Route description missing"); + } + if (!res.body.success.options) { + throw new Error("Route options missing"); + } + if (!res.body.success.options.parameters) { + throw new Error("Route parameters missing"); + } + if (!res.body.success.options.output_formats) { + throw new Error("Route output formats missing"); + } + if (!res.body.success.options.examples) { + throw new Error("Route examples missing"); + } + if (!res.body.success.options.fields) { + throw new Error("Route fields missing"); + } + + // Make sure the metadata sections are formatted properly + if (!(res.body.success.options.parameters instanceof Object)) { + throw new Error("Something wrong with parameters object"); + } + if (!(res.body.success.options.output_formats instanceof Array)) { + throw new Error("Something wrong with output formats array"); + } + if (!(res.body.success.options.examples instanceof Array)) { + throw new Error("Something wrong with examples array"); + } + if (!(res.body.success.options.fields instanceof Object)) { + throw new Error("Something wrong with fields object"); + } + + // Make sure metadata sections are populated + if (Object.keys(res.body.success.options.parameters).length < 1) { + throw new Error("Route is missing parameters"); + } + if (res.body.success.options.output_formats.length < 1) { + throw new Error("Route is missing output formats"); + } + if (res.body.success.options.examples.length < 1) { + throw new Error("Route is missing examples"); + } + if (Object.keys(res.body.success.options.fields).length < 1) { + throw new Error("Route is missing field definitions"); + } + }, + + aSample: function (res: { body: { success: { data: { type: any; features: string | any[]; length: number; }; }; }; }) { + // Make sure 5 records were returned + if (res.body.success.data.type) { + if (res.body.success.data.features.length !== 5) { + throw new Error("Sample returned wrong number of records"); + } + } else { + if (res.body.success.data.length !== 5) { + throw new Error("Sample returned wrong number of records"); + } + } + }, + + geoJSON: function (res: { body: { success: { data: { type: string; features: any[]; }; }; }; }) { + if (res.body.success.data.type !== "FeatureCollection") { + throw new Error("GeoJSON was not returned"); + } + + res.body.success.data.features.forEach(function (d) { + if ( + !d.geometry || + !d.geometry.coordinates || + !d.geometry.coordinates.length || + !d.properties + ) { + throw new Error(`GeoJSON was malformed ${d}`); + } + }); + }, + + topoJSON: function (res: { body: { success: { data: { type: string; }; }; }; }) { + if (res.body.success.data.type !== "Topology") { + throw new Error("TopoJSON was not returned"); + } + }, + + json: function (res: { body: { success: any; error: any; }; }) { + if (!res.body.success && !res.body.error) { + throw new Error("Request did not return valid JSON"); + } + }, + + csv: function (res: { body: string | any[]; }) { + if (res.body.length < 10) { + throw new Error("No CSV output recieved"); + } + }, + + tile: function (res: any) { + if (res.headers["content-type"] != "image/png") { + throw new Error("Wrong content-type header on tile"); + } + if (res.headers["content-length"] < 200) { + throw new Error("Empty tile returned"); + } + /*var dims = sizeOf(res.body); + if (dims.width != 512 || dims.height != 512) { + throw new Error("Tile has the wrong dimensions"); + }*/ + }, + + atLeastOneResult: function (res: { body: { success: { data: string | any[]; }; }; }) { + if (res.body.success.data.length < 1) { + throw new Error("Should have returned at least one result"); + } + }, + + correctDataTypes: function (res: any) { + const data = res.body.success.data; + data.forEach((item: { t_age: any; b_age: any; t_prop?: any; t_int_age?: any }) => { + if (typeof item.t_age !== "number") { + throw new Error(`t_age is not a numeric type: ${item.t_age} (type: ${typeof item.t_age})`); + } + if (typeof item.b_age !== "number") { + throw new Error(`b_age is not a numeric type: ${item.b_age} (type: ${typeof item.b_age})`); + } + if (item.t_prop !== undefined && typeof item.t_prop !== "number") { + throw new Error(`t_prop is not a numeric type: ${item.t_prop} (type: ${typeof item.t_prop})`); + } + if (item.t_int_age !== undefined && typeof item.t_int_age !== "number") { + throw new Error(`t_int_age is not a numeric type: ${item.t_int_age} (type: ${typeof item.t_int_age})`); + } + }); + } +};