diff --git a/.eslintignore b/.eslintignore index 8ee5d6f0..747d65dc 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,12 +1,13 @@ !.alexrc.js -# api subpackage -packages/api/coverage/ -packages/api/dist/ +packages/**/coverage/ +packages/**/dist/ + +# api packages/api/test/__fixtures__/sdk/ -# httpsnippet-client-api subpackage -packages/httpsnippet-client-api/coverage/ -packages/httpsnippet-client-api/dist/ -packages/httpsnippet-client-api/node_modules/ +# httpsnippet-client-api packages/httpsnippet-client-api/test/__datasets__/**/output.js + +# test-utils +packages/test-utils/fixtures/ diff --git a/.prettierignore b/.prettierignore index 36c0b186..0513a70c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,17 +1,11 @@ CHANGELOG.md +packages/**/coverage/ +packages/**/dist/ -# api subpackage +# api packages/api/.api/ -packages/api/coverage/ -packages/api/.eslint* -packages/api/.gitignore -packages/api/.prettier* -packages/api/CHANGELOG.md -packages/api/dist/ packages/api/example.js packages/api/test/__fixtures__/sdk/ -# httpsnippet-client-api subpackage -packages/httpsnippet-client-api/coverage/ -packages/httpsnippet-client-api/dist/ +# httpsnippet-client-api packages/httpsnippet-client-api/test/__datasets__/**/output.js diff --git a/package-lock.json b/package-lock.json index d0ba0787..bab992c5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,6 +44,14 @@ "node": ">=6.0.0" } }, + "node_modules/@api/core": { + "resolved": "packages/core", + "link": true + }, + "node_modules/@api/test-utils": { + "resolved": "packages/test-utils", + "link": true + }, "node_modules/@apidevtools/openapi-schemas": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz", @@ -984,12 +992,10 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" ], - "peer": true, "engines": { "node": ">=12" } @@ -1001,12 +1007,10 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" ], - "peer": true, "engines": { "node": ">=12" } @@ -1018,12 +1022,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" ], - "peer": true, "engines": { "node": ">=12" } @@ -1035,12 +1037,10 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=12" } @@ -1052,12 +1052,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" ], - "peer": true, "engines": { "node": ">=12" } @@ -1069,12 +1067,10 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -1086,12 +1082,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -1103,12 +1097,10 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1120,12 +1112,10 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1137,12 +1127,10 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1154,12 +1142,10 @@ "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1171,12 +1157,10 @@ "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1188,12 +1172,10 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1205,12 +1187,10 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1222,12 +1202,10 @@ "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1239,12 +1217,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" ], - "peer": true, "engines": { "node": ">=12" } @@ -1256,12 +1232,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -1273,12 +1247,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" ], - "peer": true, "engines": { "node": ">=12" } @@ -1290,12 +1262,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" ], - "peer": true, "engines": { "node": ">=12" } @@ -1307,12 +1277,10 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" ], - "peer": true, "engines": { "node": ">=12" } @@ -1324,12 +1292,10 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" ], - "peer": true, "engines": { "node": ">=12" } @@ -1341,12 +1307,10 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" ], - "peer": true, "engines": { "node": ">=12" } @@ -1914,7 +1878,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", - "dev": true, "dependencies": { "@sinclair/typebox": "^0.27.8" }, @@ -3243,6 +3206,11 @@ "prettier": "^3.0.0" } }, + "node_modules/@readme/http-status-codes": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@readme/http-status-codes/-/http-status-codes-7.2.0.tgz", + "integrity": "sha512-/dBh9qw3QhJYqlGwt2I+KUP/lQ6nytdCx3aq+GpMUhibLHF3O7fwoowNcTwlbnwtyJ+TJYTIIrp3oVUlRNx3fA==" + }, "node_modules/@readme/httpsnippet": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/@readme/httpsnippet/-/httpsnippet-4.0.3.tgz", @@ -3289,13 +3257,13 @@ } }, "node_modules/@readme/oas-to-har": { - "version": "20.0.2", - "resolved": "https://registry.npmjs.org/@readme/oas-to-har/-/oas-to-har-20.0.2.tgz", - "integrity": "sha512-yJ9IhEvb/UkleBYw+Br8/JlpHIKQC7EqW0BoFsXXxxbM6CQ19B2gcs2fFbNbV+hz4qXfaXZnXDw0b7KXjns3Sw==", + "version": "20.1.1", + "resolved": "https://registry.npmjs.org/@readme/oas-to-har/-/oas-to-har-20.1.1.tgz", + "integrity": "sha512-rz8YpdZw+Jqrd8VQhQaYrzctkCAYdBldoQ5qDQyF9vGvq2lpA1yMvQPgKCJXfPGXH8Cm+NjLbunxnYabKQeKeA==", "dependencies": { "@readme/data-urls": "^1.0.1", "@readme/oas-extensions": "^17.0.1", - "oas": "^20.3.0", + "oas": "^20.5.0", "qs": "^6.10.5", "remove-undefined-objects": "^2.0.2" }, @@ -3303,6 +3271,14 @@ "node": ">=14" } }, + "node_modules/@readme/oas-to-har/node_modules/remove-undefined-objects": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/remove-undefined-objects/-/remove-undefined-objects-2.0.2.tgz", + "integrity": "sha512-b6x4MUtR4YBW1aCoGx3tE4mA2PFjiXSmtSdNmLexQzUdZa4ybnJAItXLKpkcVgCUJIzJtk2DFG402sMSEMlonQ==", + "engines": { + "node": ">=14" + } + }, "node_modules/@readme/openapi-parser": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/@readme/openapi-parser/-/openapi-parser-2.5.0.tgz", @@ -3357,6 +3333,22 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" }, + "node_modules/@readme/postman-to-openapi": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/@readme/postman-to-openapi/-/postman-to-openapi-4.1.0.tgz", + "integrity": "sha512-VvV2Hzjskz01m8doSn7Ypt6cSZzgjnypVqXy1ipThbyYD6SGiM74VSePXykOODj/43Y2m6zeYedPk/ZLts/HvQ==", + "dependencies": { + "@readme/http-status-codes": "^7.2.0", + "js-yaml": "^4.1.0", + "jsonc-parser": "3.2.0", + "lodash.camelcase": "^4.3.0", + "marked": "^4.3.0", + "mustache": "^4.2.0" + }, + "engines": { + "node": ">=14" + } + }, "node_modules/@sigstore/bundle": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@sigstore/bundle/-/bundle-1.1.0.tgz", @@ -3408,8 +3400,7 @@ "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", - "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", - "dev": true + "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==" }, "node_modules/@sindresorhus/is": { "version": "5.3.0", @@ -3671,14 +3662,12 @@ "node_modules/@types/chai": { "version": "4.3.5", "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.5.tgz", - "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==", - "dev": true + "integrity": "sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==" }, "node_modules/@types/chai-subset": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/@types/chai-subset/-/chai-subset-1.3.3.tgz", "integrity": "sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==", - "dev": true, "dependencies": { "@types/chai": "*" } @@ -3894,8 +3883,7 @@ "node_modules/@types/node": { "version": "18.11.9", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.9.tgz", - "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==", - "dev": true + "integrity": "sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==" }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -4331,7 +4319,6 @@ "version": "0.34.4", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-0.34.4.tgz", "integrity": "sha512-XlMKX8HyYUqB8dsY8Xxrc64J2Qs9pKMt2Z8vFTL4mBWXJsg4yoALHzJfDWi8h5nkO4Zua4zjqtapQ/IluVkSnA==", - "dev": true, "dependencies": { "@vitest/spy": "0.34.4", "@vitest/utils": "0.34.4", @@ -4345,7 +4332,6 @@ "version": "0.34.4", "resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-0.34.4.tgz", "integrity": "sha512-hwwdB1StERqUls8oV8YcpmTIpVeJMe4WgYuDongVzixl5hlYLT2G8afhcdADeDeqCaAmZcSgLTLtqkjPQF7x+w==", - "dev": true, "dependencies": { "@vitest/utils": "0.34.4", "p-limit": "^4.0.0", @@ -4359,7 +4345,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", - "dev": true, "dependencies": { "yocto-queue": "^1.0.0" }, @@ -4374,7 +4359,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.0.0.tgz", "integrity": "sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==", - "dev": true, "engines": { "node": ">=12.20" }, @@ -4386,7 +4370,6 @@ "version": "0.34.4", "resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-0.34.4.tgz", "integrity": "sha512-GCsh4coc3YUSL/o+BPUo7lHQbzpdttTxL6f4q0jRx2qVGoYz/cyTRDJHbnwks6TILi6560bVWoBpYC10PuTLHw==", - "dev": true, "dependencies": { "magic-string": "^0.30.1", "pathe": "^1.1.1", @@ -4400,7 +4383,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, "engines": { "node": ">=10" }, @@ -4412,7 +4394,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", - "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -4425,14 +4406,12 @@ "node_modules/@vitest/snapshot/node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, "node_modules/@vitest/spy": { "version": "0.34.4", "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-0.34.4.tgz", "integrity": "sha512-PNU+fd7DUPgA3Ya924b1qKuQkonAW6hL7YUjkON3wmBwSTIlhOSpy04SJ0NrRsEbrXgMMj6Morh04BMf8k+w0g==", - "dev": true, "dependencies": { "tinyspy": "^2.1.1" }, @@ -4444,7 +4423,6 @@ "version": "0.34.4", "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-0.34.4.tgz", "integrity": "sha512-yR2+5CHhp/K4ySY0Qtd+CAL9f5Yh1aXrKfAT42bq6CtlGPh92jIDDDSg7ydlRow1CP+dys4TrOrbELOyNInHSg==", - "dev": true, "dependencies": { "diff-sequences": "^29.4.3", "loupe": "^2.3.6", @@ -4458,7 +4436,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", - "dev": true, "engines": { "node": ">=10" }, @@ -4470,7 +4447,6 @@ "version": "29.6.3", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.6.3.tgz", "integrity": "sha512-ZsBgjVhFAj5KeK+nHfF1305/By3lechHQSMWCTl8iHSbfOm2TN5nHEtFc/+W7fAyUeCs2n5iow72gld4gW0xDw==", - "dev": true, "dependencies": { "@jest/schemas": "^29.6.3", "ansi-styles": "^5.0.0", @@ -4483,8 +4459,7 @@ "node_modules/@vitest/utils/node_modules/react-is": { "version": "18.2.0", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz", - "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", - "dev": true + "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==" }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", @@ -4552,7 +4527,6 @@ "version": "8.10.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", - "dev": true, "bin": { "acorn": "bin/acorn" }, @@ -4573,7 +4547,6 @@ "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, "engines": { "node": ">=0.4.0" } @@ -5347,7 +5320,6 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true, "engines": { "node": "*" } @@ -5869,7 +5841,6 @@ "version": "6.7.14", "resolved": "https://registry.npmjs.org/cac/-/cac-6.7.14.tgz", "integrity": "sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==", - "dev": true, "engines": { "node": ">=8" } @@ -6073,7 +6044,6 @@ "version": "4.3.8", "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.8.tgz", "integrity": "sha512-vX4YvVVtxlfSZ2VecZgFUTU5qPCYsobVI2O9FmwEXBhDigYGQA6jRXCycIs1yJnnWbZ6/+a2zNIF5DfVCcJBFQ==", - "dev": true, "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", @@ -6163,7 +6133,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", "integrity": "sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==", - "dev": true, "engines": { "node": "*" } @@ -7048,7 +7017,6 @@ "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, "dependencies": { "ms": "2.1.2" }, @@ -7142,7 +7110,6 @@ "version": "4.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", - "dev": true, "dependencies": { "type-detect": "^4.0.0" }, @@ -7456,7 +7423,6 @@ "version": "29.4.3", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.4.3.tgz", "integrity": "sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==", - "dev": true, "engines": { "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } @@ -7834,7 +7800,6 @@ "version": "0.18.20", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", - "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -9544,7 +9509,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/formdata-to-string/-/formdata-to-string-1.0.0.tgz", "integrity": "sha512-VTseQXEHo086wgchDG6priy+GSUE6CGjdJ+02vQbDshiHZ70FmsheGfYVTF47NGMDX27zsH9tvVvcf+SENP4Rw==", - "dev": true, "dependencies": { "undici": "^5.24.0" }, @@ -9599,13 +9563,11 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ "darwin" ], - "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -9682,7 +9644,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", - "dev": true, "engines": { "node": "*" } @@ -13413,7 +13374,6 @@ "version": "0.4.3", "resolved": "https://registry.npmjs.org/local-pkg/-/local-pkg-0.4.3.tgz", "integrity": "sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==", - "dev": true, "engines": { "node": ">=14" }, @@ -13567,7 +13527,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", - "dev": true, "dependencies": { "get-func-name": "^2.0.0" } @@ -13617,7 +13576,6 @@ "version": "0.30.2", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.2.tgz", "integrity": "sha512-lNZdu7pewtq/ZvWUp9Wpf/x7WzMTsR26TWV03BRZrXFsv+BI6dy8RAiKgm1uM/kyR0rCfUcqvOlXKG66KhIGug==", - "dev": true, "dependencies": { "@jridgewell/sourcemap-codec": "^1.4.15" }, @@ -13628,8 +13586,7 @@ "node_modules/magic-string/node_modules/@jridgewell/sourcemap-codec": { "version": "1.4.15", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz", - "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==", - "dev": true + "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==" }, "node_modules/make-dir": { "version": "3.1.0", @@ -13743,9 +13700,9 @@ } }, "node_modules/marked": { - "version": "4.2.12", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.12.tgz", - "integrity": "sha512-yr8hSKa3Fv4D3jdZmtMMPghgVt6TWbk86WQaWhDloQjRSQhMMYCAro7jP7VDJrjjdV8pxVxMssXS8B8Y5DZ5aw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-4.3.0.tgz", + "integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==", "bin": { "marked": "bin/marked.js" }, @@ -15130,7 +15087,6 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.4.2.tgz", "integrity": "sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==", - "dev": true, "dependencies": { "acorn": "^8.10.0", "pathe": "^1.1.1", @@ -15159,8 +15115,7 @@ "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==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/multimatch": { "version": "5.0.0", @@ -15208,7 +15163,6 @@ "version": "3.3.6", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz", "integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==", - "dev": true, "funding": [ { "type": "github", @@ -16014,9 +15968,9 @@ } }, "node_modules/oas": { - "version": "20.4.0", - "resolved": "https://registry.npmjs.org/oas/-/oas-20.4.0.tgz", - "integrity": "sha512-vExbxQHWHdRz/7PrXK3L110/+ff8SK6Tq7N1PqBZiX5/WunoYLyjjDP0lq52RsWFfeluU+EzIAFodKacI5BMHQ==", + "version": "20.10.3", + "resolved": "https://registry.npmjs.org/oas/-/oas-20.10.3.tgz", + "integrity": "sha512-dBxDuwn2ssggPMOqEKEzT4sjCqbkol8JozuWrpwD7chcmbKbverj5vpk2kmsczeyguFkLcKUOMcqUUimf9h+IQ==", "dependencies": { "@readme/json-schema-ref-parser": "^1.2.0", "@types/json-schema": "^7.0.11", @@ -16024,9 +15978,10 @@ "jsonpath-plus": "^7.2.0", "jsonpointer": "^5.0.0", "memoizee": "^0.4.14", - "oas-normalize": "^8.3.0", - "openapi-types": "^12.1.0", - "path-to-regexp": "^6.2.0" + "oas-normalize": "^8.4.0", + "openapi-types": "^12.1.1", + "path-to-regexp": "^6.2.0", + "remove-undefined-objects": "^3.0.0" }, "engines": { "node": ">=14" @@ -16054,15 +16009,15 @@ } }, "node_modules/oas-normalize": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/oas-normalize/-/oas-normalize-8.3.2.tgz", - "integrity": "sha512-xjPRdN9l27BxaR4+LYnJo/0SMw9nMBtCQ/NPejXT5dxw+is0j05PTgVnGxm6G+QTk2Y35hND4F9lNuPKk9Zw2A==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/oas-normalize/-/oas-normalize-8.4.1.tgz", + "integrity": "sha512-cGODg+AntZteJRHBiYDWKtcO2svWGMXuFWYu2I8b4hOrNiwB3hgDs/ScX3O9mYm6RpLsUIftt6rDHGc8eYG8aA==", "dependencies": { - "@readme/openapi-parser": "^2.4.0", + "@readme/openapi-parser": "^2.5.0", + "@readme/postman-to-openapi": "^4.1.0", "js-yaml": "^4.1.0", "node-fetch": "^2.6.1", "openapi-types": "^12.1.0", - "postman-to-openapi": "^3.0.1", "swagger2openapi": "^7.0.8" }, "engines": { @@ -16288,9 +16243,9 @@ } }, "node_modules/openapi-types": { - "version": "12.1.0", - "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.0.tgz", - "integrity": "sha512-XpeCy01X6L5EpP+6Hc3jWN7rMZJ+/k1lwki/kTmWzbVhdPie3jd5O2ZtedEx8Yp58icJ0osVldLMrTB/zslQXA==" + "version": "12.1.3", + "resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz", + "integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==" }, "node_modules/optionator": { "version": "0.9.3", @@ -16832,14 +16787,12 @@ "node_modules/pathe": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathe/-/pathe-1.1.1.tgz", - "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==", - "dev": true + "integrity": "sha512-d+RQGp0MAYTIaDBIMmOfMwz3E+LOZnxx1HZd5R18mmCZY0QBlK0LDZfPc8FW8Ed2DlvsuE6PRjroDY+wg4+j/Q==" }, "node_modules/pathval": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true, "engines": { "node": "*" } @@ -16855,8 +16808,7 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -16960,7 +16912,6 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.0.3.tgz", "integrity": "sha512-nN7pYi0AQqJnoLPC9eHFQ8AcyaixBUOwvqc5TDnIKCMEE6I0y8P7OKA7fPexsXGCGxQDl/cmrLAp26LhcwxZ4A==", - "dev": true, "dependencies": { "jsonc-parser": "^3.2.0", "mlly": "^1.2.0", @@ -16980,7 +16931,6 @@ "version": "8.4.29", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.29.tgz", "integrity": "sha512-cbI+jaqIeu/VGqXEarWkRCCffhjgXc0qjBtXpqJhTBohMUjUQnbBr0xqX3vEKudc4iviTewcJo5ajcec5+wdJw==", - "dev": true, "funding": [ { "type": "opencollective", @@ -17004,33 +16954,6 @@ "node": "^10 || ^12 || >=14" } }, - "node_modules/postman-to-openapi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/postman-to-openapi/-/postman-to-openapi-3.0.1.tgz", - "integrity": "sha512-OUenC7fi5moe41nhO0yUj8jqVj6tchLCjPxG2d28Ai//Oujt3lL7tiFCL2P6pKUV1a7p5X/BJh7op65jjbrs3Q==", - "dependencies": { - "commander": "^8.3.0", - "js-yaml": "^4.1.0", - "jsonc-parser": "3.2.0", - "lodash.camelcase": "^4.3.0", - "marked": "^4.2.5", - "mustache": "^4.2.0" - }, - "bin": { - "p2o": "bin/cli.js" - }, - "engines": { - "node": ">=14 <20" - } - }, - "node_modules/postman-to-openapi/node_modules/commander": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", - "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", - "engines": { - "node": ">= 12" - } - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -17261,9 +17184,9 @@ "peer": true }, "node_modules/qs": { - "version": "6.11.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", - "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "version": "6.11.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", + "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", "dependencies": { "side-channel": "^1.0.4" }, @@ -17900,11 +17823,11 @@ } }, "node_modules/remove-undefined-objects": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/remove-undefined-objects/-/remove-undefined-objects-2.0.2.tgz", - "integrity": "sha512-b6x4MUtR4YBW1aCoGx3tE4mA2PFjiXSmtSdNmLexQzUdZa4ybnJAItXLKpkcVgCUJIzJtk2DFG402sMSEMlonQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/remove-undefined-objects/-/remove-undefined-objects-3.0.0.tgz", + "integrity": "sha512-nxG1yYfc/Jxi+bNCBiqKhxVJPE+QvziIOKbD+Dxc93Uisz92v/ZYpo4WR0TJuf+dk2xE8lW2WPJsA3mDFzXy8w==", "engines": { - "node": ">=14" + "node": ">=16" } }, "node_modules/require-directory": { @@ -18130,7 +18053,6 @@ "version": "3.29.0", "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.0.tgz", "integrity": "sha512-nszM8DINnx1vSS+TpbWKMkxem0CDWk3cSit/WWCBVs9/JZ1I/XLwOsiUglYuYReaeWWSsW9kge5zE5NZtf/a4w==", - "dev": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -18383,8 +18305,7 @@ "node_modules/siginfo": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/siginfo/-/siginfo-2.0.0.tgz", - "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==", - "dev": true + "integrity": "sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==" }, "node_modules/signal-exit": { "version": "3.0.7", @@ -18493,7 +18414,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.0.2.tgz", "integrity": "sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -18796,14 +18716,12 @@ "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", - "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==", - "dev": true + "integrity": "sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==" }, "node_modules/std-env": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/std-env/-/std-env-3.3.3.tgz", - "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==", - "dev": true + "integrity": "sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==" }, "node_modules/stop-iteration-iterator": { "version": "1.0.0", @@ -19084,7 +19002,6 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/strip-literal/-/strip-literal-1.3.0.tgz", "integrity": "sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==", - "dev": true, "dependencies": { "acorn": "^8.10.0" }, @@ -19316,14 +19233,12 @@ "node_modules/tinybench": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-2.5.0.tgz", - "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==", - "dev": true + "integrity": "sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==" }, "node_modules/tinypool": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-0.7.0.tgz", "integrity": "sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==", - "dev": true, "engines": { "node": ">=14.0.0" } @@ -19332,7 +19247,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-2.1.1.tgz", "integrity": "sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==", - "dev": true, "engines": { "node": ">=14.0.0" } @@ -19595,7 +19509,6 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, "engines": { "node": ">=4" } @@ -19708,8 +19621,7 @@ "node_modules/ufo": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.3.0.tgz", - "integrity": "sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==", - "dev": true + "integrity": "sha512-bRn3CsoojyNStCZe0BG0Mt4Nr/4KF+rhFlnNXybgqt5pXHNFRlqinSoQaTrGyzE4X8aHplSb+TorH+COin9Yxw==" }, "node_modules/uglify-js": { "version": "3.17.4", @@ -20544,7 +20456,6 @@ "version": "4.4.9", "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.9.tgz", "integrity": "sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==", - "dev": true, "dependencies": { "esbuild": "^0.18.10", "postcss": "^8.4.27", @@ -20599,7 +20510,6 @@ "version": "0.34.4", "resolved": "https://registry.npmjs.org/vite-node/-/vite-node-0.34.4.tgz", "integrity": "sha512-ho8HtiLc+nsmbwZMw8SlghESEE3KxJNp04F/jPUCLVvaURwt0d+r9LxEqCX5hvrrOQ0GSyxbYr5ZfRYhQ0yVKQ==", - "dev": true, "dependencies": { "cac": "^6.7.14", "debug": "^4.3.4", @@ -20622,7 +20532,6 @@ "version": "0.34.4", "resolved": "https://registry.npmjs.org/vitest/-/vitest-0.34.4.tgz", "integrity": "sha512-SE/laOsB6995QlbSE6BtkpXDeVNLJc1u2LHRG/OpnN4RsRzM3GQm4nm3PQCK5OBtrsUqnhzLdnT7se3aeNGdlw==", - "dev": true, "dependencies": { "@types/chai": "^4.3.5", "@types/chai-subset": "^1.3.3", @@ -20815,7 +20724,6 @@ "version": "2.2.2", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.2.2.tgz", "integrity": "sha512-6tSwToZxTOcotxHeA+qGCq1mVzKR3CwcJGmVcY+QE8SHy6TnpFnh8PAvPNHYr7EcuVeG0QSMxtYCuO1ta/G/oA==", - "dev": true, "dependencies": { "siginfo": "^2.0.0", "stackback": "0.0.2" @@ -21159,29 +21067,21 @@ "version": "6.1.1", "license": "MIT", "dependencies": { - "@readme/oas-to-har": "^20.0.2", "@readme/openapi-parser": "^2.4.0", - "caseless": "^0.12.0", "chalk": "^4.1.2", "commander": "^11.0.0", - "datauri": "^4.1.0", "execa": "^5.1.1", - "fetch-har": "^10.0.0", "figures": "^3.2.0", - "get-stream": "^6.0.1", "js-yaml": "^4.1.0", "json-schema-to-ts": "^2.9.2", - "json-schema-traverse": "^1.0.0", "lodash.camelcase": "^4.3.0", "lodash.deburr": "^4.1.0", - "lodash.merge": "^4.6.2", "lodash.setwith": "^4.3.2", "lodash.startcase": "^4.4.0", "make-dir": "^3.1.0", "oas": "^20.4.0", "ora": "^5.4.1", "prompts": "^2.4.2", - "remove-undefined-objects": "^2.0.2", "semver": "^7.3.8", "ssri": "^10.0.1", "ts-morph": "^17.0.1", @@ -21191,22 +21091,20 @@ "api": "bin/api" }, "devDependencies": { + "@api/core": "file:../core", + "@api/test-utils": "file:../test-utils", "@readme/oas-examples": "^5.12.0", - "@types/caseless": "^0.12.3", "@types/js-yaml": "^4.0.5", "@types/lodash.camelcase": "^4.3.7", "@types/lodash.deburr": "^4.1.7", - "@types/lodash.merge": "^4.6.7", "@types/lodash.setwith": "^4.3.7", "@types/lodash.startcase": "^4.4.7", - "@types/prettier": "^3.0.0", "@types/prompts": "^2.4.4", "@types/semver": "^7.5.1", "@types/ssri": "^7.1.1", "@types/validate-npm-package-name": "^4.0.0", "@vitest/coverage-v8": "^0.34.1", "fetch-mock": "^9.11.0", - "formdata-to-string": "^1.0.0", "oas-normalize": "^8.3.2", "type-fest": "^4.3.1", "typescript": "^5.2.2", @@ -21217,17 +21115,43 @@ "node": ">=18" } }, - "packages/api/node_modules/@types/prettier": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-3.0.0.tgz", - "integrity": "sha512-mFMBfMOz8QxhYVbuINtswBp9VL2b4Y0QqYHwqLz3YbgtfAcat2Dl6Y1o4e22S/OVE6Ebl9m7wWiMT2lSbAs1wA==", - "deprecated": "This is a stub types definition. prettier provides its own type definitions, so you do not need this installed.", - "dev": true, + "packages/api-testing": { + "extraneous": true, + "devDependencies": {}, + "engines": { + "node": ">=18" + } + }, + "packages/core": { + "name": "@api/core", + "version": "1.0.0", + "license": "MIT", "dependencies": { - "prettier": "*" + "@readme/oas-to-har": "^20.1.1", + "caseless": "^0.12.0", + "datauri": "^4.1.0", + "fetch-har": "^10.0.0", + "get-stream": "^6.0.1", + "json-schema-traverse": "^1.0.0", + "lodash.merge": "^4.6.2", + "oas": "^20.10.3", + "remove-undefined-objects": "^3.0.0" + }, + "devDependencies": { + "@api/test-utils": "file:../test-utils", + "@readme/oas-examples": "^5.12.0", + "@types/caseless": "^0.12.3", + "@types/lodash.merge": "^4.6.7", + "@vitest/coverage-v8": "^0.34.4", + "fetch-mock": "^9.11.0", + "typescript": "^5.2.2", + "vitest": "^0.34.4" + }, + "engines": { + "node": ">=18" } }, - "packages/api/node_modules/json-schema-traverse": { + "packages/core/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==" @@ -21255,6 +21179,21 @@ "@readme/httpsnippet": ">=4", "oas": "^20.0.0" } + }, + "packages/test-utils": { + "name": "@api/test-utils", + "version": "1.0.0", + "dependencies": { + "caseless": "^0.12.0", + "datauri": "^4.1.0", + "formdata-to-string": "^1.0.0", + "vitest": "^0.34.4" + }, + "devDependencies": { + "@types/caseless": "^0.12.3", + "oas": "^20.10.3", + "typescript": "^5.2.2" + } } } } diff --git a/packages/api/.eslintrc b/packages/api/.eslintrc index d92803ea..a0f07c94 100644 --- a/packages/api/.eslintrc +++ b/packages/api/.eslintrc @@ -1,11 +1,4 @@ { - "globals": { - "fetch": true, - "Response": true - }, - "parserOptions": { - "ecmaVersion": 2020 - }, "rules": { "@typescript-eslint/no-explicit-any": "off" // @todo fix these eventually }, @@ -17,15 +10,6 @@ "import/no-unresolved": "off" } }, - { - "files": ["src/core/**/*.ts"], - "rules": { - "no-restricted-imports": ["error", { - "name": "fs/promises", - "message": "Please use `fs` instead as some client frameworks don't polyfill `fs/promises`." - }] - } - }, { "files": ["example.js"], "rules": { diff --git a/packages/api/package.json b/packages/api/package.json index ae383a7a..d2f21c21 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -36,51 +36,41 @@ "swagger" ], "dependencies": { - "@readme/oas-to-har": "^20.0.2", "@readme/openapi-parser": "^2.4.0", - "caseless": "^0.12.0", "chalk": "^4.1.2", "commander": "^11.0.0", - "datauri": "^4.1.0", "execa": "^5.1.1", - "fetch-har": "^10.0.0", "figures": "^3.2.0", - "get-stream": "^6.0.1", "js-yaml": "^4.1.0", "json-schema-to-ts": "^2.9.2", - "json-schema-traverse": "^1.0.0", "lodash.camelcase": "^4.3.0", "lodash.deburr": "^4.1.0", - "lodash.merge": "^4.6.2", "lodash.setwith": "^4.3.2", "lodash.startcase": "^4.4.0", "make-dir": "^3.1.0", "oas": "^20.4.0", "ora": "^5.4.1", "prompts": "^2.4.2", - "remove-undefined-objects": "^2.0.2", "semver": "^7.3.8", "ssri": "^10.0.1", "ts-morph": "^17.0.1", "validate-npm-package-name": "^5.0.0" }, "devDependencies": { + "@api/core": "file:../core", + "@api/test-utils": "file:../test-utils", "@readme/oas-examples": "^5.12.0", - "@types/caseless": "^0.12.3", "@types/js-yaml": "^4.0.5", "@types/lodash.camelcase": "^4.3.7", "@types/lodash.deburr": "^4.1.7", - "@types/lodash.merge": "^4.6.7", "@types/lodash.setwith": "^4.3.7", "@types/lodash.startcase": "^4.4.7", - "@types/prettier": "^3.0.0", "@types/prompts": "^2.4.4", "@types/semver": "^7.5.1", "@types/ssri": "^7.1.1", "@types/validate-npm-package-name": "^4.0.0", "@vitest/coverage-v8": "^0.34.1", "fetch-mock": "^9.11.0", - "formdata-to-string": "^1.0.0", "oas-normalize": "^8.3.2", "type-fest": "^4.3.1", "typescript": "^5.2.2", diff --git a/packages/api/src/cli/codegen/languages/typescript.ts b/packages/api/src/cli/codegen/languages/typescript.ts index 8a95abf2..c3f1ea1e 100644 --- a/packages/api/src/cli/codegen/languages/typescript.ts +++ b/packages/api/src/cli/codegen/languages/typescript.ts @@ -87,7 +87,7 @@ export default class TSGenerator extends CodeGeneratorLanguage { this.requiredPackages = { api: { - reason: "Required for the `api/dist/core` library that the codegen'd SDK uses for making requests.", + reason: "Required for the `@api/core` library that the codegen'd SDK uses for making requests.", url: 'https://npm.im/api', }, 'json-schema-to-ts': { @@ -95,7 +95,7 @@ export default class TSGenerator extends CodeGeneratorLanguage { url: 'https://npm.im/json-schema-to-ts', }, oas: { - reason: 'Used within `api/dist/core` and is also loaded for TypeScript types.', + reason: 'Used within `@api/core` and is also loaded for TypeScript types.', url: 'https://npm.im/oas', }, }; @@ -230,7 +230,7 @@ export default class TSGenerator extends CodeGeneratorLanguage { sdkSource .getImportDeclarations() .find(id => id.getText().includes('HTTPMethodRange')) - .replaceWithText("import type { ConfigOptions, FetchResponse } from 'api/dist/core'"); + .replaceWithText("import type { ConfigOptions, FetchResponse } from '@api/core'"); } if (this.outputJS) { @@ -301,10 +301,10 @@ export default class TSGenerator extends CodeGeneratorLanguage { { // `HTTPMethodRange` will be conditionally removed later if it ends up not being used. defaultImport: 'type { ConfigOptions, FetchResponse, HTTPMethodRange }', - moduleSpecifier: 'api/dist/core', + moduleSpecifier: '@api/core', }, { defaultImport: 'Oas', moduleSpecifier: 'oas' }, - { defaultImport: 'APICore', moduleSpecifier: 'api/dist/core' }, + { defaultImport: 'APICore', moduleSpecifier: '@api/core' }, { defaultImport: 'definition', moduleSpecifier: this.specPath }, ]); @@ -711,7 +711,7 @@ sdk.server('https://eu.api.example.com/v14');`), // our `metadata` parameter is actually required for this operation this is the only way we're // able to have an optional `body` parameter be present before `metadata`. // - // Thankfully our core fetch work in `api/dist/core` is able to do the proper determination to + // Thankfully our core fetch work in `@api/core` is able to do the proper determination to // see if what the user is supplying is `metadata` or `body` content when they supply one or // both. operationIdAccessor.addParameters([ diff --git a/packages/api/test/__fixtures__/sdk/alby/index.ts b/packages/api/test/__fixtures__/sdk/alby/index.ts index 9f1f3ae7..e9863e5f 100644 --- a/packages/api/test/__fixtures__/sdk/alby/index.ts +++ b/packages/api/test/__fixtures__/sdk/alby/index.ts @@ -1,8 +1,8 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse } from 'api/dist/core' +import type { ConfigOptions, FetchResponse } from '@api/core' import Oas from 'oas'; -import APICore from 'api/dist/core'; -import definition from '../../../__fixtures__/definitions/alby.json'; +import APICore from '@api/core'; +import definition from '@api/test-utils/definitions/alby.json'; class SDK { spec: Oas; @@ -388,4 +388,4 @@ const createSDK = (() => { return new SDK(); })() export default createSDK; -export type { AmqpExternalRulePatch, AmqpExternalRulePost, AmqpExternalRuleResponse, AmqpRulePatch, AmqpRulePost, AmqpRuleResponse, AppPatch, AppPkcs12, AppPost, AppResponse, AwsAccessKeys, AwsAccessKeysResponse, AwsAssumeRole, AwsKinesisRulePatch, AwsKinesisRulePost, AwsKinesisRuleResponse, AwsLambdaRulePatch, AwsLambdaRulePost, AwsLambdaRuleResponse, AwsSqsRulePatch, AwsSqsRulePost, AwsSqsRuleResponse, AzureFunctionRulePatch, AzureFunctionRulePost, AzureFunctionRuleResponse, CloudflareWorkerRulePatch, CloudflareWorkerRulePost, CloudflareWorkerRuleResponse, DeleteAppsAppIdNamespacesNamespaceIdMetadataParam, DeleteAppsAppIdQueuesQueueIdMetadataParam, DeleteAppsAppIdRulesRuleIdMetadataParam, DeleteAppsIdMetadataParam, Error, GetAccountsAccountIdAppsMetadataParam, GetAccountsAccountIdAppsResponse200, GetAppsAppIdKeysMetadataParam, GetAppsAppIdKeysResponse200, GetAppsAppIdNamespacesMetadataParam, GetAppsAppIdNamespacesResponse200, GetAppsAppIdQueuesMetadataParam, GetAppsAppIdQueuesResponse200, GetAppsAppIdRulesMetadataParam, GetAppsAppIdRulesResponse200, GetAppsAppIdRulesRuleIdMetadataParam, GoogleCloudFunctionRulePatch, GoogleCloudFunctionRulePost, GoogleCloudFunctionRuleResponse, HttpRulePatch, HttpRulePost, HttpRuleResponse, IftttRulePatch, IftttRulePost, IftttRuleResponse, KeyPatch, KeyPost, KeyResponse, Me, NamespacePatch, NamespacePost, NamespaceResponse, PatchAppsAppIdKeysKeyIdMetadataParam, PatchAppsAppIdNamespacesNamespaceIdMetadataParam, PatchAppsAppIdRulesRuleIdMetadataParam, PatchAppsIdMetadataParam, PostAccountsAccountIdAppsMetadataParam, PostAppsAppIdKeysKeyIdRevokeMetadataParam, PostAppsAppIdKeysMetadataParam, PostAppsAppIdNamespacesMetadataParam, PostAppsAppIdQueuesMetadataParam, PostAppsAppIdRulesMetadataParam, PostAppsIdPkcs12MetadataParam, Queue, QueueResponse, RuleAttributes, RulePatch, RulePost, RuleResponse, RuleSource, RuleSourcePatch, UnsupportedRuleResponse, ZapierRulePatch, ZapierRulePost, ZapierRuleResponse } from './types'; +export type { AmqpExternalRulePatch, AmqpExternalRulePost, AmqpExternalRuleResponse, AmqpRulePatch, AmqpRulePost, AmqpRuleResponse, AppPatch, AppPkcs12, AppPost, AppResponse, AwsAccessKeys, AwsAccessKeysResponse, AwsAssumeRole, AwsKinesisRulePatch, AwsKinesisRulePost, AwsKinesisRuleResponse, AwsLambdaRulePatch, AwsLambdaRulePost, AwsLambdaRuleResponse, AwsSqsRulePatch, AwsSqsRulePost, AwsSqsRuleResponse, AzureFunctionRulePatch, AzureFunctionRulePost, AzureFunctionRuleResponse, CloudflareWorkerRulePatch, CloudflareWorkerRulePost, CloudflareWorkerRuleResponse, DeleteAppsAppIdNamespacesNamespaceIdMetadataParam, DeleteAppsAppIdQueuesQueueIdMetadataParam, DeleteAppsAppIdRulesRuleIdMetadataParam, DeleteAppsIdMetadataParam, Error, GetAccountsAccountIdAppsMetadataParam, GetAccountsAccountIdAppsResponse200, GetAppsAppIdKeysMetadataParam, GetAppsAppIdKeysResponse200, GetAppsAppIdNamespacesMetadataParam, GetAppsAppIdNamespacesResponse200, GetAppsAppIdQueuesMetadataParam, GetAppsAppIdQueuesResponse200, GetAppsAppIdRulesMetadataParam, GetAppsAppIdRulesResponse200, GetAppsAppIdRulesRuleIdMetadataParam, GoogleCloudFunctionRulePatch, GoogleCloudFunctionRulePost, GoogleCloudFunctionRuleResponse, HttpRulePatch, HttpRulePost, HttpRuleResponse, IftttRulePatch, IftttRulePost, IftttRuleResponse, KeyPatch, KeyPost, KeyResponse, Me, NamespacePatch, NamespacePost, NamespaceResponse, PatchAppsAppIdKeysKeyIdMetadataParam, PatchAppsAppIdNamespacesNamespaceIdMetadataParam, PatchAppsAppIdRulesRuleIdMetadataParam, PatchAppsIdMetadataParam, PostAccountsAccountIdAppsMetadataParam, PostAppsAppIdKeysKeyIdRevokeMetadataParam, PostAppsAppIdKeysMetadataParam, PostAppsAppIdNamespacesMetadataParam, PostAppsAppIdQueuesMetadataParam, PostAppsAppIdRulesMetadataParam, PostAppsIdPkcs12MetadataParam, Queue, QueueResponse, RulePatch, RulePost, RuleResponse, RuleSource, UnsupportedRuleResponse, ZapierRulePatch, ZapierRulePost, ZapierRuleResponse } from './types'; diff --git a/packages/api/test/__fixtures__/sdk/alby/schemas.ts b/packages/api/test/__fixtures__/sdk/alby/schemas.ts index 9af7f1c4..1a43dbc2 100644 --- a/packages/api/test/__fixtures__/sdk/alby/schemas.ts +++ b/packages/api/test/__fixtures__/sdk/alby/schemas.ts @@ -1,58 +1,58 @@ -const AmqpExternalRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP external (using Firehose). See the Ably documentation for further information.","enum":["amqp/external"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"mandatoryRoute":{"description":"Reject delivery of the message if the route does not exist, otherwise fail silently.","type":"boolean"},"messageTtl":{"description":"You can optionally override the default TTL on a queue and specify a TTL in minutes for messages to be persisted. It is unusual to change the default TTL, so if this field is left empty, the default TTL for the queue will be used.","type":"integer"},"persistentMessages":{"description":"Marks the message as persistent, instructing the broker to write it to disk if it is in a durable queue.","type":"boolean"},"routingKey":{"description":"The AMQP routing key. See this Ably knowledge base article for details.","type":"string"},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"amqp_external_rule_patch","x-readme-ref-name":"amqp_external_rule_patch"} as const +const AmqpExternalRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP external (using Firehose). See the Ably documentation for further information.","enum":["amqp/external"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"mandatoryRoute":{"description":"Reject delivery of the message if the route does not exist, otherwise fail silently.","type":"boolean"},"messageTtl":{"description":"You can optionally override the default TTL on a queue and specify a TTL in minutes for messages to be persisted. It is unusual to change the default TTL, so if this field is left empty, the default TTL for the queue will be used.","type":"integer"},"persistentMessages":{"description":"Marks the message as persistent, instructing the broker to write it to disk if it is in a durable queue.","type":"boolean"},"routingKey":{"description":"The AMQP routing key. See this Ably knowledge base article for details.","type":"string"},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"amqp_external_rule_patch","x-readme-ref-name":"amqp_external_rule_patch"} as const ; -const AmqpExternalRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP external (using Firehose). See the documentation for further information.","enum":["amqp/external"],"type":"string"},"source":RuleSource,"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"mandatoryRoute":{"description":"Reject delivery of the message if the route does not exist, otherwise fail silently.","type":"boolean"},"messageTtl":{"description":"You can optionally override the default TTL on a queue and specify a TTL in minutes for messages to be persisted. It is unusual to change the default TTL, so if this field is left empty, the default TTL for the queue will be used.","type":"integer"},"persistentMessages":{"description":"Marks the message as persistent, instructing the broker to write it to disk if it is in a durable queue.","type":"boolean"},"routingKey":{"description":"The AMQP routing key. See this Ably knowledge base article for details.","type":"string"},"url":{"type":"string"}},"required":["url","routingKey","mandatoryRoute","persistentMessages"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_external_rule_post","x-readme-ref-name":"amqp_external_rule_post"} as const +const AmqpExternalRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP external (using Firehose). See the documentation for further information.","enum":["amqp/external"],"type":"string"},"source":RuleSource,"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"mandatoryRoute":{"description":"Reject delivery of the message if the route does not exist, otherwise fail silently.","type":"boolean"},"messageTtl":{"description":"You can optionally override the default TTL on a queue and specify a TTL in minutes for messages to be persisted. It is unusual to change the default TTL, so if this field is left empty, the default TTL for the queue will be used.","type":"integer"},"persistentMessages":{"description":"Marks the message as persistent, instructing the broker to write it to disk if it is in a durable queue.","type":"boolean"},"routingKey":{"description":"The AMQP routing key. See this Ably knowledge base article for details.","type":"string"},"url":{"type":"string"}},"required":["url","routingKey","mandatoryRoute","persistentMessages"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_external_rule_post","x-readme-ref-name":"amqp_external_rule_post"} as const ; -const AmqpExternalRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP external (using Firehose). See the Ably documentation for further information.","enum":["amqp/external"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"mandatoryRoute":{"description":"Reject delivery of the message if the route does not exist, otherwise fail silently.","type":"boolean"},"messageTtl":{"description":"You can optionally override the default TTL on a queue and specify a TTL in minutes for messages to be persisted. It is unusual to change the default TTL, so if this field is left empty, the default TTL for the queue will be used.","type":"integer"},"persistentMessages":{"description":"Marks the message as persistent, instructing the broker to write it to disk if it is in a durable queue.","type":"boolean"},"routingKey":{"description":"The AMQP routing key. See this Ably knowledge base article for details.","type":"string"},"url":{"type":"string"}},"required":["url","routingKey","mandatoryRoute","persistentMessages"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_external_rule_response","x-readme-ref-name":"amqp_external_rule_response"} as const +const AmqpExternalRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.\n\n`single`","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP external (using Firehose). See the Ably documentation for further information.\n\n`amqp/external`","enum":["amqp/external"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"mandatoryRoute":{"description":"Reject delivery of the message if the route does not exist, otherwise fail silently.","type":"boolean"},"messageTtl":{"description":"You can optionally override the default TTL on a queue and specify a TTL in minutes for messages to be persisted. It is unusual to change the default TTL, so if this field is left empty, the default TTL for the queue will be used.","type":"integer"},"persistentMessages":{"description":"Marks the message as persistent, instructing the broker to write it to disk if it is in a durable queue.","type":"boolean"},"routingKey":{"description":"The AMQP routing key. See this Ably knowledge base article for details.","type":"string"},"url":{"type":"string"}},"required":["url","routingKey","mandatoryRoute","persistentMessages"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_external_rule_response","x-readme-ref-name":"amqp_external_rule_response"} as const ; -const AmqpRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP. See the documentation for further information.","enum":["amqp"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"queueId":{"type":"string"}},"type":"object"}},"type":"object","title":"amqp_rule_patch","x-readme-ref-name":"amqp_rule_patch"} as const +const AmqpRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP. See the documentation for further information.","enum":["amqp"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"queueId":{"type":"string"}},"type":"object"}},"type":"object","title":"amqp_rule_patch","x-readme-ref-name":"amqp_rule_patch"} as const ; -const AmqpRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP. See the documentation for further information.","enum":["amqp"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"queueId":{"type":"string"}},"required":["queueId"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_rule_post","x-readme-ref-name":"amqp_rule_post"} as const +const AmqpRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP. See the documentation for further information.","enum":["amqp"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"queueId":{"type":"string"}},"required":["queueId"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_rule_post","x-readme-ref-name":"amqp_rule_post"} as const ; -const AmqpRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP. See the documentation for further information.","enum":["amqp"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"queueId":{"type":"string"}},"required":["queueId"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_rule_response","x-readme-ref-name":"amqp_rule_response"} as const +const AmqpRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.\n\n`single`","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AMQP. See the documentation for further information.\n\n`amqp`","enum":["amqp"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"queueId":{"type":"string"}},"required":["queueId"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"amqp_rule_response","x-readme-ref-name":"amqp_rule_response"} as const ; -const AppPatch = {"additionalProperties":false,"properties":{"apnsCertificate":{"description":"The Apple Push Notification service certificate.","type":"string"},"apnsPrivateKey":{"description":"The Apple Push Notification service private key.","type":"string"},"apnsUseSandboxEndpoint":{"description":"The Apple Push Notification service sandbox endpoint.","type":"boolean"},"fcmKey":{"description":"The Firebase Cloud Messaging key.","type":"string","examples":[false]},"name":{"description":"The name of the application for your reference only.","type":"string","examples":["My App"]},"status":{"description":"The status of the application. Can be `enabled` or `disabled`. Enabled means available to accept inbound connections and all services are available.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"tlsOnly":{"description":"Enforce TLS for all connections.","type":"boolean","examples":[true]}},"type":"object","title":"app_patch","x-readme-ref-name":"app_patch"} as const +const AppPatch = {"additionalProperties":false,"properties":{"apnsCertificate":{"description":"The Apple Push Notification service certificate.","type":["string","null"]},"apnsPrivateKey":{"description":"The Apple Push Notification service private key.","type":["string","null"]},"apnsUseSandboxEndpoint":{"description":"The Apple Push Notification service sandbox endpoint.","type":["boolean","null"]},"fcmKey":{"description":"The Firebase Cloud Messaging key.","type":["string","null"],"examples":[false]},"name":{"description":"The name of the application for your reference only.","type":"string","examples":["My App"]},"status":{"description":"The status of the application. Can be `enabled` or `disabled`. Enabled means available to accept inbound connections and all services are available.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"tlsOnly":{"description":"Enforce TLS for all connections.","type":["boolean","null"],"examples":[true]}},"type":"object","title":"app_patch","x-readme-ref-name":"app_patch"} as const ; const AppPkcs12 = {"additionalProperties":false,"properties":{"p12File":{"description":"The `.p12` file containing the app's APNs information.","format":"binary","type":"string"},"p12Pass":{"description":"The password for the corresponding `.p12` file.","type":"string"}},"required":["p12File","p12Pass"],"type":"object","title":"app_pkcs12","x-readme-ref-name":"app_pkcs12"} as const ; -const AppPost = {"additionalProperties":false,"properties":{"apnsCertificate":{"description":"The Apple Push Notification service certificate.","type":"string"},"apnsPrivateKey":{"description":"The Apple Push Notification service private key.","type":"string"},"apnsUseSandboxEndpoint":{"description":"The Apple Push Notification service sandbox endpoint.","type":"boolean"},"fcmKey":{"description":"The Firebase Cloud Messaging key.","type":"string","examples":[false]},"name":{"description":"The name of the application for your reference only.","type":"string","examples":["My App"]},"status":{"description":"The status of the application. Can be `enabled` or `disabled`. Enabled means available to accept inbound connections and all services are available.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"tlsOnly":{"description":"Enforce TLS for all connections.","type":"boolean","examples":[true]}},"required":["name"],"type":"object","title":"app_post","x-readme-ref-name":"app_post"} as const +const AppPost = {"additionalProperties":false,"properties":{"apnsCertificate":{"description":"The Apple Push Notification service certificate.","type":["string","null"]},"apnsPrivateKey":{"description":"The Apple Push Notification service private key.","type":["string","null"]},"apnsUseSandboxEndpoint":{"description":"The Apple Push Notification service sandbox endpoint.","type":["boolean","null"]},"fcmKey":{"description":"The Firebase Cloud Messaging key.","type":["string","null"],"examples":[false]},"name":{"description":"The name of the application for your reference only.","type":"string","examples":["My App"]},"status":{"description":"The status of the application. Can be `enabled` or `disabled`. Enabled means available to accept inbound connections and all services are available.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"tlsOnly":{"description":"Enforce TLS for all connections.","type":["boolean","null"],"examples":[true]}},"required":["name"],"type":"object","title":"app_post","x-readme-ref-name":"app_post"} as const ; -const AppResponse = {"additionalProperties":false,"properties":{"_links":{"description":"A link self-referencing the app that has been created.","type":"object","additionalProperties":true},"accountId":{"description":"The ID of your Ably account.","type":"string","examples":["WgRpOB"]},"apnsUseSandboxEndpoint":{"description":"Apple Push Notification service endpoint.","type":"boolean","examples":[false]},"id":{"description":"The application ID.","type":"string","examples":["28AB6x"]},"name":{"description":"The application name.","type":"string","examples":["Default"]},"status":{"description":"The application status. Disabled applications will not accept new connections and will return an error to all clients.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"tlsOnly":{"description":"Enforce TLS for all connections. This setting overrides any channel setting.","type":"boolean","examples":[true]}},"type":"object","title":"app_response","x-readme-ref-name":"app_response"} as const +const AppResponse = {"additionalProperties":false,"properties":{"_links":{"description":"A link self-referencing the app that has been created.","type":["object","null"],"additionalProperties":true},"accountId":{"description":"The ID of your Ably account.","type":"string","examples":["WgRpOB"]},"apnsUseSandboxEndpoint":{"description":"Apple Push Notification service endpoint.","type":["boolean","null"],"examples":[false]},"id":{"description":"The application ID.","type":"string","examples":["28AB6x"]},"name":{"description":"The application name.","type":"string","examples":["Default"]},"status":{"description":"The application status. Disabled applications will not accept new connections and will return an error to all clients.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"tlsOnly":{"description":"Enforce TLS for all connections. This setting overrides any channel setting.","type":["boolean","null"],"examples":[true]}},"type":"object","title":"app_response","x-readme-ref-name":"app_response"} as const ; const AwsAccessKeys = {"additionalProperties":false,"properties":{"accessKeyId":{"description":"The AWS key ID for the AWS IAM user. See this Ably knowledge base article for details.","type":"string"},"authenticationMode":{"description":"Authentication method is using AWS credentials (AWS key ID and secret key).","enum":["credentials"],"type":"string"},"secretAccessKey":{"description":"The AWS secret key for the AWS IAM user. See this Ably knowledge base article for details.","type":"string"}},"required":["accessKeyId","secretAccessKey"],"type":"object","title":"aws_access_keys","x-readme-ref-name":"aws_access_keys"} as const ; -const AwsAccessKeysResponse = {"additionalProperties":false,"properties":{"accessKeyId":{"description":"The AWS key ID for the AWS IAM user. See this Ably knowledge base article for details.","type":"string"},"authenticationMode":{"description":"Authentication method is using AWS credentials (AWS key ID and secret key).","enum":["credentials"],"type":"string"}},"type":"object","title":"aws_access_keys_response","x-readme-ref-name":"aws_access_keys_response"} as const +const AwsAccessKeysResponse = {"additionalProperties":false,"properties":{"accessKeyId":{"description":"The AWS key ID for the AWS IAM user. See this Ably knowledge base article for details.","type":"string"},"authenticationMode":{"description":"Authentication method is using AWS credentials (AWS key ID and secret key).\n\n`credentials`","enum":["credentials"],"type":"string"}},"type":"object","title":"aws_access_keys_response","x-readme-ref-name":"aws_access_keys_response"} as const ; -const AwsAssumeRole = {"additionalProperties":false,"properties":{"assumeRoleArn":{"description":"If you are using the \"ARN of an assumable role\" authentication method, this is your Assume Role ARN. See this Ably knowledge base article for details.","type":"string"},"authenticationMode":{"description":"Authentication method is using the ARN of an assumable role. See this Ably knowledge base article for details.","enum":["assumeRole"],"type":"string"}},"required":["assumeRoleArn"],"type":"object","title":"aws_assume_role","x-readme-ref-name":"aws_assume_role"} as const +const AwsAssumeRole = {"additionalProperties":false,"properties":{"assumeRoleArn":{"description":"If you are using the \"ARN of an assumable role\" authentication method, this is your Assume Role ARN. See this Ably knowledge base article for details.","type":"string"},"authenticationMode":{"description":"Authentication method is using the ARN of an assumable role. See this Ably knowledge base article for details.\n\n`assumeRole`","enum":["assumeRole"],"type":"string"}},"required":["assumeRoleArn"],"type":"object","title":"aws_assume_role","x-readme-ref-name":"aws_assume_role"} as const ; -const AwsKinesisRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Kinesis. See the documentation for further information.","enum":["aws/kinesis"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"partitionKey":{"description":"The AWS Kinesis partition key. See this Ably knowledge base article for details.","type":"string"},"region":{"description":"The region is which AWS Kinesis is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]},"streamName":{"description":"The name of your AWS Kinesis Stream.","type":"string"}},"type":"object"}},"type":"object","title":"aws_kinesis_rule_patch","x-readme-ref-name":"aws_kinesis_rule_patch"} as const +const AwsKinesisRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Kinesis. See the documentation for further information.","enum":["aws/kinesis"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"partitionKey":{"description":"The AWS Kinesis partition key. See this Ably knowledge base article for details.","type":"string"},"region":{"description":"The region is which AWS Kinesis is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]},"streamName":{"description":"The name of your AWS Kinesis Stream.","type":"string"}},"type":"object"}},"type":"object","title":"aws_kinesis_rule_patch","x-readme-ref-name":"aws_kinesis_rule_patch"} as const ; -const AwsKinesisRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Kinesis. See the documentation for further information.","enum":["aws/kinesis"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"partitionKey":{"description":"The AWS Kinesis partition key. See this Ably knowledge base article for details.","type":"string"},"region":{"description":"The region is which AWS Kinesis is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]},"streamName":{"description":"The name of your AWS Kinesis Stream.","type":"string"}},"required":["region","streamName","partitionKey","authentication","format"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_kinesis_rule_post","x-readme-ref-name":"aws_kinesis_rule_post"} as const +const AwsKinesisRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Kinesis. See the documentation for further information.","enum":["aws/kinesis"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"partitionKey":{"description":"The AWS Kinesis partition key. See this Ably knowledge base article for details.","type":"string"},"region":{"description":"The region is which AWS Kinesis is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]},"streamName":{"description":"The name of your AWS Kinesis Stream.","type":"string"}},"required":["region","streamName","partitionKey","authentication","format"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_kinesis_rule_post","x-readme-ref-name":"aws_kinesis_rule_post"} as const ; -const AwsKinesisRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Kinesis. See the documentation for further information.","enum":["aws/kinesis"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys_response"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeysResponse,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"partitionKey":{"description":"The AWS Kinesis partition key. See this Ably knowledge base article for details.","type":"string"},"region":{"description":"The region is which AWS Kinesis is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]},"streamName":{"description":"The name of your AWS Kinesis Stream.","type":"string"}},"required":["region","streamName","partitionKey","authentication","format"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_kinesis_rule_response","x-readme-ref-name":"aws_kinesis_rule_response"} as const +const AwsKinesisRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.\n\n`single`","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Kinesis. See the documentation for further information.\n\n`aws/kinesis`","enum":["aws/kinesis"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys_response"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeysResponse,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.\n\n`json`","enum":["json"],"type":"string"},"partitionKey":{"description":"The AWS Kinesis partition key. See this Ably knowledge base article for details.","type":"string"},"region":{"description":"The region is which AWS Kinesis is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]},"streamName":{"description":"The name of your AWS Kinesis Stream.","type":"string"}},"required":["region","streamName","partitionKey","authentication","format"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_kinesis_rule_response","x-readme-ref-name":"aws_kinesis_rule_response"} as const ; -const AwsLambdaRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Lambda. See the Ably documentation for further information.","enum":["aws/lambda"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"functionName":{"description":"The name of your AWS Lambda Function.","type":"string"},"region":{"description":"The region is which your AWS Lambda Function is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","functionName","authentication"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_lambda_rule_patch","x-readme-ref-name":"aws_lambda_rule_patch"} as const +const AwsLambdaRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Lambda. See the Ably documentation for further information.","enum":["aws/lambda"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"functionName":{"description":"The name of your AWS Lambda Function.","type":"string"},"region":{"description":"The region is which your AWS Lambda Function is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","functionName","authentication"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_lambda_rule_patch","x-readme-ref-name":"aws_lambda_rule_patch"} as const ; -const AwsLambdaRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Lambda. See the documentation for further information.","enum":["aws/lambda"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"functionName":{"description":"The name of your AWS Lambda Function.","type":"string"},"region":{"description":"The region is which your AWS Lambda Function is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","functionName","authentication"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_lambda_rule_post","x-readme-ref-name":"aws_lambda_rule_post"} as const +const AwsLambdaRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Lambda. See the documentation for further information.","enum":["aws/lambda"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"functionName":{"description":"The name of your AWS Lambda Function.","type":"string"},"region":{"description":"The region is which your AWS Lambda Function is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","functionName","authentication"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_lambda_rule_post","x-readme-ref-name":"aws_lambda_rule_post"} as const ; -const AwsLambdaRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Lambda. See the documentation for further information.","enum":["aws/lambda"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys_response"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeysResponse,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"functionName":{"description":"The name of your AWS Lambda Function.","type":"string"},"region":{"description":"The region is which your AWS Lambda Function is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","functionName","authentication"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_lambda_rule_response","x-readme-ref-name":"aws_lambda_rule_response"} as const +const AwsLambdaRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.\n\n`single`","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS Lambda. See the documentation for further information.\n\n`aws/lambda`","enum":["aws/lambda"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys_response"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeysResponse,AwsAssumeRole]},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"functionName":{"description":"The name of your AWS Lambda Function.","type":"string"},"region":{"description":"The region is which your AWS Lambda Function is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","functionName","authentication"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_lambda_rule_response","x-readme-ref-name":"aws_lambda_rule_response"} as const ; -const AwsSqsRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS SQS. See the documentation for further information.","enum":["aws/sqs"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"awsAccountId":{"description":"Your AWS account ID.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"queueName":{"description":"The AWS SQS queue name.","type":"string"},"region":{"description":"The region is which AWS SQS is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"type":"object"}},"type":"object","title":"aws_sqs_rule_patch","x-readme-ref-name":"aws_sqs_rule_patch"} as const +const AwsSqsRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS SQS. See the documentation for further information.","enum":["aws/sqs"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"awsAccountId":{"description":"Your AWS account ID.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"queueName":{"description":"The AWS SQS queue name.","type":"string"},"region":{"description":"The region is which AWS SQS is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"type":"object"}},"type":"object","title":"aws_sqs_rule_patch","x-readme-ref-name":"aws_sqs_rule_patch"} as const ; -const AwsSqsRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS SQS. See the documentation for further information.","enum":["aws/sqs"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"awsAccountId":{"description":"Your AWS account ID.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"queueName":{"description":"The AWS SQS queue name.","type":"string"},"region":{"description":"The region is which AWS SQS is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","awsAccountId","queueName","authentication"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_sqs_rule_post","x-readme-ref-name":"aws_sqs_rule_post"} as const +const AwsSqsRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS SQS. See the documentation for further information.","enum":["aws/sqs"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeys,AwsAssumeRole]},"awsAccountId":{"description":"Your AWS account ID.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"queueName":{"description":"The AWS SQS queue name.","type":"string"},"region":{"description":"The region is which AWS SQS is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","awsAccountId","queueName","authentication"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_sqs_rule_post","x-readme-ref-name":"aws_sqs_rule_post"} as const ; -const AwsSqsRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS SQS. See the documentation for further information.","enum":["aws/sqs"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys_response"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeysResponse,AwsAssumeRole]},"awsAccountId":{"description":"Your AWS account ID.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"type":"string"},"queueName":{"description":"The AWS SQS queue name.","type":"string"},"region":{"description":"The region is which AWS SQS is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","awsAccountId","queueName","authentication"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_sqs_rule_response","x-readme-ref-name":"aws_sqs_rule_response"} as const +const AwsSqsRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.\n\n`single`","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case AWS SQS. See the documentation for further information.\n\n`aws/sqs`","enum":["aws/sqs"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"authentication":{"discriminator":{"mapping":{"assumeRole":"#/components/schemas/aws_assume_role","credentials":"#/components/schemas/aws_access_keys_response"},"propertyName":"authenticationMode"},"oneOf":[AwsAccessKeysResponse,AwsAssumeRole]},"awsAccountId":{"description":"Your AWS account ID.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"type":"string"},"queueName":{"description":"The AWS SQS queue name.","type":"string"},"region":{"description":"The region is which AWS SQS is hosted. See the AWS documentation for more detail.","type":"string","examples":["us-west-1"]}},"required":["region","awsAccountId","queueName","authentication"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"aws_sqs_rule_response","x-readme-ref-name":"aws_sqs_rule_response"} as const ; -const AzureFunctionRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Microsoft Azure Function. See the documentation for further information.","enum":["http/azure-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"azureAppId":{"description":"The Microsoft Azure Application ID. You can find your Microsoft Azure Application ID as shown in this article.","type":"string","examples":["d1e9f419-c438-6032b32df979"]},"azureFunctionName":{"description":"The name of your Microsoft Azure Function.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"}},"type":"object"}},"type":"object","title":"azure_function_rule_patch","x-readme-ref-name":"azure_function_rule_patch"} as const +const AzureFunctionRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Microsoft Azure Function. See the documentation for further information.","enum":["http/azure-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"azureAppId":{"description":"The Microsoft Azure Application ID. You can find your Microsoft Azure Application ID as shown in this article.","type":"string","examples":["d1e9f419-c438-6032b32df979"]},"azureFunctionName":{"description":"The name of your Microsoft Azure Function.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]}},"type":"object"}},"type":"object","title":"azure_function_rule_patch","x-readme-ref-name":"azure_function_rule_patch"} as const ; -const AzureFunctionRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Microsoft Azure Function. See the documentation for further information.","enum":["http/azure-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"azureAppId":{"description":"The Microsoft Azure Application ID. You can find your Microsoft Azure Application ID as shown in this article.","type":"string","examples":["d1e9f419-c438-6032b32df979"]},"azureFunctionName":{"description":"The name of your Microsoft Azure Function.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"}},"required":["azureAppId","azureFunctionName"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"azure_function_rule_post","x-readme-ref-name":"azure_function_rule_post"} as const +const AzureFunctionRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Microsoft Azure Function. See the documentation for further information.","enum":["http/azure-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"azureAppId":{"description":"The Microsoft Azure Application ID. You can find your Microsoft Azure Application ID as shown in this article.","type":"string","examples":["d1e9f419-c438-6032b32df979"]},"azureFunctionName":{"description":"The name of your Microsoft Azure Function.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]}},"required":["azureAppId","azureFunctionName"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"azure_function_rule_post","x-readme-ref-name":"azure_function_rule_post"} as const ; -const AzureFunctionRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Microsoft Azure Function. See the documentation for further information.","enum":["http/azure-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"azureAppId":{"description":"The Microsoft Azure Application ID. You can find your Microsoft Azure Application ID as shown in this article.","type":"string","examples":["d1e9f419-c438-6032b32df979"]},"azureFunctionName":{"description":"The name of your Microsoft Azure Function.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"}},"required":["azureAppId","azureFunctionName"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"azure_function_rule_response","x-readme-ref-name":"azure_function_rule_response"} as const +const AzureFunctionRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.\n\n`single` `batch`","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Microsoft Azure Function. See the documentation for further information.\n\n`http/azure-function`","enum":["http/azure-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"azureAppId":{"description":"The Microsoft Azure Application ID. You can find your Microsoft Azure Application ID as shown in this article.","type":"string","examples":["d1e9f419-c438-6032b32df979"]},"azureFunctionName":{"description":"The name of your Microsoft Azure Function.","type":"string"},"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.\n\n`json`","enum":["json"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]}},"required":["azureAppId","azureFunctionName"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"azure_function_rule_response","x-readme-ref-name":"azure_function_rule_response"} as const ; -const CloudflareWorkerRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Cloudflare Worker. See the documentation for further information.","enum":["http/cloudflare-worker"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"cloudflare_worker_rule_patch","x-readme-ref-name":"cloudflare_worker_rule_patch"} as const +const CloudflareWorkerRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Cloudflare Worker. See the documentation for further information.","enum":["http/cloudflare-worker"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"cloudflare_worker_rule_patch","x-readme-ref-name":"cloudflare_worker_rule_patch"} as const ; -const CloudflareWorkerRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Cloudflare Worker. See the documentation for further information.","enum":["http/cloudflare-worker"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"cloudflare_worker_rule_post","x-readme-ref-name":"cloudflare_worker_rule_post"} as const +const CloudflareWorkerRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Cloudflare Worker. See the documentation for further information.","enum":["http/cloudflare-worker"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"required":["url"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"cloudflare_worker_rule_post","x-readme-ref-name":"cloudflare_worker_rule_post"} as const ; -const CloudflareWorkerRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Cloudflare Worker. See the documentation for further information.","enum":["http/cloudflare-worker"],"type":"string","examples":["http/cloudflare-worker"]},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"cloudflare_worker_rule_response","x-readme-ref-name":"cloudflare_worker_rule_response"} as const +const CloudflareWorkerRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.\n\n`single` `batch`","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Cloudflare Worker. See the documentation for further information.\n\n`http/cloudflare-worker`","enum":["http/cloudflare-worker"],"type":"string","examples":["http/cloudflare-worker"]},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"required":["url"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"cloudflare_worker_rule_response","x-readme-ref-name":"cloudflare_worker_rule_response"} as const ; const DeleteAppsAppIdNamespacesNamespaceId = {"metadata":{"allOf":[{"type":"object","properties":{"app_id":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"The application ID."},"namespace_id":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"The namespace ID."}},"required":["app_id","namespace_id"]}]}} as const ; @@ -62,7 +62,7 @@ const DeleteAppsAppIdRulesRuleId = {"metadata":{"allOf":[{"type":"object","prope ; const DeleteAppsId = {"metadata":{"allOf":[{"type":"object","properties":{"id":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"The ID of the application to be deleted."}},"required":["id"]}]}} as const ; -const Error = {"additionalProperties":false,"properties":{"code":{"description":"The HTTP status code returned.","type":"integer"},"details":{"description":"Any additional details about the error message.","type":"object","additionalProperties":true},"href":{"description":"The URL to documentation about the error code.","type":"string"},"message":{"description":"The error message.","type":"string"},"statusCode":{"description":"The Ably error code.","type":"integer"}},"required":["message","code","statusCode","href"],"type":"object","title":"error","x-readme-ref-name":"error"} as const +const Error = {"additionalProperties":false,"properties":{"code":{"description":"The HTTP status code returned.","type":"integer"},"details":{"description":"Any additional details about the error message.","type":["object","null"],"additionalProperties":true},"href":{"description":"The URL to documentation about the error code.","type":"string"},"message":{"description":"The error message.","type":"string"},"statusCode":{"description":"The Ably error code.","type":"integer"}},"required":["message","code","statusCode","href"],"type":"object","title":"error","x-readme-ref-name":"error"} as const ; const GetAccountsAccountIdApps = {"metadata":{"allOf":[{"type":"object","properties":{"account_id":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"The account ID for which to retrieve the associated applications."}},"required":["account_id"]}]},"response":{"200":{"items":AppResponse,"type":"array","$schema":"http://json-schema.org/draft-04/schema#"}}} as const ; @@ -76,29 +76,29 @@ const GetAppsAppIdRules = {"metadata":{"allOf":[{"type":"object","properties":{" ; const GetAppsAppIdRulesRuleId = {"metadata":{"allOf":[{"type":"object","properties":{"app_id":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"The application ID."},"rule_id":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"The rule ID."}},"required":["app_id","rule_id"]}]}} as const ; -const GoogleCloudFunctionRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Google Cloud Function. See the documentation for further information.","enum":["http/google-cloud-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"functionName":{"description":"The name of your Google Cloud Function.","type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"projectId":{"description":"The project ID for your Google Cloud Project that was generated when you created your project.","type":"string"},"region":{"description":"The region in which your Google Cloud Function is hosted. See the Google documentation for more details.","type":"string","examples":["us-west1"]},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"}},"type":"object"}},"type":"object","title":"google_cloud_function_rule_patch","x-readme-ref-name":"google_cloud_function_rule_patch"} as const +const GoogleCloudFunctionRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Google Cloud Function. See the documentation for further information.","enum":["http/google-cloud-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"functionName":{"description":"The name of your Google Cloud Function.","type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"projectId":{"description":"The project ID for your Google Cloud Project that was generated when you created your project.","type":"string"},"region":{"description":"The region in which your Google Cloud Function is hosted. See the Google documentation for more details.","type":"string","examples":["us-west1"]},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]}},"type":"object"}},"type":"object","title":"google_cloud_function_rule_patch","x-readme-ref-name":"google_cloud_function_rule_patch"} as const ; -const GoogleCloudFunctionRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Google Cloud Function. See the documentation for further information.","enum":["http/google-cloud-function"],"type":"string"},"source":RuleSource,"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"functionName":{"description":"The name of your Google Cloud Function.","type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"projectId":{"description":"The project ID for your Google Cloud Project that was generated when you created your project.","type":"string"},"region":{"description":"The region in which your Google Cloud Function is hosted. See the Google documentation for more details.","type":"string","examples":["us-west1"]},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"}},"required":["region","projectId","functionName"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"google_cloud_function_rule_post","x-readme-ref-name":"google_cloud_function_rule_post"} as const +const GoogleCloudFunctionRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Google Cloud Function. See the documentation for further information.","enum":["http/google-cloud-function"],"type":"string"},"source":RuleSource,"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"functionName":{"description":"The name of your Google Cloud Function.","type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"projectId":{"description":"The project ID for your Google Cloud Project that was generated when you created your project.","type":"string"},"region":{"description":"The region in which your Google Cloud Function is hosted. See the Google documentation for more details.","type":"string","examples":["us-west1"]},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]}},"required":["region","projectId","functionName"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"google_cloud_function_rule_post","x-readme-ref-name":"google_cloud_function_rule_post"} as const ; -const GoogleCloudFunctionRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Google Cloud Function. See the documentation for further information.","enum":["http/google-cloud-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a text-based encoding.","enum":["json"],"type":"string"},"functionName":{"description":"The name of your Google Cloud Function.","type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"projectId":{"description":"The project ID for your Google Cloud Project that was generated when you created your project.","type":"string"},"region":{"description":"The region in which your Google Cloud Function is hosted. See the Google documentation for more details.","type":"string","examples":["us-west1"]},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"}},"required":["region","projectId","functionName"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"google_cloud_function_rule_response","x-readme-ref-name":"google_cloud_function_rule_response"} as const +const GoogleCloudFunctionRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.\n\n`single` `batch`","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Google Cloud Function. See the documentation for further information.\n\n`http/google-cloud-function`","enum":["http/google-cloud-function"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a text-based encoding.\n\n`json`","enum":["json"],"type":"string"},"functionName":{"description":"The name of your Google Cloud Function.","type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"projectId":{"description":"The project ID for your Google Cloud Project that was generated when you created your project.","type":"string"},"region":{"description":"The region in which your Google Cloud Function is hosted. See the Google documentation for more details.","type":"string","examples":["us-west1"]},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]}},"required":["region","projectId","functionName"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"google_cloud_function_rule_response","x-readme-ref-name":"google_cloud_function_rule_response"} as const ; -const HttpRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. See the documentation for further information.","enum":["http"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a simpler text-based encoding, whereas MsgPack provides a more efficient binary encoding.","enum":["json","msgpack"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"http_rule_patch","x-readme-ref-name":"http_rule_patch"} as const +const HttpRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. See the documentation for further information.","enum":["http"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a simpler text-based encoding, whereas MsgPack provides a more efficient binary encoding.","enum":["json","msgpack"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"http_rule_patch","x-readme-ref-name":"http_rule_patch"} as const ; -const HttpRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. See the documentation for further information.","enum":["http"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a simpler text-based encoding, whereas MsgPack provides a more efficient binary encoding.","enum":["json","msgpack"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"description":"The URL of the endpoint that is invoked when events occur on Ably.","type":"string"}},"required":["url","format"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"http_rule_post","x-readme-ref-name":"http_rule_post"} as const +const HttpRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. See the documentation for further information.","enum":["http"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a simpler text-based encoding, whereas MsgPack provides a more efficient binary encoding.","enum":["json","msgpack"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"description":"The URL of the endpoint that is invoked when events occur on Ably.","type":"string"}},"required":["url","format"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"http_rule_post","x-readme-ref-name":"http_rule_post"} as const ; -const HttpRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. See the documentation for further information.","enum":["http"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":"boolean"},"format":{"description":"JSON provides a simpler text-based encoding, whereas MsgPack provides a more efficient binary encoding.","enum":["json","msgpack"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"required":["url","format"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"http_rule_response","x-readme-ref-name":"http_rule_response"} as const +const HttpRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.\n\n`single` `batch`","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. See the documentation for further information.\n\n`http`","enum":["http"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"enveloped":{"description":"Messages delivered through Reactor are wrapped in an Ably envelope by default that contains metadata about the message and its payload. The form of the envelope depends on whether it is part of a Webhook/Function or a Queue/Firehose rule. For everything besides Webhooks, you can ensure you only get the raw payload by unchecking \"Enveloped\" when setting up the rule.","type":["boolean","null"]},"format":{"description":"JSON provides a simpler text-based encoding, whereas MsgPack provides a more efficient binary encoding.\n\n`json` `msgpack`","enum":["json","msgpack"],"type":"string"},"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"required":["url","format"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"http_rule_response","x-readme-ref-name":"http_rule_response"} as const ; const IftttRulePatch = {"x-requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"example":"single","type":"string"},"x-ruleType":{"description":"The type of rule. In this case IFTTT. See the documentation for further information.","enum":["http/ifttt"],"type":"string"},"x-source":{"additionalProperties":false,"properties":{"channelFilter":{"description":"This field allows you to filter your rule based on a regular expression that is matched against the complete channel name. Leave this empty if you want the rule to apply to all channels.","type":"string"},"type":{"description":"The type `channel.message` delivers all messages published on a channel. The type `channel.presence` delivers all enter, update and leave events for members present on a channel. The type `channel.lifecycle` events for this rule type are currently not supported. Get in touch (https://ably.com/contact) if you need this feature. The type `channel.occupancy` delivers all occupancy events for the channel.","enum":["channel.message","channel.presence","channel.lifecycle","channel.occupancy"],"example":"channel.message","type":"string"}},"required":["channelFilter","type"],"type":"object","title":"rule_source","x-readme-ref-name":"rule_source"},"x-target":{"additionalProperties":false,"properties":{"eventName":{"type":"string"},"webhookKey":{"type":"string"}},"type":"object"},"title":"ifttt_rule_patch","x-readme-ref-name":"ifttt_rule_patch"} as const ; const IftttRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case IFTTT. See the documentation for further information.","enum":["http/ifttt"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"eventName":{"type":"string"},"webhookKey":{"type":"string"}},"required":["webhookKey","eventName"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"ifttt_rule_post","x-readme-ref-name":"ifttt_rule_post"} as const ; -const IftttRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case IFTTT. See the documentation for further information.","enum":["http/ifttt"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"eventName":{"type":"string"},"webhookKey":{"type":"string"}},"required":["webhookKey","eventName"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"ifttt_rule_response","x-readme-ref-name":"ifttt_rule_response"} as const +const IftttRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"Single request mode sends each event separately to the endpoint specified by the rule. You can read more about single request mode events in the Ably documentation.\n\n`single`","enum":["single"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case IFTTT. See the documentation for further information.\n\n`http/ifttt`","enum":["http/ifttt"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"eventName":{"type":"string"},"webhookKey":{"type":"string"}},"required":["webhookKey","eventName"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"ifttt_rule_response","x-readme-ref-name":"ifttt_rule_response"} as const ; const KeyPatch = {"additionalProperties":false,"properties":{"capabilities":{"description":"The capabilities that this key has. More information on capabilities can be found in the Ably documentation.","items":{"enum":["publish","subscribe","history","presence","channel-metadata","push-admin","push-subscribe","statistics"],"type":"string"},"type":"array"},"channels":{"description":"Specify the channels and queues that this key can be used with.","type":"string"},"name":{"description":"The name for your API key. This is a friendly name for your reference.","type":"string"}},"type":"object","title":"key_patch","x-readme-ref-name":"key_patch"} as const ; const KeyPost = {"additionalProperties":false,"properties":{"capabilities":{"description":"The capabilities that this key has. More information on capabilities can be found in the Ably documentation.","items":{"enum":["publish","subscribe","history","presence","channel-metadata","push-admin","push-subscribe","statistics"],"type":"string"},"type":"array"},"channels":{"description":"Specify the channels and queues that this key can be used with.","type":"string"},"name":{"description":"The name for your API key. This is a friendly name for your reference.","type":"string"}},"required":["name","channels","capabilities"],"type":"object","title":"key_post","x-readme-ref-name":"key_post"} as const ; -const KeyResponse = {"additionalProperties":false,"properties":{"appId":{"description":"The Ably application ID which this key is associated with.","type":"string","examples":["28GY6a"]},"capability":{"additionalProperties":{"items":{"enum":["publish","subscribe","history","presence","channel-metadata","push-admin","push-subscribe","statistics"],"type":"string"},"type":"array"},"description":"The capabilities that this key has. More information on capabilities can be found in the Ably documentation.","type":"object"},"created":{"description":"Unix timestamp representing the date and time of creation of the key.","type":"integer","examples":[1602844091815]},"id":{"description":"The key ID.","type":"string"},"key":{"description":"The complete API key including API secret.","type":"string"},"modified":{"description":"Unix timestamp representing the date and time of the last modification of the key.","type":"integer","examples":[1614679682091]},"name":{"description":"The name of the application this key is associated with.","type":"string"}},"type":"object","title":"key_response","x-readme-ref-name":"key_response"} as const +const KeyResponse = {"additionalProperties":false,"properties":{"appId":{"description":"The Ably application ID which this key is associated with.","type":"string","examples":["28GY6a"]},"capability":{"additionalProperties":{"items":{"enum":["publish","subscribe","history","presence","channel-metadata","push-admin","push-subscribe","statistics"],"type":"string","description":"`publish` `subscribe` `history` `presence` `channel-metadata` `push-admin` `push-subscribe` `statistics`"},"type":"array"},"description":"The capabilities that this key has. More information on capabilities can be found in the Ably documentation.","type":"object"},"created":{"description":"Unix timestamp representing the date and time of creation of the key.","type":"integer","examples":[1602844091815]},"id":{"description":"The key ID.","type":"string"},"key":{"description":"The complete API key including API secret.","type":"string"},"modified":{"description":"Unix timestamp representing the date and time of the last modification of the key.","type":"integer","examples":[1614679682091]},"name":{"description":"The name of the application this key is associated with.","type":"string"}},"type":"object","title":"key_response","x-readme-ref-name":"key_response"} as const ; const Me = {"additionalProperties":false,"properties":{"account":{"additionalProperties":false,"properties":{"id":{"description":"The account ID.","type":"string","examples":["VpWaOA"]},"name":{"description":"The name of the account.","type":"string","examples":["Free account"]}},"required":["id","name"],"type":"object"},"token":{"additionalProperties":false,"properties":{"capabilities":{"description":"An array containing the access capabilities associated with the access token.","items":{"type":"string"},"type":"array","examples":["write:namespace","read:namespace","write:queue","read:queue","write:rule","read:rule","write:key","read:key","write:app","read:app"]},"id":{"description":"The token ID. This is a UUID.","type":"integer","examples":["C95837C9-184B-4CC2-8779-B769F960FADB"]},"name":{"description":"The friendly name for the token.","type":"string","examples":["My Token"]}},"required":["id","name","capabilities"],"type":"object"},"user":{"additionalProperties":false,"properties":{"email":{"description":"Email address of the user associated with the account.","type":"string"},"id":{"description":"The user ID associated with the account. This is a UUID.","type":"integer","examples":["C95837C9-184B-4CC2-8779-B769F960FADB"]}},"required":["id","email"],"type":"object"}},"type":"object","title":"me","x-readme-ref-name":"me"} as const ; @@ -132,9 +132,7 @@ const PostAppsIdPkcs12 = {"metadata":{"allOf":[{"type":"object","properties":{"i ; const Queue = {"additionalProperties":false,"properties":{"maxLength":{"description":"Message limit in number of messages.","type":"integer","examples":[10000]},"name":{"description":"A friendly name for your queue.","type":"string","examples":["My queue"]},"region":{"description":"The data center region. US East (Virginia) or EU West (Ireland). Values are `us-east-1-a` or `eu-west-1-a`.","type":"string","examples":["us-east-1-a"]},"ttl":{"description":"TTL in minutes.","type":"integer","examples":[60]}},"required":["name","ttl","maxLength","region"],"type":"object","title":"queue","x-readme-ref-name":"queue"} as const ; -const QueueResponse = {"additionalProperties":false,"properties":{"amqp":{"additionalProperties":false,"properties":{"queueName":{"description":"Name of the Ably queue.","type":"string","examples":["28AB6w:My queue"]},"uri":{"description":"URI for the AMQP queue interface.","type":"string","examples":["amqps://us-east-1-a-queue.ably.io:5671/shared"]}},"type":"object"},"appId":{"description":"The Ably application ID.","type":"string","examples":["28AB6w"]},"deadletter":{"description":"A boolean that indicates whether this is a dead letter queue or not.","type":"boolean","examples":[false]},"deadletterId":{"type":"string","examples":["28AB6w:us-east-1-a:deadletter"]},"id":{"description":"The ID of the Ably queue","type":"string","examples":["28AB6w:us-east-1-a:My queue"]},"maxLength":{"description":"Message limit in number of messages.","type":"integer","examples":[10000]},"messages":{"additionalProperties":false,"description":"Details of messages in the queue.","properties":{"ready":{"description":"The number of ready messages in the queue.","type":"integer","examples":[0]},"total":{"description":"The total number of messages in the queue.","type":"integer","examples":[0]},"unacknowledged":{"description":"The number of unacknowledged messages in the queue.","type":"integer","examples":[0]}},"type":"object"},"name":{"description":"The friendly name of the queue.","type":"string","examples":["My queue"]},"region":{"description":"The data center region for the queue.","type":"string","examples":["eu-west-1-a"]},"state":{"description":"The current state of the queue.","type":"string","examples":["Running"]},"stats":{"additionalProperties":false,"properties":{"acknowledgementRate":{"description":"The rate at which messages are acknowledged. Rate is messages per minute.","type":"number"},"deliveryRate":{"description":"The rate at which messages are delivered from the queue. Rate is messages per minute.","type":"number"},"publishRate":{"description":"The rate at which messages are published to the queue. Rate is messages per minute.","type":"number"}},"type":"object"},"stomp":{"additionalProperties":false,"properties":{"destination":{"description":"Destination queue.","type":"string","examples":["/amqp/queue/28AB6w:My queue"]},"host":{"description":"The host type for the queue.","type":"string","examples":["shared"]},"uri":{"description":"URI for the STOMP queue interface.","type":"string","examples":["stomp://us-east-1-a-queue.ably.io:61614"]}},"type":"object"},"ttl":{"description":"TTL in minutes.","type":"integer","examples":[60]}},"type":"object","title":"queue_response","x-readme-ref-name":"queue_response"} as const -; -const RuleAttributes = {"additionalProperties":false,"properties":{"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"type":"object","title":"rule_attributes","x-readme-ref-name":"rule_attributes"} as const +const QueueResponse = {"additionalProperties":false,"properties":{"amqp":{"additionalProperties":false,"properties":{"queueName":{"description":"Name of the Ably queue.","type":"string","examples":["28AB6w:My queue"]},"uri":{"description":"URI for the AMQP queue interface.","type":"string","examples":["amqps://us-east-1-a-queue.ably.io:5671/shared"]}},"type":"object"},"appId":{"description":"The Ably application ID.","type":"string","examples":["28AB6w"]},"deadletter":{"description":"A boolean that indicates whether this is a dead letter queue or not.","type":"boolean","examples":[false]},"deadletterId":{"type":["string","null"],"examples":["28AB6w:us-east-1-a:deadletter"]},"id":{"description":"The ID of the Ably queue","type":"string","examples":["28AB6w:us-east-1-a:My queue"]},"maxLength":{"description":"Message limit in number of messages.","type":"integer","examples":[10000]},"messages":{"additionalProperties":false,"description":"Details of messages in the queue.","properties":{"ready":{"description":"The number of ready messages in the queue.","type":["integer","null"],"examples":[0]},"total":{"description":"The total number of messages in the queue.","type":["integer","null"],"examples":[0]},"unacknowledged":{"description":"The number of unacknowledged messages in the queue.","type":["integer","null"],"examples":[0]}},"type":"object"},"name":{"description":"The friendly name of the queue.","type":"string","examples":["My queue"]},"region":{"description":"The data center region for the queue.","type":"string","examples":["eu-west-1-a"]},"state":{"description":"The current state of the queue.","type":"string","examples":["Running"]},"stats":{"additionalProperties":false,"properties":{"acknowledgementRate":{"description":"The rate at which messages are acknowledged. Rate is messages per minute.","type":["number","null"]},"deliveryRate":{"description":"The rate at which messages are delivered from the queue. Rate is messages per minute.","type":["number","null"]},"publishRate":{"description":"The rate at which messages are published to the queue. Rate is messages per minute.","type":["number","null"]}},"type":"object"},"stomp":{"additionalProperties":false,"properties":{"destination":{"description":"Destination queue.","type":"string","examples":["/amqp/queue/28AB6w:My queue"]},"host":{"description":"The host type for the queue.","type":"string","examples":["shared"]},"uri":{"description":"URI for the STOMP queue interface.","type":"string","examples":["stomp://us-east-1-a-queue.ably.io:61614"]}},"type":"object"},"ttl":{"description":"TTL in minutes.","type":"integer","examples":[60]}},"type":"object","title":"queue_response","x-readme-ref-name":"queue_response"} as const ; const RulePatch = {"discriminator":{"mapping":{"amqp":"#/components/schemas/amqp_rule_patch","amqp/external":"#/components/schemas/amqp_external_rule_patch","aws/kinesis":"#/components/schemas/aws_kinesis_rule_patch","aws/lambda":"#/components/schemas/aws_lambda_rule_patch","aws/sqs":"#/components/schemas/aws_sqs_rule_patch","http":"#/components/schemas/http_rule_patch","http/azure-function":"#/components/schemas/azure_function_rule_patch","http/cloudflare-worker":"#/components/schemas/cloudflare_worker_rule_patch","http/google-cloud-function":"#/components/schemas/google_cloud_function_rule_patch","http/ifttt":"#/components/schemas/ifttt_rule_patch","http/zapier":"#/components/schemas/zapier_rule_patch"},"propertyName":"ruleType"},"oneOf":[HttpRulePatch,IftttRulePatch,ZapierRulePatch,CloudflareWorkerRulePatch,AzureFunctionRulePatch,GoogleCloudFunctionRulePatch,AwsLambdaRulePatch,AwsKinesisRulePatch,AwsSqsRulePatch,AmqpRulePatch,AmqpExternalRulePatch],"title":"rule_patch","x-readme-ref-name":"rule_patch"} as const ; @@ -142,16 +140,14 @@ const RulePost = {"discriminator":{"mapping":{"amqp":"#/components/schemas/amqp_ ; const RuleResponse = {"discriminator":{"mapping":{"amqp":"#/components/schemas/amqp_rule_response","amqp/external":"#/components/schemas/amqp_external_rule_response","aws/kinesis":"#/components/schemas/aws_kinesis_rule_response","aws/lambda":"#/components/schemas/aws_lambda_rule_response","aws/sqs":"#/components/schemas/aws_sqs_rule_response","http":"#/components/schemas/http_rule_response","http/azure-function":"#/components/schemas/azure_function_rule_response","http/cloudflare-worker":"#/components/schemas/cloudflare_worker_rule_response","http/google-cloud-function":"#/components/schemas/google_cloud_function_rule_response","http/ifttt":"#/components/schemas/ifttt_rule_response","http/zapier":"#/components/schemas/zapier_rule_response"},"propertyName":"ruleType"},"oneOf":[HttpRuleResponse,IftttRuleResponse,ZapierRuleResponse,CloudflareWorkerRuleResponse,AzureFunctionRuleResponse,GoogleCloudFunctionRuleResponse,AwsLambdaRuleResponse,AwsKinesisRuleResponse,AwsSqsRuleResponse,AmqpRuleResponse,AmqpExternalRuleResponse],"title":"rule_response","x-readme-ref-name":"rule_response"} as const ; -const RuleSource = {"additionalProperties":false,"properties":{"channelFilter":{"description":"This field allows you to filter your rule based on a regular expression that is matched against the complete channel name. Leave this empty if you want the rule to apply to all channels.","type":"string"},"type":{"description":"The type `channel.message` delivers all messages published on a channel. The type `channel.presence` delivers all enter, update and leave events for members present on a channel. The type `channel.lifecycle` events for this rule type are currently not supported. Get in touch (https://ably.com/contact) if you need this feature. The type `channel.occupancy` delivers all occupancy events for the channel.","enum":["channel.message","channel.presence","channel.lifecycle","channel.occupancy"],"type":"string","examples":["channel.message"]}},"required":["channelFilter","type"],"type":"object","title":"rule_source","x-readme-ref-name":"rule_source"} as const -; -const RuleSourcePatch = {"additionalProperties":false,"properties":{"channelFilter":{"description":"This field allows you to filter your rule based on a regular expression that is matched against the complete channel name. Leave this empty if you want the rule to apply to all channels.","type":"string"},"type":{"description":"The type `channel.message` delivers all messages published on a channel. The type `channel.presence` delivers all enter, update and leave events for members present on a channel. The type `channel.lifecycle` events for this rule type are currently not supported. Get in touch (https://ably.com/contact) if you need this feature. The type `channel.occupancy` delivers all occupancy events for the channel.","enum":["channel.message","channel.presence","channel.lifecycle","channel.occupancy"],"type":"string"}},"type":"object","title":"rule_source_patch","x-readme-ref-name":"rule_source_patch"} as const +const RuleSource = {"additionalProperties":false,"properties":{"channelFilter":{"description":"This field allows you to filter your rule based on a regular expression that is matched against the complete channel name. Leave this empty if you want the rule to apply to all channels.","type":"string"},"type":{"description":"The type `channel.message` delivers all messages published on a channel. The type `channel.presence` delivers all enter, update and leave events for members present on a channel. The type `channel.lifecycle` events for this rule type are currently not supported. Get in touch (https://ably.com/contact) if you need this feature. The type `channel.occupancy` delivers all occupancy events for the channel.\n\n`channel.message` `channel.presence` `channel.lifecycle` `channel.occupancy`","enum":["channel.message","channel.presence","channel.lifecycle","channel.occupancy"],"type":"string","examples":["channel.message"]}},"required":["channelFilter","type"],"type":"object","title":"rule_source","x-readme-ref-name":"rule_source"} as const ; -const UnsupportedRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"This rule type is currently unsupported.","enum":["unsupported"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"unsupported_rule_response","x-readme-ref-name":"unsupported_rule_response"} as const +const UnsupportedRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"This rule type is currently unsupported.","enum":["unsupported"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"url":{"type":"string"}},"required":["url"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"unsupported_rule_response","x-readme-ref-name":"unsupported_rule_response"} as const ; -const ZapierRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Zapier. See the documentation for further information.","enum":["http/zapier"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"zapier_rule_patch","x-readme-ref-name":"zapier_rule_patch"} as const +const ZapierRulePatch = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Zapier. See the documentation for further information.","enum":["http/zapier"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"type":"object"}},"type":"object","title":"zapier_rule_patch","x-readme-ref-name":"zapier_rule_patch"} as const ; -const ZapierRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Zapier. See the documentation for further information.","enum":["http/zapier"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"zapier_rule_post","x-readme-ref-name":"zapier_rule_post"} as const +const ZapierRulePost = {"additionalProperties":false,"properties":{"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Zapier. See the documentation for further information.","enum":["http/zapier"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"required":["url"],"type":"object"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"zapier_rule_post","x-readme-ref-name":"zapier_rule_post"} as const ; -const ZapierRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":"object","additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Zapier. See the documentation for further information.","enum":["http/zapier"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":"string"},"url":{"type":"string"}},"required":["url"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"zapier_rule_response","x-readme-ref-name":"zapier_rule_response"} as const +const ZapierRuleResponse = {"additionalProperties":false,"properties":{"_links":{"type":["object","null"],"additionalProperties":true},"appId":{"description":"The Ably application ID.","type":"string","examples":["28GY6a"]},"created":{"description":"Unix timestamp representing the date and time of creation of the rule.","type":"number","examples":[1602844091815]},"id":{"description":"The rule ID.","type":"string","examples":["83IzAB"]},"modified":{"description":"Unix timestamp representing the date and time of last modification of the rule.","type":"number","examples":[1614679682091]},"requestMode":{"description":"This is Single Request mode or Batch Request mode. Single Request mode sends each event separately to the endpoint specified by the rule. Batch Request mode rolls up multiple events into the same request. You can read more about the difference between single and batched events in the Ably documentation.\n\n`single` `batch`","enum":["single","batch"],"type":"string","examples":["single"]},"ruleType":{"description":"The type of rule. In this case Zapier. See the documentation for further information.\n\n`http/zapier`","enum":["http/zapier"],"type":"string"},"source":RuleSource,"status":{"description":"The status of the rule. Rules can be enabled or disabled.\n\n`enabled` `disabled`","enum":["enabled","disabled"],"type":"string","examples":["enabled"]},"target":{"additionalProperties":false,"properties":{"headers":{"description":"If you have additional information to send, you'll need to include the relevant headers.","items":{"properties":{"name":{"description":"The name of the header.","type":"string"},"value":{"description":"The value of the header.","type":"string"}},"type":"object"},"type":"array"},"signingKeyId":{"description":"The signing key ID for use in `batch` mode. Ably will optionally sign the payload using an API key ensuring your servers can validate the payload using the private API key. See the webhook security docs for more information.","type":["string","null"]},"url":{"type":"string"}},"required":["url"],"type":"object"},"version":{"description":"API version. Events and the format of their payloads are versioned. Please see the Events documentation.","type":"string"}},"required":["ruleType","requestMode","source","target"],"type":"object","title":"zapier_rule_response","x-readme-ref-name":"zapier_rule_response"} as const ; -export { AmqpExternalRulePatch, AmqpExternalRulePost, AmqpExternalRuleResponse, AmqpRulePatch, AmqpRulePost, AmqpRuleResponse, AppPatch, AppPkcs12, AppPost, AppResponse, AwsAccessKeys, AwsAccessKeysResponse, AwsAssumeRole, AwsKinesisRulePatch, AwsKinesisRulePost, AwsKinesisRuleResponse, AwsLambdaRulePatch, AwsLambdaRulePost, AwsLambdaRuleResponse, AwsSqsRulePatch, AwsSqsRulePost, AwsSqsRuleResponse, AzureFunctionRulePatch, AzureFunctionRulePost, AzureFunctionRuleResponse, CloudflareWorkerRulePatch, CloudflareWorkerRulePost, CloudflareWorkerRuleResponse, DeleteAppsAppIdNamespacesNamespaceId, DeleteAppsAppIdQueuesQueueId, DeleteAppsAppIdRulesRuleId, DeleteAppsId, Error, GetAccountsAccountIdApps, GetAppsAppIdKeys, GetAppsAppIdNamespaces, GetAppsAppIdQueues, GetAppsAppIdRules, GetAppsAppIdRulesRuleId, GoogleCloudFunctionRulePatch, GoogleCloudFunctionRulePost, GoogleCloudFunctionRuleResponse, HttpRulePatch, HttpRulePost, HttpRuleResponse, IftttRulePatch, IftttRulePost, IftttRuleResponse, KeyPatch, KeyPost, KeyResponse, Me, NamespacePatch, NamespacePost, NamespaceResponse, PatchAppsAppIdKeysKeyId, PatchAppsAppIdNamespacesNamespaceId, PatchAppsAppIdRulesRuleId, PatchAppsId, PostAccountsAccountIdApps, PostAppsAppIdKeys, PostAppsAppIdKeysKeyIdRevoke, PostAppsAppIdNamespaces, PostAppsAppIdQueues, PostAppsAppIdRules, PostAppsIdPkcs12, Queue, QueueResponse, RuleAttributes, RulePatch, RulePost, RuleResponse, RuleSource, RuleSourcePatch, UnsupportedRuleResponse, ZapierRulePatch, ZapierRulePost, ZapierRuleResponse } +export { AmqpExternalRulePatch, AmqpExternalRulePost, AmqpExternalRuleResponse, AmqpRulePatch, AmqpRulePost, AmqpRuleResponse, AppPatch, AppPkcs12, AppPost, AppResponse, AwsAccessKeys, AwsAccessKeysResponse, AwsAssumeRole, AwsKinesisRulePatch, AwsKinesisRulePost, AwsKinesisRuleResponse, AwsLambdaRulePatch, AwsLambdaRulePost, AwsLambdaRuleResponse, AwsSqsRulePatch, AwsSqsRulePost, AwsSqsRuleResponse, AzureFunctionRulePatch, AzureFunctionRulePost, AzureFunctionRuleResponse, CloudflareWorkerRulePatch, CloudflareWorkerRulePost, CloudflareWorkerRuleResponse, DeleteAppsAppIdNamespacesNamespaceId, DeleteAppsAppIdQueuesQueueId, DeleteAppsAppIdRulesRuleId, DeleteAppsId, Error, GetAccountsAccountIdApps, GetAppsAppIdKeys, GetAppsAppIdNamespaces, GetAppsAppIdQueues, GetAppsAppIdRules, GetAppsAppIdRulesRuleId, GoogleCloudFunctionRulePatch, GoogleCloudFunctionRulePost, GoogleCloudFunctionRuleResponse, HttpRulePatch, HttpRulePost, HttpRuleResponse, IftttRulePatch, IftttRulePost, IftttRuleResponse, KeyPatch, KeyPost, KeyResponse, Me, NamespacePatch, NamespacePost, NamespaceResponse, PatchAppsAppIdKeysKeyId, PatchAppsAppIdNamespacesNamespaceId, PatchAppsAppIdRulesRuleId, PatchAppsId, PostAccountsAccountIdApps, PostAppsAppIdKeys, PostAppsAppIdKeysKeyIdRevoke, PostAppsAppIdNamespaces, PostAppsAppIdQueues, PostAppsAppIdRules, PostAppsIdPkcs12, Queue, QueueResponse, RulePatch, RulePost, RuleResponse, RuleSource, UnsupportedRuleResponse, ZapierRulePatch, ZapierRulePost, ZapierRuleResponse } diff --git a/packages/api/test/__fixtures__/sdk/alby/types.ts b/packages/api/test/__fixtures__/sdk/alby/types.ts index 76065fca..d1a1a501 100644 --- a/packages/api/test/__fixtures__/sdk/alby/types.ts +++ b/packages/api/test/__fixtures__/sdk/alby/types.ts @@ -74,12 +74,10 @@ export type PostAppsAppIdRulesMetadataParam = FromSchema; export type Queue = FromSchema; export type QueueResponse = FromSchema; -export type RuleAttributes = FromSchema; export type RulePatch = FromSchema; export type RulePost = FromSchema; export type RuleResponse = FromSchema; export type RuleSource = FromSchema; -export type RuleSourcePatch = FromSchema; export type UnsupportedRuleResponse = FromSchema; export type ZapierRulePatch = FromSchema; export type ZapierRulePost = FromSchema; diff --git a/packages/api/test/__fixtures__/sdk/operationid-quirks/index.ts b/packages/api/test/__fixtures__/sdk/operationid-quirks/index.ts index c0d423b4..68c072e3 100644 --- a/packages/api/test/__fixtures__/sdk/operationid-quirks/index.ts +++ b/packages/api/test/__fixtures__/sdk/operationid-quirks/index.ts @@ -1,7 +1,7 @@ -import type { ConfigOptions, FetchResponse } from 'api/dist/core' +import type { ConfigOptions, FetchResponse } from '@api/core' import Oas from 'oas'; -import APICore from 'api/dist/core'; -import definition from '../../../__fixtures__/definitions/operationid-quirks.json'; +import APICore from '@api/core'; +import definition from '@api/test-utils/definitions/operationid-quirks.json'; class SDK { spec: Oas; diff --git a/packages/api/test/__fixtures__/sdk/optional-payload/index.ts b/packages/api/test/__fixtures__/sdk/optional-payload/index.ts index d0a41be4..dd415336 100644 --- a/packages/api/test/__fixtures__/sdk/optional-payload/index.ts +++ b/packages/api/test/__fixtures__/sdk/optional-payload/index.ts @@ -1,8 +1,8 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse } from 'api/dist/core' +import type { ConfigOptions, FetchResponse } from '@api/core' import Oas from 'oas'; -import APICore from 'api/dist/core'; -import definition from '../../../__fixtures__/definitions/optional-payload.json'; +import APICore from '@api/core'; +import definition from '@api/test-utils/definitions/optional-payload.json'; class SDK { spec: Oas; diff --git a/packages/api/test/__fixtures__/sdk/petstore/index.ts b/packages/api/test/__fixtures__/sdk/petstore/index.ts index 886d0817..ac5e3126 100644 --- a/packages/api/test/__fixtures__/sdk/petstore/index.ts +++ b/packages/api/test/__fixtures__/sdk/petstore/index.ts @@ -1,7 +1,7 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse } from 'api/dist/core' +import type { ConfigOptions, FetchResponse } from '@api/core' import Oas from 'oas'; -import APICore from 'api/dist/core'; +import APICore from '@api/core'; import definition from '@readme/oas-examples/3.0/json/petstore.json'; class SDK { diff --git a/packages/api/test/__fixtures__/sdk/petstore/schemas.ts b/packages/api/test/__fixtures__/sdk/petstore/schemas.ts index 8fbe5526..51d0899d 100644 --- a/packages/api/test/__fixtures__/sdk/petstore/schemas.ts +++ b/packages/api/test/__fixtures__/sdk/petstore/schemas.ts @@ -12,7 +12,7 @@ const DeletePet = {"metadata":{"allOf":[{"type":"object","properties":{"petId":{ ; const DeleteUser = {"metadata":{"allOf":[{"type":"object","properties":{"username":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"The name that needs to be deleted"}},"required":["username"]}]}} as const ; -const FindPetsByStatus = {"metadata":{"allOf":[{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["available","pending","sold"],"default":"available"},"$schema":"http://json-schema.org/draft-04/schema#","description":"Status values that need to be considered for filter"}},"required":["status"]}]},"response":{"200":{"type":"array","items":Pet,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const +const FindPetsByStatus = {"metadata":{"allOf":[{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["available","pending","sold"],"default":"available","description":"Default: available"},"$schema":"http://json-schema.org/draft-04/schema#","description":"Status values that need to be considered for filter"}},"required":["status"]}]},"response":{"200":{"type":"array","items":Pet,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const ; const FindPetsByTags = {"metadata":{"allOf":[{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"},"$schema":"http://json-schema.org/draft-04/schema#","description":"Tags to filter by"}},"required":["tags"]}]},"response":{"200":{"type":"array","items":Pet,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const ; diff --git a/packages/api/test/__fixtures__/sdk/readme/index.ts b/packages/api/test/__fixtures__/sdk/readme/index.ts index 858cf8ab..462031c9 100644 --- a/packages/api/test/__fixtures__/sdk/readme/index.ts +++ b/packages/api/test/__fixtures__/sdk/readme/index.ts @@ -1,7 +1,7 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse } from 'api/dist/core' +import type { ConfigOptions, FetchResponse } from '@api/core' import Oas from 'oas'; -import APICore from 'api/dist/core'; +import APICore from '@api/core'; import definition from '@readme/oas-examples/3.0/json/readme.json'; class SDK { @@ -484,4 +484,4 @@ const createSDK = (() => { return new SDK(); })() export default createSDK; -export type { Apply, BaseError, Category, Changelog, CondensedProjectData, CreateCategoryMetadataParam, CreateCustomPageResponse401, CreateCustomPageResponse403, CreateDocMetadataParam, CreateDocResponse401, CreateDocResponse403, CreateVersionResponse400, CreateVersionResponse401, CreateVersionResponse403, CustomPage, DeleteApiSpecificationMetadataParam, DeleteApiSpecificationResponse401, DeleteApiSpecificationResponse403, DeleteCategoryMetadataParam, DeleteChangelogMetadataParam, DeleteCustomPageMetadataParam, DeleteCustomPageResponse401, DeleteCustomPageResponse403, DeleteDocMetadataParam, DeleteDocResponse401, DeleteDocResponse403, DeleteVersionMetadataParam, DeleteVersionResponse401, DeleteVersionResponse403, DocSchemaPost, DocSchemaPut, DocSchemaResponse, ErrorApikeyEmpty, ErrorApikeyMismatch, ErrorApikeyNotfound, ErrorApplyInvalidEmail, ErrorApplyInvalidJob, ErrorApplyInvalidName, ErrorCategoryInvalid, ErrorCategoryNotfound, ErrorChangelogInvalid, ErrorChangelogNotfound, ErrorCustompageInvalid, ErrorCustompageNotfound, ErrorDocInvalid, ErrorDocNotfound, ErrorEndpointNotfound, ErrorInternalError, ErrorProjectNeedsstaging, ErrorProjectNotfound, ErrorRateLimited, ErrorRegistryInvalid, ErrorRegistryNotfound, ErrorSpecFileEmpty, ErrorSpecIdDuplicate, ErrorSpecIdInvalid, ErrorSpecInvalid, ErrorSpecInvalidSchema, ErrorSpecNotfound, ErrorSpecTimeout, ErrorSpecVersionNotfound, ErrorUnexpectedError, ErrorVersionCantDemoteStable, ErrorVersionCantRemoveStable, ErrorVersionDuplicate, ErrorVersionEmpty, ErrorVersionForkEmpty, ErrorVersionForkNotfound, ErrorVersionInvalid, ErrorVersionNotfound, GetApiRegistryMetadataParam, GetApiRegistryResponse200, GetApiSchemaResponse200, GetApiSpecificationMetadataParam, GetApiSpecificationResponse200, GetApiSpecificationResponse401, GetApiSpecificationResponse403, GetCategoriesMetadataParam, GetCategoriesResponse200, GetCategoryDocsMetadataParam, GetCategoryMetadataParam, GetChangelogMetadataParam, GetChangelogsMetadataParam, GetChangelogsResponse200, GetCustomPageMetadataParam, GetCustomPageResponse401, GetCustomPageResponse403, GetCustomPagesMetadataParam, GetCustomPagesResponse200, GetCustomPagesResponse401, GetCustomPagesResponse403, GetDocMetadataParam, GetDocResponse401, GetDocResponse403, GetOpenRolesResponse200, GetProductionDocMetadataParam, GetProductionDocResponse401, GetProductionDocResponse403, GetProjectResponse401, GetProjectResponse403, GetVersionMetadataParam, GetVersionResponse401, GetVersionResponse403, GetVersionsResponse401, GetVersionsResponse403, JobOpening, SearchDocsMetadataParam, SearchDocsResponse401, SearchDocsResponse403, UpdateApiSpecificationBodyParam, UpdateApiSpecificationMetadataParam, UpdateApiSpecificationResponse400, UpdateApiSpecificationResponse401, UpdateApiSpecificationResponse403, UpdateCategoryMetadataParam, UpdateChangelogMetadataParam, UpdateCustomPageMetadataParam, UpdateCustomPageResponse401, UpdateCustomPageResponse403, UpdateDocMetadataParam, UpdateDocResponse401, UpdateDocResponse403, UpdateVersionMetadataParam, UpdateVersionResponse401, UpdateVersionResponse403, UploadApiSpecificationBodyParam, UploadApiSpecificationMetadataParam, UploadApiSpecificationResponse400, UploadApiSpecificationResponse401, UploadApiSpecificationResponse403, Version } from './types'; +export type { Apply, Category, Changelog, CondensedProjectData, CreateCategoryMetadataParam, CreateCustomPageResponse401, CreateCustomPageResponse403, CreateDocMetadataParam, CreateDocResponse401, CreateDocResponse403, CreateVersionResponse400, CreateVersionResponse401, CreateVersionResponse403, CustomPage, DeleteApiSpecificationMetadataParam, DeleteApiSpecificationResponse401, DeleteApiSpecificationResponse403, DeleteCategoryMetadataParam, DeleteChangelogMetadataParam, DeleteCustomPageMetadataParam, DeleteCustomPageResponse401, DeleteCustomPageResponse403, DeleteDocMetadataParam, DeleteDocResponse401, DeleteDocResponse403, DeleteVersionMetadataParam, DeleteVersionResponse401, DeleteVersionResponse403, DocSchemaPost, DocSchemaPut, DocSchemaResponse, ErrorApikeyEmpty, ErrorApikeyMismatch, ErrorApikeyNotfound, ErrorCategoryInvalid, ErrorCategoryNotfound, ErrorCustompageInvalid, ErrorCustompageNotfound, ErrorDocInvalid, ErrorDocNotfound, ErrorRegistryNotfound, ErrorSpecFileEmpty, ErrorSpecIdDuplicate, ErrorSpecIdInvalid, ErrorSpecInvalid, ErrorSpecInvalidSchema, ErrorSpecNotfound, ErrorSpecTimeout, ErrorSpecVersionNotfound, ErrorVersionCantDemoteStable, ErrorVersionCantRemoveStable, ErrorVersionDuplicate, ErrorVersionEmpty, ErrorVersionForkEmpty, ErrorVersionForkNotfound, ErrorVersionNotfound, GetApiRegistryMetadataParam, GetApiRegistryResponse200, GetApiSchemaResponse200, GetApiSpecificationMetadataParam, GetApiSpecificationResponse200, GetApiSpecificationResponse401, GetApiSpecificationResponse403, GetCategoriesMetadataParam, GetCategoriesResponse200, GetCategoryDocsMetadataParam, GetCategoryMetadataParam, GetChangelogMetadataParam, GetChangelogsMetadataParam, GetChangelogsResponse200, GetCustomPageMetadataParam, GetCustomPageResponse401, GetCustomPageResponse403, GetCustomPagesMetadataParam, GetCustomPagesResponse200, GetCustomPagesResponse401, GetCustomPagesResponse403, GetDocMetadataParam, GetDocResponse401, GetDocResponse403, GetOpenRolesResponse200, GetProductionDocMetadataParam, GetProductionDocResponse401, GetProductionDocResponse403, GetProjectResponse401, GetProjectResponse403, GetVersionMetadataParam, GetVersionResponse401, GetVersionResponse403, GetVersionsResponse401, GetVersionsResponse403, JobOpening, SearchDocsMetadataParam, SearchDocsResponse401, SearchDocsResponse403, UpdateApiSpecificationBodyParam, UpdateApiSpecificationMetadataParam, UpdateApiSpecificationResponse400, UpdateApiSpecificationResponse401, UpdateApiSpecificationResponse403, UpdateCategoryMetadataParam, UpdateChangelogMetadataParam, UpdateCustomPageMetadataParam, UpdateCustomPageResponse401, UpdateCustomPageResponse403, UpdateDocMetadataParam, UpdateDocResponse401, UpdateDocResponse403, UpdateVersionMetadataParam, UpdateVersionResponse401, UpdateVersionResponse403, UploadApiSpecificationBodyParam, UploadApiSpecificationMetadataParam, UploadApiSpecificationResponse400, UploadApiSpecificationResponse401, UploadApiSpecificationResponse403, Version } from './types'; diff --git a/packages/api/test/__fixtures__/sdk/readme/schemas.ts b/packages/api/test/__fixtures__/sdk/readme/schemas.ts index f9bef178..c4d023cd 100644 --- a/packages/api/test/__fixtures__/sdk/readme/schemas.ts +++ b/packages/api/test/__fixtures__/sdk/readme/schemas.ts @@ -1,10 +1,8 @@ -const Apply = {"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Your full name","default":"Your Name"},"email":{"type":"string","format":"email","description":"A valid email we can reach you at.","default":"you@example.com"},"job":{"type":"string","description":"The job you're looking to apply for (https://readme.com/careers).","enum":["Front End Engineer","Full Stack Engineer","Head of Product","Head of Solutions Engineering","Product Designer"],"default":"Front End Engineer"},"pronouns":{"type":"string","description":"Learn more at https://lgbtlifecenter.org/pronouns/"},"linkedin":{"type":"string","format":"url","description":"What have you been up to the past few years?"},"github":{"type":"string","description":"Or Bitbucket, Gitlab or anywhere else your code is hosted!","format":"url"},"coverLetter":{"type":"string","format":"blob","description":"What should we know about you?"},"dontReallyApply":{"type":"boolean","description":"Want to play with the API but not actually apply? Set this to true.","default":false}},"required":["name","email","job"],"title":"apply","x-readme-ref-name":"apply"} as const +const Apply = {"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Your full name","default":"Your Name"},"email":{"type":"string","format":"email","description":"A valid email we can reach you at.","default":"you@example.com"},"job":{"type":"string","description":"The job you're looking to apply for (https://readme.com/careers).\n\nDefault: `Front End Engineer`","enum":["Front End Engineer","Full Stack Engineer","Head of Product","Head of Solutions Engineering","Product Designer"],"default":"Front End Engineer"},"pronouns":{"type":"string","description":"Learn more at https://lgbtlifecenter.org/pronouns/"},"linkedin":{"type":"string","format":"url","description":"What have you been up to the past few years?"},"github":{"type":"string","description":"Or Bitbucket, Gitlab or anywhere else your code is hosted!","format":"url"},"coverLetter":{"type":"string","format":"blob","description":"What should we know about you?"},"dontReallyApply":{"type":"boolean","description":"Want to play with the API but not actually apply? Set this to true.","default":false}},"required":["name","email","job"],"title":"apply","x-readme-ref-name":"apply"} as const ; -const BaseError = {"type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received."},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}},"title":"baseError","x-readme-ref-name":"baseError"} as const +const Category = {"type":"object","title":"category","x-readme-ref-name":"category","required":["title"],"properties":{"title":{"type":"string","description":"A short title for the category. This is what will show in the sidebar."},"type":{"type":"string","enum":["reference","guide"],"default":"guide","description":"A category can be part of your reference or guide documentation, which is determined by this field.\n\nDefault: `guide`"}}} as const ; -const Category = {"type":"object","properties":{"title":{"type":"string","description":"A short title for the category. This is what will show in the sidebar."},"type":{"type":"string","enum":["reference","guide"],"default":"guide","description":"A category can be part of your reference or guide documentation, which is determined by this field."}},"title":"category","x-readme-ref-name":"category"} as const -; -const Changelog = {"type":"object","properties":{"title":{"type":"string","description":"Title of the changelog."},"type":{"type":"string","enum":["","added","fixed","improved","deprecated","removed"]},"body":{"type":"string","description":"Body content of the changelog."},"hidden":{"type":"boolean","description":"Visibility of the changelog.","default":true}},"required":["title","body"],"title":"changelog","x-readme-ref-name":"changelog"} as const +const Changelog = {"type":"object","properties":{"title":{"type":"string","description":"Title of the changelog."},"type":{"type":"string","enum":["","added","fixed","improved","deprecated","removed"],"description":"Default: "},"body":{"type":"string","description":"Body content of the changelog."},"hidden":{"type":"boolean","description":"Visibility of the changelog.","default":true}},"required":["title","body"],"title":"changelog","x-readme-ref-name":"changelog"} as const ; const CondensedProjectData = {"type":"object","properties":{"name":{"type":"string"},"subdomain":{"type":"string"},"jwtSecret":{"type":"string"},"baseUrl":{"type":"string","format":"url","description":"The base URL for the project. If the project is not running under a custom domain, it will be `https://projectSubdomain.readme.io`, otherwise it can either be or `https://example.com` or, in the case of an enterprise child project `https://example.com/projectSubdomain`."},"plan":{"type":"string"}},"title":"condensedProjectData","x-readme-ref-name":"condensedProjectData"} as const ; @@ -34,7 +32,7 @@ const DocSchemaPost = {"type":"object","oneOf":[{"required":["title","category"] ; const DocSchemaPut = {"type":"object","properties":{"title":{"type":"string","description":"Title of the page."},"type":{"type":"string","description":"Type of the page. The available types all show up under the /docs/ URL path of your docs project (also known as the \"guides\" section). Can be \"basic\" (most common), \"error\" (page desribing an API error), or \"link\" (page that redirects to an external link).","enum":["basic","error","link"]},"body":{"type":"string","description":"Body content of the page, formatted in [ReadMe-flavored Markdown](https://docs.readme.com/rdmd/docs)."},"category":{"type":"string","description":"Category ID of the page, which you can get through [the **Get all categories** endpoint](https://docs.readme.com/main/reference/getcategories)."},"hidden":{"type":"boolean","description":"Visibility of the page."},"order":{"type":"integer","description":"The position of the page in your project sidebar.","examples":[999]},"parentDoc":{"type":"string","description":"The parent doc's ID, if the page is a subpage."},"error":{"type":"object","properties":{"code":{"type":"string","description":"The error code for docs with the \"error\" type."}}},"categorySlug":{"type":"string","description":"The slug of the category this page is associated with. You can get this through [the **Get all categories** endpoint](https://docs.readme.com/main/reference/getcategories). This field is an alternative to the `category` field."},"parentDocSlug":{"type":"string","description":"If this page is a subpage, this field will be the slug of the parent document. You can get this through https://docs.readme.com/main/reference/docs#getdoc. This field is an alternative to the `parentDoc` field."}},"additionalProperties":true,"title":"docSchemaPut","x-readme-ref-name":"docSchemaPut"} as const ; -const DocSchemaResponse = {"type":"object","properties":{"title":{"type":"string","description":"Title of the page."},"type":{"type":"string","description":"Type of the page. The available types all show up under the /docs/ URL path of your docs project (also known as the \"guides\" section). Can be \"basic\" (most common), \"error\" (page desribing an API error), or \"link\" (page that redirects to an external link).","enum":["basic","error","link"]},"body":{"type":"string","description":"Body content of the page, formatted in [ReadMe-flavored Markdown](https://docs.readme.com/rdmd/docs)."},"category":{"type":"string","description":"Category ID of the page, which you can get through [the **Get all categories** endpoint](https://docs.readme.com/main/reference/getcategories)."},"hidden":{"type":"boolean","description":"Visibility of the page."},"order":{"type":"integer","description":"The position of the page in your project sidebar.","examples":[999]},"parentDoc":{"type":"string","description":"The parent doc's ID, if the page is a subpage."},"error":{"type":"object","properties":{"code":{"type":"string","description":"The error code for docs with the \"error\" type."}}}},"additionalProperties":true,"title":"docSchemaResponse","x-readme-ref-name":"docSchemaResponse"} as const +const DocSchemaResponse = {"type":"object","properties":{"title":{"type":"string","description":"Title of the page."},"type":{"type":"string","description":"Type of the page. The available types all show up under the /docs/ URL path of your docs project (also known as the \"guides\" section). Can be \"basic\" (most common), \"error\" (page desribing an API error), or \"link\" (page that redirects to an external link).\n\n`basic` `error` `link`","enum":["basic","error","link"]},"body":{"type":"string","description":"Body content of the page, formatted in [ReadMe-flavored Markdown](https://docs.readme.com/rdmd/docs)."},"category":{"type":"string","description":"Category ID of the page, which you can get through [the **Get all categories** endpoint](https://docs.readme.com/main/reference/getcategories)."},"hidden":{"type":"boolean","description":"Visibility of the page."},"order":{"type":"integer","description":"The position of the page in your project sidebar.","examples":[999]},"parentDoc":{"type":"string","description":"The parent doc's ID, if the page is a subpage."},"error":{"type":"object","properties":{"code":{"type":"string","description":"The error code for docs with the \"error\" type."}}}},"additionalProperties":true,"title":"docSchemaResponse","x-readme-ref-name":"docSchemaResponse"} as const ; const ErrorApikeyEmpty = {"title":"error_APIKEY_EMPTY","x-readme-ref-name":"error_APIKEY_EMPTY","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"APIKEY_EMPTY"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; @@ -42,20 +40,10 @@ const ErrorApikeyMismatch = {"title":"error_APIKEY_MISMATCH","x-readme-ref-name" ; const ErrorApikeyNotfound = {"title":"error_APIKEY_NOTFOUND","x-readme-ref-name":"error_APIKEY_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"APIKEY_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; -const ErrorApplyInvalidEmail = {"title":"error_APPLY_INVALID_EMAIL","x-readme-ref-name":"error_APPLY_INVALID_EMAIL","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"APPLY_INVALID_EMAIL"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorApplyInvalidJob = {"title":"error_APPLY_INVALID_JOB","x-readme-ref-name":"error_APPLY_INVALID_JOB","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"APPLY_INVALID_JOB"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorApplyInvalidName = {"title":"error_APPLY_INVALID_NAME","x-readme-ref-name":"error_APPLY_INVALID_NAME","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"APPLY_INVALID_NAME"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; const ErrorCategoryInvalid = {"title":"error_CATEGORY_INVALID","x-readme-ref-name":"error_CATEGORY_INVALID","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"CATEGORY_INVALID"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; const ErrorCategoryNotfound = {"title":"error_CATEGORY_NOTFOUND","x-readme-ref-name":"error_CATEGORY_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"CATEGORY_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; -const ErrorChangelogInvalid = {"title":"error_CHANGELOG_INVALID","x-readme-ref-name":"error_CHANGELOG_INVALID","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"CHANGELOG_INVALID"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorChangelogNotfound = {"title":"error_CHANGELOG_NOTFOUND","x-readme-ref-name":"error_CHANGELOG_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"CHANGELOG_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; const ErrorCustompageInvalid = {"title":"error_CUSTOMPAGE_INVALID","x-readme-ref-name":"error_CUSTOMPAGE_INVALID","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"CUSTOMPAGE_INVALID"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; const ErrorCustompageNotfound = {"title":"error_CUSTOMPAGE_NOTFOUND","x-readme-ref-name":"error_CUSTOMPAGE_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"CUSTOMPAGE_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const @@ -64,18 +52,6 @@ const ErrorDocInvalid = {"title":"error_DOC_INVALID","x-readme-ref-name":"error_ ; const ErrorDocNotfound = {"title":"error_DOC_NOTFOUND","x-readme-ref-name":"error_DOC_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"DOC_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; -const ErrorEndpointNotfound = {"title":"error_ENDPOINT_NOTFOUND","x-readme-ref-name":"error_ENDPOINT_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"ENDPOINT_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorInternalError = {"title":"error_INTERNAL_ERROR","x-readme-ref-name":"error_INTERNAL_ERROR","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"INTERNAL_ERROR"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorProjectNeedsstaging = {"title":"error_PROJECT_NEEDSSTAGING","x-readme-ref-name":"error_PROJECT_NEEDSSTAGING","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"PROJECT_NEEDSSTAGING"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorProjectNotfound = {"title":"error_PROJECT_NOTFOUND","x-readme-ref-name":"error_PROJECT_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"PROJECT_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorRateLimited = {"title":"error_RATE_LIMITED","x-readme-ref-name":"error_RATE_LIMITED","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"RATE_LIMITED"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; -const ErrorRegistryInvalid = {"title":"error_REGISTRY_INVALID","x-readme-ref-name":"error_REGISTRY_INVALID","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"REGISTRY_INVALID"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; const ErrorRegistryNotfound = {"title":"error_REGISTRY_NOTFOUND","x-readme-ref-name":"error_REGISTRY_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"REGISTRY_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; const ErrorSpecFileEmpty = {"title":"error_SPEC_FILE_EMPTY","x-readme-ref-name":"error_SPEC_FILE_EMPTY","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"SPEC_FILE_EMPTY"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const @@ -94,8 +70,6 @@ const ErrorSpecTimeout = {"title":"error_SPEC_TIMEOUT","x-readme-ref-name":"erro ; const ErrorSpecVersionNotfound = {"title":"error_SPEC_VERSION_NOTFOUND","x-readme-ref-name":"error_SPEC_VERSION_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"SPEC_VERSION_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; -const ErrorUnexpectedError = {"title":"error_UNEXPECTED_ERROR","x-readme-ref-name":"error_UNEXPECTED_ERROR","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"UNEXPECTED_ERROR"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; const ErrorVersionCantDemoteStable = {"title":"error_VERSION_CANT_DEMOTE_STABLE","x-readme-ref-name":"error_VERSION_CANT_DEMOTE_STABLE","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"VERSION_CANT_DEMOTE_STABLE"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; const ErrorVersionCantRemoveStable = {"title":"error_VERSION_CANT_REMOVE_STABLE","x-readme-ref-name":"error_VERSION_CANT_REMOVE_STABLE","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"VERSION_CANT_REMOVE_STABLE"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const @@ -108,8 +82,6 @@ const ErrorVersionForkEmpty = {"title":"error_VERSION_FORK_EMPTY","x-readme-ref- ; const ErrorVersionForkNotfound = {"title":"error_VERSION_FORK_NOTFOUND","x-readme-ref-name":"error_VERSION_FORK_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"VERSION_FORK_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; -const ErrorVersionInvalid = {"title":"error_VERSION_INVALID","x-readme-ref-name":"error_VERSION_INVALID","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"VERSION_INVALID"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const -; const ErrorVersionNotfound = {"title":"error_VERSION_NOTFOUND","x-readme-ref-name":"error_VERSION_NOTFOUND","type":"object","properties":{"error":{"type":"string","description":"An error code unique to the error received.","default":"VERSION_NOTFOUND"},"message":{"type":"string","description":"The reason why the error occured."},"suggestion":{"type":"string","description":"A helpful suggestion for how to alleviate the error."},"docs":{"type":"string","format":"url","description":"A [ReadMe Metrics](https://readme.com/metrics/) log URL where you can see more information the request that you made. If we have metrics URLs unavailable for your request, this URL will be a URL to our API Reference.","examples":["https://docs.readme.com/logs/6883d0ee-cf79-447a-826f-a48f7d5bdf5f"]},"help":{"type":"string","description":"Information on where you can receive additional assistance from our wonderful support team.","examples":["If you need help, email support@readme.io"]},"poem":{"type":"array","description":"A short poem we wrote you about your error.","items":{"type":"string"},"examples":["If you're seeing this error,","Things didn't quite go the way we hoped.","When we tried to process your request,","Maybe trying again it'll work—who knows!"]}}} as const ; const GetApiRegistry = {"metadata":{"allOf":[{"type":"object","properties":{"uuid":{"type":"string","$schema":"http://json-schema.org/draft-04/schema#","description":"An API Registry UUID. This can be found by navigating to your API Reference page and viewing code snippets for Node with the `api` library."}},"required":["uuid"]}]},"response":{"200":{"type":"object","additionalProperties":true,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const @@ -164,4 +136,4 @@ const UploadApiSpecification = {"body":{"type":"object","properties":{"spec":{"d ; const Version = {"type":"object","properties":{"version":{"type":"string","description":"Semantic Version"},"codename":{"type":"string","description":"Dubbed name of version."},"from":{"type":"string","description":"Semantic Version to use as the base fork."},"is_stable":{"type":"boolean","description":"Should this be the **main** version?"},"is_beta":{"type":"boolean","default":true},"is_hidden":{"type":"boolean","description":"Should this be publically accessible?"},"is_deprecated":{"type":"boolean","description":"Should this be deprecated? Only allowed in PUT operations."}},"required":["version","from"],"title":"version","x-readme-ref-name":"version"} as const ; -export { Apply, BaseError, Category, Changelog, CondensedProjectData, CreateCategory, CreateCustomPage, CreateDoc, CreateVersion, CustomPage, DeleteApiSpecification, DeleteCategory, DeleteChangelog, DeleteCustomPage, DeleteDoc, DeleteVersion, DocSchemaPost, DocSchemaPut, DocSchemaResponse, ErrorApikeyEmpty, ErrorApikeyMismatch, ErrorApikeyNotfound, ErrorApplyInvalidEmail, ErrorApplyInvalidJob, ErrorApplyInvalidName, ErrorCategoryInvalid, ErrorCategoryNotfound, ErrorChangelogInvalid, ErrorChangelogNotfound, ErrorCustompageInvalid, ErrorCustompageNotfound, ErrorDocInvalid, ErrorDocNotfound, ErrorEndpointNotfound, ErrorInternalError, ErrorProjectNeedsstaging, ErrorProjectNotfound, ErrorRateLimited, ErrorRegistryInvalid, ErrorRegistryNotfound, ErrorSpecFileEmpty, ErrorSpecIdDuplicate, ErrorSpecIdInvalid, ErrorSpecInvalid, ErrorSpecInvalidSchema, ErrorSpecNotfound, ErrorSpecTimeout, ErrorSpecVersionNotfound, ErrorUnexpectedError, ErrorVersionCantDemoteStable, ErrorVersionCantRemoveStable, ErrorVersionDuplicate, ErrorVersionEmpty, ErrorVersionForkEmpty, ErrorVersionForkNotfound, ErrorVersionInvalid, ErrorVersionNotfound, GetApiRegistry, GetApiSchema, GetApiSpecification, GetCategories, GetCategory, GetCategoryDocs, GetChangelog, GetChangelogs, GetCustomPage, GetCustomPages, GetDoc, GetOpenRoles, GetProductionDoc, GetProject, GetVersion, GetVersions, JobOpening, SearchDocs, UpdateApiSpecification, UpdateCategory, UpdateChangelog, UpdateCustomPage, UpdateDoc, UpdateVersion, UploadApiSpecification, Version } +export { Apply, Category, Changelog, CondensedProjectData, CreateCategory, CreateCustomPage, CreateDoc, CreateVersion, CustomPage, DeleteApiSpecification, DeleteCategory, DeleteChangelog, DeleteCustomPage, DeleteDoc, DeleteVersion, DocSchemaPost, DocSchemaPut, DocSchemaResponse, ErrorApikeyEmpty, ErrorApikeyMismatch, ErrorApikeyNotfound, ErrorCategoryInvalid, ErrorCategoryNotfound, ErrorCustompageInvalid, ErrorCustompageNotfound, ErrorDocInvalid, ErrorDocNotfound, ErrorRegistryNotfound, ErrorSpecFileEmpty, ErrorSpecIdDuplicate, ErrorSpecIdInvalid, ErrorSpecInvalid, ErrorSpecInvalidSchema, ErrorSpecNotfound, ErrorSpecTimeout, ErrorSpecVersionNotfound, ErrorVersionCantDemoteStable, ErrorVersionCantRemoveStable, ErrorVersionDuplicate, ErrorVersionEmpty, ErrorVersionForkEmpty, ErrorVersionForkNotfound, ErrorVersionNotfound, GetApiRegistry, GetApiSchema, GetApiSpecification, GetCategories, GetCategory, GetCategoryDocs, GetChangelog, GetChangelogs, GetCustomPage, GetCustomPages, GetDoc, GetOpenRoles, GetProductionDoc, GetProject, GetVersion, GetVersions, JobOpening, SearchDocs, UpdateApiSpecification, UpdateCategory, UpdateChangelog, UpdateCustomPage, UpdateDoc, UpdateVersion, UploadApiSpecification, Version } diff --git a/packages/api/test/__fixtures__/sdk/readme/types.ts b/packages/api/test/__fixtures__/sdk/readme/types.ts index 16b7271e..317a54b2 100644 --- a/packages/api/test/__fixtures__/sdk/readme/types.ts +++ b/packages/api/test/__fixtures__/sdk/readme/types.ts @@ -2,7 +2,6 @@ import type { FromSchema } from 'json-schema-to-ts'; import * as schemas from './schemas'; export type Apply = FromSchema; -export type BaseError = FromSchema; export type Category = FromSchema; export type Changelog = FromSchema; export type CondensedProjectData = FromSchema; @@ -36,23 +35,12 @@ export type DocSchemaResponse = FromSchema; export type ErrorApikeyEmpty = FromSchema; export type ErrorApikeyMismatch = FromSchema; export type ErrorApikeyNotfound = FromSchema; -export type ErrorApplyInvalidEmail = FromSchema; -export type ErrorApplyInvalidJob = FromSchema; -export type ErrorApplyInvalidName = FromSchema; export type ErrorCategoryInvalid = FromSchema; export type ErrorCategoryNotfound = FromSchema; -export type ErrorChangelogInvalid = FromSchema; -export type ErrorChangelogNotfound = FromSchema; export type ErrorCustompageInvalid = FromSchema; export type ErrorCustompageNotfound = FromSchema; export type ErrorDocInvalid = FromSchema; export type ErrorDocNotfound = FromSchema; -export type ErrorEndpointNotfound = FromSchema; -export type ErrorInternalError = FromSchema; -export type ErrorProjectNeedsstaging = FromSchema; -export type ErrorProjectNotfound = FromSchema; -export type ErrorRateLimited = FromSchema; -export type ErrorRegistryInvalid = FromSchema; export type ErrorRegistryNotfound = FromSchema; export type ErrorSpecFileEmpty = FromSchema; export type ErrorSpecIdDuplicate = FromSchema; @@ -62,14 +50,12 @@ export type ErrorSpecInvalidSchema = FromSchema; export type ErrorSpecTimeout = FromSchema; export type ErrorSpecVersionNotfound = FromSchema; -export type ErrorUnexpectedError = FromSchema; export type ErrorVersionCantDemoteStable = FromSchema; export type ErrorVersionCantRemoveStable = FromSchema; export type ErrorVersionDuplicate = FromSchema; export type ErrorVersionEmpty = FromSchema; export type ErrorVersionForkEmpty = FromSchema; export type ErrorVersionForkNotfound = FromSchema; -export type ErrorVersionInvalid = FromSchema; export type ErrorVersionNotfound = FromSchema; export type GetApiRegistryMetadataParam = FromSchema; export type GetApiRegistryResponse200 = FromSchema; diff --git a/packages/api/test/__fixtures__/sdk/response-title-quirks/index.ts b/packages/api/test/__fixtures__/sdk/response-title-quirks/index.ts index e29950c2..fa3b2b8e 100644 --- a/packages/api/test/__fixtures__/sdk/response-title-quirks/index.ts +++ b/packages/api/test/__fixtures__/sdk/response-title-quirks/index.ts @@ -1,8 +1,8 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse, HTTPMethodRange } from 'api/dist/core'; +import type { ConfigOptions, FetchResponse, HTTPMethodRange } from '@api/core'; import Oas from 'oas'; -import APICore from 'api/dist/core'; -import definition from '../../../__fixtures__/definitions/response-title-quirks.json'; +import APICore from '@api/core'; +import definition from '@api/test-utils/definitions/response-title-quirks.json'; class SDK { spec: Oas; diff --git a/packages/api/test/__fixtures__/sdk/response-title-quirks/schemas.ts b/packages/api/test/__fixtures__/sdk/response-title-quirks/schemas.ts index 1ace9bc3..5651e764 100644 --- a/packages/api/test/__fixtures__/sdk/response-title-quirks/schemas.ts +++ b/packages/api/test/__fixtures__/sdk/response-title-quirks/schemas.ts @@ -1,3 +1,3 @@ -const GetAnything = {"metadata":{"allOf":[{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["available","pending","sold"],"default":"available"},"$schema":"https://json-schema.org/draft/2020-12/schema#","description":"Status values that need to be considered for filter"}},"required":["status"]}]},"response":{"2XX":{"oneOf":[{"title":"260 Created (token)","type":"object","properties":{"id":{"type":"string","examples":["e450ec69-dac2-4858-b4c9-6d3af44bb5f8"]}}},{"title":"260 Created","type":"object","properties":{"id":{"type":"string","examples":["e450ec69-dac2-4858-b4c9-6d3af44bb5f8"]}}}],"$schema":"https://json-schema.org/draft/2020-12/schema#"}}} as const +const GetAnything = {"metadata":{"allOf":[{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["available","pending","sold"],"default":"available","description":"Default: available"},"$schema":"https://json-schema.org/draft/2020-12/schema#","description":"Status values that need to be considered for filter"}},"required":["status"]}]},"response":{"2XX":{"oneOf":[{"title":"260 Created (token)","type":"object","properties":{"id":{"type":"string","examples":["e450ec69-dac2-4858-b4c9-6d3af44bb5f8"]}}},{"title":"260 Created","type":"object","properties":{"id":{"type":"string","examples":["e450ec69-dac2-4858-b4c9-6d3af44bb5f8"]}}}],"$schema":"https://json-schema.org/draft/2020-12/schema#"}}} as const ; export { GetAnything } diff --git a/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.d.ts b/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.d.ts index 4d8b34cb..d2a7e7d5 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.d.ts +++ b/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.d.ts @@ -1,7 +1,7 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse } from 'api/dist/core'; +import type { ConfigOptions, FetchResponse } from '@api/core'; import Oas from 'oas'; -import APICore from 'api/dist/core'; +import APICore from '@api/core'; declare class SDK { spec: Oas; core: APICore; diff --git a/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.js b/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.js index 5958ae9e..99ee70ca 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.js +++ b/packages/api/test/__fixtures__/sdk/simple-js-cjs/index.js @@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; var oas_1 = __importDefault(require("oas")); -var core_1 = __importDefault(require("api/dist/core")); -var simple_json_1 = __importDefault(require("../../../__fixtures__/definitions/simple.json")); +var core_1 = __importDefault(require("@api/core")); +var simple_json_1 = __importDefault(require("@api/test-utils/definitions/simple.json")); var SDK = /** @class */ (function () { function SDK() { this.spec = oas_1.default.init(simple_json_1.default); diff --git a/packages/api/test/__fixtures__/sdk/simple-js-cjs/schemas.d.ts b/packages/api/test/__fixtures__/sdk/simple-js-cjs/schemas.d.ts index 71dd645d..11ee2ca4 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-cjs/schemas.d.ts +++ b/packages/api/test/__fixtures__/sdk/simple-js-cjs/schemas.d.ts @@ -1,22 +1,3 @@ -declare const ApiResponse: { - readonly type: "object"; - readonly properties: { - readonly code: { - readonly type: "integer"; - readonly format: "int32"; - readonly minimum: -2147483648; - readonly maximum: 2147483647; - }; - readonly type: { - readonly type: "string"; - }; - readonly message: { - readonly type: "string"; - }; - }; - readonly title: "ApiResponse"; - readonly "x-readme-ref-name": "ApiResponse"; -}; declare const Category: { readonly type: "object"; readonly properties: { @@ -44,6 +25,7 @@ declare const FindPetsByStatus: { readonly type: "string"; readonly enum: readonly ["available", "pending", "sold"]; readonly default: "available"; + readonly description: "Default: available"; }; readonly $schema: "http://json-schema.org/draft-04/schema#"; readonly description: "Status values that need to be considered for filter"; @@ -116,7 +98,7 @@ declare const FindPetsByStatus: { }; readonly status: { readonly type: "string"; - readonly description: "pet status in the store"; + readonly description: "pet status in the store\n\n`available` `pending` `sold`"; readonly enum: readonly ["available", "pending", "sold"]; }; }; @@ -127,44 +109,6 @@ declare const FindPetsByStatus: { }; }; }; -declare const Order: { - readonly type: "object"; - readonly properties: { - readonly id: { - readonly type: "integer"; - readonly format: "int64"; - readonly minimum: -9223372036854776000; - readonly maximum: 9223372036854776000; - }; - readonly petId: { - readonly type: "integer"; - readonly format: "int64"; - readonly minimum: -9223372036854776000; - readonly maximum: 9223372036854776000; - }; - readonly quantity: { - readonly type: "integer"; - readonly format: "int32"; - readonly minimum: -2147483648; - readonly maximum: 2147483647; - }; - readonly shipDate: { - readonly type: "string"; - readonly format: "date-time"; - }; - readonly status: { - readonly type: "string"; - readonly description: "Order Status"; - readonly enum: readonly ["placed", "approved", "delivered"]; - }; - readonly complete: { - readonly type: "boolean"; - readonly default: false; - }; - }; - readonly title: "Order"; - readonly "x-readme-ref-name": "Order"; -}; declare const Pet: { readonly type: "object"; readonly required: readonly ["name", "photoUrls"]; @@ -226,7 +170,7 @@ declare const Pet: { }; readonly status: { readonly type: "string"; - readonly description: "pet status in the store"; + readonly description: "pet status in the store\n\n`available` `pending` `sold`"; readonly enum: readonly ["available", "pending", "sold"]; }; }; @@ -249,42 +193,4 @@ declare const Tag: { readonly title: "Tag"; readonly "x-readme-ref-name": "Tag"; }; -declare const User: { - readonly type: "object"; - readonly properties: { - readonly id: { - readonly type: "integer"; - readonly format: "int64"; - readonly minimum: -9223372036854776000; - readonly maximum: 9223372036854776000; - }; - readonly username: { - readonly type: "string"; - }; - readonly firstName: { - readonly type: "string"; - }; - readonly lastName: { - readonly type: "string"; - }; - readonly email: { - readonly type: "string"; - }; - readonly password: { - readonly type: "string"; - }; - readonly phone: { - readonly type: "string"; - }; - readonly userStatus: { - readonly type: "integer"; - readonly format: "int32"; - readonly description: "User Status"; - readonly minimum: -2147483648; - readonly maximum: 2147483647; - }; - }; - readonly title: "User"; - readonly "x-readme-ref-name": "User"; -}; -export { ApiResponse, Category, FindPetsByStatus, Order, Pet, Tag, User }; +export { Category, FindPetsByStatus, Pet, Tag }; diff --git a/packages/api/test/__fixtures__/sdk/simple-js-cjs/types.d.ts b/packages/api/test/__fixtures__/sdk/simple-js-cjs/types.d.ts index 04a97fa1..5807822c 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-cjs/types.d.ts +++ b/packages/api/test/__fixtures__/sdk/simple-js-cjs/types.d.ts @@ -1,10 +1,7 @@ import type { FromSchema } from 'json-schema-to-ts'; import * as schemas from './schemas'; -export type ApiResponse = FromSchema; export type Category = FromSchema; export type FindPetsByStatusMetadataParam = FromSchema; export type FindPetsByStatusResponse200 = FromSchema; -export type Order = FromSchema; export type Pet = FromSchema; export type Tag = FromSchema; -export type User = FromSchema; diff --git a/packages/api/test/__fixtures__/sdk/simple-js-esm/index.d.ts b/packages/api/test/__fixtures__/sdk/simple-js-esm/index.d.ts index 1badaae1..f6f2d1f9 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-esm/index.d.ts +++ b/packages/api/test/__fixtures__/sdk/simple-js-esm/index.d.ts @@ -1,7 +1,7 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse } from 'api/dist/core'; +import type { ConfigOptions, FetchResponse } from '@api/core'; import Oas from 'oas'; -import APICore from 'api/dist/core'; +import APICore from '@api/core'; declare class SDK { spec: Oas; core: APICore; diff --git a/packages/api/test/__fixtures__/sdk/simple-js-esm/index.js b/packages/api/test/__fixtures__/sdk/simple-js-esm/index.js index cb078b80..0b0bc280 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-esm/index.js +++ b/packages/api/test/__fixtures__/sdk/simple-js-esm/index.js @@ -1,6 +1,6 @@ import Oas from 'oas'; -import APICore from 'api/dist/core'; -import definition from '../../../__fixtures__/definitions/simple.json'; +import APICore from '@api/core'; +import definition from '@api/test-utils/definitions/simple.json'; class SDK { constructor() { this.spec = Oas.init(definition); diff --git a/packages/api/test/__fixtures__/sdk/simple-js-esm/schemas.d.ts b/packages/api/test/__fixtures__/sdk/simple-js-esm/schemas.d.ts index 71dd645d..11ee2ca4 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-esm/schemas.d.ts +++ b/packages/api/test/__fixtures__/sdk/simple-js-esm/schemas.d.ts @@ -1,22 +1,3 @@ -declare const ApiResponse: { - readonly type: "object"; - readonly properties: { - readonly code: { - readonly type: "integer"; - readonly format: "int32"; - readonly minimum: -2147483648; - readonly maximum: 2147483647; - }; - readonly type: { - readonly type: "string"; - }; - readonly message: { - readonly type: "string"; - }; - }; - readonly title: "ApiResponse"; - readonly "x-readme-ref-name": "ApiResponse"; -}; declare const Category: { readonly type: "object"; readonly properties: { @@ -44,6 +25,7 @@ declare const FindPetsByStatus: { readonly type: "string"; readonly enum: readonly ["available", "pending", "sold"]; readonly default: "available"; + readonly description: "Default: available"; }; readonly $schema: "http://json-schema.org/draft-04/schema#"; readonly description: "Status values that need to be considered for filter"; @@ -116,7 +98,7 @@ declare const FindPetsByStatus: { }; readonly status: { readonly type: "string"; - readonly description: "pet status in the store"; + readonly description: "pet status in the store\n\n`available` `pending` `sold`"; readonly enum: readonly ["available", "pending", "sold"]; }; }; @@ -127,44 +109,6 @@ declare const FindPetsByStatus: { }; }; }; -declare const Order: { - readonly type: "object"; - readonly properties: { - readonly id: { - readonly type: "integer"; - readonly format: "int64"; - readonly minimum: -9223372036854776000; - readonly maximum: 9223372036854776000; - }; - readonly petId: { - readonly type: "integer"; - readonly format: "int64"; - readonly minimum: -9223372036854776000; - readonly maximum: 9223372036854776000; - }; - readonly quantity: { - readonly type: "integer"; - readonly format: "int32"; - readonly minimum: -2147483648; - readonly maximum: 2147483647; - }; - readonly shipDate: { - readonly type: "string"; - readonly format: "date-time"; - }; - readonly status: { - readonly type: "string"; - readonly description: "Order Status"; - readonly enum: readonly ["placed", "approved", "delivered"]; - }; - readonly complete: { - readonly type: "boolean"; - readonly default: false; - }; - }; - readonly title: "Order"; - readonly "x-readme-ref-name": "Order"; -}; declare const Pet: { readonly type: "object"; readonly required: readonly ["name", "photoUrls"]; @@ -226,7 +170,7 @@ declare const Pet: { }; readonly status: { readonly type: "string"; - readonly description: "pet status in the store"; + readonly description: "pet status in the store\n\n`available` `pending` `sold`"; readonly enum: readonly ["available", "pending", "sold"]; }; }; @@ -249,42 +193,4 @@ declare const Tag: { readonly title: "Tag"; readonly "x-readme-ref-name": "Tag"; }; -declare const User: { - readonly type: "object"; - readonly properties: { - readonly id: { - readonly type: "integer"; - readonly format: "int64"; - readonly minimum: -9223372036854776000; - readonly maximum: 9223372036854776000; - }; - readonly username: { - readonly type: "string"; - }; - readonly firstName: { - readonly type: "string"; - }; - readonly lastName: { - readonly type: "string"; - }; - readonly email: { - readonly type: "string"; - }; - readonly password: { - readonly type: "string"; - }; - readonly phone: { - readonly type: "string"; - }; - readonly userStatus: { - readonly type: "integer"; - readonly format: "int32"; - readonly description: "User Status"; - readonly minimum: -2147483648; - readonly maximum: 2147483647; - }; - }; - readonly title: "User"; - readonly "x-readme-ref-name": "User"; -}; -export { ApiResponse, Category, FindPetsByStatus, Order, Pet, Tag, User }; +export { Category, FindPetsByStatus, Pet, Tag }; diff --git a/packages/api/test/__fixtures__/sdk/simple-js-esm/types.d.ts b/packages/api/test/__fixtures__/sdk/simple-js-esm/types.d.ts index 04a97fa1..5807822c 100644 --- a/packages/api/test/__fixtures__/sdk/simple-js-esm/types.d.ts +++ b/packages/api/test/__fixtures__/sdk/simple-js-esm/types.d.ts @@ -1,10 +1,7 @@ import type { FromSchema } from 'json-schema-to-ts'; import * as schemas from './schemas'; -export type ApiResponse = FromSchema; export type Category = FromSchema; export type FindPetsByStatusMetadataParam = FromSchema; export type FindPetsByStatusResponse200 = FromSchema; -export type Order = FromSchema; export type Pet = FromSchema; export type Tag = FromSchema; -export type User = FromSchema; diff --git a/packages/api/test/__fixtures__/sdk/simple-ts/index.ts b/packages/api/test/__fixtures__/sdk/simple-ts/index.ts index 87da09ae..fef08cc4 100644 --- a/packages/api/test/__fixtures__/sdk/simple-ts/index.ts +++ b/packages/api/test/__fixtures__/sdk/simple-ts/index.ts @@ -1,8 +1,8 @@ import type * as types from './types'; -import type { ConfigOptions, FetchResponse } from 'api/dist/core' +import type { ConfigOptions, FetchResponse } from '@api/core' import Oas from 'oas'; -import APICore from 'api/dist/core'; -import definition from '../../../__fixtures__/definitions/simple.json'; +import APICore from '@api/core'; +import definition from '@api/test-utils/definitions/simple.json'; class SDK { spec: Oas; @@ -88,4 +88,4 @@ const createSDK = (() => { return new SDK(); })() export default createSDK; -export type { ApiResponse, Category, FindPetsByStatusMetadataParam, FindPetsByStatusResponse200, Order, Pet, Tag, User } from './types'; +export type { Category, FindPetsByStatusMetadataParam, FindPetsByStatusResponse200, Pet, Tag } from './types'; diff --git a/packages/api/test/__fixtures__/sdk/simple-ts/schemas.ts b/packages/api/test/__fixtures__/sdk/simple-ts/schemas.ts index 49d9164f..a0e1b7ef 100644 --- a/packages/api/test/__fixtures__/sdk/simple-ts/schemas.ts +++ b/packages/api/test/__fixtures__/sdk/simple-ts/schemas.ts @@ -1,15 +1,9 @@ -const ApiResponse = {"type":"object","properties":{"code":{"type":"integer","format":"int32","minimum":-2147483648,"maximum":2147483647},"type":{"type":"string"},"message":{"type":"string"}},"title":"ApiResponse","x-readme-ref-name":"ApiResponse"} as const -; const Category = {"type":"object","properties":{"id":{"type":"integer","format":"int64","minimum":-9223372036854776000,"maximum":9223372036854776000},"name":{"type":"string"}},"title":"Category","x-readme-ref-name":"Category"} as const ; -const FindPetsByStatus = {"metadata":{"allOf":[{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["available","pending","sold"],"default":"available"},"$schema":"http://json-schema.org/draft-04/schema#","description":"Status values that need to be considered for filter"}},"required":["status"]}]},"response":{"200":{"type":"array","items":Pet,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const -; -const Order = {"type":"object","properties":{"id":{"type":"integer","format":"int64","minimum":-9223372036854776000,"maximum":9223372036854776000},"petId":{"type":"integer","format":"int64","minimum":-9223372036854776000,"maximum":9223372036854776000},"quantity":{"type":"integer","format":"int32","minimum":-2147483648,"maximum":2147483647},"shipDate":{"type":"string","format":"date-time"},"status":{"type":"string","description":"Order Status","enum":["placed","approved","delivered"]},"complete":{"type":"boolean","default":false}},"title":"Order","x-readme-ref-name":"Order"} as const +const FindPetsByStatus = {"metadata":{"allOf":[{"type":"object","properties":{"status":{"type":"array","items":{"type":"string","enum":["available","pending","sold"],"default":"available","description":"Default: available"},"$schema":"http://json-schema.org/draft-04/schema#","description":"Status values that need to be considered for filter"}},"required":["status"]}]},"response":{"200":{"type":"array","items":Pet,"$schema":"http://json-schema.org/draft-04/schema#"}}} as const ; -const Pet = {"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64","readOnly":true,"default":40,"examples":[25],"minimum":-9223372036854776000,"maximum":9223372036854776000},"category":Category,"name":{"type":"string","examples":["doggie"]},"photoUrls":{"type":"array","items":{"type":"string","examples":["https://example.com/photo.png"]}},"tags":{"type":"array","items":Tag},"status":{"type":"string","description":"pet status in the store","enum":["available","pending","sold"]}},"title":"Pet","x-readme-ref-name":"Pet"} as const +const Pet = {"type":"object","required":["name","photoUrls"],"properties":{"id":{"type":"integer","format":"int64","readOnly":true,"default":40,"examples":[25],"minimum":-9223372036854776000,"maximum":9223372036854776000},"category":Category,"name":{"type":"string","examples":["doggie"]},"photoUrls":{"type":"array","items":{"type":"string","examples":["https://example.com/photo.png"]}},"tags":{"type":"array","items":Tag},"status":{"type":"string","description":"pet status in the store\n\n`available` `pending` `sold`","enum":["available","pending","sold"]}},"title":"Pet","x-readme-ref-name":"Pet"} as const ; const Tag = {"type":"object","properties":{"id":{"type":"integer","format":"int64","minimum":-9223372036854776000,"maximum":9223372036854776000},"name":{"type":"string"}},"title":"Tag","x-readme-ref-name":"Tag"} as const ; -const User = {"type":"object","properties":{"id":{"type":"integer","format":"int64","minimum":-9223372036854776000,"maximum":9223372036854776000},"username":{"type":"string"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string"},"password":{"type":"string"},"phone":{"type":"string"},"userStatus":{"type":"integer","format":"int32","description":"User Status","minimum":-2147483648,"maximum":2147483647}},"title":"User","x-readme-ref-name":"User"} as const -; -export { ApiResponse, Category, FindPetsByStatus, Order, Pet, Tag, User } +export { Category, FindPetsByStatus, Pet, Tag } diff --git a/packages/api/test/__fixtures__/sdk/simple-ts/types.ts b/packages/api/test/__fixtures__/sdk/simple-ts/types.ts index 53007759..4ea47267 100644 --- a/packages/api/test/__fixtures__/sdk/simple-ts/types.ts +++ b/packages/api/test/__fixtures__/sdk/simple-ts/types.ts @@ -1,11 +1,8 @@ import type { FromSchema } from 'json-schema-to-ts'; import * as schemas from './schemas'; -export type ApiResponse = FromSchema; export type Category = FromSchema; export type FindPetsByStatusMetadataParam = FromSchema; export type FindPetsByStatusResponse200 = FromSchema; -export type Order = FromSchema; export type Pet = FromSchema; export type Tag = FromSchema; -export type User = FromSchema; diff --git a/packages/api/test/cli/codegen/languages/typescript.test.ts b/packages/api/test/cli/codegen/languages/typescript.test.ts index 7386b408..d1c6889b 100644 --- a/packages/api/test/cli/codegen/languages/typescript.test.ts +++ b/packages/api/test/cli/codegen/languages/typescript.test.ts @@ -3,6 +3,8 @@ import type { TSGeneratorOptions } from '../../../../src/cli/codegen/languages/t import { promises as fs } from 'fs'; import path from 'path'; +import { responses as mockResponse } from '@api/test-utils/fetch-mock'; +import loadSpec from '@api/test-utils/load-spec'; import fetchMock from 'fetch-mock'; import Oas from 'oas'; import uniqueTempDir from 'unique-temp-dir'; @@ -11,8 +13,6 @@ import { describe, beforeEach, afterEach, it, expect, vi } from 'vitest'; import TSGenerator from '../../../../src/cli/codegen/languages/typescript'; import Storage from '../../../../src/cli/storage'; import * as packageInfo from '../../../../src/packageInfo'; -import { responses as mockResponse } from '../../../helpers/fetch-mock'; -import loadSpec from '../../../helpers/load-spec'; function assertSDKFixture(file: string, fixture: string, opts: TSGeneratorOptions = {}) { return async () => { @@ -121,12 +121,12 @@ describe('typescript', () => { describe('#generator', () => { it( 'should generate typescript (by default)', - assertSDKFixture('../../../__fixtures__/definitions/simple.json', 'simple-ts'), + assertSDKFixture('@api/test-utils/definitions/simple.json', 'simple-ts'), ); it( 'should be able to generate valid TS when a body is optional but metadata isnt', - assertSDKFixture('../../../__fixtures__/definitions/optional-payload.json', 'optional-payload'), + assertSDKFixture('@api/test-utils/definitions/optional-payload.json', 'optional-payload'), ); it('should work against the petstore', assertSDKFixture('@readme/oas-examples/3.0/json/petstore.json', 'petstore')); @@ -136,30 +136,30 @@ describe('typescript', () => { // This SDK only has an `index.ts` as it has no schemas. it( 'should handle some quirky `operationId` cases', - assertSDKFixture('../../../__fixtures__/definitions/operationid-quirks.json', 'operationid-quirks'), + assertSDKFixture('@api/test-utils/definitions/operationid-quirks.json', 'operationid-quirks'), ); it( 'should handle `title` props that start with a number', - assertSDKFixture('../../../__fixtures__/definitions/response-title-quirks.json', 'response-title-quirks'), + assertSDKFixture('@api/test-utils/definitions/response-title-quirks.json', 'response-title-quirks'), ); it.todo('should handle a operations with a `default` response'); it( 'should handle an api that has discriminators and no operation ids', - assertSDKFixture('../../../__fixtures__/definitions/alby.json', 'alby'), + assertSDKFixture('@api/test-utils/definitions/alby.json', 'alby'), ); describe('javascript generation', () => { it( 'should generate a CommonJS library', - assertSDKFixture('../../../__fixtures__/definitions/simple.json', 'simple-js-cjs', { outputJS: true }), + assertSDKFixture('@api/test-utils/definitions/simple.json', 'simple-js-cjs', { outputJS: true }), ); it( 'should generate am ESM library', - assertSDKFixture('../../../__fixtures__/definitions/simple.json', 'simple-js-esm', { + assertSDKFixture('@api/test-utils/definitions/simple.json', 'simple-js-esm', { outputJS: true, compilerTarget: 'esm', }), diff --git a/packages/api/test/cli/codegen/languages/typescript/smoketest.test.ts b/packages/api/test/cli/codegen/languages/typescript/smoketest.test.ts index 97840bbd..ee9c65be 100644 --- a/packages/api/test/cli/codegen/languages/typescript/smoketest.test.ts +++ b/packages/api/test/cli/codegen/languages/typescript/smoketest.test.ts @@ -15,12 +15,12 @@ * @example Everything * npm run test:smoke */ +import realWorldAPIs from '@api/test-utils/datasets/real-world-apis.json'; import Oas from 'oas'; import OASNormalize from 'oas-normalize'; import { describe, it, expect } from 'vitest'; import TSGenerator from '../../../../../src/cli/codegen/languages/typescript'; -import realWorldAPIs from '../../../../datasets/real-world-apis.json'; // These APIs don't have any schemas so they should only be generating an `index.ts`. const APIS_WITHOUT_SCHEMAS = ['poemist.com']; diff --git a/packages/api/test/cli/fetcher.test.ts b/packages/api/test/cli/fetcher.test.ts index 4dd32f80..22976622 100644 --- a/packages/api/test/cli/fetcher.test.ts +++ b/packages/api/test/cli/fetcher.test.ts @@ -1,11 +1,11 @@ import assert from 'assert'; import fs from 'fs/promises'; +import loadSpec from '@api/test-utils/load-spec'; import fetchMock from 'fetch-mock'; import { describe, beforeAll, it, expect } from 'vitest'; import Fetcher from '../../src/cli/fetcher'; -import loadSpec from '../helpers/load-spec'; let readmeSpec; diff --git a/packages/api/test/cli/storage.test.ts b/packages/api/test/cli/storage.test.ts index 6111fe46..9dad3aca 100644 --- a/packages/api/test/cli/storage.test.ts +++ b/packages/api/test/cli/storage.test.ts @@ -4,13 +4,13 @@ import assert from 'assert'; import fs from 'fs/promises'; import path from 'path'; +import loadSpec from '@api/test-utils/load-spec'; import fetchMock from 'fetch-mock'; import uniqueTempDir from 'unique-temp-dir'; import { describe, beforeAll, beforeEach, afterEach, it, expect } from 'vitest'; import Storage from '../../src/cli/storage'; import { PACKAGE_VERSION } from '../../src/packageInfo'; -import loadSpec from '../helpers/load-spec'; let petstoreSimple; diff --git a/packages/api/test/global.d.ts b/packages/api/test/global.d.ts index 89196dab..eace3e8b 100644 --- a/packages/api/test/global.d.ts +++ b/packages/api/test/global.d.ts @@ -1 +1 @@ -import './helpers/vitest.matchers'; +import '@api/test-utils/vitest.matchers'; diff --git a/packages/api/tsconfig.json b/packages/api/tsconfig.json index 513f48fa..c04ee9df 100644 --- a/packages/api/tsconfig.json +++ b/packages/api/tsconfig.json @@ -4,7 +4,7 @@ "baseUrl": "./src", "declaration": true, "esModuleInterop": true, - "lib": ["dom", "dom.iterable", "es2020"], + "lib": ["DOM", "DOM.Iterable", "ES2020"], "noImplicitAny": true, "outDir": "dist/" }, diff --git a/packages/api/vitest-smoketest.config.ts b/packages/api/vitest-smoketest.config.ts index 5060a0bc..beaee9cd 100644 --- a/packages/api/vitest-smoketest.config.ts +++ b/packages/api/vitest-smoketest.config.ts @@ -4,7 +4,7 @@ import { defineConfig } from 'vitest/config'; export default defineConfig({ test: { include: ['**/smoketest.test.ts'], - setupFiles: ['./test/helpers/vitest.matchers.ts'], + setupFiles: ['@api/test-utils/vitest.matchers.ts'], testTimeout: 20000, }, }); diff --git a/packages/api/vitest.config.ts b/packages/api/vitest.config.ts index 8363a45e..e5d0af9b 100644 --- a/packages/api/vitest.config.ts +++ b/packages/api/vitest.config.ts @@ -11,7 +11,7 @@ export default defineConfig({ '**/helpers/**', '**/smoketest.test.ts', ], - setupFiles: ['./test/helpers/vitest.matchers.ts'], + setupFiles: ['@api/test-utils/vitest.matchers.ts'], testTimeout: 20000, }, }); diff --git a/packages/core/.eslintrc b/packages/core/.eslintrc new file mode 100644 index 00000000..7ea05f4f --- /dev/null +++ b/packages/core/.eslintrc @@ -0,0 +1,13 @@ +{ + "rules": { + "@typescript-eslint/no-explicit-any": "off", // @todo fix these eventually + + "no-restricted-imports": [ + "error", + { + "name": "fs/promises", + "message": "Please use `fs` instead as some client frameworks don't polyfill `fs/promises`." + } + ] + } +} diff --git a/packages/core/.gitignore b/packages/core/.gitignore new file mode 100644 index 00000000..ef229ed3 --- /dev/null +++ b/packages/core/.gitignore @@ -0,0 +1,3 @@ +coverage/ +dist/ +node_modules/ diff --git a/packages/core/.npmignore b/packages/core/.npmignore new file mode 100644 index 00000000..5324474f --- /dev/null +++ b/packages/core/.npmignore @@ -0,0 +1,7 @@ +.api/ +coverage/ +test/ +.eslint* +.gitignore +.prettier* +vitest* diff --git a/packages/core/LICENSE b/packages/core/LICENSE new file mode 100644 index 00000000..8e096215 --- /dev/null +++ b/packages/core/LICENSE @@ -0,0 +1,18 @@ +Copyright © 2023 ReadMe + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 00000000..04746d4b --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,16 @@ +# @api/core + +

