diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 657513f..8cd6097 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,9 +1,6 @@ name: Linter on: - push: - branches-ignore: - - 'dependabot/**' workflow_call: inputs: install-all: diff --git a/CHANGELOG.md b/CHANGELOG.md index 878dcef..f936dfc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ by [**SWR Audio Lab**](https://lab.swr.de/) - 2024-07-10 - v2.0.0 - refact!: remove aws-sdk integration (s3) + - refact!: remove `ard:publishers` and `ard:pub-sort` scripts + - chore!: switch super-linter ESLint config default to `/eslint.config.mjs` - 2024-05-13 - v1.3.0 diff --git a/package.json b/package.json index 47e40a4..767b360 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,6 @@ "scripts": { "ard:coreId": "node ./scripts/ard/coreId.js", "ard:categories": "node -r dotenv/config scripts/ard/categories.js", - "ard:publishers": "node -r dotenv/config scripts/ard/publishers.js", - "ard:pub-sort": "node -r dotenv/config scripts/ard/sortPubByExtId.js", "lint": "eslint .", "test": "mocha tests/**.js -r dotenv/config", "outdated": "yarn upgrade-interactive", diff --git a/scripts/ard/publishers.js b/scripts/ard/publishers.js deleted file mode 100644 index 068ed9f..0000000 --- a/scripts/ard/publishers.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - - SWR audio lab - - exports an ard-publisher list as json file - -*/ - -// load utils -const undici = require('../../packages/undici')() - -// init storage -const Storage = require('../../packages/storage-wrapper') - -const storage = new Storage({ - gs: { projectId: process.env.GCP_PROJECT_ID }, - logging: true, -}) - -const ARD_API_URL = - process.env.ARD_DELIVER_API || - 'https://deliver-test.ard.de/organization-service/' -const ARD_API_HEADERS = { - Authorization: `Basic ${Buffer.from(process.env.ARD_AUTH).toString('base64')}`, -} - -const crawl = async () => { - const output = [] - - try { - const { string: publisherString } = await undici( - `${ARD_API_URL}publishers?page=0&size=500`, - { - headers: ARD_API_HEADERS, - } - ) - - const publishers = JSON.parse(publisherString) - - for await (const publisher of publishers.elements) { - const { string: publisherInfoString } = await undici( - publisher.href, - { - headers: ARD_API_HEADERS, - } - ) - const publisherInfo = JSON.parse(publisherInfoString) - - const { string: institutionInfoString } = await undici( - publisherInfo.institution.href, - { - headers: ARD_API_HEADERS, - } - ) - const institutionInfo = JSON.parse( - institutionInfoString - ) - - const details = { - _type: publisherInfo._type, - id: publisherInfo.id, - externalId: publisherInfo.externalId, - title: publisherInfo.title, - institution: { - _type: institutionInfo._type, - id: institutionInfo.id, - externalId: institutionInfo.externalId, - title: institutionInfo.title, - acronym: institutionInfo.acronym, - }, - } - - output.push(details) - console.log(details) - } - - await storage.save( - 'tmp/ard-publishers.json', - JSON.stringify(output) - ) - } catch (error) { - console.log(error) - } -} - -crawl() diff --git a/scripts/ard/sortPubByExtId.js b/scripts/ard/sortPubByExtId.js deleted file mode 100644 index 054dd55..0000000 --- a/scripts/ard/sortPubByExtId.js +++ /dev/null @@ -1,38 +0,0 @@ -/* - - by SWR audio lab - - sorts list of ard-publishers by external-id - -*/ - -// init storage -const Storage = require('../../packages/storage-wrapper') - -const storage = new Storage({ - gs: { projectId: process.env.GCP_PROJECT_ID }, - logging: true, -}) - -const sort = async () => { - try { - const input = await storage.load('tmp/ard-publishers.json') - const publisher = JSON.parse(input) - - publisher.sort((a, b) => { - return ( - Number.parseInt(a.externalId) - - Number.parseInt(b.externalId) - ) - }) - - await storage.save( - 'tmp/ard-publishers-ordered.json', - JSON.stringify(publisher) - ) - } catch (error) { - console.log(error) - } -} - -sort()