diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6c313659..4d0894e4 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -40,7 +40,7 @@ jobs: # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} if: github.event_name != 'pull_request' - uses: docker/login-action@a9794064588be971151ec5e7144cb535bcb56e36 + uses: docker/login-action@553b6f090f15b58451081ce157ff1929a266131d with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -50,14 +50,14 @@ jobs: # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta - uses: docker/metadata-action@35e9aff4f5d665b5aa8a8f2adffaf8a1b5f49cc0 + uses: docker/metadata-action@0f8c876bafbf5dbce05c36682ec68e9a0274a48a with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - name: Build and push Docker image - uses: docker/build-push-action@4fad532b9fdbfb80f436784834374a1c11834153 + uses: docker/build-push-action@9311bf5263ae5b36f3ec67aff768790c6e2344ad with: context: . push: ${{ github.event_name != 'pull_request' }} diff --git a/.github/workflows/jest-coverage.yml b/.github/workflows/jest-coverage.yml index c54aacd7..4198621c 100644 --- a/.github/workflows/jest-coverage.yml +++ b/.github/workflows/jest-coverage.yml @@ -17,7 +17,7 @@ jobs: if: "!contains(github.event.head_commit.message, '[skip ci]')" steps: - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2.2.4 + - uses: pnpm/action-setup@v2.4.0 with: version: latest - uses: ArtiomTr/jest-coverage-report-action@v2 diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index a705eb11..52aca7af 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -22,7 +22,7 @@ jobs: name: Node ${{ matrix.node }} sample steps: - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2.2.4 + - uses: pnpm/action-setup@v2.4.0 with: version: latest - name: Use Node.js ${{ matrix.node-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 655a6ecf..190da1a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## [1.7.0](https://github.com/djdembeck/audnexus/compare/v1.6.0...v1.7.0) (2023-08-19) + + +### Features + +* **helper:** :sparkles: remove links, emails, and handles from descriptions ([e80819d](https://github.com/djdembeck/audnexus/commit/e80819dbfd069c5ac6581d669a1979a4b3695935)) +* **schema:** :sparkles: add `copyright` and `isbn` fields ([d9bf840](https://github.com/djdembeck/audnexus/commit/d9bf840ffe58a89ce2e931234f2c88bdd885600e)) +* **schema:** :sparkles: use `adult` data from audible in form of `isAdult` ([feec8d8](https://github.com/djdembeck/audnexus/commit/feec8d80916eeee48cf65598f8d3838ed7d6f414)) + ## [1.6.0](https://github.com/djdembeck/audnexus/compare/v1.5.0...v1.6.0) (2023-07-30) diff --git a/README.md b/README.md index ea7dd75f..d272f38f 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,7 @@ Pre-rendered HTML documentation is also included in docs/index.html. HTML can be re-generated from the spec, using: ``` -redoc-cli build docs/spec/audnexus.yaml -o docs/index.html +pnpm run build-docs ``` ## 🚀 Deployment diff --git a/docker-compose.yml b/docker-compose.yml index 60ddbf61..47d27680 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,19 @@ -version: '3.7' +version: "3.7" services: node-server: image: ghcr.io/laxamentumtech/audnexus:develop restart: always environment: - - ADP_TOKEN=${NODE_ADP_TOKEN} - - MAX_REQUESTS=${NODE_MAX_REQUESTS} - - MONGODB_URI=${NODE_MONGODB_URI} - - PRIVATE_KEY=${NODE_PRIVATE_KEY} - - REDIS_URL=${NODE_REDIS_URL} - - UPDATE_INTERVAL=${NODE_UPDATE_INTERVAL} - - UPDATE_THRESHOLD=${NODE_UPDATE_THRESHOLD} + ADP_TOKEN: ${NODE_ADP_TOKEN} + MAX_REQUESTS: ${NODE_MAX_REQUESTS:-300} + MONGODB_URI: ${NODE_MONGODB_URI:-mongodb://mongo:27017/audnexus} + PRIVATE_KEY: ${NODE_PRIVATE_KEY} + REDIS_URL: ${NODE_REDIS_URL:-redis://redis:6379} + UPDATE_INTERVAL: ${NODE_UPDATE_INTERVAL:-30} + UPDATE_THRESHOLD: ${NODE_UPDATE_THRESHOLD:-7} ports: - - '3000:3000' + - "3000:3000" depends_on: - mongo - redis @@ -22,12 +22,12 @@ services: - internal deploy: labels: - - 'traefik.enable=true' - - 'traefik.docker.network=traefik-overlay' - - 'traefik.http.routers.node-server.rule=Host(`${TRAEFIK_DOMAIN}`)' - - 'traefik.http.routers.node-server.entrypoints=websecure' - - 'traefik.http.routers.redirs.entrypoints=websecure' - - 'traefik.http.services.node-server.loadbalancer.server.port=3000' + - "traefik.enable=true" + - "traefik.docker.network=traefik-overlay" + - "traefik.http.routers.node-server.rule=Host(`${TRAEFIK_DOMAIN}`)" + - "traefik.http.routers.node-server.entrypoints=websecure" + - "traefik.http.routers.redirs.entrypoints=websecure" + - "traefik.http.services.node-server.loadbalancer.server.port=3000" replicas: 15 mongo: @@ -48,15 +48,15 @@ services: image: traefik:v3.0 restart: always command: - - '--providers.docker=true' - - '--entryPoints.websecure.address=:443' - - '--providers.docker.exposedbydefault=false' - - '--entrypoints.websecure.http.tls=true' - - '--certificatesresolvers.myresolver.acme.tlschallenge=true' - - '--certificatesresolvers.myresolver.acme.email=${TRAEFIK_EMAIL}' - - '--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json' + - "--providers.docker=true" + - "--entryPoints.websecure.address=:443" + - "--providers.docker.exposedbydefault=false" + - "--entrypoints.websecure.http.tls=true" + - "--certificatesresolvers.myresolver.acme.tlschallenge=true" + - "--certificatesresolvers.myresolver.acme.email=${TRAEFIK_EMAIL}" + - "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json" ports: - - '443:443' + - "443:443" volumes: - /mnt/docker/letsencrypt:/letsencrypt - /var/run/docker.sock:/var/run/docker.sock:ro diff --git a/docs/index.html b/docs/index.html index 784b6e9e..d0ec2fcd 100644 --- a/docs/index.html +++ b/docs/index.html @@ -12,2168 +12,363 @@ margin: 0; } -
-Returns a list of authors, based on search query provided
+name required | string Name to search with + |
region | string Default: "us" Enum: "au" "ca" "de" "es" "fr" "in" "it" "jp" "us" "uk" Region code + |
[- {
- "asin": "string",
- "description": "string",
- "genres": [
- {
- "asin": "string",
- "name": "string",
- "type": "string"
}
], - "image": "string",
- "name": "string",
- "region": "au",
- "similar": [
- {
- "asin": "string",
- "name": "string"
}
]
}
]
Returns a single author
+ASIN required | string ID of author to return + |
update | string Enum: "0" "1" Have server check for updated data upstream + |
region | string Default: "us" Enum: "au" "ca" "de" "es" "fr" "in" "it" "jp" "us" "uk" Region code + |
{- "asin": "B00G0WYW92",
- "description": "ANDY WEIR built a two-decade career as a software engineer until the success of his first published novel, The Martian, allowed him to live out his dream of writing full-time. He is a lifelong space nerd and a devoted hobbyist of such subjects as relativistic physics, orbital mechanics, and the history of manned spaceflight. He also mixes a mean cocktail. He lives in California.",
- "genres": [
- {
- "asin": "18580606011",
- "name": "Science Fiction & Fantasy",
- "type": "genre"
}, - {
- "asin": "18574597011",
- "name": "Mystery, Thriller & Suspense",
- "type": "genre"
}, - {
- "asin": "18574426011",
- "name": "Literature & Fiction",
- "type": "genre"
}
], - "name": "Andy Weir",
- "region": "us",
- "similar": [
- {
- "asin": "B002XLHS8Q",
- "name": "Adrian Tchaikovsky"
}, - {
- "asin": "B001H6U8X0",
- "name": "Blake Crouch"
}, - {
- "asin": "B001IGFHW6",
- "name": "Brandon Sanderson"
}, - {
- "asin": "B007JP96JU",
- "name": "Cixin Liu"
}, - {
- "asin": "B010ETTBJC",
- "name": "Dennis E. Taylor"
}, - {
- "asin": "B004XRR8Z6",
- "name": "Ernest Cline"
}, - {
- "asin": "B000APO5OM",
- "name": "Frank Herbert"
}, - {
- "asin": "B00EDBZVNI",
- "name": "Pierce Brown"
}
]
}
Returns a single book
+ASIN required | string ID of book to return + |
seedAuthors | number Enum: 0 1 Whether to seed authors of book + |
update | number Enum: 0 1 Have server check for updated data upstream + |
region | string Default: "us" Enum: "au" "ca" "de" "es" "fr" "in" "it" "jp" "us" "uk" Region code + |
{- "asin": "B08G9PRS1K",
- "authors": [
- {
- "asin": "B00G0WYW92",
- "name": "Andy Weir"
}
], - "copyright": 2021,
- "description": "Ryland Grace is the sole survivor on a desperate, last-chance mission - and if he fails, humanity and the Earth itself will perish. Except that right now, he doesn't know that. He can't even remember his own name, let alone the nature of his assignment or how to complete it....",
- "formatType": "unabridged",
- "genres": [
- {
- "asin": "18580606011",
- "name": "Science Fiction & Fantasy",
- "type": "genre"
}, - {
- "asin": "18580628011",
- "name": "Science Fiction",
- "type": "tag"
}, - {
- "asin": "18580629011",
- "name": "Adventure",
- "type": "tag"
}, - {
- "asin": "18580639011",
- "name": "Hard Science Fiction",
- "type": "tag"
}, - {
- "asin": "18580645011",
- "name": "Space Opera",
- "type": "tag"
}
], - "isAdult": false,
- "isbn": "9781603935470",
- "language": "english",
- "narrators": [
- {
- "name": "Ray Porter"
}
], - "publisherName": "Audible Studios",
- "rating": "4.9",
- "region": "us",
- "releaseDate": "2021-05-04T00:00:00.000Z",
- "runtimeLengthMin": 970,
- "summary": "<p><b><i>Winner of the 2022 Audie Awards' Audiobook of the Year</i></b></p> <p><b><i>Number-One Audible and </i></b><b>New York Times</b><b><i> Audio Best Seller</i></b></p> <p><b><i>More than one million audiobooks sold</i></b></p> <p><b>A lone astronaut must save the earth from disaster in this incredible new science-based thriller from the number-one </b><b><i>New York Times</i></b><b> best-selling author of </b><b><i>The Martian</i></b><b>.</b></p> <p>Ryland Grace is the sole survivor on a desperate, last-chance mission - and if he fails, humanity and the Earth itself will perish.</p> <p>Except that right now, he doesn't know that. He can't even remember his own name, let alone the nature of his assignment or how to complete it.</p> <p>All he knows is that he's been asleep for a very, very long time. And he's just been awakened to find himself millions of miles from home, with nothing but two corpses for company.</p> <p>His crewmates dead, his memories fuzzily returning, he realizes that an impossible task now confronts him. Alone on this tiny ship that's been cobbled together by every government and space agency on the planet and hurled into the depths of space, it's up to him to conquer an extinction-level threat to our species.</p> <p>And thanks to an unexpected ally, he just might have a chance.</p> <p>Part scientific mystery, part dazzling interstellar journey, <i>Project Hail Mary</i> is a tale of discovery, speculation, and survival to rival <i>The Martian</i> - while taking us to places it never dreamed of going.</p> <p>PLEASE NOTE: To accommodate this audio edition, some changes to the original text have been made with the approval of author Andy Weir.</p>",
- "title": "Project Hail Mary"
}
Returns a single book's chapters
+ASIN required | string ID of book to return + |
update | number Enum: 0 1 Have server check for updated data upstream + |
region | string Default: "us" Enum: "au" "ca" "de" "es" "fr" "in" "it" "jp" "us" "uk" Region code + |
{- "asin": "B08G9PRS1K",
- "brandIntroDurationMs": 2043,
- "brandOutroDurationMs": 5061,
- "chapters": [
- {
- "lengthMs": 13307,
- "startOffsetMs": 0,
- "startOffsetSec": 0,
- "title": "Opening Credits"
}, - {
- "lengthMs": 5909,
- "startOffsetMs": 13307,
- "startOffsetSec": 13,
- "title": "Dedication"
}, - {
- "lengthMs": 2203908,
- "startOffsetMs": 19216,
- "startOffsetSec": 19,
- "title": "Chapter 1"
}, - {
- "lengthMs": 1721527,
- "startOffsetMs": 2223124,
- "startOffsetSec": 2223,
- "title": "Chapter 2"
}, - {
- "lengthMs": 2241282,
- "startOffsetMs": 3944651,
- "startOffsetSec": 3945,
- "title": "Chapter 3"
}, - {
- "lengthMs": 2460850,
- "startOffsetMs": 6185933,
- "startOffsetSec": 6186,
- "title": "Chapter 4"
}, - {
- "lengthMs": 3189400,
- "startOffsetMs": 8646783,
- "startOffsetSec": 8647,
- "title": "Chapter 5"
}, - {
- "lengthMs": 2650650,
- "startOffsetMs": 11836183,
- "startOffsetSec": 11836,
- "title": "Chapter 6"
}, - {
- "lengthMs": 1806744,
- "startOffsetMs": 14486833,
- "startOffsetSec": 14487,
- "title": "Chapter 7"
}, - {
- "lengthMs": 2189734,
- "startOffsetMs": 16293577,
- "startOffsetSec": 16294,
- "title": "Chapter 8"
}, - {
- "lengthMs": 1759608,
- "startOffsetMs": 18483311,
- "startOffsetSec": 18483,
- "title": "Chapter 9"
}, - {
- "lengthMs": 2120817,
- "startOffsetMs": 20242919,
- "startOffsetSec": 20243,
- "title": "Chapter 10"
}, - {
- "lengthMs": 1566928,
- "startOffsetMs": 22363736,
- "startOffsetSec": 22364,
- "title": "Chapter 11"
}, - {
- "lengthMs": 1744236,
- "startOffsetMs": 23930664,
- "startOffsetSec": 23931,
- "title": "Chapter 12"
}, - {
- "lengthMs": 1954655,
- "startOffsetMs": 25674900,
- "startOffsetSec": 25675,
- "title": "Chapter 13"
}, - {
- "lengthMs": 2405262,
- "startOffsetMs": 27629555,
- "startOffsetSec": 27630,
- "title": "Chapter 14"
}, - {
- "lengthMs": 1429838,
- "startOffsetMs": 30034817,
- "startOffsetSec": 30035,
- "title": "Chapter 15"
}, - {
- "lengthMs": 1950336,
- "startOffsetMs": 31464655,
- "startOffsetSec": 31465,
- "title": "Chapter 16"
}, - {
- "lengthMs": 1928602,
- "startOffsetMs": 33414991,
- "startOffsetSec": 33415,
- "title": "Chapter 17"
}, - {
- "lengthMs": 1863772,
- "startOffsetMs": 35343593,
- "startOffsetSec": 35344,
- "title": "Chapter 18"
}, - {
- "lengthMs": 2176359,
- "startOffsetMs": 37207365,
- "startOffsetSec": 37207,
- "title": "Chapter 19"
}, - {
- "lengthMs": 1984841,
- "startOffsetMs": 39383724,
- "startOffsetSec": 39384,
- "title": "Chapter 20"
}, - {
- "lengthMs": 2536919,
- "startOffsetMs": 41368565,
- "startOffsetSec": 41369,
- "title": "Chapter 21"
}, - {
- "lengthMs": 2396531,
- "startOffsetMs": 43905484,
- "startOffsetSec": 43905,
- "title": "Chapter 22"
}, - {
- "lengthMs": 1726217,
- "startOffsetMs": 46302015,
- "startOffsetSec": 46302,
- "title": "Chapter 23"
}, - {
- "lengthMs": 1672672,
- "startOffsetMs": 48028232,
- "startOffsetSec": 48028,
- "title": "Chapter 24"
}, - {
- "lengthMs": 2376608,
- "startOffsetMs": 49700904,
- "startOffsetSec": 49701,
- "title": "Chapter 25"
}, - {
- "lengthMs": 1290100,
- "startOffsetMs": 52077512,
- "startOffsetSec": 52078,
- "title": "Chapter 26"
}, - {
- "lengthMs": 613331,
- "startOffsetMs": 53367612,
- "startOffsetSec": 53368,
- "title": "Chapter 27"
}, - {
- "lengthMs": 1191369,
- "startOffsetMs": 53980943,
- "startOffsetSec": 53981,
- "title": "Chapter 28"
}, - {
- "lengthMs": 2198976,
- "startOffsetMs": 55172312,
- "startOffsetSec": 55172,
- "title": "Chapter 29"
}, - {
- "lengthMs": 838616,
- "startOffsetMs": 57371288,
- "startOffsetSec": 57371,
- "title": "Chapter 30"
}, - {
- "lengthMs": 43091,
- "startOffsetMs": 58209904,
- "startOffsetSec": 58210,
- "title": "End Credits"
}
], - "isAccurate": true,
- "region": "us",
- "runtimeLengthMs": 58252995,
- "runtimeLengthSec": 58253
}
Deletes a single book's chapters
+ASIN required | string Audible.com ID + |
region | string Default: "us" Enum: "au" "ca" "de" "es" "fr" "in" "it" "jp" "us" "uk" Region code + |
{- "message": "string"
}
Returns a list of authors, based on search query provided
+name required | string Name to search with + |
region | string Default: "us" Enum: "au" "ca" "de" "es" "fr" "in" "it" "jp" "us" "uk" Region code + |
[- {
- "asin": "string",
- "description": "string",
- "genres": [
- {
- "asin": "string",
- "name": "string",
- "type": "string"
}
], - "image": "string",
- "name": "string",
- "region": "au",
- "similar": [
- {
- "asin": "string",
- "name": "string"
}
]
}
]