diff --git a/package-lock.json b/package-lock.json index a3e50e8..d6d40e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "tc-source-content-updater", - "version": "1.4.31-beta", + "version": "1.4.32-beta.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "tc-source-content-updater", - "version": "1.4.31-beta", + "version": "1.4.32-beta.3", "license": "ISC", "dependencies": { "adm-zip": "^0.4.11", diff --git a/package.json b/package.json index 4750c13..5964473 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tc-source-content-updater", - "version": "1.4.31", + "version": "1.4.32", "description": "Module that updates source content for the desktop application translationCore.", "main": "lib/index.js", "display": "library", diff --git a/src/helpers/apiHelpers.js b/src/helpers/apiHelpers.js index e0ad80a..cdc2abc 100644 --- a/src/helpers/apiHelpers.js +++ b/src/helpers/apiHelpers.js @@ -285,13 +285,16 @@ export async function getCatalog(config = {}) { DCS_BASE_URL: config.DCS_BASE_URL, partialMatch: '0', }; - const catalogReleases = await searchCatalogNext(searchParams); + const fetchDoor43Catalog = !config.ignoreDoor43Catalog; + const catalogReleases = fetchDoor43Catalog ? await searchCatalogNext(searchParams) : []; console.log(`getCatalog - found ${catalogReleases.length} items in old Door43-Catalog`); searchParams = { subject: SUBJECT.ALL_TC_RESOURCES, stage: config.stage || STAGE.PROD, DCS_BASE_URL: config.DCS_BASE_URL, partialMatch: '0', + ignoreDoor43Catalog: config.ignoreDoor43Catalog, + topic: config.topic, }; const newCatalogReleases = await searchCatalogNext(searchParams); console.log(`getCatalog - found ${newCatalogReleases.length} items in catalog next`); @@ -398,6 +401,7 @@ function getCompatibleResourceList(resources) { * STAGE.LATEST -return the default branch (e.g. master) if it is a valid RC instead of the "prod", "preprod" or "draft". (default) * @property {Number|String} checkingLevel - search only for entries with the given checking level(s). Can be 1, 2 or 3. Default is any. * @property {String} sort - how to sort results (see defines in SORT), if undefined then sorted by by "lang", then "subject" and then "tag" + * @property {String} topic - filter by topic tags (e.g. "tc-ready") */ /** @@ -419,6 +423,7 @@ export async function searchCatalogNext(searchParams, retries=3) { partialMatch, sort = SORT.REPO_NAME, DCS_BASE_URL: baseUrl = DCS_BASE_URL, + topic, } = searchParams; try { @@ -433,6 +438,7 @@ export async function searchCatalogNext(searchParams, retries=3) { parameters = addUrlParameter(partialMatch, parameters, 'partialMatch'); parameters = addUrlParameter('rc', parameters, 'metadataType'); parameters = addUrlParameter(sort, parameters, 'sort'); + parameters = addUrlParameter(topic, parameters, 'topic'); if (parameters) { fetchUrl += '?' + parameters; }