diff --git a/cabal.project.freeze b/cabal.project.freeze index 290550f4fe4..205c74ede93 100644 --- a/cabal.project.freeze +++ b/cabal.project.freeze @@ -32,8 +32,8 @@ constraints: any.Cabal ==3.2.1.0, any.attoparsec-iso8601 ==1.0.2.1, any.authenticate-oauth ==1.7, any.auto-update ==0.1.6, - any.autodocodec ==0.1.0.0, - any.autodocodec-openapi3 ==0.2.0.0, + any.autodocodec ==0.1.0.1, + any.autodocodec-openapi3 ==0.2.1.0, any.barbies ==2.0.3.1, any.base ==4.14.3.0, any.base-compat ==0.11.2, @@ -352,4 +352,4 @@ constraints: any.Cabal ==3.2.1.0, any.xml-types ==0.3.8, any.yaml ==0.11.7.0, any.zlib ==0.6.2.3, -index-state: hackage.haskell.org 2022-06-13T15:16:34Z \ No newline at end of file +index-state: hackage.haskell.org 2022-06-20T06:51:52Z diff --git a/dc-agents/README.md b/dc-agents/README.md index 368e222d55a..ca77f4d5d19 100644 --- a/dc-agents/README.md +++ b/dc-agents/README.md @@ -210,7 +210,7 @@ Notice that the names of tables and columns are used in the metadata document to #### Type definitions -The `SchemaResponse` TypeScript type from [the reference implementation](./reference/src/types/schema.ts) describes the valid response body for the `GET /schema` endpoint. +The `SchemaResponse` TypeScript type from [the reference implementation](./reference/src/types/index.ts) describes the valid response body for the `GET /schema` endpoint. ### Responding to queries @@ -672,4 +672,4 @@ The key point of interest here is in the `where` field where we are comparing be #### Type Definitions -The `QueryRequest` TypeScript type in the [reference implementation](./reference/src/types/query.ts) describes the valid request body payloads which may be passed to the `POST /query` endpoint. The response body structure is captured by the `QueryResponse` type. +The `QueryRequest` TypeScript type in the [reference implementation](./reference/src/types/index.ts) describes the valid request body payloads which may be passed to the `POST /query` endpoint. The response body structure is captured by the `QueryResponse` type. diff --git a/dc-agents/reference/package-lock.json b/dc-agents/reference/package-lock.json index db165b44d7c..906aab4d700 100644 --- a/dc-agents/reference/package-lock.json +++ b/dc-agents/reference/package-lock.json @@ -11,7 +11,6 @@ "dependencies": { "@fastify/cors": "^7.0.0", "fastify": "^3.29.0", - "openapi3-ts": "^2.0.2", "pino-pretty": "^8.0.0", "xml2js": "^0.4.23" }, @@ -19,15 +18,27 @@ "@tsconfig/node16": "^1.0.2", "@types/node": "^16.11.38", "@types/xml2js": "^0.4.11", + "openapi-typescript-codegen": "^0.23.0", "ts-node": "^10.8.1", "typescript": "^4.7.3" } }, + "node_modules/@apidevtools/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", + "dev": true, + "dependencies": { + "@jsdevtools/ono": "^7.1.3", + "@types/json-schema": "^7.0.6", + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0" + } + }, "node_modules/@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, + "license": "MIT", "dependencies": { "@jridgewell/trace-mapping": "0.3.9" }, @@ -37,8 +48,7 @@ }, "node_modules/@fastify/ajv-compiler": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz", - "integrity": "sha512-gvCOUNpXsWrIQ3A4aXCLIdblL0tDq42BG/2Xw7oxbil9h11uow10ztS2GuFazNBfjbrsZ5nl+nPl5jDSjj5TSg==", + "license": "MIT", "dependencies": { "ajv": "^6.12.6" } @@ -54,83 +64,83 @@ }, "node_modules/@fastify/error": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-2.0.0.tgz", - "integrity": "sha512-wI3fpfDT0t7p8E6dA2eTECzzOd+bZsZCJ2Hcv+Onn2b7ZwK3RwD27uW2QDaMtQhAfWQQP+WNK7nKf0twLsBf9w==" + "license": "MIT" }, "node_modules/@jridgewell/resolve-uri": { "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", - "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", "dev": true, + "license": "MIT", "engines": { "node": ">=6.0.0" } }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.13", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", - "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@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, + "license": "MIT", "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", "@jridgewell/sourcemap-codec": "^1.4.10" } }, + "node_modules/@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "dev": true + }, "node_modules/@tsconfig/node10": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node12": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node14": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@tsconfig/node16": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "node_modules/@types/node": { "version": "16.11.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.39.tgz", - "integrity": "sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw==", - "dev": true + "dev": true, + "license": "MIT" }, "node_modules/@types/xml2js": { "version": "0.4.11", - "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.11.tgz", - "integrity": "sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==", "dev": true, + "license": "MIT", "dependencies": { "@types/node": "*" } }, "node_modules/abstract-logging": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", - "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==" + "license": "MIT" }, "node_modules/acorn": { "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true, + "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -140,17 +150,15 @@ }, "node_modules/acorn-walk": { "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true, + "license": "MIT", "engines": { "node": ">=0.4.0" } }, "node_modules/ajv": { "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -164,8 +172,7 @@ }, "node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -175,19 +182,22 @@ }, "node_modules/archy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" + "license": "MIT" }, "node_modules/arg": { "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "node_modules/args": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz", - "integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==", + "license": "MIT", "dependencies": { "camelcase": "5.0.0", "chalk": "2.4.2", @@ -200,16 +210,14 @@ }, "node_modules/atomic-sleep": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", - "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "license": "MIT", "engines": { "node": ">=8.0.0" } }, "node_modules/avvio": { "version": "7.2.5", - "resolved": "https://registry.npmjs.org/avvio/-/avvio-7.2.5.tgz", - "integrity": "sha512-AOhBxyLVdpOad3TujtC9kL/9r3HnTkxwQ5ggOsYrvvZP1cCFvzHWJd5XxZDFuTn+IN8vkKSG5SEJrd27vCSbeA==", + "license": "MIT", "dependencies": { "archy": "^1.0.0", "debug": "^4.0.0", @@ -219,8 +227,7 @@ }, "node_modules/avvio/node_modules/debug": { "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "license": "MIT", "dependencies": { "ms": "2.1.2" }, @@ -235,21 +242,24 @@ }, "node_modules/avvio/node_modules/ms": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "license": "MIT" + }, + "node_modules/call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", + "dev": true }, "node_modules/camelcase": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -261,65 +271,65 @@ }, "node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, "node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "license": "MIT" }, "node_modules/colorette": { "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==" + "license": "MIT" + }, + "node_modules/commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", + "dev": true, + "engines": { + "node": "^12.20.0 || >=14" + } }, "node_modules/cookie": { "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, "node_modules/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 + "dev": true, + "license": "MIT" }, "node_modules/dateformat": { "version": "4.6.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", - "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "license": "MIT", "engines": { "node": "*" } }, "node_modules/deepmerge": { "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/diff": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, "node_modules/duplexify": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", - "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", + "license": "MIT", "dependencies": { "end-of-stream": "^1.4.1", "inherits": "^2.0.3", @@ -329,44 +339,37 @@ }, "node_modules/end-of-stream": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", "dependencies": { "once": "^1.4.0" } }, "node_modules/escape-string-regexp": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "license": "MIT", "engines": { "node": ">=0.8.0" } }, "node_modules/fast-copy": { "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-2.1.3.tgz", - "integrity": "sha512-LDzYKNTHhD+XOp8wGMuCkY4eTxFZOOycmpwLBiuF3r3OjOmZnURRD8t2dUAbmKuXGbo/MGggwbSjcBdp8QT0+g==" + "license": "MIT" }, "node_modules/fast-decode-uri-component": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", - "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==" + "license": "MIT" }, "node_modules/fast-deep-equal": { "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "license": "MIT" }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "license": "MIT" }, "node_modules/fast-json-stringify": { "version": "2.7.13", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-2.7.13.tgz", - "integrity": "sha512-ar+hQ4+OIurUGjSJD1anvYSDcUflywhKjfxnsW4TBTD7+u0tJufv6DKRWoQk3vI6YBOWMoz0TQtfbe7dxbQmvA==", + "license": "MIT", "dependencies": { "ajv": "^6.11.0", "deepmerge": "^4.2.2", @@ -379,21 +382,18 @@ }, "node_modules/fast-redact": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.1.tgz", - "integrity": "sha512-odVmjC8x8jNeMZ3C+rPMESzXVSEU8tSWSHv9HFxP2mm89G/1WwqhrerJDQm9Zus8X6aoRgQDThKqptdNA6bt+A==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/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==" + "license": "MIT" }, "node_modules/fastify": { "version": "3.29.0", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-3.29.0.tgz", - "integrity": "sha512-zXSiDTdHJCHcmDrSje1f1RfzTmUTjMtHnPhh6cdokgfHhloQ+gy0Du+KlEjwTbcNC3Djj4GAsBzl6KvfI9Ah2g==", + "license": "MIT", "dependencies": { "@fastify/ajv-compiler": "^1.0.0", "@fastify/error": "^2.0.0", @@ -419,16 +419,14 @@ }, "node_modules/fastq": { "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", + "license": "ISC", "dependencies": { "reusify": "^1.0.4" } }, "node_modules/find-my-way": { "version": "4.5.1", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-4.5.1.tgz", - "integrity": "sha512-kE0u7sGoUFbMXcOG/xpkmz4sRLCklERnBcg7Ftuu1iAxsfEt2S46RLJ3Sq7vshsEy2wJT2hZxE58XZK27qa8kg==", + "license": "MIT", "dependencies": { "fast-decode-uri-component": "^1.0.1", "fast-deep-equal": "^3.1.3", @@ -441,63 +439,131 @@ }, "node_modules/flatstr": { "version": "1.0.12", - "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz", - "integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==" + "license": "MIT" }, "node_modules/forwarded": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", "engines": { "node": ">= 0.6" } }, + "node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "node_modules/handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, "node_modules/has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "license": "ISC" }, "node_modules/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==", + "license": "MIT", "engines": { "node": ">= 0.10" } }, "node_modules/joycon": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==", + "dev": true, + "dependencies": { + "@apidevtools/json-schema-ref-parser": "9.0.9" + }, "engines": { "node": ">=10" } }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } }, "node_modules/leven": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/light-my-request": { "version": "4.8.0", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-4.8.0.tgz", - "integrity": "sha512-C2XESrTRsZnI59NSQigOsS6IuTxpj8OhSBvZS9fhgBMsamBsAuWN1s4hj/nCi8EeZcyAA6xbROhsZy7wKdfckg==", + "license": "BSD-3-Clause", "dependencies": { "ajv": "^8.1.0", "cookie": "^0.4.0", @@ -507,8 +573,7 @@ }, "node_modules/light-my-request/node_modules/ajv": { "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", + "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -522,13 +587,11 @@ }, "node_modules/light-my-request/node_modules/json-schema-traverse": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "license": "MIT" }, "node_modules/lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", "dependencies": { "yallist": "^4.0.0" }, @@ -538,43 +601,70 @@ }, "node_modules/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, + "license": "ISC" + }, + "node_modules/minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "node_modules/mri": { "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==", + "license": "MIT", "engines": { "node": ">=4" } }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, "node_modules/on-exit-leak-free": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz", - "integrity": "sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==" + "license": "MIT" }, "node_modules/once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "license": "ISC", "dependencies": { "wrappy": "1" } }, - "node_modules/openapi3-ts": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/openapi3-ts/-/openapi3-ts-2.0.2.tgz", - "integrity": "sha512-TxhYBMoqx9frXyOgnRHufjQfPXomTIHYKhSKJ6jHfj13kS8OEIhvmE8CTuQyKtjjWttAjX5DPxM1vmalEpo8Qw==", + "node_modules/openapi-typescript-codegen": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/openapi-typescript-codegen/-/openapi-typescript-codegen-0.23.0.tgz", + "integrity": "sha512-gOJXy5g3H3HlLpVNN+USrNK2i2KYBmDczk9Xk34u6JorwrGiDJZUj+al4S+i9TXdfUQ/ZaLxE59Xf3wqkxGfqA==", + "dev": true, "dependencies": { - "yaml": "^1.10.2" + "camelcase": "^6.3.0", + "commander": "^9.3.0", + "fs-extra": "^10.1.0", + "handlebars": "^4.7.7", + "json-schema-ref-parser": "^9.0.9" + }, + "bin": { + "openapi": "bin/index.js" + } + }, + "node_modules/openapi-typescript-codegen/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/pino": { "version": "6.14.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-6.14.0.tgz", - "integrity": "sha512-iuhEDel3Z3hF9Jfe44DPXR8l07bhjuFY3GMHIXbjnY9XcafbyDDwl2sN2vw2GjMPf5Nkoe+OFao7ffn9SXaKDg==", + "license": "MIT", "dependencies": { "fast-redact": "^3.0.0", "fast-safe-stringify": "^2.0.8", @@ -590,8 +680,7 @@ }, "node_modules/pino-abstract-transport": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz", - "integrity": "sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==", + "license": "MIT", "dependencies": { "duplexify": "^4.1.2", "split2": "^4.0.0" @@ -599,8 +688,7 @@ }, "node_modules/pino-pretty": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-8.0.0.tgz", - "integrity": "sha512-6Zn+2HBc8ZXEJb1XYZfY0Kh0jVBeKxmu077BzE0wzJZzQwNffmdQbIH7bNe0WPLjLApnVTx8TvvR8UNUcgE4nA==", + "license": "MIT", "dependencies": { "args": "5.0.1", "colorette": "^2.0.7", @@ -622,26 +710,22 @@ }, "node_modules/pino-pretty/node_modules/sonic-boom": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-2.6.0.tgz", - "integrity": "sha512-6xYZFRmDEtxGqfOKcDQ4cPLrNa0SPEDI+wlzDAHowXE6YV42NeXqg9mP2KkiM8JVu3lHfZ2iQKYlGOz+kTpphg==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0" } }, "node_modules/pino-std-serializers": { "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz", - "integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==" + "license": "MIT" }, "node_modules/process-warning": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz", - "integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==" + "license": "MIT" }, "node_modules/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==", + "license": "MIT", "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" @@ -652,8 +736,7 @@ }, "node_modules/pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "license": "MIT", "dependencies": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -661,16 +744,13 @@ }, "node_modules/punycode": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "license": "MIT", "engines": { "node": ">=6" } }, "node_modules/queue-microtask": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", "funding": [ { "type": "github", @@ -684,17 +764,16 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/quick-format-unescaped": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + "license": "MIT" }, "node_modules/readable-stream": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "license": "MIT", "dependencies": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -706,24 +785,21 @@ }, "node_modules/require-from-string": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "license": "MIT", "engines": { "node": ">=0.10.0" } }, "node_modules/ret": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", - "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==", + "license": "MIT", "engines": { "node": ">=4" } }, "node_modules/reusify": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "license": "MIT", "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -731,13 +807,10 @@ }, "node_modules/rfdc": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + "license": "MIT" }, "node_modules/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==", "funding": [ { "type": "github", @@ -751,30 +824,27 @@ "type": "consulting", "url": "https://feross.org/support" } - ] + ], + "license": "MIT" }, "node_modules/safe-regex2": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz", - "integrity": "sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==", + "license": "MIT", "dependencies": { "ret": "~0.2.0" } }, "node_modules/sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "license": "ISC" }, "node_modules/secure-json-parse": { "version": "2.4.0", - "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.4.0.tgz", - "integrity": "sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg==" + "license": "BSD-3-Clause" }, "node_modules/semver": { "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" }, @@ -787,53 +857,54 @@ }, "node_modules/semver-store": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/semver-store/-/semver-store-0.3.0.tgz", - "integrity": "sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg==" + "license": "MIT" }, "node_modules/set-cookie-parser": { "version": "2.4.8", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.4.8.tgz", - "integrity": "sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg==" + "license": "MIT" }, "node_modules/sonic-boom": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-1.4.1.tgz", - "integrity": "sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg==", + "license": "MIT", "dependencies": { "atomic-sleep": "^1.0.0", "flatstr": "^1.0.12" } }, + "node_modules/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, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/split2": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==", + "license": "ISC", "engines": { "node": ">= 10.x" } }, "node_modules/stream-shift": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + "license": "MIT" }, "node_modules/string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", "dependencies": { "safe-buffer": "~5.2.0" } }, "node_modules/string-similarity": { "version": "4.0.4", - "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz", - "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==" + "license": "ISC" }, "node_modules/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==", + "license": "MIT", "engines": { "node": ">=8" }, @@ -843,8 +914,7 @@ }, "node_modules/supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", "dependencies": { "has-flag": "^3.0.0" }, @@ -854,17 +924,15 @@ }, "node_modules/tiny-lru": { "version": "8.0.2", - "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-8.0.2.tgz", - "integrity": "sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==", + "license": "BSD-3-Clause", "engines": { "node": ">=6" } }, "node_modules/ts-node": { "version": "10.8.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", - "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", "dev": true, + "license": "MIT", "dependencies": { "@cspotcode/source-map-support": "^0.8.0", "@tsconfig/node10": "^1.0.7", @@ -905,9 +973,8 @@ }, "node_modules/typescript": { "version": "4.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", - "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", "dev": true, + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -916,24 +983,43 @@ "node": ">=4.2.0" } }, + "node_modules/uglify-js": { + "version": "3.16.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.1.tgz", + "integrity": "sha512-X5BGTIDH8U6IQ1TIRP62YC36k+ULAa1d59BxlWvPUJ1NkW5L3FwcGfEzuVvGmhJFBu0YJ5Ge25tmRISqCmLiRQ==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "dev": true, + "engines": { + "node": ">= 10.0.0" + } + }, "node_modules/uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", "dependencies": { "punycode": "^2.1.0" } }, "node_modules/util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "license": "MIT" }, "node_modules/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 + "dev": true, + "license": "MIT" }, "node_modules/vary": { "version": "1.1.2", @@ -943,15 +1029,19 @@ "node": ">= 0.8" } }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, "node_modules/wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "license": "ISC" }, "node_modules/xml2js": { "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "license": "MIT", "dependencies": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" @@ -962,40 +1052,39 @@ }, "node_modules/xmlbuilder": { "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "license": "MIT", "engines": { "node": ">=4.0" } }, "node_modules/yallist": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", - "engines": { - "node": ">= 6" - } + "license": "ISC" }, "node_modules/yn": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=6" } } }, "dependencies": { + "@apidevtools/json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-GBD2Le9w2+lVFoc4vswGI/TjkNIZSVp7+9xPf+X3uidBfWnAeUWmquteSyt0+VCrhNMWj/FTABISQrD3Z/YA+w==", + "dev": true, + "requires": { + "@jsdevtools/ono": "^7.1.3", + "@types/json-schema": "^7.0.6", + "call-me-maybe": "^1.0.1", + "js-yaml": "^4.1.0" + } + }, "@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" @@ -1003,8 +1092,6 @@ }, "@fastify/ajv-compiler": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-1.1.0.tgz", - "integrity": "sha512-gvCOUNpXsWrIQ3A4aXCLIdblL0tDq42BG/2Xw7oxbil9h11uow10ztS2GuFazNBfjbrsZ5nl+nPl5jDSjj5TSg==", "requires": { "ajv": "^6.12.6" } @@ -1019,92 +1106,76 @@ } }, "@fastify/error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@fastify/error/-/error-2.0.0.tgz", - "integrity": "sha512-wI3fpfDT0t7p8E6dA2eTECzzOd+bZsZCJ2Hcv+Onn2b7ZwK3RwD27uW2QDaMtQhAfWQQP+WNK7nKf0twLsBf9w==" + "version": "2.0.0" }, "@jridgewell/resolve-uri": { "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", - "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", "dev": true }, "@jridgewell/sourcemap-codec": { "version": "1.4.13", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", - "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", "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" } }, + "@jsdevtools/ono": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz", + "integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==", + "dev": true + }, "@tsconfig/node10": { "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", "dev": true }, "@tsconfig/node12": { "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", "dev": true }, "@tsconfig/node14": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", "dev": true }, "@tsconfig/node16": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", + "dev": true + }, + "@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", "dev": true }, "@types/node": { "version": "16.11.39", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.39.tgz", - "integrity": "sha512-K0MsdV42vPwm9L6UwhIxMAOmcvH/1OoVkZyCgEtVu4Wx7sElGloy/W7kMBNe/oJ7V/jW9BVt1F6RahH6e7tPXw==", "dev": true }, "@types/xml2js": { "version": "0.4.11", - "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.11.tgz", - "integrity": "sha512-JdigeAKmCyoJUiQljjr7tQG3if9NkqGUgwEUqBvV0N7LM4HyQk7UXCnusRa1lnvXAEYJ8mw8GtZWioagNztOwA==", "dev": true, "requires": { "@types/node": "*" } }, "abstract-logging": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", - "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==" + "version": "2.0.1" }, "acorn": { "version": "8.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.1.tgz", - "integrity": "sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A==", "dev": true }, "acorn-walk": { "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", "dev": true }, "ajv": { "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "requires": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1114,27 +1185,25 @@ }, "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "^1.9.0" } }, "archy": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" + "version": "1.0.0" }, "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==", "dev": true }, "args": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/args/-/args-5.0.1.tgz", - "integrity": "sha512-1kqmFCFsPffavQFGt8OxJdIcETti99kySRUPMpOhaGjL6mRJn8HFU1OxKY5bMqfZKUwTQc1mZkAjmGYaVOHFtQ==", "requires": { "camelcase": "5.0.0", "chalk": "2.4.2", @@ -1143,14 +1212,10 @@ } }, "atomic-sleep": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", - "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==" + "version": "1.0.0" }, "avvio": { "version": "7.2.5", - "resolved": "https://registry.npmjs.org/avvio/-/avvio-7.2.5.tgz", - "integrity": "sha512-AOhBxyLVdpOad3TujtC9kL/9r3HnTkxwQ5ggOsYrvvZP1cCFvzHWJd5XxZDFuTn+IN8vkKSG5SEJrd27vCSbeA==", "requires": { "archy": "^1.0.0", "debug": "^4.0.0", @@ -1160,28 +1225,26 @@ "dependencies": { "debug": { "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "requires": { "ms": "2.1.2" } }, "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "version": "2.1.2" } } }, + "call-me-maybe": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "integrity": "sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw==", + "dev": true + }, "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + "version": "5.0.0" }, "chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "requires": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -1190,53 +1253,41 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "requires": { "color-name": "1.1.3" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "version": "1.1.3" }, "colorette": { - "version": "2.0.16", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", - "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==" + "version": "2.0.16" + }, + "commander": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-9.3.0.tgz", + "integrity": "sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw==", + "dev": true }, "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" + "version": "0.4.2" }, "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 }, "dateformat": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", - "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==" + "version": "4.6.3" }, "deepmerge": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + "version": "4.2.2" }, "diff": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true }, "duplexify": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.2.tgz", - "integrity": "sha512-fz3OjcNCHmRP12MJoZMPglx8m4rrFP8rovnk4vT8Fs+aonZoCwGg10dSsQsfP/E62eZcPTMSMP6686fu9Qlqtw==", "requires": { "end-of-stream": "^1.4.1", "inherits": "^2.0.3", @@ -1246,41 +1297,27 @@ }, "end-of-stream": { "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "requires": { "once": "^1.4.0" } }, "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + "version": "1.0.5" }, "fast-copy": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/fast-copy/-/fast-copy-2.1.3.tgz", - "integrity": "sha512-LDzYKNTHhD+XOp8wGMuCkY4eTxFZOOycmpwLBiuF3r3OjOmZnURRD8t2dUAbmKuXGbo/MGggwbSjcBdp8QT0+g==" + "version": "2.1.3" }, "fast-decode-uri-component": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", - "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==" + "version": "1.0.1" }, "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + "version": "3.1.3" }, "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==" + "version": "2.1.0" }, "fast-json-stringify": { "version": "2.7.13", - "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-2.7.13.tgz", - "integrity": "sha512-ar+hQ4+OIurUGjSJD1anvYSDcUflywhKjfxnsW4TBTD7+u0tJufv6DKRWoQk3vI6YBOWMoz0TQtfbe7dxbQmvA==", "requires": { "ajv": "^6.11.0", "deepmerge": "^4.2.2", @@ -1289,19 +1326,13 @@ } }, "fast-redact": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-redact/-/fast-redact-3.1.1.tgz", - "integrity": "sha512-odVmjC8x8jNeMZ3C+rPMESzXVSEU8tSWSHv9HFxP2mm89G/1WwqhrerJDQm9Zus8X6aoRgQDThKqptdNA6bt+A==" + "version": "3.1.1" }, "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==" + "version": "2.1.1" }, "fastify": { "version": "3.29.0", - "resolved": "https://registry.npmjs.org/fastify/-/fastify-3.29.0.tgz", - "integrity": "sha512-zXSiDTdHJCHcmDrSje1f1RfzTmUTjMtHnPhh6cdokgfHhloQ+gy0Du+KlEjwTbcNC3Djj4GAsBzl6KvfI9Ah2g==", "requires": { "@fastify/ajv-compiler": "^1.0.0", "@fastify/error": "^2.0.0", @@ -1327,16 +1358,12 @@ }, "fastq": { "version": "1.13.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", - "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "requires": { "reusify": "^1.0.4" } }, "find-my-way": { "version": "4.5.1", - "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-4.5.1.tgz", - "integrity": "sha512-kE0u7sGoUFbMXcOG/xpkmz4sRLCklERnBcg7Ftuu1iAxsfEt2S46RLJ3Sq7vshsEy2wJT2hZxE58XZK27qa8kg==", "requires": { "fast-decode-uri-component": "^1.0.1", "fast-deep-equal": "^3.1.3", @@ -1345,49 +1372,89 @@ } }, "flatstr": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/flatstr/-/flatstr-1.0.12.tgz", - "integrity": "sha512-4zPxDyhCyiN2wIAtSLI6gc82/EjqZc1onI4Mz/l0pWrAlsSfYH/2ZIcU+e3oA2wDwbzIWNKwa23F8rh6+DRWkw==" + "version": "1.0.12" }, "forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + "version": "0.2.0" + }, + "fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "handlebars": { + "version": "4.7.7", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", + "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", + "dev": true, + "requires": { + "minimist": "^1.2.5", + "neo-async": "^2.6.0", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4", + "wordwrap": "^1.0.0" + } }, "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "version": "3.0.0" }, "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "version": "2.0.4" }, "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==" + "version": "1.9.1" }, "joycon": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", - "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==" + "version": "3.1.1" + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-ref-parser": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz", + "integrity": "sha512-qcP2lmGy+JUoQJ4DOQeLaZDqH9qSkeGCK3suKWxJXS82dg728Mn3j97azDMaOUmJAN4uCq91LdPx4K7E8F1a7Q==", + "dev": true, + "requires": { + "@apidevtools/json-schema-ref-parser": "9.0.9" + } }, "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + "version": "0.4.1" + }, + "jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6", + "universalify": "^2.0.0" + } }, "leven": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", - "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=" + "version": "2.1.0" }, "light-my-request": { "version": "4.8.0", - "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-4.8.0.tgz", - "integrity": "sha512-C2XESrTRsZnI59NSQigOsS6IuTxpj8OhSBvZS9fhgBMsamBsAuWN1s4hj/nCi8EeZcyAA6xbROhsZy7wKdfckg==", "requires": { "ajv": "^8.1.0", "cookie": "^0.4.0", @@ -1397,8 +1464,6 @@ "dependencies": { "ajv": { "version": "8.10.0", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.10.0.tgz", - "integrity": "sha512-bzqAEZOjkrUMl2afH8dknrq5KEk2SrwdBROR+vH1EKVQTqaUbJVPdc/gEdggTMM0Se+s+Ja4ju4TlNcStKl2Hw==", "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -1407,56 +1472,67 @@ } }, "json-schema-traverse": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", - "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + "version": "1.0.0" } } }, "lru-cache": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", - "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", "requires": { "yallist": "^4.0.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 + }, + "minimist": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", + "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==", "dev": true }, "mri": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/mri/-/mri-1.1.4.tgz", - "integrity": "sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w==" + "version": "1.1.4" + }, + "neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true }, "on-exit-leak-free": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz", - "integrity": "sha512-dqaz3u44QbRXQooZLTUKU41ZrzYrcvLISVgbrzbyCMxpmSLJvZ3ZamIJIZ29P6OhZIkNIQKosdeM6t1LYbA9hg==" + "version": "0.2.0" }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" } }, - "openapi3-ts": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/openapi3-ts/-/openapi3-ts-2.0.2.tgz", - "integrity": "sha512-TxhYBMoqx9frXyOgnRHufjQfPXomTIHYKhSKJ6jHfj13kS8OEIhvmE8CTuQyKtjjWttAjX5DPxM1vmalEpo8Qw==", + "openapi-typescript-codegen": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/openapi-typescript-codegen/-/openapi-typescript-codegen-0.23.0.tgz", + "integrity": "sha512-gOJXy5g3H3HlLpVNN+USrNK2i2KYBmDczk9Xk34u6JorwrGiDJZUj+al4S+i9TXdfUQ/ZaLxE59Xf3wqkxGfqA==", + "dev": true, "requires": { - "yaml": "^1.10.2" + "camelcase": "^6.3.0", + "commander": "^9.3.0", + "fs-extra": "^10.1.0", + "handlebars": "^4.7.7", + "json-schema-ref-parser": "^9.0.9" + }, + "dependencies": { + "camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true + } } }, "pino": { "version": "6.14.0", - "resolved": "https://registry.npmjs.org/pino/-/pino-6.14.0.tgz", - "integrity": "sha512-iuhEDel3Z3hF9Jfe44DPXR8l07bhjuFY3GMHIXbjnY9XcafbyDDwl2sN2vw2GjMPf5Nkoe+OFao7ffn9SXaKDg==", "requires": { "fast-redact": "^3.0.0", "fast-safe-stringify": "^2.0.8", @@ -1469,8 +1545,6 @@ }, "pino-abstract-transport": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-0.5.0.tgz", - "integrity": "sha512-+KAgmVeqXYbTtU2FScx1XS3kNyfZ5TrXY07V96QnUSFqo2gAqlvmaxH67Lj7SWazqsMabf+58ctdTcBgnOLUOQ==", "requires": { "duplexify": "^4.1.2", "split2": "^4.0.0" @@ -1478,8 +1552,6 @@ }, "pino-pretty": { "version": "8.0.0", - "resolved": "https://registry.npmjs.org/pino-pretty/-/pino-pretty-8.0.0.tgz", - "integrity": "sha512-6Zn+2HBc8ZXEJb1XYZfY0Kh0jVBeKxmu077BzE0wzJZzQwNffmdQbIH7bNe0WPLjLApnVTx8TvvR8UNUcgE4nA==", "requires": { "args": "5.0.1", "colorette": "^2.0.7", @@ -1498,8 +1570,6 @@ "dependencies": { "sonic-boom": { "version": "2.6.0", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-2.6.0.tgz", - "integrity": "sha512-6xYZFRmDEtxGqfOKcDQ4cPLrNa0SPEDI+wlzDAHowXE6YV42NeXqg9mP2KkiM8JVu3lHfZ2iQKYlGOz+kTpphg==", "requires": { "atomic-sleep": "^1.0.0" } @@ -1507,19 +1577,13 @@ } }, "pino-std-serializers": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-3.2.0.tgz", - "integrity": "sha512-EqX4pwDPrt3MuOAAUBMU0Tk5kR/YcCM5fNPEzgCO2zJ5HfX0vbiH9HbJglnyeQsN96Kznae6MWD47pZB5avTrg==" + "version": "3.2.0" }, "process-warning": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-1.0.0.tgz", - "integrity": "sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==" + "version": "1.0.0" }, "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" @@ -1527,32 +1591,22 @@ }, "pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" } }, "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "version": "2.1.1" }, "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==" + "version": "1.2.3" }, "quick-format-unescaped": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", - "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + "version": "4.0.4" }, "readable-stream": { "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -1560,120 +1614,86 @@ } }, "require-from-string": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", - "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" + "version": "2.0.2" }, "ret": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz", - "integrity": "sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ==" + "version": "0.2.2" }, "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==" + "version": "1.0.4" }, "rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==" + "version": "1.3.0" }, "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==" + "version": "5.2.1" }, "safe-regex2": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz", - "integrity": "sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ==", "requires": { "ret": "~0.2.0" } }, "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "version": "1.2.4" }, "secure-json-parse": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.4.0.tgz", - "integrity": "sha512-Q5Z/97nbON5t/L/sH6mY2EacfjVGwrCcSi5D3btRO2GZ8pf1K1UN7Z9H5J57hjVU2Qzxr1xO+FmBhOvEkzCMmg==" + "version": "2.4.0" }, "semver": { "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", "requires": { "lru-cache": "^6.0.0" } }, "semver-store": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/semver-store/-/semver-store-0.3.0.tgz", - "integrity": "sha512-TcZvGMMy9vodEFSse30lWinkj+JgOBvPn8wRItpQRSayhc+4ssDs335uklkfvQQJgL/WvmHLVj4Ycv2s7QCQMg==" + "version": "0.3.0" }, "set-cookie-parser": { - "version": "2.4.8", - "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-2.4.8.tgz", - "integrity": "sha512-edRH8mBKEWNVIVMKejNnuJxleqYE/ZSdcT8/Nem9/mmosx12pctd80s2Oy00KNZzrogMZS5mauK2/ymL1bvlvg==" + "version": "2.4.8" }, "sonic-boom": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-1.4.1.tgz", - "integrity": "sha512-LRHh/A8tpW7ru89lrlkU4AszXt1dbwSjVWguGrmlxE7tawVmDBlI1PILMkXAxJTwqhgsEeTHzj36D5CmHgQmNg==", "requires": { "atomic-sleep": "^1.0.0", "flatstr": "^1.0.12" } }, + "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 + }, "split2": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.1.0.tgz", - "integrity": "sha512-VBiJxFkxiXRlUIeyMQi8s4hgvKCSjtknJv/LVYbrgALPwf5zSKmEwV9Lst25AkvMDnvxODugjdl6KZgwKM1WYQ==" + "version": "4.1.0" }, "stream-shift": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", - "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==" + "version": "1.0.1" }, "string_decoder": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "requires": { "safe-buffer": "~5.2.0" } }, "string-similarity": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/string-similarity/-/string-similarity-4.0.4.tgz", - "integrity": "sha512-/q/8Q4Bl4ZKAPjj8WerIBJWALKkaPRfrvhfF8k/B23i4nzrlRj2/go1m90In7nG/3XDSbOo0+pu6RvCTM9RGMQ==" + "version": "4.0.4" }, "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==" + "version": "3.1.1" }, "supports-color": { "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "requires": { "has-flag": "^3.0.0" } }, "tiny-lru": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/tiny-lru/-/tiny-lru-8.0.2.tgz", - "integrity": "sha512-ApGvZ6vVvTNdsmt676grvCkUCGwzG9IqXma5Z07xJgiC5L7akUMof5U8G2JTI9Rz/ovtVhJBlY6mNhEvtjzOIg==" + "version": "8.0.2" }, "ts-node": { "version": "10.8.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", - "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", "dev": true, "requires": { "@cspotcode/source-map-support": "^0.8.0", @@ -1693,27 +1713,32 @@ }, "typescript": { "version": "4.7.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", - "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", + "dev": true + }, + "uglify-js": { + "version": "3.16.1", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.16.1.tgz", + "integrity": "sha512-X5BGTIDH8U6IQ1TIRP62YC36k+ULAa1d59BxlWvPUJ1NkW5L3FwcGfEzuVvGmhJFBu0YJ5Ge25tmRISqCmLiRQ==", + "dev": true, + "optional": true + }, + "universalify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", + "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", "dev": true }, "uri-js": { "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", "requires": { "punycode": "^2.1.0" } }, "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "version": "1.0.2" }, "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": { @@ -1721,39 +1746,30 @@ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==" }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "version": "1.0.2" }, "xml2js": { "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", "requires": { "sax": ">=0.6.0", "xmlbuilder": "~11.0.0" } }, "xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" + "version": "11.0.1" }, "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" - }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" + "version": "4.0.0" }, "yn": { "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true } } diff --git a/dc-agents/reference/package.json b/dc-agents/reference/package.json index 85735fe6ef2..f6e21245f47 100644 --- a/dc-agents/reference/package.json +++ b/dc-agents/reference/package.json @@ -18,12 +18,12 @@ "typecheck": "tsc --noEmit", "start": "ts-node ./src/index.ts", "start-no-typecheck": "ts-node --transpileOnly ./src/index.ts", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "generate-types": "./scripts/generate-types.sh" }, "dependencies": { "@fastify/cors": "^7.0.0", "fastify": "^3.29.0", - "openapi3-ts": "^2.0.2", "pino-pretty": "^8.0.0", "xml2js": "^0.4.23" }, @@ -31,6 +31,7 @@ "@tsconfig/node16": "^1.0.2", "@types/node": "^16.11.38", "@types/xml2js": "^0.4.11", + "openapi-typescript-codegen": "^0.23.0", "ts-node": "^10.8.1", "typescript": "^4.7.3" } diff --git a/dc-agents/reference/scripts/generate-types.sh b/dc-agents/reference/scripts/generate-types.sh new file mode 100755 index 00000000000..9d0e1cd8101 --- /dev/null +++ b/dc-agents/reference/scripts/generate-types.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +PROJECT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." >/dev/null 2>&1 && pwd )" # ... https://stackoverflow.com/a/246128/176841 +cd "$PROJECT_ROOT" + +TYPES_DIR="./src/types" +SCHEMA_FILE="$TYPES_DIR/agent.openapi.json" + +mkdir -p $TYPES_DIR + +if [ ! -f $SCHEMA_FILE ] ; then + echo "$SCHEMA_FILE does not exist, re-generating it using the agent test suite" + cabal run test:tests-dc-api -- export-openapi-spec | tail -n 1 | jq > $SCHEMA_FILE +fi + +echo "Deleting existing generated model..." +rm -rf "$TYPES_DIR/models" +rm -f "$TYPES_DIR/index.ts" +echo "Generating model from $SCHEMA_FILE..." +openapi --useUnionTypes --input $SCHEMA_FILE --output $TYPES_DIR --exportServices false --exportCore false --indent 2 diff --git a/dc-agents/reference/src/capabilities.ts b/dc-agents/reference/src/capabilities.ts index ff9e01a2a4b..2086d242c88 100644 --- a/dc-agents/reference/src/capabilities.ts +++ b/dc-agents/reference/src/capabilities.ts @@ -1,17 +1,7 @@ -import { ConfigSchemaResponse, configSchema } from "./config" - -export type Relationships = {} - -export type Capabilities = { - relationships: Relationships -} - -export type CapabilitiesResponse = { - capabilities: Capabilities, - configSchemas: ConfigSchemaResponse, -} +import { configSchema } from "./config" +import { CapabilitiesResponse } from "./types" export const capabilitiesResponse: CapabilitiesResponse = { - capabilities: { relationships: {}}, + capabilities: { relationships: {} }, configSchemas: configSchema } diff --git a/dc-agents/reference/src/config.ts b/dc-agents/reference/src/config.ts index 94b438ec490..924c0256952 100644 --- a/dc-agents/reference/src/config.ts +++ b/dc-agents/reference/src/config.ts @@ -1,15 +1,10 @@ import { FastifyRequest } from "fastify" -import { SchemaObject } from "openapi3-ts" +import { ConfigSchemaResponse } from "./types" export type Config = { tables: String[] | null } -export type ConfigSchemaResponse = { - configSchema: SchemaObject, - otherSchemas: { [schemaName: string]: SchemaObject }, -} - export const getConfig = (request: FastifyRequest): Config => { const configHeader = request.headers["x-hasura-dataconnector-config"]; const rawConfigJson = Array.isArray(configHeader) ? configHeader[0] : configHeader ?? "{}"; diff --git a/dc-agents/reference/src/data/index.ts b/dc-agents/reference/src/data/index.ts index 5192095318a..d8471fb1e58 100644 --- a/dc-agents/reference/src/data/index.ts +++ b/dc-agents/reference/src/data/index.ts @@ -1,4 +1,4 @@ -import { SchemaResponse, ScalarType } from "../types/schema" +import { SchemaResponse } from "../types" import { Config } from "../config"; import xml2js from "xml2js" import fs from "fs" @@ -43,13 +43,13 @@ const schema: SchemaResponse = { columns: [ { name: "ArtistId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Artist primary key identifier" }, { name: "Name", - type: ScalarType.String, + type: "string", nullable: true, description: "The name of the artist" } @@ -62,19 +62,19 @@ const schema: SchemaResponse = { columns: [ { name: "AlbumId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Album primary key identifier" }, { name: "Title", - type: ScalarType.String, + type: "string", nullable: false, description: "The title of the album" }, { name: "ArtistId", - type: ScalarType.Number, + type: "number", nullable: false, description: "The ID of the artist that created this album" } @@ -87,79 +87,79 @@ const schema: SchemaResponse = { columns: [ { name: "CustomerId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Customer primary key identifier" }, { name: "FirstName", - type: ScalarType.String, + type: "string", nullable: false, description: "The customer's first name" }, { name: "LastName", - type: ScalarType.String, + type: "string", nullable: false, description: "The customer's last name" }, { name: "Company", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's company name" }, { name: "Address", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's address line (street number, street)" }, { name: "City", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's address city" }, { name: "State", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's address state" }, { name: "Country", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's address country" }, { name: "PostalCode", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's address postal code" }, { name: "Phone", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's phone number" }, { name: "Fax", - type: ScalarType.String, + type: "string", nullable: true, description: "The customer's fax number" }, { name: "Email", - type: ScalarType.String, + type: "string", nullable: false, description: "The customer's email address" }, { name: "SupportRepId", - type: ScalarType.Number, + type: "number", nullable: true, description: "The ID of the Employee who is this customer's support representative" } @@ -172,85 +172,85 @@ const schema: SchemaResponse = { columns: [ { name: "EmployeeId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Employee primary key identifier" }, { name: "FirstName", - type: ScalarType.String, + type: "string", nullable: false, description: "The employee's first name" }, { name: "LastName", - type: ScalarType.String, + type: "string", nullable: false, description: "The employee's last name" }, { name: "Title", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's job title" }, { name: "BirthDate", - type: ScalarType.String, // Ought to be DateTime but we don't have a type for this yet + type: "string", // Ought to be DateTime but we don't have a type for this yet nullable: true, description: "The employee's birth date" }, { name: "HireDate", - type: ScalarType.String, // Ought to be DateTime but we don't have a type for this yet + type: "string", // Ought to be DateTime but we don't have a type for this yet nullable: true, description: "The employee's birth date" }, { name: "Address", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's address line (street number, street)" }, { name: "City", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's address city" }, { name: "State", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's address state" }, { name: "Country", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's address country" }, { name: "PostalCode", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's address postal code" }, { name: "Phone", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's phone number" }, { name: "Fax", - type: ScalarType.String, + type: "string", nullable: true, description: "The employee's fax number" }, { name: "Email", - type: ScalarType.String, + type: "string", nullable: false, description: "The employee's email address" }, @@ -263,13 +263,13 @@ const schema: SchemaResponse = { columns: [ { name: "GenreId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Genre primary key identifier" }, { name: "Name", - type: ScalarType.String, + type: "string", nullable: true, description: "The name of the genre" } @@ -282,55 +282,55 @@ const schema: SchemaResponse = { columns: [ { name: "InvoiceId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Invoice primary key identifier" }, { name: "CustomerId", - type: ScalarType.Number, + type: "number", nullable: false, description: "ID of the customer who bought the music" }, { name: "InvoiceDate", - type: ScalarType.String, // Ought to be DateTime but we don't have a type for this yet + type: "string", // Ought to be DateTime but we don't have a type for this yet nullable: false, description: "Date of the invoice" }, { name: "BillingAddress", - type: ScalarType.String, + type: "string", nullable: true, description: "The invoice's billing address line (street number, street)" }, { name: "BillingCity", - type: ScalarType.String, + type: "string", nullable: true, description: "The invoice's billing address city" }, { name: "BillingState", - type: ScalarType.String, + type: "string", nullable: true, description: "The invoice's billing address state" }, { name: "BillingCountry", - type: ScalarType.String, + type: "string", nullable: true, description: "The invoice's billing address country" }, { name: "BillingPostalCode", - type: ScalarType.String, + type: "string", nullable: true, description: "The invoice's billing address postal code" }, { name: "Total", - type: ScalarType.Number, + type: "number", nullable: false, description: "The total amount due on the invoice" }, @@ -343,31 +343,31 @@ const schema: SchemaResponse = { columns: [ { name: "InvoiceLineId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Invoice Line primary key identifier" }, { name: "InvoiceId", - type: ScalarType.Number, + type: "number", nullable: false, description: "ID of the invoice the line belongs to" }, { name: "TrackId", - type: ScalarType.Number, + type: "number", nullable: false, description: "ID of the music track being purchased" }, { name: "UnitPrice", - type: ScalarType.Number, + type: "number", nullable: false, description: "Price of each individual track unit" }, { name: "Quantity", - type: ScalarType.Number, + type: "number", nullable: false, description: "Quantity of the track purchased" }, @@ -380,13 +380,13 @@ const schema: SchemaResponse = { columns: [ { name: "MediaTypeId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Media Type primary key identifier" }, { name: "Name", - type: ScalarType.Number, + type: "number", nullable: true, description: "The name of the media type format" }, @@ -399,13 +399,13 @@ const schema: SchemaResponse = { columns: [ { name: "PlaylistId", - type: ScalarType.Number, + type: "number", nullable: false, description: "Playlist primary key identifier" }, { name: "Name", - type: ScalarType.Number, + type: "number", nullable: true, description: "The name of the playlist" }, @@ -419,13 +419,13 @@ const schema: SchemaResponse = { // columns: [ // { // name: "PlaylistId", - // type: ScalarType.Number, + // type: "number", // nullable: false, // description: "The ID of the playlist" // }, // { // name: "TrackId", - // type: ScalarType.Number, + // type: "number", // nullable: true, // description: "The ID of the track" // }, @@ -438,55 +438,55 @@ const schema: SchemaResponse = { columns: [ { name: "TrackId", - type: ScalarType.Number, + type: "number", nullable: false, description: "The ID of the track" }, { name: "Name", - type: ScalarType.String, + type: "string", nullable: false, description: "The name of the track" }, { name: "AlbumId", - type: ScalarType.Number, + type: "number", nullable: true, description: "The ID of the album the track belongs to" }, { name: "MediaTypeId", - type: ScalarType.Number, + type: "number", nullable: true, description: "The ID of the media type the track is encoded with" }, { name: "GenreId", - type: ScalarType.Number, + type: "number", nullable: true, description: "The ID of the genre of the track" }, { name: "Composer", - type: ScalarType.String, + type: "string", nullable: true, description: "The name of the composer of the track" }, { name: "Milliseconds", - type: ScalarType.Number, + type: "number", nullable: false, description: "The length of the track in milliseconds" }, { name: "Bytes", - type: ScalarType.Number, + type: "number", nullable: true, description: "The size of the track in bytes" }, { name: "UnitPrice", - type: ScalarType.Number, + type: "number", nullable: false, description: "The price of the track" }, diff --git a/dc-agents/reference/src/index.ts b/dc-agents/reference/src/index.ts index 210f3561082..acf3509a519 100644 --- a/dc-agents/reference/src/index.ts +++ b/dc-agents/reference/src/index.ts @@ -1,11 +1,10 @@ -import Fastify from 'fastify'; +import Fastify from 'fastify'; import FastifyCors from '@fastify/cors'; -import { SchemaResponse } from './types/schema'; -import { ProjectedRow, QueryRequest } from './types/query'; import { filterAvailableTables, getSchema, loadStaticData } from './data'; import { queryData } from './query'; import { getConfig } from './config'; -import { CapabilitiesResponse, capabilitiesResponse} from './capabilities'; +import { capabilitiesResponse } from './capabilities'; +import { CapabilitiesResponse, SchemaResponse, QueryRequest, QueryResponse } from './types'; const port = Number(process.env.PORT) || 8100; const server = Fastify({ logger: { prettyPrint: true } }); @@ -31,7 +30,7 @@ server.get<{ Reply: SchemaResponse }>("/schema", async (request, _response) => { return getSchema(config); }); -server.post<{ Body: QueryRequest, Reply: ProjectedRow[] }>("/query", async (request, _response) => { +server.post<{ Body: QueryRequest, Reply: QueryResponse }>("/query", async (request, _response) => { server.log.info({ headers: request.headers, query: request.body, }, "query.request"); const config = getConfig(request); const data = filterAvailableTables(staticData, config); diff --git a/dc-agents/reference/src/query.ts b/dc-agents/reference/src/query.ts index e48d1c151d1..67edb3bcdb7 100644 --- a/dc-agents/reference/src/query.ts +++ b/dc-agents/reference/src/query.ts @@ -1,49 +1,56 @@ -import { Expression, Fields, BinaryComparisonOperator, OrderBy, OrderType, ProjectedRow, Query, QueryResponse, RelationshipType, ScalarValue, UnaryComparisonOperator, ComparisonValue, BinaryArrayComparisonOperator, QueryRequest, TableName, ComparisonColumn, TableRelationships, Relationship, RelationshipName } from "./types/query"; +import { QueryRequest, TableRelationships, Relationship, Query, Field, OrderBy, Expression, BinaryComparisonOperator, UnaryComparisonOperator, BinaryArrayComparisonOperator, ComparisonColumn, ComparisonValue, ScalarValue, QueryResponse } from "./types"; import { coerceUndefinedToNull, crossProduct, unreachable, zip } from "./util"; type StaticData = { [tableName: string]: Record[] } +type TableName = string +type RelationshipName = string + +type ProjectedRow = { + [fieldName: string]: ScalarValue | ProjectedRow[] | ProjectedRow +} + const prettyPrintBinaryComparisonOperator = (operator: BinaryComparisonOperator): string => { switch (operator) { - case BinaryComparisonOperator.GreaterThan: return ">"; - case BinaryComparisonOperator.GreaterThanOrEqual: return ">="; - case BinaryComparisonOperator.LessThan: return "<"; - case BinaryComparisonOperator.LessThanOrEqual: return "<="; - case BinaryComparisonOperator.Equal: return "=="; + case "greater_than": return ">"; + case "greater_than_or_equal": return ">="; + case "less_than": return "<"; + case "less_than_or_equal": return "<="; + case "equal": return "=="; default: return unreachable(operator); }; }; const prettyPrintBinaryArrayComparisonOperator = (operator: BinaryArrayComparisonOperator): string => { switch (operator) { - case BinaryArrayComparisonOperator.In: return "IN"; + case "in": return "IN"; default: return unreachable(operator); }; }; const prettyPrintUnaryComparisonOperator = (operator: UnaryComparisonOperator): string => { switch (operator) { - case UnaryComparisonOperator.IsNull: return "IS NULL"; + case "is_null": return "IS NULL"; default: return unreachable(operator); }; }; const getBinaryComparisonOperatorEvaluator = (operator: BinaryComparisonOperator): ((left: ScalarValue, right: ScalarValue) => boolean) => { switch (operator) { - case BinaryComparisonOperator.GreaterThan: return (a, b) => a !== null && b !== null && a > b; - case BinaryComparisonOperator.GreaterThanOrEqual: return (a, b) => a !== null && b !== null && a >= b; - case BinaryComparisonOperator.LessThan: return (a, b) => a !== null && b !== null && a < b; - case BinaryComparisonOperator.LessThanOrEqual: return (a, b) => a !== null && b !== null && a <= b; - case BinaryComparisonOperator.Equal: return (a, b) => a !== null && b !== null && a === b; + case "greater_than": return (a, b) => a !== null && b !== null && a > b; + case "greater_than_or_equal": return (a, b) => a !== null && b !== null && a >= b; + case "less_than": return (a, b) => a !== null && b !== null && a < b; + case "less_than_or_equal": return (a, b) => a !== null && b !== null && a <= b; + case "equal": return (a, b) => a !== null && b !== null && a === b; default: return unreachable(operator); }; }; const getBinaryArrayComparisonOperatorEvaluator = (operator: BinaryArrayComparisonOperator): ((left: ScalarValue, right: ScalarValue[]) => boolean) => { switch (operator) { - case BinaryArrayComparisonOperator.In: return (a, bs) => a !== null && bs.includes(a); + case "in": return (a, bs) => a !== null && bs.includes(a); default: return unreachable(operator); }; }; @@ -51,7 +58,7 @@ const getBinaryArrayComparisonOperatorEvaluator = (operator: BinaryArrayComparis const getUnaryComparisonOperatorEvaluator = (operator: UnaryComparisonOperator): ((value: ScalarValue) => boolean) => { switch (operator) { - case UnaryComparisonOperator.IsNull: return (v) => v === null; + case "is_null": return (v) => v === null; default: return unreachable(operator); }; }; @@ -162,7 +169,7 @@ const sortRows = (rows: Record[], orderBy: OrderBy[]): Reco ? -1 : 1; - return ordering === OrderType.Descending ? -compared : compared; + return ordering === "desc" ? -compared : compared; }, 0) ); @@ -191,7 +198,7 @@ const createFilterExpressionForRelationshipJoin = (row: Record { return { type: "binary_op", - operator: BinaryComparisonOperator.Equal, + operator: "equal", column: { path: [], name: innerColumnName, @@ -222,7 +229,7 @@ const addRelationshipFilterToQuery = (row: Record, relation } }; -const buildFieldsForPathedComparisonColumn = (comparisonColumn: ComparisonColumn): Fields => { +const buildFieldsForPathedComparisonColumn = (comparisonColumn: ComparisonColumn): Record => { const [relationshipName, ...remainingPath] = comparisonColumn.path; if (relationshipName === undefined) { return { @@ -276,7 +283,7 @@ const makeGetComparisonColumnValues = (findRelationship: (relationshipName: Rela } }; -const projectRow = (fields: Fields, findRelationship: (relationshipName: RelationshipName) => Relationship, performQuery: (tableName: TableName, query: Query) => ProjectedRow[]) => (row: Record): ProjectedRow => { +const projectRow = (fields: Record, findRelationship: (relationshipName: RelationshipName) => Relationship, performQuery: (tableName: TableName, query: Query) => ProjectedRow[]) => (row: Record): ProjectedRow => { const projectedRow: ProjectedRow = {}; for (const [fieldName, field] of Object.entries(fields)) { @@ -289,11 +296,11 @@ const projectRow = (fields: Fields, findRelationship: (relationshipName: Relatio const relationship = findRelationship(field.relationship); const subquery = addRelationshipFilterToQuery(row, relationship, field.query); switch (relationship.relationship_type) { - case RelationshipType.Object: + case "object": projectedRow[fieldName] = subquery ? coerceUndefinedToNull(performQuery(relationship.target_table, subquery)[0]) : null; break; - case RelationshipType.Array: + case "array": projectedRow[fieldName] = subquery ? performQuery(relationship.target_table, subquery) : []; break; diff --git a/dc-agents/reference/src/types/agent.openapi.json b/dc-agents/reference/src/types/agent.openapi.json new file mode 100644 index 00000000000..eda0ee4a433 --- /dev/null +++ b/dc-agents/reference/src/types/agent.openapi.json @@ -0,0 +1,1022 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "", + "version": "" + }, + "paths": { + "/capabilities": { + "get": { + "responses": { + "200": { + "content": { + "application/json;charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/CapabilitiesResponse" + } + } + }, + "description": "" + } + } + } + }, + "/schema": { + "get": { + "parameters": [ + { + "in": "header", + "name": "X-Hasura-DataConnector-SourceName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Hasura-DataConnector-Config", + "required": true, + "schema": { + "additionalProperties": true, + "nullable": false, + "type": "object" + } + } + ], + "responses": { + "200": { + "content": { + "application/json;charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/SchemaResponse" + } + } + }, + "description": "" + }, + "400": { + "description": "Invalid `X-Hasura-DataConnector-Config` or `X-Hasura-DataConnector-SourceName`" + } + } + } + }, + "/query": { + "post": { + "parameters": [ + { + "in": "header", + "name": "X-Hasura-DataConnector-SourceName", + "required": true, + "schema": { + "type": "string" + } + }, + { + "in": "header", + "name": "X-Hasura-DataConnector-Config", + "required": true, + "schema": { + "additionalProperties": true, + "nullable": false, + "type": "object" + } + } + ], + "requestBody": { + "content": { + "application/json;charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/QueryRequest" + } + } + } + }, + "responses": { + "200": { + "content": { + "application/json;charset=utf-8": { + "schema": { + "$ref": "#/components/schemas/QueryResponse" + } + } + }, + "description": "" + }, + "400": { + "description": "Invalid `body` or `X-Hasura-DataConnector-Config` or `X-Hasura-DataConnector-SourceName`" + } + } + } + } + }, + "components": { + "schemas": { + "CapabilitiesResponse": { + "nullable": false, + "properties": { + "capabilities": { + "$ref": "#/components/schemas/Capabilities" + }, + "configSchemas": { + "$ref": "#/components/schemas/ConfigSchemaResponse" + } + }, + "required": [ + "capabilities", + "configSchemas" + ], + "type": "object" + }, + "Capabilities": { + "properties": { + "filtering": { + "$ref": "#/components/schemas/FilteringCapabilities" + }, + "mutations": { + "$ref": "#/components/schemas/MutationCapabilities" + }, + "queries": { + "$ref": "#/components/schemas/QueryCapabilities" + }, + "relationships": { + "$ref": "#/components/schemas/RelationshipCapabilities" + }, + "subscriptions": { + "$ref": "#/components/schemas/SubscriptionCapabilities" + } + }, + "type": "object" + }, + "QueryCapabilities": { + "properties": { + "supportsPrimaryKeys": { + "description": "Does the agent support querying a table by primary key?", + "type": "boolean" + } + }, + "required": [ + "supportsPrimaryKeys" + ], + "type": "object" + }, + "MutationCapabilities": {}, + "SubscriptionCapabilities": {}, + "BooleanOperators": {}, + "ComparisonOperators": {}, + "FilteringCapabilities": { + "properties": { + "booleanOperators": { + "$ref": "#/components/schemas/BooleanOperators" + }, + "comparisonOperators": { + "$ref": "#/components/schemas/ComparisonOperators" + } + }, + "required": [ + "booleanOperators", + "comparisonOperators" + ], + "type": "object" + }, + "RelationshipCapabilities": {}, + "ConfigSchemaResponse": { + "nullable": false, + "properties": { + "configSchema": { + "$ref": "#/components/schemas/OpenApiSchema" + }, + "otherSchemas": { + "additionalProperties": { + "$ref": "#/components/schemas/OpenApiSchema" + }, + "nullable": false, + "type": "object" + } + }, + "required": [ + "configSchema", + "otherSchemas" + ], + "type": "object" + }, + "OpenApiSchema": { + "additionalProperties": false, + "properties": { + "additionalProperties": { + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenApiSchema" + }, + { + "$ref": "#/components/schemas/OpenApiReference" + }, + { + "type": "boolean" + } + ] + }, + "default": true + }, + "allOf": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenApiSchema" + }, + { + "$ref": "#/components/schemas/OpenApiReference" + } + ] + }, + "type": "array" + }, + "anyOf": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenApiSchema" + }, + { + "$ref": "#/components/schemas/OpenApiReference" + } + ] + }, + "type": "array" + }, + "default": {}, + "deprecated": { + "default": false, + "type": "boolean" + }, + "description": { + "type": "string" + }, + "discriminator": { + "$ref": "#/components/schemas/OpenApiDiscriminator" + }, + "enum": { + "items": {}, + "minItems": 1, + "type": "array", + "uniqueItems": false + }, + "example": {}, + "exclusiveMaximum": { + "default": false, + "type": "boolean" + }, + "exclusiveMinimum": { + "default": false, + "type": "boolean" + }, + "externalDocs": { + "$ref": "#/components/schemas/OpenApiExternalDocumentation" + }, + "format": { + "type": "string" + }, + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenApiSchema" + }, + { + "$ref": "#/components/schemas/OpenApiReference" + } + ] + }, + "maxItems": { + "minimum": 0, + "type": "integer" + }, + "maxLength": { + "minimum": 0, + "type": "integer" + }, + "maxProperties": { + "minimum": 0, + "type": "integer" + }, + "maximum": { + "type": "number" + }, + "minItems": { + "default": 0, + "minimum": 0, + "type": "integer" + }, + "minLength": { + "default": 0, + "minimum": 0, + "type": "integer" + }, + "minProperties": { + "default": 0, + "minimum": 0, + "type": "integer" + }, + "minimum": { + "type": "number" + }, + "multipleOf": { + "exclusiveMinimum": true, + "minimum": 0, + "type": "number" + }, + "not": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenApiSchema" + }, + { + "$ref": "#/components/schemas/OpenApiReference" + } + ] + }, + "nullable": { + "default": false, + "type": "boolean" + }, + "oneOf": { + "items": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenApiSchema" + }, + { + "$ref": "#/components/schemas/OpenApiReference" + } + ] + }, + "type": "array" + }, + "pattern": { + "format": "regex", + "type": "string" + }, + "properties": { + "additionalProperties": { + "oneOf": [ + { + "$ref": "#/components/schemas/OpenApiSchema" + }, + { + "$ref": "#/components/schemas/OpenApiReference" + } + ] + }, + "type": "object" + }, + "readOnly": { + "default": false, + "type": "boolean" + }, + "required": { + "items": { + "type": "string" + }, + "minItems": 1, + "type": "array", + "uniqueItems": true + }, + "title": { + "type": "string" + }, + "type": { + "enum": [ + "array", + "boolean", + "integer", + "number", + "object", + "string" + ], + "type": "string" + }, + "uniqueItems": { + "default": false, + "type": "boolean" + }, + "writeOnly": { + "default": false, + "type": "boolean" + }, + "xml": { + "$ref": "#/components/schemas/OpenApiXml" + } + }, + "type": "object" + }, + "OpenApiReference": { + "properties": { + "$ref": { + "format": "uri-reference", + "type": "string" + } + }, + "required": [ + "$ref" + ], + "type": "object" + }, + "OpenApiDiscriminator": { + "properties": { + "mapping": { + "additionalProperties": { + "type": "string" + }, + "type": "object" + }, + "propertyName": { + "type": "string" + } + }, + "required": [ + "propertyName" + ], + "type": "object" + }, + "OpenApiExternalDocumentation": { + "additionalProperties": false, + "properties": { + "description": { + "type": "string" + }, + "url": { + "format": "uri-reference", + "type": "string" + } + }, + "required": [ + "url" + ], + "type": "object" + }, + "OpenApiXml": { + "additionalProperties": false, + "properties": { + "attribute": { + "default": false, + "type": "boolean" + }, + "name": { + "type": "string" + }, + "namespace": { + "format": "uri", + "type": "string" + }, + "prefix": { + "type": "string" + }, + "wrapped": { + "default": false, + "type": "boolean" + } + }, + "type": "object" + }, + "SchemaResponse": { + "properties": { + "tables": { + "description": "Available tables", + "items": { + "$ref": "#/components/schemas/TableInfo" + }, + "type": "array" + } + }, + "required": [ + "tables" + ], + "type": "object" + }, + "ScalarType": { + "enum": [ + "string", + "number", + "bool" + ], + "type": "string" + }, + "ColumnInfo": { + "properties": { + "description": { + "description": "Column description", + "nullable": true, + "type": "string" + }, + "name": { + "description": "Column name", + "type": "string" + }, + "nullable": { + "description": "Is column nullable", + "type": "boolean" + }, + "type": { + "$ref": "#/components/schemas/ScalarType" + } + }, + "required": [ + "name", + "type", + "nullable" + ], + "type": "object" + }, + "TableInfo": { + "properties": { + "columns": { + "description": "The columns of the table", + "items": { + "$ref": "#/components/schemas/ColumnInfo" + }, + "type": "array" + }, + "description": { + "description": "Description of the table", + "nullable": true, + "type": "string" + }, + "name": { + "description": "The name of the table", + "type": "string" + }, + "primary_key": { + "description": "The primary key of the table", + "nullable": true, + "type": "string" + } + }, + "required": [ + "name", + "columns" + ], + "type": "object" + }, + "QueryResponse": { + "items": { + "additionalProperties": { + "additionalProperties": true + }, + "type": "object" + }, + "type": "array" + }, + "QueryRequest": { + "properties": { + "query": { + "$ref": "#/components/schemas/Query" + }, + "table": { + "description": "The name of the table to query", + "type": "string" + }, + "table_relationships": { + "description": "The relationships between tables involved in the entire query request", + "items": { + "$ref": "#/components/schemas/TableRelationships" + }, + "type": "array" + } + }, + "required": [ + "table", + "table_relationships", + "query" + ], + "type": "object" + }, + "RelationshipType": { + "enum": [ + "object", + "array" + ], + "type": "string" + }, + "Relationship": { + "properties": { + "column_mapping": { + "additionalProperties": { + "type": "string" + }, + "description": "A mapping between columns on the source table to columns on the target table", + "type": "object" + }, + "relationship_type": { + "$ref": "#/components/schemas/RelationshipType" + }, + "target_table": { + "description": "The name of the target table in the relationship", + "type": "string" + } + }, + "required": [ + "target_table", + "relationship_type", + "column_mapping" + ], + "type": "object" + }, + "TableRelationships": { + "properties": { + "relationships": { + "additionalProperties": { + "$ref": "#/components/schemas/Relationship" + }, + "description": "A map of relationships from the source table to target tables. The key of the map is the relationship name", + "type": "object" + }, + "source_table": { + "description": "The name of the source table in the relationship", + "type": "string" + } + }, + "required": [ + "source_table", + "relationships" + ], + "type": "object" + }, + "Query": { + "properties": { + "fields": { + "additionalProperties": { + "$ref": "#/components/schemas/Field" + }, + "description": "Fields of the query", + "type": "object" + }, + "limit": { + "description": "Optionally limit to N results", + "maximum": 9223372036854776000, + "minimum": -9223372036854776000, + "nullable": true, + "type": "number" + }, + "offset": { + "description": "Optionally offset from the Nth result", + "maximum": 9223372036854776000, + "minimum": -9223372036854776000, + "nullable": true, + "type": "number" + }, + "order_by": { + "description": "Optionally order the results by the value of one or more fields", + "items": { + "$ref": "#/components/schemas/OrderBy" + }, + "nullable": true, + "type": "array" + }, + "where": { + "$ref": "#/components/schemas/Expression" + } + }, + "required": [ + "fields" + ], + "type": "object" + }, + "ColumnField": { + "properties": { + "column": { + "type": "string" + }, + "type": { + "enum": [ + "column" + ], + "type": "string" + } + }, + "required": [ + "type", + "column" + ], + "type": "object" + }, + "RelationshipField": { + "properties": { + "query": { + "$ref": "#/components/schemas/Query" + }, + "relationship": { + "description": "The name of the relationship to follow for the subquery", + "type": "string" + }, + "type": { + "enum": [ + "relationship" + ], + "type": "string" + } + }, + "required": [ + "type", + "relationship", + "query" + ], + "type": "object" + }, + "Field": { + "oneOf": [ + { + "$ref": "#/components/schemas/ColumnField" + }, + { + "$ref": "#/components/schemas/RelationshipField" + } + ] + }, + "Expression": { + "oneOf": [ + { + "$ref": "#/components/schemas/AndExpression" + }, + { + "$ref": "#/components/schemas/OrExpression" + }, + { + "$ref": "#/components/schemas/NotExpression" + }, + { + "$ref": "#/components/schemas/ApplyBinaryComparisonOperator" + }, + { + "$ref": "#/components/schemas/ApplyBinaryArrayComparisonExpression" + }, + { + "$ref": "#/components/schemas/ApplyUnaryComparisonOperator" + } + ] + }, + "BinaryComparisonOperator": { + "enum": [ + "less_than", + "less_than_or_equal", + "greater_than", + "greater_than_or_equal", + "equal" + ], + "type": "string" + }, + "ComparisonColumn": { + "properties": { + "name": { + "description": "The name of the column", + "type": "string" + }, + "path": { + "description": "The relationship path from the current query table to the table that contains the specified column. Empty array means the current query table.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "path", + "name" + ], + "type": "object" + }, + "ScalarValue": { + "oneOf": [ + { + "type": "string" + }, + { + "type": "number" + }, + { + "type": "boolean" + }, + { + "type": "null" + } + ] + }, + "AnotherColumnComparison": { + "properties": { + "column": { + "$ref": "#/components/schemas/ComparisonColumn" + }, + "type": { + "enum": [ + "column" + ], + "type": "string" + } + }, + "required": [ + "type", + "column" + ], + "type": "object" + }, + "ScalarValueComparison": { + "properties": { + "type": { + "enum": [ + "scalar" + ], + "type": "string" + }, + "value": { + "$ref": "#/components/schemas/ScalarValue" + } + }, + "required": [ + "type", + "value" + ], + "type": "object" + }, + "ComparisonValue": { + "oneOf": [ + { + "$ref": "#/components/schemas/AnotherColumnComparison" + }, + { + "$ref": "#/components/schemas/ScalarValueComparison" + } + ] + }, + "BinaryArrayComparisonOperator": { + "enum": [ + "in" + ], + "type": "string" + }, + "UnaryComparisonOperator": { + "enum": [ + "is_null" + ], + "type": "string" + }, + "ApplyBinaryArrayComparisonExpression": { + "properties": { + "column": { + "$ref": "#/components/schemas/ComparisonColumn" + }, + "operator": { + "$ref": "#/components/schemas/BinaryArrayComparisonOperator" + }, + "type": { + "enum": [ + "binary_arr_op" + ], + "type": "string" + }, + "values": { + "items": { + "$ref": "#/components/schemas/ScalarValue" + }, + "type": "array" + } + }, + "required": [ + "type", + "operator", + "column", + "values" + ], + "type": "object" + }, + "ApplyUnaryComparisonOperator": { + "properties": { + "column": { + "$ref": "#/components/schemas/ComparisonColumn" + }, + "operator": { + "$ref": "#/components/schemas/UnaryComparisonOperator" + }, + "type": { + "enum": [ + "unary_op" + ], + "type": "string" + } + }, + "required": [ + "type", + "operator", + "column" + ], + "type": "object" + }, + "ApplyBinaryComparisonOperator": { + "properties": { + "column": { + "$ref": "#/components/schemas/ComparisonColumn" + }, + "operator": { + "$ref": "#/components/schemas/BinaryComparisonOperator" + }, + "type": { + "enum": [ + "binary_op" + ], + "type": "string" + }, + "value": { + "$ref": "#/components/schemas/ComparisonValue" + } + }, + "required": [ + "type", + "operator", + "column", + "value" + ], + "type": "object" + }, + "NotExpression": { + "properties": { + "expression": { + "$ref": "#/components/schemas/Expression" + }, + "type": { + "enum": [ + "not" + ], + "type": "string" + } + }, + "required": [ + "type", + "expression" + ], + "type": "object" + }, + "OrExpression": { + "properties": { + "expressions": { + "items": { + "$ref": "#/components/schemas/Expression" + }, + "type": "array" + }, + "type": { + "enum": [ + "or" + ], + "type": "string" + } + }, + "required": [ + "type", + "expressions" + ], + "type": "object" + }, + "AndExpression": { + "properties": { + "expressions": { + "items": { + "$ref": "#/components/schemas/Expression" + }, + "type": "array" + }, + "type": { + "enum": [ + "and" + ], + "type": "string" + } + }, + "required": [ + "type", + "expressions" + ], + "type": "object" + }, + "OrderType": { + "enum": [ + "asc", + "desc" + ], + "type": "string" + }, + "OrderBy": { + "properties": { + "column": { + "description": "Column to order by", + "type": "string" + }, + "ordering": { + "$ref": "#/components/schemas/OrderType" + } + }, + "required": [ + "column", + "ordering" + ], + "type": "object" + } + } + } +} diff --git a/dc-agents/reference/src/types/index.ts b/dc-agents/reference/src/types/index.ts new file mode 100644 index 00000000000..e204e4812d0 --- /dev/null +++ b/dc-agents/reference/src/types/index.ts @@ -0,0 +1,49 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type { AndExpression } from './models/AndExpression'; +export type { AnotherColumnComparison } from './models/AnotherColumnComparison'; +export type { ApplyBinaryArrayComparisonExpression } from './models/ApplyBinaryArrayComparisonExpression'; +export type { ApplyBinaryComparisonOperator } from './models/ApplyBinaryComparisonOperator'; +export type { ApplyUnaryComparisonOperator } from './models/ApplyUnaryComparisonOperator'; +export type { BinaryArrayComparisonOperator } from './models/BinaryArrayComparisonOperator'; +export type { BinaryComparisonOperator } from './models/BinaryComparisonOperator'; +export type { BooleanOperators } from './models/BooleanOperators'; +export type { Capabilities } from './models/Capabilities'; +export type { CapabilitiesResponse } from './models/CapabilitiesResponse'; +export type { ColumnField } from './models/ColumnField'; +export type { ColumnInfo } from './models/ColumnInfo'; +export type { ComparisonColumn } from './models/ComparisonColumn'; +export type { ComparisonOperators } from './models/ComparisonOperators'; +export type { ComparisonValue } from './models/ComparisonValue'; +export type { ConfigSchemaResponse } from './models/ConfigSchemaResponse'; +export type { Expression } from './models/Expression'; +export type { Field } from './models/Field'; +export type { FilteringCapabilities } from './models/FilteringCapabilities'; +export type { MutationCapabilities } from './models/MutationCapabilities'; +export type { NotExpression } from './models/NotExpression'; +export type { OpenApiDiscriminator } from './models/OpenApiDiscriminator'; +export type { OpenApiExternalDocumentation } from './models/OpenApiExternalDocumentation'; +export type { OpenApiReference } from './models/OpenApiReference'; +export type { OpenApiSchema } from './models/OpenApiSchema'; +export type { OpenApiXml } from './models/OpenApiXml'; +export type { OrderBy } from './models/OrderBy'; +export type { OrderType } from './models/OrderType'; +export type { OrExpression } from './models/OrExpression'; +export type { Query } from './models/Query'; +export type { QueryCapabilities } from './models/QueryCapabilities'; +export type { QueryRequest } from './models/QueryRequest'; +export type { QueryResponse } from './models/QueryResponse'; +export type { Relationship } from './models/Relationship'; +export type { RelationshipCapabilities } from './models/RelationshipCapabilities'; +export type { RelationshipField } from './models/RelationshipField'; +export type { RelationshipType } from './models/RelationshipType'; +export type { ScalarType } from './models/ScalarType'; +export type { ScalarValue } from './models/ScalarValue'; +export type { ScalarValueComparison } from './models/ScalarValueComparison'; +export type { SchemaResponse } from './models/SchemaResponse'; +export type { SubscriptionCapabilities } from './models/SubscriptionCapabilities'; +export type { TableInfo } from './models/TableInfo'; +export type { TableRelationships } from './models/TableRelationships'; +export type { UnaryComparisonOperator } from './models/UnaryComparisonOperator'; diff --git a/dc-agents/reference/src/types/models/AndExpression.ts b/dc-agents/reference/src/types/models/AndExpression.ts new file mode 100644 index 00000000000..c7eaa27bd13 --- /dev/null +++ b/dc-agents/reference/src/types/models/AndExpression.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Expression } from './Expression'; + +export type AndExpression = { + expressions: Array; + type: 'and'; +}; + diff --git a/dc-agents/reference/src/types/models/AnotherColumnComparison.ts b/dc-agents/reference/src/types/models/AnotherColumnComparison.ts new file mode 100644 index 00000000000..b33ef8d2c7a --- /dev/null +++ b/dc-agents/reference/src/types/models/AnotherColumnComparison.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ComparisonColumn } from './ComparisonColumn'; + +export type AnotherColumnComparison = { + column: ComparisonColumn; + type: 'column'; +}; + diff --git a/dc-agents/reference/src/types/models/ApplyBinaryArrayComparisonExpression.ts b/dc-agents/reference/src/types/models/ApplyBinaryArrayComparisonExpression.ts new file mode 100644 index 00000000000..7a7eddf09b8 --- /dev/null +++ b/dc-agents/reference/src/types/models/ApplyBinaryArrayComparisonExpression.ts @@ -0,0 +1,15 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { BinaryArrayComparisonOperator } from './BinaryArrayComparisonOperator'; +import type { ComparisonColumn } from './ComparisonColumn'; +import type { ScalarValue } from './ScalarValue'; + +export type ApplyBinaryArrayComparisonExpression = { + column: ComparisonColumn; + operator: BinaryArrayComparisonOperator; + type: 'binary_arr_op'; + values: Array; +}; + diff --git a/dc-agents/reference/src/types/models/ApplyBinaryComparisonOperator.ts b/dc-agents/reference/src/types/models/ApplyBinaryComparisonOperator.ts new file mode 100644 index 00000000000..70bab23748c --- /dev/null +++ b/dc-agents/reference/src/types/models/ApplyBinaryComparisonOperator.ts @@ -0,0 +1,15 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { BinaryComparisonOperator } from './BinaryComparisonOperator'; +import type { ComparisonColumn } from './ComparisonColumn'; +import type { ComparisonValue } from './ComparisonValue'; + +export type ApplyBinaryComparisonOperator = { + column: ComparisonColumn; + operator: BinaryComparisonOperator; + type: 'binary_op'; + value: ComparisonValue; +}; + diff --git a/dc-agents/reference/src/types/models/ApplyUnaryComparisonOperator.ts b/dc-agents/reference/src/types/models/ApplyUnaryComparisonOperator.ts new file mode 100644 index 00000000000..5d32bd0ff66 --- /dev/null +++ b/dc-agents/reference/src/types/models/ApplyUnaryComparisonOperator.ts @@ -0,0 +1,13 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ComparisonColumn } from './ComparisonColumn'; +import type { UnaryComparisonOperator } from './UnaryComparisonOperator'; + +export type ApplyUnaryComparisonOperator = { + column: ComparisonColumn; + operator: UnaryComparisonOperator; + type: 'unary_op'; +}; + diff --git a/dc-agents/reference/src/types/models/BinaryArrayComparisonOperator.ts b/dc-agents/reference/src/types/models/BinaryArrayComparisonOperator.ts new file mode 100644 index 00000000000..7bbf51a2b78 --- /dev/null +++ b/dc-agents/reference/src/types/models/BinaryArrayComparisonOperator.ts @@ -0,0 +1,5 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type BinaryArrayComparisonOperator = 'in'; diff --git a/dc-agents/reference/src/types/models/BinaryComparisonOperator.ts b/dc-agents/reference/src/types/models/BinaryComparisonOperator.ts new file mode 100644 index 00000000000..ae1f6f4c180 --- /dev/null +++ b/dc-agents/reference/src/types/models/BinaryComparisonOperator.ts @@ -0,0 +1,5 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type BinaryComparisonOperator = 'less_than' | 'less_than_or_equal' | 'greater_than' | 'greater_than_or_equal' | 'equal'; diff --git a/dc-agents/reference/src/types/models/BooleanOperators.ts b/dc-agents/reference/src/types/models/BooleanOperators.ts new file mode 100644 index 00000000000..ca63f8e4e7e --- /dev/null +++ b/dc-agents/reference/src/types/models/BooleanOperators.ts @@ -0,0 +1,7 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type BooleanOperators = { +}; + diff --git a/dc-agents/reference/src/types/models/Capabilities.ts b/dc-agents/reference/src/types/models/Capabilities.ts new file mode 100644 index 00000000000..2c4cb42b584 --- /dev/null +++ b/dc-agents/reference/src/types/models/Capabilities.ts @@ -0,0 +1,18 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { FilteringCapabilities } from './FilteringCapabilities'; +import type { MutationCapabilities } from './MutationCapabilities'; +import type { QueryCapabilities } from './QueryCapabilities'; +import type { RelationshipCapabilities } from './RelationshipCapabilities'; +import type { SubscriptionCapabilities } from './SubscriptionCapabilities'; + +export type Capabilities = { + filtering?: FilteringCapabilities; + mutations?: MutationCapabilities; + queries?: QueryCapabilities; + relationships?: RelationshipCapabilities; + subscriptions?: SubscriptionCapabilities; +}; + diff --git a/dc-agents/reference/src/types/models/CapabilitiesResponse.ts b/dc-agents/reference/src/types/models/CapabilitiesResponse.ts new file mode 100644 index 00000000000..95618ee3115 --- /dev/null +++ b/dc-agents/reference/src/types/models/CapabilitiesResponse.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Capabilities } from './Capabilities'; +import type { ConfigSchemaResponse } from './ConfigSchemaResponse'; + +export type CapabilitiesResponse = { + capabilities: Capabilities; + configSchemas: ConfigSchemaResponse; +}; + diff --git a/dc-agents/reference/src/types/models/ColumnField.ts b/dc-agents/reference/src/types/models/ColumnField.ts new file mode 100644 index 00000000000..d887c53e7d4 --- /dev/null +++ b/dc-agents/reference/src/types/models/ColumnField.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ColumnField = { + column: string; + type: 'column'; +}; + diff --git a/dc-agents/reference/src/types/models/ColumnInfo.ts b/dc-agents/reference/src/types/models/ColumnInfo.ts new file mode 100644 index 00000000000..4332e2ae77e --- /dev/null +++ b/dc-agents/reference/src/types/models/ColumnInfo.ts @@ -0,0 +1,22 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ScalarType } from './ScalarType'; + +export type ColumnInfo = { + /** + * Column description + */ + description?: string | null; + /** + * Column name + */ + name: string; + /** + * Is column nullable + */ + nullable: boolean; + type: ScalarType; +}; + diff --git a/dc-agents/reference/src/types/models/ComparisonColumn.ts b/dc-agents/reference/src/types/models/ComparisonColumn.ts new file mode 100644 index 00000000000..26cdc634737 --- /dev/null +++ b/dc-agents/reference/src/types/models/ComparisonColumn.ts @@ -0,0 +1,15 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ComparisonColumn = { + /** + * The name of the column + */ + name: string; + /** + * The relationship path from the current query table to the table that contains the specified column. Empty array means the current query table. + */ + path: Array; +}; + diff --git a/dc-agents/reference/src/types/models/ComparisonOperators.ts b/dc-agents/reference/src/types/models/ComparisonOperators.ts new file mode 100644 index 00000000000..453bb4bd520 --- /dev/null +++ b/dc-agents/reference/src/types/models/ComparisonOperators.ts @@ -0,0 +1,7 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ComparisonOperators = { +}; + diff --git a/dc-agents/reference/src/types/models/ComparisonValue.ts b/dc-agents/reference/src/types/models/ComparisonValue.ts new file mode 100644 index 00000000000..4848c3ffaf9 --- /dev/null +++ b/dc-agents/reference/src/types/models/ComparisonValue.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { AnotherColumnComparison } from './AnotherColumnComparison'; +import type { ScalarValueComparison } from './ScalarValueComparison'; + +export type ComparisonValue = (AnotherColumnComparison | ScalarValueComparison); + diff --git a/dc-agents/reference/src/types/models/ConfigSchemaResponse.ts b/dc-agents/reference/src/types/models/ConfigSchemaResponse.ts new file mode 100644 index 00000000000..5cda70a4aa5 --- /dev/null +++ b/dc-agents/reference/src/types/models/ConfigSchemaResponse.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { OpenApiSchema } from './OpenApiSchema'; + +export type ConfigSchemaResponse = { + configSchema: OpenApiSchema; + otherSchemas: Record; +}; + diff --git a/dc-agents/reference/src/types/models/Expression.ts b/dc-agents/reference/src/types/models/Expression.ts new file mode 100644 index 00000000000..7510391e24e --- /dev/null +++ b/dc-agents/reference/src/types/models/Expression.ts @@ -0,0 +1,13 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { AndExpression } from './AndExpression'; +import type { ApplyBinaryArrayComparisonExpression } from './ApplyBinaryArrayComparisonExpression'; +import type { ApplyBinaryComparisonOperator } from './ApplyBinaryComparisonOperator'; +import type { ApplyUnaryComparisonOperator } from './ApplyUnaryComparisonOperator'; +import type { NotExpression } from './NotExpression'; +import type { OrExpression } from './OrExpression'; + +export type Expression = (AndExpression | OrExpression | NotExpression | ApplyBinaryComparisonOperator | ApplyBinaryArrayComparisonExpression | ApplyUnaryComparisonOperator); + diff --git a/dc-agents/reference/src/types/models/Field.ts b/dc-agents/reference/src/types/models/Field.ts new file mode 100644 index 00000000000..e9564bbf2f4 --- /dev/null +++ b/dc-agents/reference/src/types/models/Field.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ColumnField } from './ColumnField'; +import type { RelationshipField } from './RelationshipField'; + +export type Field = (ColumnField | RelationshipField); + diff --git a/dc-agents/reference/src/types/models/FilteringCapabilities.ts b/dc-agents/reference/src/types/models/FilteringCapabilities.ts new file mode 100644 index 00000000000..de9026f299b --- /dev/null +++ b/dc-agents/reference/src/types/models/FilteringCapabilities.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { BooleanOperators } from './BooleanOperators'; +import type { ComparisonOperators } from './ComparisonOperators'; + +export type FilteringCapabilities = { + booleanOperators: BooleanOperators; + comparisonOperators: ComparisonOperators; +}; + diff --git a/dc-agents/reference/src/types/models/MutationCapabilities.ts b/dc-agents/reference/src/types/models/MutationCapabilities.ts new file mode 100644 index 00000000000..85d10e00b1d --- /dev/null +++ b/dc-agents/reference/src/types/models/MutationCapabilities.ts @@ -0,0 +1,7 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type MutationCapabilities = { +}; + diff --git a/dc-agents/reference/src/types/models/NotExpression.ts b/dc-agents/reference/src/types/models/NotExpression.ts new file mode 100644 index 00000000000..85be63112cb --- /dev/null +++ b/dc-agents/reference/src/types/models/NotExpression.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Expression } from './Expression'; + +export type NotExpression = { + expression: Expression; + type: 'not'; +}; + diff --git a/dc-agents/reference/src/types/models/OpenApiDiscriminator.ts b/dc-agents/reference/src/types/models/OpenApiDiscriminator.ts new file mode 100644 index 00000000000..ec6af0b4938 --- /dev/null +++ b/dc-agents/reference/src/types/models/OpenApiDiscriminator.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OpenApiDiscriminator = { + mapping?: Record; + propertyName: string; +}; + diff --git a/dc-agents/reference/src/types/models/OpenApiExternalDocumentation.ts b/dc-agents/reference/src/types/models/OpenApiExternalDocumentation.ts new file mode 100644 index 00000000000..ea5981b61c3 --- /dev/null +++ b/dc-agents/reference/src/types/models/OpenApiExternalDocumentation.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OpenApiExternalDocumentation = { + description?: string; + url: string; +}; + diff --git a/dc-agents/reference/src/types/models/OpenApiReference.ts b/dc-agents/reference/src/types/models/OpenApiReference.ts new file mode 100644 index 00000000000..b684de97eaf --- /dev/null +++ b/dc-agents/reference/src/types/models/OpenApiReference.ts @@ -0,0 +1,8 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OpenApiReference = { + $ref: string; +}; + diff --git a/dc-agents/reference/src/types/models/OpenApiSchema.ts b/dc-agents/reference/src/types/models/OpenApiSchema.ts new file mode 100644 index 00000000000..044df4e2cb5 --- /dev/null +++ b/dc-agents/reference/src/types/models/OpenApiSchema.ts @@ -0,0 +1,47 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { OpenApiDiscriminator } from './OpenApiDiscriminator'; +import type { OpenApiExternalDocumentation } from './OpenApiExternalDocumentation'; +import type { OpenApiReference } from './OpenApiReference'; +import type { OpenApiXml } from './OpenApiXml'; + +export type OpenApiSchema = { + additionalProperties?: any; + allOf?: Array<(OpenApiSchema | OpenApiReference)>; + anyOf?: Array<(OpenApiSchema | OpenApiReference)>; + default?: any; + deprecated?: boolean; + description?: string; + discriminator?: OpenApiDiscriminator; + enum?: Array; + example?: any; + exclusiveMaximum?: boolean; + exclusiveMinimum?: boolean; + externalDocs?: OpenApiExternalDocumentation; + format?: string; + items?: (OpenApiSchema | OpenApiReference); + maxItems?: number; + maxLength?: number; + maxProperties?: number; + maximum?: number; + minItems?: number; + minLength?: number; + minProperties?: number; + minimum?: number; + multipleOf?: number; + not?: (OpenApiSchema | OpenApiReference); + nullable?: boolean; + oneOf?: Array<(OpenApiSchema | OpenApiReference)>; + pattern?: string; + properties?: Record; + readOnly?: boolean; + required?: Array; + title?: string; + type?: 'array' | 'boolean' | 'integer' | 'number' | 'object' | 'string'; + uniqueItems?: boolean; + writeOnly?: boolean; + xml?: OpenApiXml; +}; + diff --git a/dc-agents/reference/src/types/models/OpenApiXml.ts b/dc-agents/reference/src/types/models/OpenApiXml.ts new file mode 100644 index 00000000000..65869ca2b05 --- /dev/null +++ b/dc-agents/reference/src/types/models/OpenApiXml.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OpenApiXml = { + attribute?: boolean; + name?: string; + namespace?: string; + prefix?: string; + wrapped?: boolean; +}; + diff --git a/dc-agents/reference/src/types/models/OrExpression.ts b/dc-agents/reference/src/types/models/OrExpression.ts new file mode 100644 index 00000000000..42c5406534d --- /dev/null +++ b/dc-agents/reference/src/types/models/OrExpression.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Expression } from './Expression'; + +export type OrExpression = { + expressions: Array; + type: 'or'; +}; + diff --git a/dc-agents/reference/src/types/models/OrderBy.ts b/dc-agents/reference/src/types/models/OrderBy.ts new file mode 100644 index 00000000000..f8972dca36d --- /dev/null +++ b/dc-agents/reference/src/types/models/OrderBy.ts @@ -0,0 +1,14 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { OrderType } from './OrderType'; + +export type OrderBy = { + /** + * Column to order by + */ + column: string; + ordering: OrderType; +}; + diff --git a/dc-agents/reference/src/types/models/OrderType.ts b/dc-agents/reference/src/types/models/OrderType.ts new file mode 100644 index 00000000000..45b1a4b9430 --- /dev/null +++ b/dc-agents/reference/src/types/models/OrderType.ts @@ -0,0 +1,5 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type OrderType = 'asc' | 'desc'; diff --git a/dc-agents/reference/src/types/models/Query.ts b/dc-agents/reference/src/types/models/Query.ts new file mode 100644 index 00000000000..0a9c39e9159 --- /dev/null +++ b/dc-agents/reference/src/types/models/Query.ts @@ -0,0 +1,28 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Expression } from './Expression'; +import type { Field } from './Field'; +import type { OrderBy } from './OrderBy'; + +export type Query = { + /** + * Fields of the query + */ + fields: Record; + /** + * Optionally limit to N results + */ + limit?: number | null; + /** + * Optionally offset from the Nth result + */ + offset?: number | null; + /** + * Optionally order the results by the value of one or more fields + */ + order_by?: Array | null; + where?: Expression; +}; + diff --git a/dc-agents/reference/src/types/models/QueryCapabilities.ts b/dc-agents/reference/src/types/models/QueryCapabilities.ts new file mode 100644 index 00000000000..b669209dd58 --- /dev/null +++ b/dc-agents/reference/src/types/models/QueryCapabilities.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type QueryCapabilities = { + /** + * Does the agent support querying a table by primary key? + */ + supportsPrimaryKeys: boolean; +}; + diff --git a/dc-agents/reference/src/types/models/QueryRequest.ts b/dc-agents/reference/src/types/models/QueryRequest.ts new file mode 100644 index 00000000000..d95898f866a --- /dev/null +++ b/dc-agents/reference/src/types/models/QueryRequest.ts @@ -0,0 +1,19 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Query } from './Query'; +import type { TableRelationships } from './TableRelationships'; + +export type QueryRequest = { + query: Query; + /** + * The name of the table to query + */ + table: string; + /** + * The relationships between tables involved in the entire query request + */ + table_relationships: Array; +}; + diff --git a/dc-agents/reference/src/types/models/QueryResponse.ts b/dc-agents/reference/src/types/models/QueryResponse.ts new file mode 100644 index 00000000000..9c2dd5a304c --- /dev/null +++ b/dc-agents/reference/src/types/models/QueryResponse.ts @@ -0,0 +1,5 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type QueryResponse = Array>; diff --git a/dc-agents/reference/src/types/models/Relationship.ts b/dc-agents/reference/src/types/models/Relationship.ts new file mode 100644 index 00000000000..0fd631e62d0 --- /dev/null +++ b/dc-agents/reference/src/types/models/Relationship.ts @@ -0,0 +1,18 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { RelationshipType } from './RelationshipType'; + +export type Relationship = { + /** + * A mapping between columns on the source table to columns on the target table + */ + column_mapping: Record; + relationship_type: RelationshipType; + /** + * The name of the target table in the relationship + */ + target_table: string; +}; + diff --git a/dc-agents/reference/src/types/models/RelationshipCapabilities.ts b/dc-agents/reference/src/types/models/RelationshipCapabilities.ts new file mode 100644 index 00000000000..ac946a539c5 --- /dev/null +++ b/dc-agents/reference/src/types/models/RelationshipCapabilities.ts @@ -0,0 +1,7 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type RelationshipCapabilities = { +}; + diff --git a/dc-agents/reference/src/types/models/RelationshipField.ts b/dc-agents/reference/src/types/models/RelationshipField.ts new file mode 100644 index 00000000000..b9bd031a8c5 --- /dev/null +++ b/dc-agents/reference/src/types/models/RelationshipField.ts @@ -0,0 +1,15 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Query } from './Query'; + +export type RelationshipField = { + query: Query; + /** + * The name of the relationship to follow for the subquery + */ + relationship: string; + type: 'relationship'; +}; + diff --git a/dc-agents/reference/src/types/models/RelationshipType.ts b/dc-agents/reference/src/types/models/RelationshipType.ts new file mode 100644 index 00000000000..d16ef292704 --- /dev/null +++ b/dc-agents/reference/src/types/models/RelationshipType.ts @@ -0,0 +1,5 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type RelationshipType = 'object' | 'array'; diff --git a/dc-agents/reference/src/types/models/ScalarType.ts b/dc-agents/reference/src/types/models/ScalarType.ts new file mode 100644 index 00000000000..f566508760d --- /dev/null +++ b/dc-agents/reference/src/types/models/ScalarType.ts @@ -0,0 +1,5 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ScalarType = 'string' | 'number' | 'bool'; diff --git a/dc-agents/reference/src/types/models/ScalarValue.ts b/dc-agents/reference/src/types/models/ScalarValue.ts new file mode 100644 index 00000000000..6d14aac1279 --- /dev/null +++ b/dc-agents/reference/src/types/models/ScalarValue.ts @@ -0,0 +1,6 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type ScalarValue = (string | number | boolean | null); + diff --git a/dc-agents/reference/src/types/models/ScalarValueComparison.ts b/dc-agents/reference/src/types/models/ScalarValueComparison.ts new file mode 100644 index 00000000000..e09e2fa9ee6 --- /dev/null +++ b/dc-agents/reference/src/types/models/ScalarValueComparison.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ScalarValue } from './ScalarValue'; + +export type ScalarValueComparison = { + type: 'scalar'; + value: ScalarValue; +}; + diff --git a/dc-agents/reference/src/types/models/SchemaResponse.ts b/dc-agents/reference/src/types/models/SchemaResponse.ts new file mode 100644 index 00000000000..ab8d6b907b2 --- /dev/null +++ b/dc-agents/reference/src/types/models/SchemaResponse.ts @@ -0,0 +1,13 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { TableInfo } from './TableInfo'; + +export type SchemaResponse = { + /** + * Available tables + */ + tables: Array; +}; + diff --git a/dc-agents/reference/src/types/models/SubscriptionCapabilities.ts b/dc-agents/reference/src/types/models/SubscriptionCapabilities.ts new file mode 100644 index 00000000000..fb0a38fcbab --- /dev/null +++ b/dc-agents/reference/src/types/models/SubscriptionCapabilities.ts @@ -0,0 +1,7 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type SubscriptionCapabilities = { +}; + diff --git a/dc-agents/reference/src/types/models/TableInfo.ts b/dc-agents/reference/src/types/models/TableInfo.ts new file mode 100644 index 00000000000..58d04222fc7 --- /dev/null +++ b/dc-agents/reference/src/types/models/TableInfo.ts @@ -0,0 +1,25 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ColumnInfo } from './ColumnInfo'; + +export type TableInfo = { + /** + * The columns of the table + */ + columns: Array; + /** + * Description of the table + */ + description?: string | null; + /** + * The name of the table + */ + name: string; + /** + * The primary key of the table + */ + primary_key?: string | null; +}; + diff --git a/dc-agents/reference/src/types/models/TableRelationships.ts b/dc-agents/reference/src/types/models/TableRelationships.ts new file mode 100644 index 00000000000..2ed2ec9a0cd --- /dev/null +++ b/dc-agents/reference/src/types/models/TableRelationships.ts @@ -0,0 +1,17 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { Relationship } from './Relationship'; + +export type TableRelationships = { + /** + * A map of relationships from the source table to target tables. The key of the map is the relationship name + */ + relationships: Record; + /** + * The name of the source table in the relationship + */ + source_table: string; +}; + diff --git a/dc-agents/reference/src/types/models/UnaryComparisonOperator.ts b/dc-agents/reference/src/types/models/UnaryComparisonOperator.ts new file mode 100644 index 00000000000..18d99573fa4 --- /dev/null +++ b/dc-agents/reference/src/types/models/UnaryComparisonOperator.ts @@ -0,0 +1,5 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type UnaryComparisonOperator = 'is_null'; diff --git a/dc-agents/reference/src/types/query.ts b/dc-agents/reference/src/types/query.ts deleted file mode 100644 index 9b25ee670f1..00000000000 --- a/dc-agents/reference/src/types/query.ts +++ /dev/null @@ -1,148 +0,0 @@ -export type QueryRequest = { - table: TableName, - table_relationships: TableRelationships[], - query: Query, -} - -export type TableName = string - -export type TableRelationships = { - source_table: TableName, - relationships: { [relationshipName: RelationshipName]: Relationship } -} - -export type Relationship = { - target_table: TableName, - relationship_type: RelationshipType, - column_mapping: { [source: SourceColumnName]: TargetColumnName }, -} - -export type SourceColumnName = ColumnName -export type TargetColumnName = ColumnName - -export type RelationshipName = string - -export enum RelationshipType { - Object = "object", - Array = "array" -} - -export type Query = { - fields: Fields, - limit?: number | null, - offset?: number | null, - where?: Expression | null, - order_by?: OrderBy[], -} - -export type Fields = { [fieldName: string]: Field } - -export type Field = ColumnField | RelationshipField - -export type ColumnName = string -export type ColumnField = { - type: "column", - column: ColumnName, -} - -export type RelationshipField = { - type: "relationship", - relationship: RelationshipName - query: Query, -} - -export type ScalarValue = string | number | boolean | null - -export type ComparisonColumn = { - path: RelationshipName[], - name: ColumnName, -} - -export type ComparisonValue = - | AnotherColumnComparisonValue - | ScalarComparisonValue - -export type AnotherColumnComparisonValue = { - type: "column", - column: ComparisonColumn, -} - -export type ScalarComparisonValue = { - type: "scalar", - value: ScalarValue, -} - -export type Expression = - | AndExpression - | OrExpression - | NotExpression - | ApplyBinaryComparisonOperatorExpression - | ApplyBinaryArrayComparisonOperatorExpression - | ApplyUnaryComparisonOperatorExpression - -export type AndExpression = { - type: "and", - expressions: Expression[], -} - -export type OrExpression = { - type: "or", - expressions: Expression[], -} - -export type NotExpression = { - type: "not", - expression: Expression, -} - -export type ApplyBinaryComparisonOperatorExpression = { - type: "binary_op", - operator: BinaryComparisonOperator, - column: ComparisonColumn, - value: ComparisonValue, -} - -export type ApplyBinaryArrayComparisonOperatorExpression = { - type: "binary_arr_op", - operator: BinaryArrayComparisonOperator, - column: ComparisonColumn, - values: ScalarValue[], -} - -export type ApplyUnaryComparisonOperatorExpression = { - type: "unary_op", - operator: UnaryComparisonOperator, - column: ComparisonColumn, -} - -export enum BinaryComparisonOperator { - LessThan = "less_than", - LessThanOrEqual = "less_than_or_equal", - GreaterThan = "greater_than", - GreaterThanOrEqual = "greater_than_or_equal", - Equal = "equal", -} - -export enum BinaryArrayComparisonOperator { - In = "in", -} - -export enum UnaryComparisonOperator { - IsNull = "is_null", -} - -export type OrderBy = { - column: ColumnName, - ordering: OrderType, -} - -export enum OrderType { - Ascending = "asc", - Descending = "desc", -} - -export type QueryResponse = ProjectedRow[] - -export type ProjectedRow = { - [fieldName: string]: ScalarValue | ProjectedRow[] | ProjectedRow -} diff --git a/dc-agents/reference/src/types/schema.ts b/dc-agents/reference/src/types/schema.ts deleted file mode 100644 index d283b60a9b6..00000000000 --- a/dc-agents/reference/src/types/schema.ts +++ /dev/null @@ -1,23 +0,0 @@ -export type SchemaResponse = { - tables: Table[], -} - -export type Table = { - name: string, - columns: ColumnInfo[], - primary_key?: string | null, - description?: string | null -} - -export type ColumnInfo = { - name: string, - type: ScalarType, - nullable: boolean, - description?: string | null -} - -export enum ScalarType { - String = "string", - Number = "number", - Boolean = "bool" -} diff --git a/dc-agents/reference/src/util.ts b/dc-agents/reference/src/util.ts index 1227d29fa67..a13e453dc4e 100644 --- a/dc-agents/reference/src/util.ts +++ b/dc-agents/reference/src/util.ts @@ -1,9 +1,8 @@ export const coerceUndefinedToNull = (v: T | undefined): T | null => v === undefined ? null : v; export const unreachable = (x: never): never => { throw new Error(`Unreachable code reached! The types lied! 😭 Unexpected value: ${x}`) }; -; -export const zip = (arr1: T[], arr2: U[]): [T,U][] => { +export const zip = (arr1: T[], arr2: U[]): [T, U][] => { const length = Math.min(arr1.length, arr2.length); const newArray = Array(length); for (let i = 0; i < length; i++) { @@ -12,6 +11,6 @@ export const zip = (arr1: T[], arr2: U[]): [T,U][] => { return newArray; }; -export const crossProduct = (arr1: T[], arr2: U[]): [T,U][] => { - return arr1.flatMap(a1 => arr2.map(a2 => [a1, a2]) as [T,U][]); +export const crossProduct = (arr1: T[], arr2: U[]): [T, U][] => { + return arr1.flatMap(a1 => arr2.map(a2 => [a1, a2]) as [T, U][]); }; diff --git a/server/src-dc-api/Hasura/Backends/DataConnector/API.hs b/server/src-dc-api/Hasura/Backends/DataConnector/API.hs index 0d7d913d958..531dc7cda48 100644 --- a/server/src-dc-api/Hasura/Backends/DataConnector/API.hs +++ b/server/src-dc-api/Hasura/Backends/DataConnector/API.hs @@ -7,13 +7,12 @@ module Hasura.Backends.DataConnector.API ConfigHeader, SourceNameHeader, SourceName, - openApiSchemaJson, + openApiSchema, Routes (..), apiClient, ) where -import Data.Aeson qualified as J import Data.Data (Proxy (..)) import Data.OpenApi (OpenApi) import Data.Text (Text) @@ -22,7 +21,6 @@ import Servant.API import Servant.API.Generic import Servant.Client (Client, ClientM, client) import Servant.OpenApi -import Prelude -------------------------------------------------------------------------------- -- Servant Routes @@ -68,13 +66,6 @@ type Api = CapabilitiesApi :<|> SchemaApi :<|> QueryApi openApiSchema :: OpenApi openApiSchema = toOpenApi (Proxy @Api) --- | The OpenAPI 3.0 schema for the API --- --- This is not exposed as the 'OpenApi' type because we need to do some hackery in --- the serialized JSON to work around some limitations in the openapi3 library -openApiSchemaJson :: J.Value -openApiSchemaJson = V0.fixExternalSchemaRefsInComponentSchemas $ J.toJSON openApiSchema - apiClient :: Client ClientM (NamedRoutes Routes) apiClient = client (Proxy @(NamedRoutes Routes)) diff --git a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Capabilities.hs b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Capabilities.hs index 9e60ce6c064..8737668f95a 100644 --- a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Capabilities.hs +++ b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Capabilities.hs @@ -22,7 +22,7 @@ import Data.Aeson (FromJSON, ToJSON) import Data.Data (Data, Proxy (..)) import Data.HashMap.Strict.InsOrd qualified as InsOrdHashMap import Data.Hashable (Hashable) -import Data.OpenApi (NamedSchema (..), OpenApiType (OpenApiObject), Referenced (..), Schema (..), ToSchema (..)) +import Data.OpenApi (NamedSchema (..), OpenApiType (OpenApiObject), Schema (..), ToSchema (..), declareSchemaRef) import GHC.Generics (Generic) import Hasura.Backends.DataConnector.API.V0.ConfigSchema (ConfigSchemaResponse) import Prelude @@ -137,8 +137,8 @@ instance HasCodec CapabilitiesResponse where instance ToSchema CapabilitiesResponse where declareNamedSchema _ = do - capabilitiesSchema <- declareNamedSchema (Proxy @Capabilities) - configSchemasSchema <- declareNamedSchema (Proxy @ConfigSchemaResponse) + capabilitiesSchemaRef <- declareSchemaRef (Proxy @Capabilities) + configSchemasSchemaRef <- declareSchemaRef (Proxy @ConfigSchemaResponse) let schema = mempty { _schemaType = Just OpenApiObject, @@ -146,8 +146,8 @@ instance ToSchema CapabilitiesResponse where _schemaRequired = ["capabilities", "configSchemas"], _schemaProperties = InsOrdHashMap.fromList - [ ("capabilities", Inline $ _namedSchemaSchema capabilitiesSchema), - ("configSchemas", Inline $ _namedSchemaSchema configSchemasSchema) + [ ("capabilities", capabilitiesSchemaRef), + ("configSchemas", configSchemasSchemaRef) ] } diff --git a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/ConfigSchema.hs b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/ConfigSchema.hs index 2aa67d8dedf..da14c94aa37 100644 --- a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/ConfigSchema.hs +++ b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/ConfigSchema.hs @@ -4,8 +4,6 @@ module Hasura.Backends.DataConnector.API.V0.ConfigSchema ( Config (..), ConfigSchemaResponse (..), validateConfigAgainstConfigSchema, - fixExternalSchemaRefsInComponentSchemas, - fixExternalSchemaRefsInSchema, ) where @@ -20,8 +18,9 @@ import Data.ByteString.Lazy qualified as BSL import Data.HashMap.Strict.InsOrd qualified as InsOrdHashMap import Data.Hashable (Hashable) import Data.Maybe (fromMaybe) -import Data.OpenApi (AdditionalProperties (..), Definitions, NamedSchema (..), OpenApiType (..), Reference (..), Referenced (..), Schema (..), ToParamSchema (..), ToSchema (..), ValidationError) +import Data.OpenApi (AdditionalProperties (..), Definitions, NamedSchema (..), OpenApiItems (..), OpenApiType (..), Reference (..), Referenced (..), Schema (..), ToParamSchema (..), ToSchema (..), ValidationError) import Data.OpenApi qualified as OpenApi +import Data.OpenApi.Declare (Declare, MonadDeclare (..)) import Data.Text (Text) import Data.Text qualified as Text import Data.Text.Encoding qualified as Text @@ -75,33 +74,184 @@ instance Autodocodec.HasCodec ConfigSchemaResponse where codec = Autodocodec.codecViaAeson "Configuration schemas" instance ToSchema ConfigSchemaResponse where - declareNamedSchema _ = + declareNamedSchema _ = do + openApiSchemaRef <- declareOpenApiSchema + let otherSchemasSchema = + mempty + { _schemaType = Just OpenApiObject, + _schemaNullable = Just False, + _schemaAdditionalProperties = Just $ AdditionalPropertiesSchema openApiSchemaRef + } + let schema = + mempty + { _schemaType = Just OpenApiObject, + _schemaNullable = Just False, + _schemaRequired = ["configSchema", "otherSchemas"], + _schemaProperties = + InsOrdHashMap.fromList + [ ("configSchema", openApiSchemaRef), + ("otherSchemas", Inline otherSchemasSchema) + ] + } pure $ NamedSchema (Just "ConfigSchemaResponse") schema - where - schema :: Schema - schema = + +-- | Declares the schema for the OpenAPI Schema type (and its dependent types) and +-- returns a reference that can be used to refer to it from other schemas. +-- +-- This is a transcription of the schemas defined here: +-- https://raw.githubusercontent.com/OAI/OpenAPI-Specification/80c781e479f85ac67001ceb3e7e410e25d2a561b/schemas/v3.0/schema.json#/definitions/Schema +-- +-- Unfortunately using external references to the above schema tends to make many +-- OpenAPI type generators choke, so importing the relevant schemas into our spec +-- is a pragmatic workaround. +declareOpenApiSchema :: Declare (Definitions Schema) (Referenced Schema) +declareOpenApiSchema = do + declare $ + InsOrdHashMap.fromList + [ openApiSchema, + openApiReference, + openApiDiscriminator, + openApiExternalDocumentation, + openApiXml + ] + pure . Ref $ Reference "OpenApiSchema" + where + openApiSchema :: (Text, Schema) + openApiSchema = + ("OpenApiSchema",) mempty { _schemaType = Just OpenApiObject, - _schemaNullable = Just False, - _schemaRequired = ["configSchema", "otherSchemas"], _schemaProperties = InsOrdHashMap.fromList - [ ("configSchema", openApiSchemaSchema), - ("otherSchemas", Inline otherSchemasSchema) + [ ("title", Inline mempty {_schemaType = Just OpenApiString}), + ("multipleOf", Inline mempty {_schemaType = Just OpenApiNumber, _schemaMinimum = Just 0, _schemaExclusiveMinimum = Just True}), + ("maximum", Inline mempty {_schemaType = Just OpenApiNumber}), + ("exclusiveMaximum", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("minimum", Inline mempty {_schemaType = Just OpenApiNumber}), + ("exclusiveMinimum", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("maxLength", Inline mempty {_schemaType = Just OpenApiInteger, _schemaMinimum = Just 0}), + ("minLength", Inline mempty {_schemaType = Just OpenApiInteger, _schemaMinimum = Just 0, _schemaDefault = Just $ Number 0}), + ("pattern", Inline mempty {_schemaType = Just OpenApiString, _schemaFormat = Just "regex"}), + ("maxItems", Inline mempty {_schemaType = Just OpenApiInteger, _schemaMinimum = Just 0}), + ("minItems", Inline mempty {_schemaType = Just OpenApiInteger, _schemaMinimum = Just 0, _schemaDefault = Just $ Number 0}), + ("uniqueItems", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("maxProperties", Inline mempty {_schemaType = Just OpenApiInteger, _schemaMinimum = Just 0}), + ("minProperties", Inline mempty {_schemaType = Just OpenApiInteger, _schemaMinimum = Just 0, _schemaDefault = Just $ Number 0}), + ( "required", + Inline + mempty + { _schemaType = Just OpenApiArray, + _schemaItems = Just . OpenApiItemsObject $ Inline mempty {_schemaType = Just OpenApiString}, + _schemaMinItems = Just 1, + _schemaUniqueItems = Just True + } + ), + ( "enum", + Inline + mempty + { _schemaType = Just OpenApiArray, + _schemaItems = Just . OpenApiItemsObject $ Inline mempty, + _schemaMinItems = Just 1, + _schemaUniqueItems = Just False + } + ), + ("type", Inline mempty {_schemaType = Just OpenApiString, _schemaEnum = Just ["array", "boolean", "integer", "number", "object", "string"]}), + ("not", Inline mempty {_schemaOneOf = Just schemaOrReference}), + ("allOf", Inline mempty {_schemaType = Just OpenApiArray, _schemaItems = Just . OpenApiItemsObject $ Inline mempty {_schemaOneOf = Just schemaOrReference}}), + ("oneOf", Inline mempty {_schemaType = Just OpenApiArray, _schemaItems = Just . OpenApiItemsObject $ Inline mempty {_schemaOneOf = Just schemaOrReference}}), + ("anyOf", Inline mempty {_schemaType = Just OpenApiArray, _schemaItems = Just . OpenApiItemsObject $ Inline mempty {_schemaOneOf = Just schemaOrReference}}), + ("items", Inline mempty {_schemaOneOf = Just schemaOrReference}), + ("properties", Inline mempty {_schemaType = Just OpenApiObject, _schemaAdditionalProperties = Just . AdditionalPropertiesSchema $ Inline mempty {_schemaOneOf = Just schemaOrReference}}), + ( "additionalProperties", + Inline + mempty + { _schemaAdditionalProperties = Just . AdditionalPropertiesSchema $ Inline mempty {_schemaOneOf = Just $ schemaOrReference <> [Inline mempty {_schemaType = Just OpenApiBoolean}]}, + _schemaDefault = Just $ Bool True + } + ), + ("description", Inline mempty {_schemaType = Just OpenApiString}), + ("format", Inline mempty {_schemaType = Just OpenApiString}), + ("default", Inline mempty), + ("nullable", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("discriminator", Ref . Reference $ fst openApiDiscriminator), + ("readOnly", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("writeOnly", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("example", Inline mempty), + ("externalDocs", Ref . Reference $ fst openApiExternalDocumentation), + ("deprecated", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("xml", Ref . Reference $ fst openApiXml) + ], + -- Note: Technically OpenAPI schemas should be able to define extension properties but since OpenAPI itself doesn't + -- support defining patternProperties, I can't define them here. 😢 + -- "patternProperties": { "^x-": {} } + -- _schemaPatternProperties = + _schemaAdditionalProperties = Just $ AdditionalPropertiesAllowed False + } + + openApiReference :: (Text, Schema) + openApiReference = + ("OpenApiReference",) + mempty + { _schemaType = Just OpenApiObject, + _schemaRequired = ["$ref"], + -- Note: This is technically defined using "patternProperties" with the property name regex ^\$ref$ + -- but OpenAPI doesn't support patternProperties ironically, so this is close enough + _schemaProperties = InsOrdHashMap.fromList [("$ref", Inline mempty {_schemaType = Just OpenApiString, _schemaFormat = Just "uri-reference"})] + } + + schemaOrReference :: [Referenced Schema] + schemaOrReference = [Ref . Reference $ fst openApiSchema, Ref . Reference $ fst openApiReference] + + openApiDiscriminator :: (Text, Schema) + openApiDiscriminator = + ("OpenApiDiscriminator",) + mempty + { _schemaType = Just OpenApiObject, + _schemaRequired = ["propertyName"], + _schemaProperties = + InsOrdHashMap.fromList + [ ("propertyName", Inline mempty {_schemaType = Just OpenApiString}), + ("mapping", Inline mempty {_schemaType = Just OpenApiObject, _schemaAdditionalProperties = Just . AdditionalPropertiesSchema $ Inline mempty {_schemaType = Just OpenApiString}}) ] } - otherSchemasSchema :: Schema - otherSchemasSchema = + openApiExternalDocumentation :: (Text, Schema) + openApiExternalDocumentation = + ("OpenApiExternalDocumentation",) mempty { _schemaType = Just OpenApiObject, - _schemaNullable = Just False, - _schemaAdditionalProperties = Just $ AdditionalPropertiesSchema openApiSchemaSchema + _schemaRequired = ["url"], + _schemaProperties = + InsOrdHashMap.fromList + [ ("description", Inline mempty {_schemaType = Just OpenApiString}), + ("url", Inline mempty {_schemaType = Just OpenApiString, _schemaFormat = Just "uri-reference"}) + ], + -- Note: Technically external docs should be able to define extension properties but since OpenAPI itself doesn't + -- support defining patternProperties, I can't define them here. 😢 + -- "patternProperties": { "^x-": {} } + -- _schemaPatternProperties = + _schemaAdditionalProperties = Just $ AdditionalPropertiesAllowed False } - openApiSchemaSchema :: Referenced Schema - openApiSchemaSchema = - Ref (Reference "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/80c781e479f85ac67001ceb3e7e410e25d2a561b/schemas/v3.0/schema.json#/definitions/Schema") + openApiXml :: (Text, Schema) + openApiXml = + ("OpenApiXml",) + mempty + { _schemaType = Just OpenApiObject, + _schemaProperties = + InsOrdHashMap.fromList + [ ("name", Inline mempty {_schemaType = Just OpenApiString}), + ("namespace", Inline mempty {_schemaType = Just OpenApiString, _schemaFormat = Just "uri"}), + ("prefix", Inline mempty {_schemaType = Just OpenApiString}), + ("attribute", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}), + ("wrapped", Inline mempty {_schemaType = Just OpenApiBoolean, _schemaDefault = Just $ Bool False}) + ], + -- Note: Technically XML should be able to define extension properties but since OpenAPI itself doesn't + -- support defining patternProperties, I can't define them here. 😢 + -- "patternProperties": { "^x-": {} } + -- _schemaPatternProperties = + _schemaAdditionalProperties = Just $ AdditionalPropertiesAllowed False + } -- | Rewrites the config schema internal refs to the form that openapi3 expects when it deserialized them -- @@ -157,26 +307,3 @@ rewriteSchemaRefs rewriteRefText schemaObj = validateConfigAgainstConfigSchema :: ConfigSchemaResponse -> Config -> [ValidationError] validateConfigAgainstConfigSchema ConfigSchemaResponse {..} (Config config) = OpenApi.validateJSON _csrOtherSchemas _csrConfigSchema (Object config) - --- | Fixes any refs in schemas that are external refs to an http-based URL. --- Note that this is limited to schemas in the components/schemas section. --- This is used to specifically address the external refs defined by the --- OpenAPI schema spec of the 'ConfigSchemaResponse' type. --- --- This works around a limitation in the openapi3 library where it does not --- understand the concept of external refs and will always assume any defined --- ref refers to a schema inside the top level OpenApi document itself. --- Practically, this means that #/components/schemas/ gets mashed onto the --- front of any external ref :( -fixExternalSchemaRefsInComponentSchemas :: Value -> Value -fixExternalSchemaRefsInComponentSchemas openApiObj = - openApiObj - & key "components" . key "schemas" . members %~ fixExternalSchemaRefsInSchema - -fixExternalSchemaRefsInSchema :: Value -> Value -fixExternalSchemaRefsInSchema = rewriteSchemaRefs fixExternalHttpSchemaRef - -fixExternalHttpSchemaRef :: Text -> Text -fixExternalHttpSchemaRef = \case - (Text.stripPrefix "#/components/schemas/http" -> Just suffix) -> "http" <> suffix - other -> other diff --git a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Query.hs b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Query.hs index d30aeba8c07..df344a62fe5 100644 --- a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Query.hs +++ b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Query.hs @@ -113,7 +113,10 @@ deriving via Autodocodec Field instance ToSchema Field -- endpoint encoded as a list of JSON objects. newtype QueryResponse = QueryResponse {getQueryResponse :: [Object]} deriving newtype (Eq, Ord, Show, NFData) - deriving (ToJSON, FromJSON, ToSchema) via Autodocodec [Object] + deriving (ToJSON, FromJSON, ToSchema) via Autodocodec QueryResponse + +instance HasCodec QueryResponse where + codec = named "QueryResponse" $ dimapCodec QueryResponse getQueryResponse codec $(makeLenses ''QueryRequest) $(makeLenses ''Query) diff --git a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Scalar/Type.hs b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Scalar/Type.hs index b9295cd1c63..a1681859666 100644 --- a/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Scalar/Type.hs +++ b/server/src-dc-api/Hasura/Backends/DataConnector/API/V0/Scalar/Type.hs @@ -31,5 +31,5 @@ data Type instance HasCodec Type where codec = - named "Type" $ + named "ScalarType" $ disjointStringConstCodec [(StringTy, "string"), (NumberTy, "number"), (BoolTy, "bool")] diff --git a/server/src-lib/Hasura/Server/App.hs b/server/src-lib/Hasura/Server/App.hs index 76de349308f..35b5ebadaa9 100644 --- a/server/src-lib/Hasura/Server/App.hs +++ b/server/src-lib/Hasura/Server/App.hs @@ -42,7 +42,7 @@ import Data.Text.Extended import Data.Text.Lazy qualified as LT import Data.Text.Lazy.Encoding qualified as TL import GHC.Stats.Extended qualified as RTS -import Hasura.Backends.DataConnector.API (openApiSchemaJson) +import Hasura.Backends.DataConnector.API (openApiSchema) import Hasura.Backends.Postgres.Execute.Types import Hasura.Base.Error import Hasura.EncJSON @@ -1078,7 +1078,7 @@ httpApp setupHook corsCfg serverCtx enableConsole consoleAssetsDir enableTelemet spockAction encodeQErr id $ mkGetHandler $ do onlyAdmin - return (emptyHttpLogMetadata @m, JSONResp $ HttpResponse (encJFromJValue openApiSchemaJson) []) + return (emptyHttpLogMetadata @m, JSONResp $ HttpResponse (encJFromJValue openApiSchema) []) Spock.get "api/swagger/json" $ spockAction encodeQErr id $ mkGetHandler $ do diff --git a/server/src-test/Hasura/Backends/DataConnector/API/V0/ConfigSchemaSpec.hs b/server/src-test/Hasura/Backends/DataConnector/API/V0/ConfigSchemaSpec.hs index e6722d095fa..fc1186486d0 100644 --- a/server/src-test/Hasura/Backends/DataConnector/API/V0/ConfigSchemaSpec.hs +++ b/server/src-test/Hasura/Backends/DataConnector/API/V0/ConfigSchemaSpec.hs @@ -65,8 +65,8 @@ spec = do |] testToFromJSON val jsonVal - it "produces the correct OpenAPI Spec once external schema refs are fixed up" $ - fixExternalSchemaRefsInSchema (toJSON $ toSchema (Proxy @ConfigSchemaResponse)) + it "OpenAPI spec is as expected" $ + toJSON (toSchema (Proxy @ConfigSchemaResponse)) `shouldBe` [aesonQQ| { "required": [ @@ -77,11 +77,11 @@ spec = do "nullable": false, "properties": { "configSchema": { - "$ref": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/80c781e479f85ac67001ceb3e7e410e25d2a561b/schemas/v3.0/schema.json#/definitions/Schema" + "$ref": "#/components/schemas/OpenApiSchema" }, "otherSchemas": { "additionalProperties": { - "$ref": "https://raw.githubusercontent.com/OAI/OpenAPI-Specification/80c781e479f85ac67001ceb3e7e410e25d2a561b/schemas/v3.0/schema.json#/definitions/Schema" + "$ref": "#/components/schemas/OpenApiSchema" }, "type": "object", "nullable": false diff --git a/server/tests-dc-api/Main.hs b/server/tests-dc-api/Main.hs index 3ecc986579c..71968e9fdb5 100644 --- a/server/tests-dc-api/Main.hs +++ b/server/tests-dc-api/Main.hs @@ -6,7 +6,7 @@ import Control.Monad ((>=>)) import Data.Aeson.Text (encodeToLazyText) import Data.Proxy (Proxy (..)) import Data.Text.Lazy.IO qualified as Text -import Hasura.Backends.DataConnector.API (Routes (..), apiClient, openApiSchemaJson) +import Hasura.Backends.DataConnector.API (Routes (..), apiClient, openApiSchema) import Hasura.Backends.DataConnector.API qualified as API import Network.HTTP.Client (defaultManagerSettings, newManager) import Servant.API (NamedRoutes) @@ -38,7 +38,7 @@ main = do agentCapabilities <- getAgentCapabilities api _toAgentCapabilities runSpec (tests api testSourceName _toAgentConfig agentCapabilities) (applyTestConfig defaultConfig testOptions) >>= evaluateSummary ExportOpenAPISpec -> - Text.putStrLn $ encodeToLazyText openApiSchemaJson + Text.putStrLn $ encodeToLazyText openApiSchema pure () diff --git a/server/tests-hspec/Harness/Backend/DataConnector.hs b/server/tests-hspec/Harness/Backend/DataConnector.hs index f3614cc62a2..3fb46c9d135 100644 --- a/server/tests-hspec/Harness/Backend/DataConnector.hs +++ b/server/tests-hspec/Harness/Backend/DataConnector.hs @@ -27,6 +27,7 @@ import Data.Aeson qualified as Aeson import Data.IORef qualified as I import Harness.Backend.DataConnector.MockAgent import Harness.GraphqlEngine qualified as GraphqlEngine +import Harness.Http (healthCheck) import Harness.Quoter.Yaml (shouldReturnYaml, yaml) import Harness.Test.Context (BackendType (DataConnector), Options, defaultBackendTypeString) import Harness.TestEnvironment (TestEnvironment) @@ -48,10 +49,11 @@ dataconnector: mockBackendConfig :: Aeson.Value mockBackendConfig = let backendType = defaultBackendTypeString $ DataConnector + agentUri = "http://127.0.0.1:" <> show mockAgentPort <> "/" in [yaml| dataconnector: *backendType: - uri: "http://127.0.0.1:65006/" + uri: *agentUri |] -------------------------------------------------------------------------------- @@ -114,6 +116,7 @@ mkLocalTestEnvironmentMock _ = do maeConfig <- I.newIORef chinookMock maeQuery <- I.newIORef Nothing maeThreadId <- forkIO $ runMockServer maeConfig maeQuery + healthCheck $ "http://127.0.0.1:" <> show mockAgentPort <> "/healthz" pure $ MockAgentEnvironment {..} -- | Load the agent schema into HGE. diff --git a/server/tests-hspec/Harness/Backend/DataConnector/MockAgent.hs b/server/tests-hspec/Harness/Backend/DataConnector/MockAgent.hs index 0715c504058..87846a64f8c 100644 --- a/server/tests-hspec/Harness/Backend/DataConnector/MockAgent.hs +++ b/server/tests-hspec/Harness/Backend/DataConnector/MockAgent.hs @@ -1,6 +1,7 @@ module Harness.Backend.DataConnector.MockAgent ( MockConfig (..), chinookMock, + mockAgentPort, runMockServer, ) where @@ -220,12 +221,22 @@ mockQueryHandler :: I.IORef MockConfig -> I.IORef (Maybe API.QueryRequest) -> AP mockQueryHandler mcfg mquery _sourceName _cfg query = liftIO $ do handler <- fmap _queryResponse $ I.readIORef mcfg I.writeIORef mquery (Just query) - pure $ handler (error "WTF DUDE") + pure $ handler query -dcMockableServer :: I.IORef MockConfig -> I.IORef (Maybe API.QueryRequest) -> Server API.Api -dcMockableServer mcfg mquery = mockCapabilitiesHandler mcfg :<|> mockSchemaHandler mcfg :<|> mockQueryHandler mcfg mquery +type HealthcheckApi = + "healthz" + :> Get '[JSON] () + +healthcheckHandler :: Handler () +healthcheckHandler = pure () + +dcMockableServer :: I.IORef MockConfig -> I.IORef (Maybe API.QueryRequest) -> Server (API.Api :<|> HealthcheckApi) +dcMockableServer mcfg mquery = (mockCapabilitiesHandler mcfg :<|> mockSchemaHandler mcfg :<|> mockQueryHandler mcfg mquery) :<|> healthcheckHandler + +mockAgentPort :: Warp.Port +mockAgentPort = 65006 runMockServer :: I.IORef MockConfig -> I.IORef (Maybe API.QueryRequest) -> IO () runMockServer mcfg mquery = do - let app = serve (Proxy :: Proxy API.Api) $ dcMockableServer mcfg mquery - Warp.run 65006 app + let app = serve (Proxy :: Proxy (API.Api :<|> HealthcheckApi)) $ dcMockableServer mcfg mquery + Warp.run mockAgentPort app