From 78b83d590e78ae86f2891cb2e9e7fbb5e8247b5e Mon Sep 17 00:00:00 2001 From: suecharo Date: Mon, 2 May 2022 17:19:01 +0900 Subject: [PATCH] Rename `yevis config file` -> `yevis metadata file` --- src/api/trs.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/api/trs.ts b/src/api/trs.ts index 54c12c3..02a4bec 100644 --- a/src/api/trs.ts +++ b/src/api/trs.ts @@ -101,7 +101,7 @@ export const getToolVersion = async ( return await res.json() } -export const getGhTrsConfig = async ( +export const getYevisMetadata = async ( id: string, version: string ): Promise => { @@ -109,7 +109,7 @@ export const getGhTrsConfig = async ( `${trsEndpoint().replace( /\/$/, '' - )}/tools/${id}/versions/${version}/gh-trs-config.json`, + )}/tools/${id}/versions/${version}/yevis-metadata.json`, { method: 'GET', } @@ -119,7 +119,7 @@ export const getGhTrsConfig = async ( `Failed to get ${trsEndpoint().replace( /\/$/, '' - )}/tools/${id}/versions/${version}/gh-trs-config.json with error: ${ + )}/tools/${id}/versions/${version}/yevis-metadata.json with error: ${ res.status } ${res.statusText}` ) @@ -129,12 +129,12 @@ export const getGhTrsConfig = async ( // params: [id, version][] // return: { `${id}_${version}`: Config } -export const getGhTrsConfigs = async ( +export const getYevisMetadataFiles = async ( idVersions: [string, string][] ): Promise> => { const configs: Record = {} // key: ${id}_${version} const results = await Promise.all( - idVersions.map(([id, version]) => getGhTrsConfig(id, version)) + idVersions.map(([id, version]) => getYevisMetadata(id, version)) ) results.forEach((config) => { configs[`${config.id}_${config.version}`] = config @@ -149,7 +149,7 @@ export const getLastModifiedDate = async ( ): Promise => { const commits = await request('GET /repos/{owner}/{repo}/commits', { owner: wfRepo().split('/')[0], - path: `tools/${id}/versions/${version}/gh-trs-config.json`, + path: `tools/${id}/versions/${version}/yevis-metadata.json`, per_page: 1, repo: wfRepo().split('/')[1], sha: wfRepoGhPagesBranch(), @@ -199,7 +199,7 @@ export const getPublishedWorkflows = async (): Promise => { (toolVersion) => [toolVersion.id, extractVersionStr(toolVersion)] ) const [configs, modifiedDate] = await Promise.all([ - getGhTrsConfigs(latestIdVersions), + getYevisMetadataFiles(latestIdVersions), getLastModifiedDates(latestIdVersions), ]) const publishedWorkflows: PublishedWorkflows = {} @@ -331,7 +331,7 @@ export const getPublishedWorkflow = async ( ): Promise => { const [toolVersion, config, modifiedDate] = await Promise.all([ getToolVersion(id, version), - getGhTrsConfig(id, version), + getYevisMetadata(id, version), getLastModifiedDate(id, version), ]) return {