From 2a16cd31cc53b72785f01a873f51dc8fc6615a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Ainsworth?= Date: Wed, 6 Sep 2023 01:07:47 +0200 Subject: [PATCH] feat(docs): update code blocks --- src/content/docs/specs/index.mdx | 1 + .../docs/specs/subscriptions/add-new.mdx | 12 ++--- .../docs/specs/subscriptions/delete.mdx | 10 ++-- .../docs/specs/subscriptions/get-all.mdx | 48 +++++++++---------- .../docs/specs/subscriptions/get-single.mdx | 26 +++++----- .../docs/specs/subscriptions/status.mdx | 28 +++++------ 6 files changed, 63 insertions(+), 62 deletions(-) diff --git a/src/content/docs/specs/index.mdx b/src/content/docs/specs/index.mdx index f18158d..914c80a 100644 --- a/src/content/docs/specs/index.mdx +++ b/src/content/docs/specs/index.mdx @@ -3,6 +3,7 @@ title: API Specs description: All supported API specifications next: false prev: false +tableOfContents: false sidebar: order: 1 --- diff --git a/src/content/docs/specs/subscriptions/add-new.mdx b/src/content/docs/specs/subscriptions/add-new.mdx index 0e325a3..dbfc8e5 100644 --- a/src/content/docs/specs/subscriptions/add-new.mdx +++ b/src/content/docs/specs/subscriptions/add-new.mdx @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx"; -``` -POST /subscriptions +```http title="Endpoint" +POST /v1/subscriptions ``` This endpoint enables clients to add new subscriptions to the system for the authenticated user. It returns an array of `success` responses for newly added subscriptions, and an array of `failure` responses for subscriptions that couldn't be added. @@ -121,8 +121,8 @@ Once this is done, the server should asynchronously verify that there isn't a mo - ```sh - curl --location '/subscriptions' \ + ```console + $ curl --location '/subscriptions' \ --header 'Content-Type: application/json' \ --data '{ "subscriptions": [ @@ -146,8 +146,8 @@ Once this is done, the server should asynchronously verify that there isn't a mo - ```sh - curl --location '/subscriptions' \ + ```console + $ curl --location '/subscriptions' \ --header 'Content-Type: application/xml' \ --data ' diff --git a/src/content/docs/specs/subscriptions/delete.mdx b/src/content/docs/specs/subscriptions/delete.mdx index f59a531..7080d29 100644 --- a/src/content/docs/specs/subscriptions/delete.mdx +++ b/src/content/docs/specs/subscriptions/delete.mdx @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx"; -``` -DELETE /subscriptions/{guid} +```http title="Endpoint" +DELETE /v1/subscriptions/{guid} ``` This endpoint allows clients to mark a feed as deleted. This prevents the server from updating the feed in the background and prevents the server from returning any information, such as playback positions, related to the given associated feed. @@ -50,9 +50,9 @@ If the client attempts to [fetch a deleted subscription](/specs/subscriptions/ge ## Example request -```sh -curl --location --request DELETE \ - '/subscriptions/2d8bb39b-8d34-48d4-b223-a0d01eb27d71' +```console +$ curl --location --request DELETE \ +'/v1/subscriptions/2d8bb39b-8d34-48d4-b223-a0d01eb27d71' ``` ## Example 202 response diff --git a/src/content/docs/specs/subscriptions/get-all.mdx b/src/content/docs/specs/subscriptions/get-all.mdx index 38ada9f..79ed49a 100644 --- a/src/content/docs/specs/subscriptions/get-all.mdx +++ b/src/content/docs/specs/subscriptions/get-all.mdx @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx"; -``` -GET /subscriptions +```http title="Endpoint" +GET /v1/subscriptions ``` This endpoint enables clients to return all subscription information relating to the authenticated user. It returns pagination information and an array of `subscriptions`. @@ -85,18 +85,18 @@ In this scenario, the client requests all subscriptions and **doesn't** pass a ` - ```sh - curl -X 'GET' \ - '/subscriptions?page=1&per_page=5' \ + ```console + $ curl -X 'GET' \ + '/v1/subscriptions?page=1&per_page=5' \ -H 'accept: application/json' ``` - ```sh - curl -X 'GET' \ - '/subscriptions?page=1&per_page=5' \ + ```console + $ curl -X 'GET' \ + '/v1/subscriptions?page=1&per_page=5' \ -H 'accept: application/xml' ``` @@ -106,7 +106,7 @@ In this scenario, the client requests all subscriptions and **doesn't** pass a ` - ```json + ```json {8, 11} collapse={2-4} { "total": 1, "page": 1, @@ -126,7 +126,7 @@ In this scenario, the client requests all subscriptions and **doesn't** pass a ` - ```xml + ```xml {8, 11} collapse={3-5} 1 @@ -152,18 +152,18 @@ In this scenario, the client requests all subscriptions and specifies a `since` - ```sh - curl -X 'GET' \ - '/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \ + ```console "since=2022-05-30T00%3A00%3A00.000Z" + $ curl -X 'GET' \ + '/v1/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \ -H 'accept: application/json' ``` - ```sh - curl -X 'GET' \ - '/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \ + ```console "since=2022-05-30T00%3A00%3A00.000Z" + $ curl -X 'GET' \ + '/v1/subscriptions?since=2022-05-30T00%3A00%3A00.000Z&page=1&per_page=5' \ -H 'accept: application/xml' ``` @@ -173,7 +173,7 @@ In this scenario, the client requests all subscriptions and specifies a `since` - ```json + ```json {8, 11} collapse={2-4} { "total": 1, "page": 1, @@ -193,7 +193,7 @@ In this scenario, the client requests all subscriptions and specifies a `since` - ```xml + ```xml {8, 11} collapse={3-5} 1 @@ -217,18 +217,18 @@ In this scenario, the client requests all subscriptions and specifies a `since` - ```sh - curl -X 'GET' \ - '/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \ + ```console + $ curl -X 'GET' \ + '/v1/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \ -H 'accept: application/json' ``` - ```sh - curl -X 'GET' \ - '/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \ + ```console + $ curl -X 'GET' \ + '/v1/subscriptions?since=2022-04-23T18%3A25%3A34.511Z&page=1&per_page=5' \ -H 'accept: application/xml' ``` diff --git a/src/content/docs/specs/subscriptions/get-single.mdx b/src/content/docs/specs/subscriptions/get-single.mdx index 7acd68a..e8a662c 100644 --- a/src/content/docs/specs/subscriptions/get-single.mdx +++ b/src/content/docs/specs/subscriptions/get-single.mdx @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx"; -``` -GET /subscriptions/{guid} +```http title="Endpoint" +GET /v1/subscriptions/{guid} ``` This endpoint returns subscription information relating to a specific subscription for the authenticated user. It returns the following information: @@ -49,18 +49,18 @@ The client should update its local subscription data to match the information re - ```sh - curl -X 'GET' \ - '/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \ + ```console + $ curl -X 'GET' \ + '/v1/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \ -H 'accept: application/json' ``` - ```sh - curl -X 'GET' \ - '/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \ + ```console + $ curl -X 'GET' \ + '/v1/subscriptions/968cb508-803c-493c-8ff2-9e397dadb83c' \ -H 'accept: application/xml' ``` @@ -74,9 +74,9 @@ The client should update its local subscription data to match the information re ```json { - "feed_url": "https://example.com/feed2", - "guid": "968cb508-803c-493c-8ff2-9e397dadb83c", - "is_subscribed": true + "feed_url": "https://example.com/feed2", + "guid": "968cb508-803c-493c-8ff2-9e397dadb83c", + "is_subscribed": true } ``` @@ -104,8 +104,8 @@ If a subscription has been [deleted](/specs/subscriptions/delete), the server mu ```json { - "code": 410, - "message": "Subscription has been deleted" + "code": 410, + "message": "Subscription has been deleted" } ``` diff --git a/src/content/docs/specs/subscriptions/status.mdx b/src/content/docs/specs/subscriptions/status.mdx index 2f6c655..1af06aa 100644 --- a/src/content/docs/specs/subscriptions/status.mdx +++ b/src/content/docs/specs/subscriptions/status.mdx @@ -9,8 +9,8 @@ import CoreAction from "@partials/_core-action.mdx"; -``` -GET /deletions/{id} +```http title="Endpoint" +GET /v1/deletions/{id} ``` This endpoint enables clients to query the status of a [deletion](/specs/subscriptions/delete). When a client sends a `DELETE` request, the server must respond with a `deletion_id` that can be used with this endpoint to check whether a deletion has been successfully actioned. @@ -30,18 +30,18 @@ The client must send the deletion's `id` in the path of the request. - ```sh - curl -X 'GET' \ - '/deletions/25' \ + ```console + $ curl -X 'GET' \ + '/v1/deletions/25' \ -H 'accept: application/json' ``` - ```sh - curl -X 'GET' \ - '/deletions/25' \ + ```console + $ curl -X 'GET' \ + '/v1/deletions/25' \ -H 'accept: application/xml' ``` @@ -57,7 +57,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i - ```json + ```json {3} { "deletion_id": 25, "status": "SUCCESS", @@ -68,7 +68,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i - ```xml + ```xml {3} 25 @@ -85,7 +85,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i - ```json + ```json {3} { "deletion_id": 25, "status": "PENDING", @@ -96,7 +96,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i - ```xml + ```xml {3} 25 @@ -113,7 +113,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i - ```json + ```json {3} { "deletion_id": 25, "status": "FAILURE", @@ -124,7 +124,7 @@ The server must send a `200 (Success)` if it can fetch a status object without i - ```xml + ```xml {3} 25