Convert a bunch of URL formats to patterns (#2293)

Follow-on to #2279
This commit is contained in:
Paul Melnikow
2018-11-09 14:03:00 -05:00
committed by GitHub
parent ec65291a11
commit c4af2cac53
11 changed files with 17 additions and 34 deletions

View File

@@ -30,8 +30,7 @@ module.exports = class PypiBase extends BaseJsonService {
static buildUrl(base) {
return {
base,
format: '(.*)',
capture: ['egg'],
pattern: ':egg*',
}
}

View File

@@ -67,8 +67,7 @@ module.exports = class PypiDownloads extends BaseJsonService {
static get url() {
return {
base: 'pypi',
format: '(dd|dw|dm)/(.+)',
capture: ['period', 'pkg'],
pattern: ':period(dd|dw|dm)/:pkg',
}
}

View File

@@ -171,8 +171,7 @@ class SteamCollectionSize extends BaseSteamAPI {
static get url() {
return {
base: 'steam/collection-files',
format: '(.+)',
capture: ['collectionId'],
pattern: ':collectionId',
}
}
@@ -254,8 +253,7 @@ class SteamFileSize extends SteamFileService {
static get url() {
return {
base: 'steam/size',
format: '(.+)',
capture: ['fileId'],
pattern: ':fileId',
}
}
@@ -290,8 +288,7 @@ class SteamFileReleaseDate extends SteamFileService {
static get url() {
return {
base: 'steam/release-date',
format: '(.+)',
capture: ['fileId'],
pattern: ':fileId',
}
}
@@ -331,8 +328,7 @@ class SteamFileSubscriptions extends SteamFileService {
static get url() {
return {
base: 'steam/subscriptions',
format: '(.+)',
capture: ['fileId'],
pattern: ':fileId',
}
}
@@ -370,8 +366,7 @@ class SteamFileFavorites extends SteamFileService {
static get url() {
return {
base: 'steam/favorites',
format: '(.+)',
capture: ['fileId'],
pattern: ':fileId',
}
}
@@ -411,8 +406,7 @@ class SteamFileDownloads extends SteamFileService {
static get url() {
return {
base: 'steam/downloads',
format: '(.+)',
capture: ['fileId'],
pattern: ':fileId',
}
}
@@ -446,8 +440,7 @@ class SteamFileViews extends SteamFileService {
static get url() {
return {
base: 'steam/views',
format: '(.+)',
capture: ['fileId'],
pattern: ':fileId',
}
}

View File

@@ -22,8 +22,7 @@ module.exports = class SwaggerValidatorService extends BaseJsonService {
static get url() {
return {
base: 'swagger/valid/2.0',
format: '(http(?:s)?)/(.+)',
capture: ['scheme', 'url'],
pattern: ':scheme(http|https)?/:url*',
}
}

View File

@@ -22,8 +22,7 @@ module.exports = class Time extends BaseService {
static get url() {
return {
base: 'servertime',
format: '',
capture: [],
pattern: '',
}
}
}

View File

@@ -15,8 +15,7 @@ module.exports = class UptimeRobotRatio extends UptimeRobotBase {
static get url() {
return {
base: 'uptimerobot/ratio',
format: '(?:([\\d+])/)?(.*)',
capture: ['numberOfDays', 'monitorApiKey'],
pattern: ':numberOfDays(\\d+)?/:monitorApiKey',
}
}

View File

@@ -12,8 +12,7 @@ module.exports = class UptimeRobotStatus extends UptimeRobotBase {
static get url() {
return {
base: 'uptimerobot/status',
format: '(.*)',
capture: ['monitorApiKey'],
pattern: ':monitorApiKey',
}
}

View File

@@ -44,8 +44,7 @@ function DownloadsForExtensionType(extensionType) {
static get url() {
return {
base: `wordpress/${extensionType}/dt`,
format: '(.+)',
capture: ['slug'],
pattern: ':slug',
}
}
static get extensionType() {

View File

@@ -47,8 +47,7 @@ class WordpressPluginRequiresVersion extends BaseWordpressPlatform {
static get url() {
return {
base: `wordpress/plugin/wp-version`,
format: '(.+)',
capture: ['slug'],
pattern: ':slug',
}
}

View File

@@ -41,8 +41,7 @@ function RatingForExtensionType(extensionType) {
static get url() {
return {
base: `wordpress/${extensionType}/rating`,
format: '(.+)',
capture: ['slug'],
pattern: ':slug',
}
}

View File

@@ -39,8 +39,7 @@ function VersionForExtensionType(extensionType) {
static get url() {
return {
base: `wordpress/${extensionType}/v`,
format: '(.+)',
capture: ['slug'],
pattern: ':slug',
}
}