Skip to content

Commit dc10a6e

Browse files
committed
build: ignore all deprecated/legacy endpoints with specific exceptions
1 parent ef5dd0a commit dc10a6e

File tree

6 files changed

+15379
-11791
lines changed

6 files changed

+15379
-11791
lines changed

scripts/update-endpoints/code.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const prettier = require("prettier");
55
const sortKeys = require("sort-keys");
66

77
const ENDPOINTS = require("./generated/endpoints.json");
8+
const { isDeprecated } = require("./util");
89

910
const ROUTES_PATH = join(
1011
__dirname,
@@ -21,12 +22,9 @@ generateRoutes();
2122

2223
async function generateRoutes() {
2324
ENDPOINTS.forEach(endpoint => {
24-
const scope = endpoint.scope;
25+
if (isDeprecated(endpoint)) return false;
2526

26-
if (endpoint.isLegacy && !/^\/teams\/\{team_id\}/.test(endpoint.url)) {
27-
// ignore legacy endpoints with the exception of the new teams legacy methods
28-
return;
29-
}
27+
const scope = endpoint.scope;
3028

3129
const isUploadReleaseAssetUrl = /^\{origin\}/.test(endpoint.url);
3230
if (isUploadReleaseAssetUrl) {

scripts/update-endpoints/docs.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ const { outputFileSync } = require("fs-extra");
22
const prettier = require("prettier");
33

44
const ENDPOINTS = require("./generated/endpoints.json");
5+
const { isDeprecated } = require("./util");
56

67
generateRoutes();
78

89
async function generateRoutes() {
910
const endpoints = ENDPOINTS.filter(endpoint => {
10-
if (endpoint.isLegacy && !/^\/teams\/\{team_id\}/.test(endpoint.url)) {
11-
// ignore legacy endpoints with the exception of the new teams legacy methods
12-
return false;
13-
}
11+
if (isDeprecated(endpoint)) return false;
1412

1513
return true;
1614
});

scripts/update-endpoints/fetch-json.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (!process.env.VERSION) {
1010

1111
const QUERY = `
1212
query ($version: String!, $ignoreChangesBefore: String!) {
13-
endpoints(version: $version, ignoreChangesBefore: $ignoreChangesBefore, filter: { isDeprecated: false, isGithubCloudOnly: false }) {
13+
endpoints(version: $version, ignoreChangesBefore: $ignoreChangesBefore, filter: { isGithubCloudOnly: false }) {
1414
name
1515
scope(format: CAMELCASE)
1616
id(format: CAMELCASE)

0 commit comments

Comments
 (0)