Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: drop support for Enterprise Server and Enterprise Cloud-specific APIs, and add support for 10 new APIs #474

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"description": "Shared TypeScript definitions for Octokit projects",
"dependencies": {
"@octokit/openapi-types": "^13.11.0"
"@octokit/openapi-types": "^14.0.0"
},
"scripts": {
"build": "pika-pack build",
Expand Down Expand Up @@ -96,6 +96,6 @@
]
},
"octokit": {
"openapi-version": "7.13.0"
"openapi-version": "8.0.0"
}
}
23 changes: 19 additions & 4 deletions scripts/update-endpoints/fetch-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const version = process.env.VERSION.replace(/^v/, "");

const QUERY = `
query ($version: String!, $ignoreChangesBefore: String!) {
endpoints(version: $version, ignoreChangesBefore: $ignoreChangesBefore) {
endpoints(version: $version, ignoreChangesBefore: $ignoreChangesBefore, filter: { isGithubCloudOnly: false }) {
method
url
documentationUrl
Expand All @@ -33,6 +33,18 @@ const QUERY = `

main();

// In order to see operations which are only available in GitHub Enterprise Cloud
// (GHEC), `github-openapi-graphql-query` now looks at the GHEC-specific OpenAPI
// specifications. At the moment, the documentation URLs, therefore, are not
// normalised. This removes the references to GHEC.
const removeEnterpriseCloudFromDocumentationUrl = (endpoint) => ({
...endpoint,
documentationUrl: endpoint.documentationUrl.replace(
"/enterprise-cloud@latest/",
""
),
});

async function main() {
const {
data: { endpoints },
Expand All @@ -43,8 +55,11 @@ async function main() {

writeFileSync(
path.resolve(__dirname, "generated", "endpoints.json"),
prettier.format(JSON.stringify(endpoints), {
parser: "json",
})
prettier.format(
JSON.stringify(endpoints.map(removeEnterpriseCloudFromDocumentationUrl)),
{
parser: "json",
}
)
);
}
Loading