diff --git a/package-lock.json b/package-lock.json index efb8f2a1..137f4258 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,9 +49,9 @@ "link": true }, "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "11.9.3", - "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.9.3.tgz", - "integrity": "sha512-60vepv88RwcJtSHrD6MjIL6Ta3SOYbgfnkHb+ppAVK+o9mXprRtulx7VlRl3lN3bbvysAfCS7WMVfhUYemB0IQ==", + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-12.0.1.tgz", + "integrity": "sha512-D3n3T19ly/RYyEvsrqKa/cSAlzQF8KXj1o0XLTI+9GKnJvdHT3WW50yZYCf+4JU7+pLlhXZVV1q1AJ0SPN/pmw==", "license": "MIT", "dependencies": { "@jsdevtools/ono": "^7.1.3", @@ -3263,20 +3263,20 @@ } }, "node_modules/@readme/oas-examples": { - "version": "5.19.2", - "resolved": "https://registry.npmjs.org/@readme/oas-examples/-/oas-examples-5.19.2.tgz", - "integrity": "sha512-KliSfKVJjJC0473ObgFu5MzqpJuI9SlKq8ewEgOoAe3wQpSVBaGA6c3qGFEa9mRRRz51y5p0Q3ZLfjuQbD8QnQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@readme/oas-examples/-/oas-examples-6.0.0.tgz", + "integrity": "sha512-SzrZy8Sn/0w0h6JCWW9IWwaUddm8pljhZ73eIqpCp9eHnxGuBuO+r1K31w8bNNnJ6tmWxtUaor8IdciwelB6zg==", "dev": true, "license": "MIT" }, "node_modules/@readme/oas-to-har": { - "version": "25.0.2", - "resolved": "https://registry.npmjs.org/@readme/oas-to-har/-/oas-to-har-25.0.2.tgz", - "integrity": "sha512-aqbU3RxXQUGEd1Z1j80eAT6k4f8fG5mGEab5dGlMzxUo6FwBFE9zUL9VPjGrKfYCQuSfFxSWRt8agQQ4EjYQ5g==", + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/@readme/oas-to-har/-/oas-to-har-26.0.0.tgz", + "integrity": "sha512-4rKG+gqilCX0Zwtle0KMfX0pcoJCoeHmwStM4RFaFG9HI98M0SJjk6OIxsRpYBlfBVVrdMEqFHRmQ8U1rrDYJQ==", "license": "ISC", "dependencies": { "@readme/data-urls": "^3.0.0", - "oas": "^26.0.2", + "oas": "^27.0.0", "qs": "^6.12.0", "remove-undefined-objects": "^6.0.0" }, @@ -3285,12 +3285,12 @@ } }, "node_modules/@readme/openapi-parser": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@readme/openapi-parser/-/openapi-parser-3.0.1.tgz", - "integrity": "sha512-U0Hn3bJRs8ZWn6cylNxLsieJjr5liibzn9JDuWNVvBILK5geEtJDS7S2vMbNViufGGLu08q1dvsbbYIZCSkBzw==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@readme/openapi-parser/-/openapi-parser-4.0.0.tgz", + "integrity": "sha512-TYeEjSYGCmaBjvQA+BcQYjfv4k+02oychlRHShj/3Iwm2s+a+isENeJU/HPgxIZqtKuP2JZ0gJTvBXo9ci4NEg==", "license": "MIT", "dependencies": { - "@apidevtools/json-schema-ref-parser": "^11.9.2", + "@apidevtools/json-schema-ref-parser": "^12.0.1", "@readme/better-ajv-errors": "^2.3.2", "@readme/openapi-schemas": "^3.1.0", "@types/json-schema": "^7.0.15", @@ -12094,13 +12094,13 @@ "dev": true }, "node_modules/jest-expect-openapi": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/jest-expect-openapi/-/jest-expect-openapi-2.0.2.tgz", - "integrity": "sha512-XCmLbINoOb0ErQvsIOlYB1lAHXl+kH3ynS3KO71sEXxdTnxWn4+lGlMWac91j5caaeTpXJuvxI5cZa/eDE4+Zg==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jest-expect-openapi/-/jest-expect-openapi-3.0.0.tgz", + "integrity": "sha512-SL0sxaoAB5m+6rYREFdfJaUuwZFmwXye7Shkdz/bp6W5d3Zy7p0EqxPYQpveDS6AVk65s8n5+8XPo0pWfoSEEQ==", "dev": true, "license": "MIT", "dependencies": { - "@readme/openapi-parser": "^3.0.1", + "@readme/openapi-parser": "^4.0.0", "@vitest/expect": "^3.0.7" }, "engines": { @@ -16995,12 +16995,12 @@ } }, "node_modules/oas": { - "version": "26.0.2", - "resolved": "https://registry.npmjs.org/oas/-/oas-26.0.2.tgz", - "integrity": "sha512-v2Je6lWjliSukRlRKy22OjZyq4KhW8GPTEDHJ7mSN7CA/V2HO2ioiNecvWKcpMn/KrHda/igmpuCXqaan3OvoQ==", + "version": "27.0.0", + "resolved": "https://registry.npmjs.org/oas/-/oas-27.0.0.tgz", + "integrity": "sha512-5ibKLmhWytJhi/ZIPUfFu3aSTH4LSE4zLAe/uWUSWbI6ijz/BqMKgnelpwPffJDAooWcJ0pP7KjskB/MNDhCGg==", "license": "MIT", "dependencies": { - "@readme/openapi-parser": "^3.0.1", + "@readme/openapi-parser": "^4.0.0", "@types/json-schema": "^7.0.11", "json-schema-merge-allof": "^0.8.1", "jsonpath-plus": "^10.0.0", @@ -17038,12 +17038,12 @@ } }, "node_modules/oas-normalize": { - "version": "13.1.2", - "resolved": "https://registry.npmjs.org/oas-normalize/-/oas-normalize-13.1.2.tgz", - "integrity": "sha512-FXi+1I2MwPZWn4ERMpjJghMBu0qhgDHt0F2HINJyqksIpHJyIO5KMD+8/pUnF3H8iH36ZbszEi35YSllScajUA==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/oas-normalize/-/oas-normalize-14.0.0.tgz", + "integrity": "sha512-nvHxGcDcUXpZgepHJSS0ewQet1a27IffKv+iJM7qKievN7denWzDFZPDy7izmcLGdImb2WAt3tRAlJN37snWFA==", "license": "MIT", "dependencies": { - "@readme/openapi-parser": "^3.0.1", + "@readme/openapi-parser": "^4.0.0", "@readme/postman-to-openapi": "^4.1.0", "js-yaml": "^4.1.0", "openapi-types": "^12.1.3", @@ -23495,8 +23495,8 @@ "js-yaml": "^4.1.0", "license": "^1.0.3", "lodash-es": "^4.17.21", - "oas": "^26.0.1", - "oas-normalize": "^13.1.0", + "oas": "^27.0.0", + "oas-normalize": "^14.0.0", "ora": "^8.0.1", "preferred-pm": "^4.0.0", "prompts": "^2.4.2", @@ -23512,7 +23512,7 @@ }, "devDependencies": { "@api/test-utils": "file:../test-utils", - "@readme/oas-examples": "^5.19.1", + "@readme/oas-examples": "^6.0.0", "@types/js-yaml": "^4.0.9", "@types/lodash-es": "^4.17.12", "@types/prompts": "^2.4.9", @@ -23835,19 +23835,19 @@ "version": "7.0.0-beta.13", "license": "MIT", "dependencies": { - "@readme/oas-to-har": "^25.0.1", + "@readme/oas-to-har": "^26.0.0", "caseless": "^0.12.0", "datauri": "^4.1.0", "fetch-har": "^11.0.1", "json-schema-to-ts": "^3.0.0", "json-schema-traverse": "^1.0.0", "lodash.merge": "^4.6.2", - "oas": "^26.0.1", + "oas": "^27.0.0", "remove-undefined-objects": "^6.0.0" }, "devDependencies": { "@api/test-utils": "file:../test-utils", - "@readme/oas-examples": "^5.19.1", + "@readme/oas-examples": "^6.0.0", "@types/caseless": "^0.12.5", "@types/lodash.merge": "^4.6.9", "@vitest/coverage-v8": "^3.0.5", @@ -23912,12 +23912,12 @@ "reserved2": "^0.1.5" }, "devDependencies": { - "@readme/oas-examples": "^5.19.1", + "@readme/oas-examples": "^6.0.0", "@types/content-type": "^1.1.8", "@types/stringify-object": "^4.0.5", "@vitest/coverage-v8": "^3.0.5", "camelcase": "^8.0.0", - "jest-expect-openapi": "^2.0.1", + "jest-expect-openapi": "^3.0.0", "stringify-object": "^5.0.0", "typescript": "^5.8.2", "vitest": "^3.0.4" @@ -23927,7 +23927,7 @@ }, "peerDependencies": { "@readme/httpsnippet": "^11.0.0", - "oas": "^26.0.1" + "oas": "^27.0.0" } }, "packages/httpsnippet-client-api/node_modules/camelcase": { @@ -23968,7 +23968,7 @@ }, "devDependencies": { "@types/caseless": "^0.12.3", - "oas": "^26.0.1", + "oas": "^27.0.0", "typescript": "^5.8.2" } }, diff --git a/packages/api/package.json b/packages/api/package.json index 95ab116d..957fa19f 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -58,8 +58,8 @@ "js-yaml": "^4.1.0", "license": "^1.0.3", "lodash-es": "^4.17.21", - "oas": "^26.0.1", - "oas-normalize": "^13.1.0", + "oas": "^27.0.0", + "oas-normalize": "^14.0.0", "ora": "^8.0.1", "preferred-pm": "^4.0.0", "prompts": "^2.4.2", @@ -72,7 +72,7 @@ }, "devDependencies": { "@api/test-utils": "file:../test-utils", - "@readme/oas-examples": "^5.19.1", + "@readme/oas-examples": "^6.0.0", "@types/js-yaml": "^4.0.9", "@types/lodash-es": "^4.17.12", "@types/prompts": "^2.4.9", diff --git a/packages/api/test/fetcher.test.ts b/packages/api/test/fetcher.test.ts index 928397bd..f6a1ff30 100644 --- a/packages/api/test/fetcher.test.ts +++ b/packages/api/test/fetcher.test.ts @@ -146,7 +146,7 @@ describe('fetcher', () => { await expect(fetcher.load()).resolves.toHaveProperty('info', { description: 'Create beautiful product and API documentation with our developer friendly platform.', - version: '4.355.0', + version: '5.319.0', title: 'ReadMe API 🦉', contact: { name: 'API Support', @@ -164,7 +164,7 @@ describe('fetcher', () => { await expect(fetcher.load()).resolves.toHaveProperty('info', { description: 'Create beautiful product and API documentation with our developer friendly platform.', - version: '4.355.0', + version: '5.319.0', title: 'ReadMe API 🦉', contact: { name: 'API Support', diff --git a/packages/api/test/lib/suggestedOperations.test.ts b/packages/api/test/lib/suggestedOperations.test.ts index 9e3e8f15..52423648 100644 --- a/packages/api/test/lib/suggestedOperations.test.ts +++ b/packages/api/test/lib/suggestedOperations.test.ts @@ -13,7 +13,7 @@ describe('#getSuggestedOperation', () => { const suggested = getSuggestedOperation(spec); expect(suggested).toBeInstanceOf(Operation); - expect((suggested as Operation).getOperationId()).toBe('getAPISpecification'); + expect((suggested as Operation).getOperationId()).toBe('getProject'); }); it('should not retrieve an operation from a spec thats only comprised of webhooks', async () => { diff --git a/packages/api/test/storage.test.ts b/packages/api/test/storage.test.ts index 3ab70b83..c9c0989d 100644 --- a/packages/api/test/storage.test.ts +++ b/packages/api/test/storage.test.ts @@ -391,7 +391,7 @@ describe('storage', () => { private: true, identifier: 'readme', source: file, - integrity: 'sha512-rcaq4j4BzMyR9n3kLRTDLbOg37QdNywj2e3whoK/J/6PNlHrLATvysfJVHq+kMBf+gkukUwxayCwbN0wZj8ysg==', + integrity: 'sha512-0oWnrEtFj8tH3RcDQCnls+emnD2hHft4KHPI1L3XFy9p5Ue3n9EXr96P3XR36zHxevtB2RJKAtVM34kq6b8UUQ==', installerVersion: PACKAGE_VERSION, language: 'js', createdAt: expect.any(String), diff --git a/packages/core/package.json b/packages/core/package.json index f94a50ee..f6dcd345 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -49,19 +49,19 @@ "node": ">=20.10.0" }, "dependencies": { - "@readme/oas-to-har": "^25.0.1", + "@readme/oas-to-har": "^26.0.0", "caseless": "^0.12.0", "datauri": "^4.1.0", "fetch-har": "^11.0.1", "json-schema-to-ts": "^3.0.0", "json-schema-traverse": "^1.0.0", "lodash.merge": "^4.6.2", - "oas": "^26.0.1", + "oas": "^27.0.0", "remove-undefined-objects": "^6.0.0" }, "devDependencies": { "@api/test-utils": "file:../test-utils", - "@readme/oas-examples": "^5.19.1", + "@readme/oas-examples": "^6.0.0", "@types/caseless": "^0.12.5", "@types/lodash.merge": "^4.6.9", "@vitest/coverage-v8": "^3.0.5", diff --git a/packages/httpsnippet-client-api/package.json b/packages/httpsnippet-client-api/package.json index 5c560aea..ce12a203 100644 --- a/packages/httpsnippet-client-api/package.json +++ b/packages/httpsnippet-client-api/package.json @@ -41,15 +41,15 @@ }, "peerDependencies": { "@readme/httpsnippet": "^11.0.0", - "oas": "^26.0.1" + "oas": "^27.0.0" }, "devDependencies": { - "@readme/oas-examples": "^5.19.1", + "@readme/oas-examples": "^6.0.0", "@types/content-type": "^1.1.8", "@types/stringify-object": "^4.0.5", "@vitest/coverage-v8": "^3.0.5", "camelcase": "^8.0.0", - "jest-expect-openapi": "^2.0.1", + "jest-expect-openapi": "^3.0.0", "stringify-object": "^5.0.0", "typescript": "^5.8.2", "vitest": "^3.0.4" diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 135ea624..ef9b3370 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -13,7 +13,7 @@ }, "devDependencies": { "@types/caseless": "^0.12.3", - "oas": "^26.0.1", + "oas": "^27.0.0", "typescript": "^5.8.2" }, "prettier": "@readme/eslint-config/prettier" diff --git a/packages/test-utils/sdks/readme/README.md b/packages/test-utils/sdks/readme/README.md index 162764c5..7042703d 100644 --- a/packages/test-utils/sdks/readme/README.md +++ b/packages/test-utils/sdks/readme/README.md @@ -8,7 +8,7 @@ This SDK was autogenerated by the [`api` SDK generator](https://api.readme.dev), import readme from '@api/readme'; readme.auth('username', 'password'); -readme.getAPISpecification() +readme.getProject() .then(({ data }) => console.log(data)) .catch(err => console.error(err)); ``` diff --git a/packages/test-utils/sdks/readme/package.json b/packages/test-utils/sdks/readme/package.json index 22459e16..3d32105e 100644 --- a/packages/test-utils/sdks/readme/package.json +++ b/packages/test-utils/sdks/readme/package.json @@ -1,6 +1,6 @@ { "name": "@api/readme", - "version": "4.355.0", + "version": "5.319.0", "type": "module", "main": "dist/index.cjs", "types": "dist/index.d.cts", diff --git a/packages/test-utils/sdks/readme/src/schemas.ts b/packages/test-utils/sdks/readme/src/schemas.ts index b1d22478..bc9ac25e 100644 --- a/packages/test-utils/sdks/readme/src/schemas.ts +++ b/packages/test-utils/sdks/readme/src/schemas.ts @@ -1,4 +1,5 @@ import Apply from './schemas/Apply.js'; +import AskOwlbot from './schemas/AskOwlbot.js'; import Category from './schemas/Category.js'; import Changelog from './schemas/Changelog.js'; import CondensedProjectData from './schemas/CondensedProjectData.js'; @@ -53,10 +54,12 @@ import GetCustomPage from './schemas/GetCustomPage.js'; import GetCustomPages from './schemas/GetCustomPages.js'; import GetDoc from './schemas/GetDoc.js'; import GetOpenRoles from './schemas/GetOpenRoles.js'; +import GetOutboundIPs from './schemas/GetOutboundIPs.js'; import GetProductionDoc from './schemas/GetProductionDoc.js'; import GetProject from './schemas/GetProject.js'; import GetVersion from './schemas/GetVersion.js'; import GetVersions from './schemas/GetVersions.js'; +import IpListEntry from './schemas/IpListEntry.js'; import JobOpening from './schemas/JobOpening.js'; import SearchDocs from './schemas/SearchDocs.js'; import UpdateApiSpecification from './schemas/UpdateApiSpecification.js'; @@ -66,5 +69,6 @@ import UpdateCustomPage from './schemas/UpdateCustomPage.js'; import UpdateDoc from './schemas/UpdateDoc.js'; import UpdateVersion from './schemas/UpdateVersion.js'; import UploadApiSpecification from './schemas/UploadApiSpecification.js'; +import ValidateApiSpecification from './schemas/ValidateApiSpecification.js'; import Version from './schemas/Version.js'; -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 } +export { Apply, AskOwlbot, 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, GetOutboundIPs, GetProductionDoc, GetProject, GetVersion, GetVersions, IpListEntry, JobOpening, SearchDocs, UpdateApiSpecification, UpdateCategory, UpdateChangelog, UpdateCustomPage, UpdateDoc, UpdateVersion, UploadApiSpecification, ValidateApiSpecification, Version } diff --git a/packages/test-utils/sdks/readme/src/schemas/Apply.ts b/packages/test-utils/sdks/readme/src/schemas/Apply.ts index 12d61640..5d3265dd 100644 --- a/packages/test-utils/sdks/readme/src/schemas/Apply.ts +++ b/packages/test-utils/sdks/readme/src/schemas/Apply.ts @@ -15,15 +15,7 @@ const Apply = { }, "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" + "description": "The job you're looking to apply for (https://readme.com/careers)." }, "pronouns": { "type": "string", diff --git a/packages/test-utils/sdks/readme/src/schemas/AskOwlbot.ts b/packages/test-utils/sdks/readme/src/schemas/AskOwlbot.ts new file mode 100644 index 00000000..5550e27b --- /dev/null +++ b/packages/test-utils/sdks/readme/src/schemas/AskOwlbot.ts @@ -0,0 +1,47 @@ +const AskOwlbot = { + "body": { + "type": "object", + "required": [ + "question" + ], + "properties": { + "question": { + "type": "string", + "description": "The question being asked to Owlbot." + }, + "stream": { + "type": "boolean", + "description": "If true the response will be streamed as it is generated." + } + }, + "$schema": "http://json-schema.org/draft-04/schema#" + }, + "response": { + "200": { + "type": "object", + "properties": { + "answer": { + "type": "string" + }, + "sources": { + "type": "array", + "items": { + "type": "object", + "properties": { + "title": { + "type": "string", + "description": "The page title for the given source." + }, + "url": { + "type": "string", + "description": "A link to the source." + } + } + } + } + }, + "$schema": "http://json-schema.org/draft-04/schema#" + } + } +} as const; +export default AskOwlbot diff --git a/packages/test-utils/sdks/readme/src/schemas/DocSchemaPost.ts b/packages/test-utils/sdks/readme/src/schemas/DocSchemaPost.ts index eda2fa7d..95f1b474 100644 --- a/packages/test-utils/sdks/readme/src/schemas/DocSchemaPost.ts +++ b/packages/test-utils/sdks/readme/src/schemas/DocSchemaPost.ts @@ -14,7 +14,7 @@ const DocSchemaPost = { }, "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).", + "description": "Type of the page. This can be one of the following:\n- `basic` (most common)\n- `link` (page that redirects to an external link)\n- `error` (page describing an API error) [DEPRECATED]", "enum": [ "basic", "error", @@ -46,10 +46,12 @@ const DocSchemaPost = { }, "error": { "type": "object", + "deprecated": true, + "description": "This is used for docs with the `type` set to `error`. The `error` page type and this `error` object have been deprecated.", "properties": { "code": { "type": "string", - "description": "The error code for docs with the \"error\" type." + "description": "The error code for docs with the `error` type [DEPRECATED]." } } }, @@ -77,7 +79,7 @@ const DocSchemaPost = { }, "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).", + "description": "Type of the page. This can be one of the following:\n- `basic` (most common)\n- `link` (page that redirects to an external link)\n- `error` (page describing an API error) [DEPRECATED]", "enum": [ "basic", "error", @@ -109,10 +111,12 @@ const DocSchemaPost = { }, "error": { "type": "object", + "deprecated": true, + "description": "This is used for docs with the `type` set to `error`. The `error` page type and this `error` object have been deprecated.", "properties": { "code": { "type": "string", - "description": "The error code for docs with the \"error\" type." + "description": "The error code for docs with the `error` type [DEPRECATED]." } } }, diff --git a/packages/test-utils/sdks/readme/src/schemas/DocSchemaPut.ts b/packages/test-utils/sdks/readme/src/schemas/DocSchemaPut.ts index 87480660..a4b255e9 100644 --- a/packages/test-utils/sdks/readme/src/schemas/DocSchemaPut.ts +++ b/packages/test-utils/sdks/readme/src/schemas/DocSchemaPut.ts @@ -7,7 +7,7 @@ const DocSchemaPut = { }, "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).", + "description": "Type of the page. This can be one of the following:\n- `basic` (most common)\n- `link` (page that redirects to an external link)\n- `error` (page describing an API error) [DEPRECATED]", "enum": [ "basic", "error", @@ -39,10 +39,12 @@ const DocSchemaPut = { }, "error": { "type": "object", + "deprecated": true, + "description": "This is used for docs with the `type` set to `error`. The `error` page type and this `error` object have been deprecated.", "properties": { "code": { "type": "string", - "description": "The error code for docs with the \"error\" type." + "description": "The error code for docs with the `error` type [DEPRECATED]." } } }, diff --git a/packages/test-utils/sdks/readme/src/schemas/DocSchemaResponse.ts b/packages/test-utils/sdks/readme/src/schemas/DocSchemaResponse.ts index d16d3ecc..4d36ef2d 100644 --- a/packages/test-utils/sdks/readme/src/schemas/DocSchemaResponse.ts +++ b/packages/test-utils/sdks/readme/src/schemas/DocSchemaResponse.ts @@ -7,7 +7,7 @@ const DocSchemaResponse = { }, "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`", + "description": "Type of the page. This can be one of the following:\n- `basic` (most common)\n- `link` (page that redirects to an external link)\n- `error` (page describing an API error) [DEPRECATED]\n\n`basic` `error` `link`", "enum": [ "basic", "error", @@ -39,10 +39,12 @@ const DocSchemaResponse = { }, "error": { "type": "object", + "deprecated": true, + "description": "This is used for docs with the `type` set to `error`. The `error` page type and this `error` object have been deprecated.", "properties": { "code": { "type": "string", - "description": "The error code for docs with the \"error\" type." + "description": "The error code for docs with the `error` type [DEPRECATED]." } } } diff --git a/packages/test-utils/sdks/readme/src/schemas/GetOutboundIPs.ts b/packages/test-utils/sdks/readme/src/schemas/GetOutboundIPs.ts new file mode 100644 index 00000000..ec2afcf8 --- /dev/null +++ b/packages/test-utils/sdks/readme/src/schemas/GetOutboundIPs.ts @@ -0,0 +1,12 @@ +import IpListEntry from './IpListEntry.js'; + +const GetOutboundIPs = { + "response": { + "200": { + "type": "array", + "items": IpListEntry, + "$schema": "http://json-schema.org/draft-04/schema#" + } + } +} as const; +export default GetOutboundIPs diff --git a/packages/test-utils/sdks/readme/src/schemas/IpListEntry.ts b/packages/test-utils/sdks/readme/src/schemas/IpListEntry.ts new file mode 100644 index 00000000..ca065e1f --- /dev/null +++ b/packages/test-utils/sdks/readme/src/schemas/IpListEntry.ts @@ -0,0 +1,15 @@ +const IpListEntry = { + "type": "object", + "properties": { + "ipAddress": { + "type": "string", + "description": "The IP address.", + "examples": [ + "127.0.0.1" + ] + } + }, + "title": "ipListEntry", + "x-readme-ref-name": "ipListEntry" +} as const; +export default IpListEntry diff --git a/packages/test-utils/sdks/readme/src/schemas/UpdateApiSpecification.ts b/packages/test-utils/sdks/readme/src/schemas/UpdateApiSpecification.ts index f76ac2f4..f7e02541 100644 --- a/packages/test-utils/sdks/readme/src/schemas/UpdateApiSpecification.ts +++ b/packages/test-utils/sdks/readme/src/schemas/UpdateApiSpecification.ts @@ -13,9 +13,14 @@ const UpdateApiSpecification = { "type": "object", "properties": { "spec": { - "description": "OpenAPI/Swagger file. We accept JSON or YAML.", + "description": "An OpenAPI/Swagger file. We accept JSON or YAML.", "type": "string", "format": "binary" + }, + "url": { + "description": "A public URL to an OpenAPI/Swagger definition. We accept JSON or YAML.", + "type": "string", + "format": "url" } }, "$schema": "http://json-schema.org/draft-04/schema#" diff --git a/packages/test-utils/sdks/readme/src/schemas/UploadApiSpecification.ts b/packages/test-utils/sdks/readme/src/schemas/UploadApiSpecification.ts index 4c218441..48611dde 100644 --- a/packages/test-utils/sdks/readme/src/schemas/UploadApiSpecification.ts +++ b/packages/test-utils/sdks/readme/src/schemas/UploadApiSpecification.ts @@ -11,9 +11,14 @@ const UploadApiSpecification = { "type": "object", "properties": { "spec": { - "description": "OpenAPI/Swagger file. We accept JSON or YAML.", + "description": "An OpenAPI/Swagger file. We accept JSON or YAML.", "type": "string", "format": "binary" + }, + "url": { + "description": "A public URL to an OpenAPI/Swagger definition. We accept JSON or YAML.", + "type": "string", + "format": "url" } }, "$schema": "http://json-schema.org/draft-04/schema#" diff --git a/packages/test-utils/sdks/readme/src/schemas/ValidateApiSpecification.ts b/packages/test-utils/sdks/readme/src/schemas/ValidateApiSpecification.ts new file mode 100644 index 00000000..13e5bf99 --- /dev/null +++ b/packages/test-utils/sdks/readme/src/schemas/ValidateApiSpecification.ts @@ -0,0 +1,33 @@ +import ErrorSpecFileEmpty from './ErrorSpecFileEmpty.js'; +import ErrorSpecInvalid from './ErrorSpecInvalid.js'; +import ErrorSpecInvalidSchema from './ErrorSpecInvalidSchema.js'; + +const ValidateApiSpecification = { + "body": { + "type": "object", + "properties": { + "spec": { + "description": "An OpenAPI/Swagger file. We accept JSON or YAML.", + "type": "string", + "format": "binary" + }, + "url": { + "description": "A public URL to an OpenAPI/Swagger definition. We accept JSON or YAML.", + "type": "string", + "format": "url" + } + }, + "$schema": "http://json-schema.org/draft-04/schema#" + }, + "response": { + "400": { + "oneOf": [ + ErrorSpecFileEmpty, + ErrorSpecInvalid, + ErrorSpecInvalidSchema + ], + "$schema": "http://json-schema.org/draft-04/schema#" + } + } +} as const; +export default ValidateApiSpecification diff --git a/packages/test-utils/sdks/readme/src/schemas/Version.ts b/packages/test-utils/sdks/readme/src/schemas/Version.ts index 046c3951..bec1f6c2 100644 --- a/packages/test-utils/sdks/readme/src/schemas/Version.ts +++ b/packages/test-utils/sdks/readme/src/schemas/Version.ts @@ -28,6 +28,10 @@ const Version = { "is_deprecated": { "type": "boolean", "description": "Should this be deprecated? Only allowed in PUT operations." + }, + "pdfStatus": { + "type": "string", + "description": "Status of pdf generations." } }, "required": [ diff --git a/packages/test-utils/sdks/readme/src/sdk.ts b/packages/test-utils/sdks/readme/src/sdk.ts index 8dc0e7fb..6f5f740f 100644 --- a/packages/test-utils/sdks/readme/src/sdk.ts +++ b/packages/test-utils/sdks/readme/src/sdk.ts @@ -9,7 +9,7 @@ export default class SDK { core: APICore; constructor() { - this.core = new APICore(definition, 'readme/4.355.0 (api/7.0.0-mock)'); + this.core = new APICore(definition, 'readme/5.319.0 (api/7.0.0-mock)'); } /** @@ -72,6 +72,17 @@ export default class SDK { this.core.setServer(url, variables); } + /** + * Returns project data for the API key. + * + * @summary Get metadata about the current project + * @throws FetchError<401, types.GetProjectResponse401> Unauthorized + * @throws FetchError<403, types.GetProjectResponse403> Unauthorized + */ + getProject(): Promise> { + return this.core.fetch('/', 'get'); + } + /** * Get an API definition file that's been uploaded to ReadMe. * @@ -135,6 +146,17 @@ export default class SDK { return this.core.fetch('/api-specification/{id}', 'delete', metadata); } + /** + * Validate an API specification. + * + * @summary Validate API specification + * @throws FetchError<400, types.ValidateApiSpecificationResponse400> The API specification is not valid. + * @throws FetchError<408, types.ErrorSpecTimeout> The spec upload timed out. + */ + validateAPISpecification(body: types.ValidateApiSpecificationBodyParam): Promise> { + return this.core.fetch('/api-validation', 'post', body); + } + /** * Returns all the roles we're hiring for at ReadMe! * @@ -196,8 +218,6 @@ export default class SDK { /** * Delete the category with this slug. - * >⚠️Heads Up! - * > This will also delete all of the docs within this category. * * @summary Delete category * @throws FetchError<404, types.ErrorCategoryNotfound> The category couldn't be found. @@ -321,6 +341,29 @@ export default class SDK { return this.core.fetch('/custompages/{slug}', 'delete', metadata); } + /** + * Create a new doc inside of this project. + * + * @summary Create doc + * @throws FetchError<400, types.ErrorDocInvalid> The doc couldn't be saved. + * @throws FetchError<401, types.CreateDocResponse401> Unauthorized + * @throws FetchError<403, types.CreateDocResponse403> Unauthorized + */ + createDoc(body: types.DocSchemaPost, metadata?: types.CreateDocMetadataParam): Promise> { + return this.core.fetch('/docs', 'post', body, metadata); + } + + /** + * Returns all docs that match the search. + * + * @summary Search docs + * @throws FetchError<401, types.SearchDocsResponse401> Unauthorized + * @throws FetchError<403, types.SearchDocsResponse403> Unauthorized + */ + searchDocs(metadata: types.SearchDocsMetadataParam): Promise> { + return this.core.fetch('/docs/search', 'post', metadata); + } + /** * Returns the doc with this slug. * @@ -373,37 +416,27 @@ export default class SDK { } /** - * Create a new doc inside of this project. + * Returns all of ReadMe’s IP addresses used for outbound webhook requests and the “Try + * It!” button on the API Explorer. * - * @summary Create doc - * @throws FetchError<400, types.ErrorDocInvalid> The doc couldn't be saved. - * @throws FetchError<401, types.CreateDocResponse401> Unauthorized - * @throws FetchError<403, types.CreateDocResponse403> Unauthorized - */ - createDoc(body: types.DocSchemaPost, metadata?: types.CreateDocMetadataParam): Promise> { - return this.core.fetch('/docs', 'post', body, metadata); - } - - /** - * Returns all docs that match the search. + * Although ReadMe’s outbound IP addresses may change, the IPs in this API response will be + * valid for at least 7 days. If you configure your API or webhooks to limit access based + * on these IPs, you should refresh the IP list from this endpoint weekly. * - * @summary Search docs - * @throws FetchError<401, types.SearchDocsResponse401> Unauthorized - * @throws FetchError<403, types.SearchDocsResponse403> Unauthorized + * + * @summary Get ReadMe’s outbound IP addresses */ - searchDocs(metadata: types.SearchDocsMetadataParam): Promise> { - return this.core.fetch('/docs/search', 'post', metadata); + getOutboundIPs(): Promise> { + return this.core.fetch('/outbound-ips', 'get'); } /** - * Returns project data for the API key. + * Ask Owlbot a question about the content of your docs. * - * @summary Get metadata about the current project - * @throws FetchError<401, types.GetProjectResponse401> Unauthorized - * @throws FetchError<403, types.GetProjectResponse403> Unauthorized + * @summary Ask Owlbot AI a question */ - getProject(): Promise> { - return this.core.fetch('/', 'get'); + askOwlbot(body: types.AskOwlbotBodyParam): Promise> { + return this.core.fetch('/owlbot/ask', 'post', body); } /** diff --git a/packages/test-utils/sdks/readme/src/types.ts b/packages/test-utils/sdks/readme/src/types.ts index 514d872d..ecbf1616 100644 --- a/packages/test-utils/sdks/readme/src/types.ts +++ b/packages/test-utils/sdks/readme/src/types.ts @@ -2,6 +2,8 @@ import type { FromSchema } from '@readme/api-core/types'; import type * as schemas from './schemas.js'; export type Apply = FromSchema; +export type AskOwlbotBodyParam = FromSchema; +export type AskOwlbotResponse200 = FromSchema; export type Category = FromSchema; export type Changelog = FromSchema; export type CondensedProjectData = FromSchema; @@ -82,6 +84,7 @@ export type GetDocMetadataParam = FromSchema; export type GetDocResponse401 = FromSchema; export type GetDocResponse403 = FromSchema; export type GetOpenRolesResponse200 = FromSchema; +export type GetOutboundIPsResponse200 = FromSchema; export type GetProductionDocMetadataParam = FromSchema; export type GetProductionDocResponse401 = FromSchema; export type GetProductionDocResponse403 = FromSchema; @@ -92,6 +95,7 @@ export type GetVersionResponse401 = FromSchema; export type GetVersionsResponse401 = FromSchema; export type GetVersionsResponse403 = FromSchema; +export type IpListEntry = FromSchema; export type JobOpening = FromSchema; export type SearchDocsMetadataParam = FromSchema; export type SearchDocsResponse401 = FromSchema; @@ -117,4 +121,6 @@ export type UploadApiSpecificationMetadataParam = FromSchema; export type UploadApiSpecificationResponse401 = FromSchema; export type UploadApiSpecificationResponse403 = FromSchema; +export type ValidateApiSpecificationBodyParam = FromSchema; +export type ValidateApiSpecificationResponse400 = FromSchema; export type Version = FromSchema;