+ NPM Version + Node Version + MIT License + Build status +

+ +

+The magic behind api 🧙 +

+ +

+Check out api.readme.dev for more details. +

diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 00000000..c0591b4f --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,50 @@ +{ + "name": "@api/core", + "version": "1.0.0", + "description": "The magic behind `api` 🧙", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "build": "tsc", + "lint:types": "tsc --noEmit", + "prebuild": "rm -rf dist/", + "prepack": "npm run build", + "test": "vitest run --coverage" + }, + "repository": { + "type": "git", + "url": "https://github.com/readmeio/api.git", + "directory": "packages/core" + }, + "homepage": "https://api.readme.dev", + "bugs": { + "url": "https://github.com/readmeio/api/issues" + }, + "author": "Jon Ursenbach ", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "dependencies": { + "@readme/oas-to-har": "^20.1.1", + "caseless": "^0.12.0", + "datauri": "^4.1.0", + "fetch-har": "^10.0.0", + "get-stream": "^6.0.1", + "json-schema-traverse": "^1.0.0", + "lodash.merge": "^4.6.2", + "oas": "^20.10.3", + "remove-undefined-objects": "^3.0.0" + }, + "devDependencies": { + "@api/test-utils": "file:../test-utils", + "@readme/oas-examples": "^5.12.0", + "@types/caseless": "^0.12.3", + "@types/lodash.merge": "^4.6.7", + "@vitest/coverage-v8": "^0.34.4", + "fetch-mock": "^9.11.0", + "typescript": "^5.2.2", + "vitest": "^0.34.4" + }, + "prettier": "@readme/eslint-config/prettier" +} diff --git a/packages/api/src/core/errors/fetchError.ts b/packages/core/src/errors/fetchError.ts similarity index 100% rename from packages/api/src/core/errors/fetchError.ts rename to packages/core/src/errors/fetchError.ts diff --git a/packages/api/src/core/index.ts b/packages/core/src/index.ts similarity index 78% rename from packages/api/src/core/index.ts rename to packages/core/src/index.ts index 09c2a71e..30d15a53 100644 --- a/packages/api/src/core/index.ts +++ b/packages/core/src/index.ts @@ -6,11 +6,11 @@ import oasToHar from '@readme/oas-to-har'; import fetchHar from 'fetch-har'; import FetchError from './errors/fetchError'; -import getJSONSchemaDefaults from './getJSONSchemaDefaults'; -import parseResponse from './parseResponse'; -import prepareAuth from './prepareAuth'; -import prepareParams from './prepareParams'; -import prepareServer from './prepareServer'; +import getJSONSchemaDefaults from './lib/getJSONSchemaDefaults'; +import parseResponse from './lib/parseResponse'; +import prepareAuth from './lib/prepareAuth'; +import prepareParams from './lib/prepareParams'; +import prepareServer from './lib/prepareServer'; export interface ConfigOptions { /** @@ -20,11 +20,11 @@ export interface ConfigOptions { timeout?: number; } -export interface FetchResponse { - data: data; +export interface FetchResponse { + data: Data; headers: Headers; res: Response; - status: status; + status: HTTPStatus; } // https://stackoverflow.com/a/39495173 @@ -81,13 +81,22 @@ export default class APICore { return this; } - async fetch(path: string, method: HttpMethods, body?: unknown, metadata?: Record) { + async fetch( + path: string, + method: HttpMethods, + body?: unknown, + metadata?: Record, + ) { const operation = this.spec.operation(path, method); - return this.fetchOperation(operation, body, metadata); + return this.fetchOperation(operation, body, metadata); } - async fetchOperation(operation: Operation, body?: unknown, metadata?: Record) { + async fetchOperation( + operation: Operation, + body?: unknown, + metadata?: Record, + ) { return prepareParams(operation, body, metadata).then(params => { const data = { ...params }; @@ -104,12 +113,12 @@ export default class APICore { // @ts-expect-error `this.auth` typing is off. FIXME const har = oasToHar(this.spec, operation, data, prepareAuth(this.auth, operation)); - let timeoutSignal: any; + let timeoutSignal: NodeJS.Timeout; const init: RequestInit = {}; if (this.config.timeout) { const controller = new AbortController(); timeoutSignal = setTimeout(() => controller.abort(), this.config.timeout); - init.signal = controller.signal as any; + init.signal = controller.signal; } return fetchHar(har as any, { @@ -118,7 +127,7 @@ export default class APICore { userAgent: this.userAgent, }) .then(async (res: Response) => { - const parsed = await parseResponse(res); + const parsed = await parseResponse(res); if (res.status >= 400 && res.status <= 599) { throw new FetchError( diff --git a/packages/api/src/core/getJSONSchemaDefaults.ts b/packages/core/src/lib/getJSONSchemaDefaults.ts similarity index 100% rename from packages/api/src/core/getJSONSchemaDefaults.ts rename to packages/core/src/lib/getJSONSchemaDefaults.ts diff --git a/packages/api/src/core/parseResponse.ts b/packages/core/src/lib/parseResponse.ts similarity index 75% rename from packages/api/src/core/parseResponse.ts rename to packages/core/src/lib/parseResponse.ts index 7e1f53b9..48095fff 100644 --- a/packages/api/src/core/parseResponse.ts +++ b/packages/core/src/lib/parseResponse.ts @@ -2,13 +2,13 @@ import { utils } from 'oas'; const { matchesMimeType } = utils; -export default async function getResponseBody(response: Response) { +export default async function parseResponse(response: Response) { const contentType = response.headers.get('Content-Type'); const isJSON = contentType && (matchesMimeType.json(contentType) || matchesMimeType.wildcard(contentType)); const responseBody = await response.text(); - let data = responseBody; + let data: any = responseBody; if (isJSON) { try { data = JSON.parse(responseBody); @@ -19,7 +19,7 @@ export default async function getResponseBody(response: Response) { return { data, - status: response.status, + status: response.status as HTTPStatus, headers: response.headers, res: response, }; diff --git a/packages/api/src/core/prepareAuth.ts b/packages/core/src/lib/prepareAuth.ts similarity index 100% rename from packages/api/src/core/prepareAuth.ts rename to packages/core/src/lib/prepareAuth.ts diff --git a/packages/api/src/core/prepareParams.ts b/packages/core/src/lib/prepareParams.ts similarity index 100% rename from packages/api/src/core/prepareParams.ts rename to packages/core/src/lib/prepareParams.ts diff --git a/packages/api/src/core/prepareServer.ts b/packages/core/src/lib/prepareServer.ts similarity index 100% rename from packages/api/src/core/prepareServer.ts rename to packages/core/src/lib/prepareServer.ts diff --git a/packages/core/test/.eslintrc b/packages/core/test/.eslintrc new file mode 100644 index 00000000..716c33cc --- /dev/null +++ b/packages/core/test/.eslintrc @@ -0,0 +1,3 @@ +{ + "extends": "@readme/eslint-config/testing/vitest" +} diff --git a/packages/core/test/global.d.ts b/packages/core/test/global.d.ts new file mode 100644 index 00000000..eace3e8b --- /dev/null +++ b/packages/core/test/global.d.ts @@ -0,0 +1 @@ +import '@api/test-utils/vitest.matchers'; diff --git a/packages/api/test/core/index.test.ts b/packages/core/test/index.test.ts similarity index 96% rename from packages/api/test/core/index.test.ts rename to packages/core/test/index.test.ts index b889571a..57598803 100644 --- a/packages/api/test/core/index.test.ts +++ b/packages/core/test/index.test.ts @@ -1,14 +1,14 @@ import assert from 'assert'; +import { responses as mockResponse } from '@api/test-utils/fetch-mock'; +import loadSpec from '@api/test-utils/load-spec'; import datauri from 'datauri'; import fetchMock from 'fetch-mock'; import Oas from 'oas'; import { describe, beforeEach, afterEach, it, expect } from 'vitest'; -import APICore from '../../src/core'; -import FetchError from '../../src/core/errors/fetchError'; -import { responses as mockResponse } from '../helpers/fetch-mock'; -import loadSpec from '../helpers/load-spec'; +import APICore from '../src'; +import FetchError from '../src/errors/fetchError'; describe('APICore', () => { let fileUploads: APICore; @@ -88,11 +88,13 @@ describe('APICore', () => { .fetch('/pets/{id}', 'delete', undefined, { id: petId }) .then(() => assert.fail()) .catch(err => { + /* eslint-disable vitest/no-conditional-expect */ expect(err).toBeInstanceOf(FetchError); expect(err.status).toBe(404); expect(err.data).toBe('Could not find that pet.'); expect(err.headers).toHaveHeader('content-type', /text\/plain/); expect(err.res.constructor.name).toBe('Response'); + /* eslint-enable vitest/no-conditional-expect */ }); }); }); @@ -238,7 +240,7 @@ describe('APICore', () => { it('should support `image/png` requests', async () => { fetchMock.post('https://httpbin.org/anything/image-png', mockResponse.datauri); - const file = `${__dirname}/../__fixtures__/owlbert.png`; + const file = require.resolve('@api/test-utils/fixtures/owlbert.png'); const { data } = await fileUploads.fetch('/anything/image-png', 'post', file); @@ -260,6 +262,7 @@ describe('APICore', () => { }; const { data } = await parametersStyle.fetch('/anything/form-data/form', 'post', body); + expect(data.uri).toBe('/anything/form-data/form'); expect(data.requestBody.split(`${data.boundary}`).filter(Boolean)).toStrictEqual([ '\r\nContent-Disposition: form-data; name="primitive"\r\n\r\nstring\r\n', @@ -276,7 +279,7 @@ describe('APICore', () => { const body = { orderId: 1234, userId: 5678, - documentFile: `${__dirname}/../__fixtures__/hello.txt`, + documentFile: require.resolve('@api/test-utils/fixtures/hello.txt'), }; const { data } = await fileUploads.fetch('/anything/multipart-formdata', 'post', body); @@ -293,7 +296,7 @@ describe('APICore', () => { fetchMock.post('https://httpbin.org/anything/multipart-formdata', mockResponse.multipart); const body = { - documentFile: `${__dirname}/../__fixtures__/hello.jp.txt`, + documentFile: require.resolve('@api/test-utils/fixtures/hello.jp.txt'), }; const { data } = await fileUploads.fetch('/anything/multipart-formdata', 'post', body); diff --git a/packages/api/test/core/getJSONSchemaDefaults.test.ts b/packages/core/test/lib/getJSONSchemaDefaults.test.ts similarity index 89% rename from packages/api/test/core/getJSONSchemaDefaults.test.ts rename to packages/core/test/lib/getJSONSchemaDefaults.test.ts index f931df20..60799d30 100644 --- a/packages/api/test/core/getJSONSchemaDefaults.test.ts +++ b/packages/core/test/lib/getJSONSchemaDefaults.test.ts @@ -1,8 +1,8 @@ +import loadSpec from '@api/test-utils/load-spec'; import Oas from 'oas'; import { describe, it, expect } from 'vitest'; -import getJSONSchemaDefaults from '../../src/core/getJSONSchemaDefaults'; -import loadSpec from '../helpers/load-spec'; +import getJSONSchemaDefaults from '../../src/lib/getJSONSchemaDefaults'; describe('#getJSONSchemaDefaults()', () => { it('should get defaults off an operation', async () => { @@ -24,7 +24,7 @@ describe('#getJSONSchemaDefaults()', () => { }); it('should be able to handle nested objects', async () => { - const oas = await loadSpec('../__fixtures__/definitions/nested-defaults.json').then(Oas.init); + const oas = await loadSpec('@api/test-utils/definitions/nested-defaults.json').then(Oas.init); await oas.dereference(); const operation = oas.operation('/pet', 'post'); diff --git a/packages/api/test/core/parseResponse.test.ts b/packages/core/test/lib/parseResponse.test.ts similarity index 98% rename from packages/api/test/core/parseResponse.test.ts rename to packages/core/test/lib/parseResponse.test.ts index 42e9fc89..623ca556 100644 --- a/packages/api/test/core/parseResponse.test.ts +++ b/packages/core/test/lib/parseResponse.test.ts @@ -1,6 +1,6 @@ import { describe, beforeEach, it, expect } from 'vitest'; -import parseResponse from '../../src/core/parseResponse'; +import parseResponse from '../../src/lib/parseResponse'; const responseBody = JSON.stringify({ id: 9205436248879918000, diff --git a/packages/api/test/core/prepareAuth.test.ts b/packages/core/test/lib/prepareAuth.test.ts similarity index 97% rename from packages/api/test/core/prepareAuth.test.ts rename to packages/core/test/lib/prepareAuth.test.ts index 389c1a9f..66bd5fb3 100644 --- a/packages/api/test/core/prepareAuth.test.ts +++ b/packages/core/test/lib/prepareAuth.test.ts @@ -1,10 +1,10 @@ import type { OASDocument } from 'oas/dist/rmoas.types'; +import loadSpec from '@api/test-utils/load-spec'; import Oas from 'oas'; import { describe, beforeAll, it, expect } from 'vitest'; -import prepareAuth from '../../src/core/prepareAuth'; -import loadSpec from '../helpers/load-spec'; +import prepareAuth from '../../src/lib/prepareAuth'; let oas: Oas; @@ -167,7 +167,7 @@ describe('#prepareAuth()', () => { let securityMultipleOas; beforeAll(async () => { - authQuirksOas = await loadSpec(require.resolve('../__fixtures__/definitions/auth-quirks.json')); + authQuirksOas = await loadSpec(require.resolve('@api/test-utils/definitions/auth-quirks.json')); securityMultipleOas = await loadSpec('@readme/oas-examples/3.0/json/security-multiple.json'); }); diff --git a/packages/api/test/core/prepareParams.test.ts b/packages/core/test/lib/prepareParams.test.ts similarity index 95% rename from packages/api/test/core/prepareParams.test.ts rename to packages/core/test/lib/prepareParams.test.ts index 6af34051..0838cd29 100644 --- a/packages/api/test/core/prepareParams.test.ts +++ b/packages/core/test/lib/prepareParams.test.ts @@ -1,11 +1,11 @@ import fs from 'fs'; +import payloadExamples from '@api/test-utils/definitions/payloads.json'; +import loadSpec from '@api/test-utils/load-spec'; import Oas from 'oas'; import { describe, beforeEach, it, expect } from 'vitest'; -import prepareParams from '../../src/core/prepareParams'; -import payloadExamples from '../__fixtures__/definitions/payloads.json'; -import loadSpec from '../helpers/load-spec'; +import prepareParams from '../../src/lib/prepareParams'; describe('#prepareParams', () => { let fileUploads: Oas; @@ -165,7 +165,7 @@ describe('#prepareParams', () => { describe('image/png', () => { it('should support a file path payload', async () => { const operation = fileUploads.operation('/anything/image-png', 'post'); - const body = `${__dirname}/../__fixtures__/owlbert.png`; + const body = require.resolve('@api/test-utils/fixtures/owlbert.png'); const res = await prepareParams(operation, body); expect(res.body).toContain('data:image/png;name=owlbert.png;base64,'); @@ -174,7 +174,7 @@ describe('#prepareParams', () => { it('should support a file stream payload', async () => { const operation = fileUploads.operation('/anything/image-png', 'post'); - const body = fs.createReadStream('./test/__fixtures__/owlbert.png'); + const body = fs.createReadStream(require.resolve('@api/test-utils/fixtures/owlbert.png')); const res = await prepareParams(operation, body); expect(res.body).toContain('data:image/png;name=owlbert.png;base64,'); @@ -197,7 +197,7 @@ describe('#prepareParams', () => { it('should handle when the file path is relative', async () => { const operation = fileUploads.operation('/anything/multipart-formdata', 'post'); const body = { - documentFile: './test/__fixtures__/owlbert.png', + documentFile: require.resolve('@api/test-utils/fixtures/owlbert.png'), }; const res = await prepareParams(operation, body); @@ -208,7 +208,7 @@ describe('#prepareParams', () => { it('should handle a multipart body when a property is a file stream', async () => { const operation = fileUploads.operation('/anything/multipart-formdata', 'post'); const body = { - documentFile: fs.createReadStream('./test/__fixtures__/owlbert.png'), + documentFile: fs.createReadStream(require.resolve('@api/test-utils/fixtures/owlbert.png')), }; const res = await prepareParams(operation, body); @@ -236,12 +236,12 @@ describe('#prepareParams', () => { it("should not reject files that don't exist", async () => { const operation = fileUploads.operation('/anything/multipart-formdata', 'post'); const body = { - documentFile: './test/__fixtures__/owlbert.jpg', + documentFile: './owlbert.doesntexist.jpg', }; await expect(prepareParams(operation, body)).resolves.toStrictEqual({ body: { - documentFile: './test/__fixtures__/owlbert.jpg', + documentFile: './owlbert.doesntexist.jpg', }, }); }); @@ -381,7 +381,7 @@ describe('#prepareParams', () => { describe('quirks', () => { it('should not send special headers in body payloads', async () => { - const basiq = await import('../__fixtures__/definitions/basiq.json').then(Oas.init); + const basiq = await import('@api/test-utils/definitions/basiq.json').then(Oas.init); await basiq.dereference(); const operation = basiq.operation('/token', 'post'); @@ -400,7 +400,7 @@ describe('#prepareParams', () => { }); it('should not duplicate a supplied header parameter if that header casing matches the spec', async () => { - const basiq = await import('../__fixtures__/definitions/basiq.json').then(Oas.init); + const basiq = await import('@api/test-utils/definitions/basiq.json').then(Oas.init); await basiq.dereference(); const operation = basiq.operation('/token', 'post'); @@ -482,7 +482,7 @@ describe('#prepareParams', () => { describe('defaults', () => { it('should prefill defaults for required body parameters if not supplied', async () => { - const oas = await loadSpec('../__fixtures__/definitions/nested-defaults.json').then(Oas.init); + const oas = await loadSpec('@api/test-utils/definitions/nested-defaults.json').then(Oas.init); await oas.dereference(); const operation = oas.operation('/pet', 'post'); diff --git a/packages/core/test/tsconfig.json b/packages/core/test/tsconfig.json new file mode 100644 index 00000000..5752383d --- /dev/null +++ b/packages/core/test/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noImplicitAny": false, + "resolveJsonModule": true + }, + "include": ["../src/**/*", "*.ts", "**/*"] +} diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json new file mode 100644 index 00000000..5acf6120 --- /dev/null +++ b/packages/core/tsconfig.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "allowJs": true, + "baseUrl": "./src", + "declaration": true, + "esModuleInterop": true, + "lib": ["DOM", "DOM.Iterable", "ES2020"], + "noImplicitAny": true, + "outDir": "dist/", + "strict": false + }, + "include": ["./src/**/*"] +} diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts new file mode 100644 index 00000000..8d5bc084 --- /dev/null +++ b/packages/core/vitest.config.ts @@ -0,0 +1,8 @@ +// eslint-disable-next-line import/no-extraneous-dependencies +import { defineConfig } from 'vitest/config'; + +export default defineConfig({ + test: { + setupFiles: ['@api/test-utils/vitest.matchers.ts'], + }, +}); diff --git a/packages/httpsnippet-client-api/tsconfig.json b/packages/httpsnippet-client-api/tsconfig.json index 058cffd5..b785b2bb 100644 --- a/packages/httpsnippet-client-api/tsconfig.json +++ b/packages/httpsnippet-client-api/tsconfig.json @@ -4,7 +4,7 @@ "baseUrl": "./src", "declaration": true, "esModuleInterop": true, - "lib": ["dom", "es2020"], + "lib": ["DOM", "ES2020"], "noImplicitAny": true, "outDir": "dist/" }, diff --git a/packages/api/test/datasets/real-world-apis.json b/packages/test-utils/datasets/real-world-apis.json similarity index 100% rename from packages/api/test/datasets/real-world-apis.json rename to packages/test-utils/datasets/real-world-apis.json diff --git a/packages/api/test/datasets/refresh-dataset b/packages/test-utils/datasets/refresh-dataset similarity index 99% rename from packages/api/test/datasets/refresh-dataset rename to packages/test-utils/datasets/refresh-dataset index d2d875b6..b082e585 100755 --- a/packages/api/test/datasets/refresh-dataset +++ b/packages/test-utils/datasets/refresh-dataset @@ -7,7 +7,6 @@ */ /* eslint-disable @typescript-eslint/no-var-requires */ /* eslint-disable no-param-reassign */ -/* eslint-disable vitest/require-hook */ const fs = require('fs'); fetch('https://api.apis.guru/v2/list.json') diff --git a/packages/api/test/__fixtures__/definitions/alby.json b/packages/test-utils/definitions/alby.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/alby.json rename to packages/test-utils/definitions/alby.json diff --git a/packages/api/test/__fixtures__/definitions/auth-quirks.json b/packages/test-utils/definitions/auth-quirks.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/auth-quirks.json rename to packages/test-utils/definitions/auth-quirks.json diff --git a/packages/api/test/__fixtures__/definitions/basiq.json b/packages/test-utils/definitions/basiq.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/basiq.json rename to packages/test-utils/definitions/basiq.json diff --git a/packages/api/test/__fixtures__/definitions/nested-defaults.json b/packages/test-utils/definitions/nested-defaults.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/nested-defaults.json rename to packages/test-utils/definitions/nested-defaults.json diff --git a/packages/api/test/__fixtures__/definitions/operationid-quirks.json b/packages/test-utils/definitions/operationid-quirks.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/operationid-quirks.json rename to packages/test-utils/definitions/operationid-quirks.json diff --git a/packages/api/test/__fixtures__/definitions/optional-payload.json b/packages/test-utils/definitions/optional-payload.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/optional-payload.json rename to packages/test-utils/definitions/optional-payload.json diff --git a/packages/api/test/__fixtures__/definitions/payloads.json b/packages/test-utils/definitions/payloads.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/payloads.json rename to packages/test-utils/definitions/payloads.json diff --git a/packages/api/test/__fixtures__/definitions/response-title-quirks.json b/packages/test-utils/definitions/response-title-quirks.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/response-title-quirks.json rename to packages/test-utils/definitions/response-title-quirks.json diff --git a/packages/api/test/__fixtures__/definitions/simple.json b/packages/test-utils/definitions/simple.json similarity index 100% rename from packages/api/test/__fixtures__/definitions/simple.json rename to packages/test-utils/definitions/simple.json diff --git a/packages/api/test/helpers/fetch-mock.ts b/packages/test-utils/fetch-mock.ts similarity index 72% rename from packages/api/test/helpers/fetch-mock.ts rename to packages/test-utils/fetch-mock.ts index e43d764f..d3076fe7 100644 --- a/packages/api/test/helpers/fetch-mock.ts +++ b/packages/test-utils/fetch-mock.ts @@ -11,7 +11,7 @@ export const response = { }; export const responses = { - all: (url, opts) => { + all: (url: string, opts: RequestInit) => { return { uri: new URL(url).pathname, headers: Object.fromEntries(opts.headers as unknown as []), @@ -19,7 +19,7 @@ export const responses = { }; }, - datauri: (url, opts) => { + datauri: (url: string, opts: RequestInit) => { const buffer = Buffer.from(opts.body as string, 'hex'); const parser = new DatauriParser(); @@ -30,21 +30,21 @@ export const responses = { }; }, - delay: (res, delay) => { + delay: (res: string | Record, delay: number) => { return new Promise(resolve => { setTimeout(() => resolve(res), delay); }); }, - headers: (url, opts) => { + headers: (url: string, opts: RequestInit) => { // `opts.headers` returns a `HeadersList` object instead of `Headers` as the typing suggests so // we need to convert it to an array before converting it to an object. return Object.fromEntries(opts.headers as unknown as []); }, - multipart: async (url, opts) => { - const headers = objectifyHeaders(opts.headers); - const payload = await formDataToString(opts.body); + multipart: async (url: string, opts: RequestInit) => { + const headers = objectifyHeaders(opts.headers as unknown as []); + const payload = await formDataToString(opts.body as FormData); return { uri: new URL(url).pathname, @@ -54,12 +54,12 @@ export const responses = { }; }, - real: res => { + real: (res: string | Record) => { return () => res; }, requestBody: () => { - return (url, opts) => { + return (url: string, opts: RequestInit) => { return { uri: new URL(url).pathname, requestBody: JSON.parse(opts.body as string), @@ -67,13 +67,13 @@ export const responses = { }; }, - searchParams: url => { + searchParams: (url: string) => { const res = new URL(url); return `${res.pathname}${res.search}`; }, url: (prop: keyof URL) => { - return url => { + return (url: string) => { return new URL(url)[prop]; }; }, diff --git a/packages/api/test/__fixtures__/hello.jp.txt b/packages/test-utils/fixtures/hello.jp.txt similarity index 100% rename from packages/api/test/__fixtures__/hello.jp.txt rename to packages/test-utils/fixtures/hello.jp.txt diff --git a/packages/api/test/__fixtures__/hello.txt b/packages/test-utils/fixtures/hello.txt similarity index 100% rename from packages/api/test/__fixtures__/hello.txt rename to packages/test-utils/fixtures/hello.txt diff --git a/packages/api/test/__fixtures__/owlbert-shrub.png b/packages/test-utils/fixtures/owlbert-shrub.png similarity index 100% rename from packages/api/test/__fixtures__/owlbert-shrub.png rename to packages/test-utils/fixtures/owlbert-shrub.png diff --git a/packages/api/test/__fixtures__/owlbert.png b/packages/test-utils/fixtures/owlbert.png similarity index 100% rename from packages/api/test/__fixtures__/owlbert.png rename to packages/test-utils/fixtures/owlbert.png diff --git a/packages/api/test/helpers/load-spec.ts b/packages/test-utils/load-spec.ts similarity index 100% rename from packages/api/test/helpers/load-spec.ts rename to packages/test-utils/load-spec.ts diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json new file mode 100644 index 00000000..2f032c4d --- /dev/null +++ b/packages/test-utils/package.json @@ -0,0 +1,20 @@ +{ + "private": true, + "name": "@api/test-utils", + "version": "1.0.0", + "scripts": { + "lint:types": "tsc --noEmit" + }, + "dependencies": { + "caseless": "^0.12.0", + "datauri": "^4.1.0", + "formdata-to-string": "^1.0.0", + "vitest": "^0.34.4" + }, + "devDependencies": { + "@types/caseless": "^0.12.3", + "oas": "^20.10.3", + "typescript": "^5.2.2" + }, + "prettier": "@readme/eslint-config/prettier" +} diff --git a/packages/test-utils/tsconfig.json b/packages/test-utils/tsconfig.json new file mode 100644 index 00000000..a0ae87dd --- /dev/null +++ b/packages/test-utils/tsconfig.json @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "allowJs": true, + "baseUrl": "./src", + "declaration": true, + "esModuleInterop": true, + "noEmit": true, + "noImplicitAny": true + }, + "include": ["./**/*"] +} diff --git a/packages/api/test/helpers/vitest.matchers.ts b/packages/test-utils/vitest.matchers.ts similarity index 79% rename from packages/api/test/helpers/vitest.matchers.ts rename to packages/test-utils/vitest.matchers.ts index 66c74b4b..ec6847a4 100644 --- a/packages/api/test/helpers/vitest.matchers.ts +++ b/packages/test-utils/vitest.matchers.ts @@ -9,11 +9,6 @@ interface CustomMatchers { */ toBeDereferenced(): R; - /** - * Assert that a Response headers object has a custom API-identifying `User Agent` header. - */ - toHaveCustomUserAgent(): R; - /** * Determine if a given `Headers` object has a given header matching a specific value. * @@ -31,6 +26,7 @@ interface CustomMatchers { } declare module 'vitest' { + // eslint-disable-next-line @typescript-eslint/no-explicit-any interface Assertion extends CustomMatchers {} interface AsymmetricMatchersContaining extends CustomMatchers {} } @@ -51,25 +47,14 @@ expect.extend({ }; }, - toHaveCustomUserAgent(headers: string[]) { - const userAgent = headers['user-agent']; - const pass = userAgent.match(/^api \(node\)\/(\d+.\d+(.\d+|unit-testing))$/); - - if (!pass) { - return { - message: () => `expected a custom \`user-agent\` header to be present.\n\nreceived: ${userAgent}`, - pass: false, - }; - } - - return { - message: () => `expected a custom \`user-agent\` header to not be present\n\nreceived: ${userAgent}`, - pass: true, - }; - }, - toHaveHeader(obj: Headers, header: string, expected: RegExp | (string | number)[] | string) { - const headers = caseless(Object.fromEntries(Array.from(obj.entries()))); + const headers = caseless( + Object.fromEntries( + // @ts-expect-error Despite the Node typings saying otherwise `Headers.entries()` exists. + // https://developer.mozilla.org/en-US/docs/Web/API/Headers/entries + Array.from(obj.entries()), + ), + ); // Header value should match a given regex. if (expected instanceof RegExp) {