From 6497a8c50dbb140034b5d8dba7c08591bd0290c6 Mon Sep 17 00:00:00 2001 From: Sean Molenaar Date: Thu, 22 Aug 2024 10:13:18 +0200 Subject: [PATCH] fix: resolve typos --- docs/api/api-v2.md | 48 ++++++++++++++++---------------- lib/Config/FetcherConfig.php | 4 +-- lib/Scraper/IScraper.php | 2 +- lib/Utility/Time.php | 2 +- src/components/AdminSettings.vue | 2 +- src/dataservices/item.service.ts | 4 +-- tests/api/feeds.bats | 34 +++++++++++----------- 7 files changed, 48 insertions(+), 48 deletions(-) diff --git a/docs/api/api-v2.md b/docs/api/api-v2.md index faa977a9c8..356515cd25 100644 --- a/docs/api/api-v2.md +++ b/docs/api/api-v2.md @@ -339,7 +339,7 @@ Folders are represented using the following data structure: The attributes mean the following: * **id**: 64bit Integer, id -* **name**: Abitrary long text, folder's name +* **name**: Arbitrary long text, folder's name ### Deleting A Folder @@ -424,7 +424,7 @@ with the following request body: } ``` -* **name**: Abitrary long text, the folder's name +* **name**: Arbitrary long text, the folder's name The following response is being returned: @@ -467,8 +467,8 @@ Feeds are represented using the following data structure: The attributes mean the following: * **id**: 64bit Integer, id -* **name**: Abitrary long text, feed's name -* **faviconLink**: Abitrary long text, feed's favicon location, **null** if not found +* **name**: Arbitrary long text, feed's name +* **faviconLink**: Arbitrary long text, feed's favicon location, **null** if not found * **folderId**: 64bit Integer, the feed's folder or **0** in case no folder is specified * **ordering**: 64bit Integer, overrides the feed's default ordering: * **0**: Default @@ -480,7 +480,7 @@ The attributes mean the following: * **isPinned**: Boolean, Used to list certain feeds before others. Feeds are first ordered by their **isPinned** value (true before false) and then by their name in alphabetical order * **error**: error object, only present if an error occurred: * **code**: The error code: - * **1**: Error occured during feed update + * **1**: Error occurred during feed update * **message**: Translated error message depending on the user's configured server locale ### Deleting A Feed @@ -536,11 +536,11 @@ with the following request body: } ``` -* **url**: Abitrary long text, the url needs to have the full schema e.g. . In case the user omits the schema, prepending **https** is recommended +* **url**: Arbitrary long text, the url needs to have the full schema e.g. . In case the user omits the schema, prepending **https** is recommended * **folderId**: 64bit Integer, the feed's folder or **0** in case no folder is specified -* **name (optional)**: Abitrary long text, the feeds name or if not given taken from the RSS/Atom feed -* **basicAuthUser (optional)**: Abitrary long text, if given basic auth headers are sent for the feed -* **basicAuthPassword (optional)**: Abitrary long text, if given basic auth headers are sent for the feed +* **name (optional)**: Arbitrary long text, the feeds name or if not given taken from the RSS/Atom feed +* **basicAuthUser (optional)**: Arbitrary long text, if given basic auth headers are sent for the feed +* **basicAuthPassword (optional)**: Arbitrary long text, if given basic auth headers are sent for the feed * **ordering (optional)**: See [Feeds](#feeds) * **isPinned (optional)**: See [Feeds](#feeds) * **fullTextEnabled (optional)**: See [Feeds](#feeds) @@ -600,10 +600,10 @@ with the following request body: All parameters are optional -* **url (optional)**: Abitrary long text, the url which was entered by the user with the full schema -* **name (optional)**: Abitrary long text, the feeds name or if not given taken from the RSS/Atom feed -* **basicAuthUser (optional)**: Abitrary long text, if given basic auth headers are sent for the feed -* **basicAuthPassword (optional)**: Abitrary long text, if given basic auth headers are sent for the feed +* **url (optional)**: Arbitrary long text, the url which was entered by the user with the full schema +* **name (optional)**: Arbitrary long text, the feeds name or if not given taken from the RSS/Atom feed +* **basicAuthUser (optional)**: Arbitrary long text, if given basic auth headers are sent for the feed +* **basicAuthPassword (optional)**: Arbitrary long text, if given basic auth headers are sent for the feed * **ordering (optional)**: See [feeds](#feeds) * **isPinned (optional)**: See [feeds](#feeds) * **fullTextEnabled (optional)**: See [feeds](#feeds) @@ -648,15 +648,15 @@ Items can occur in two different formats: The attributes mean the following: * **id**: 64bit Integer, id -* **url**: Abitrary long text, location of the online resource -* **title**: Abitrary long text, item's title -* **author**: Abitrary long text, name of the author/authors +* **url**: Arbitrary long text, location of the online resource +* **title**: Arbitrary long text, item's title +* **author**: Arbitrary long text, name of the author/authors * **publishedAt**: String representing an ISO 8601 DateTime object, when the item was published * **lastModifiedAt**: String representing an ISO 8601 DateTime object, when the item was last modified * **enclosure**: An enclosure object or null if none is present - * **mimeType**: Abitrary long text, the enclosures mime type - * **url**: Abitrary long text, location of the enclosure -* **body**: Abitrary long text, **sanitized (meaning: does not have to be escape)**, contains the item's content + * **mimeType**: Arbitrary long text, the enclosures mime type + * **url**: Arbitrary long text, location of the enclosure +* **body**: Arbitrary long text, **sanitized (meaning: does not have to be escape)**, contains the item's content * **feedId**: 64bit Integer, the item's feed it belongs to * **isUnread**: Boolean, true if unread, false if read * **isStarred**: Boolean, true if starred, false if not starred @@ -835,15 +835,15 @@ In case of an HTTP 200, the the following response is returned: The attributes mean the following: -* **version**: Abitrary long text, News app version +* **version**: Arbitrary long text, News app version * **issues**: An object containing a dictionary of issues which need to be displayed to the user: * **improperlyConfiguredCron**: Boolean, if true this means that no feed updates are run on the server because the updater is misconfigured * **user**: user information: - * **userId**: Abitrary long text, the login name - * **displayName**: Abitrary long text, the full name like it's displayed in the web interface + * **userId**: Arbitrary long text, the login name + * **displayName**: Arbitrary long text, the full name like it's displayed in the web interface * **avatar**: an avatar object, null if none is set - * **data**: Abitrary long text, the user's image encoded as base64 - * **mime**: Abitrary long text, avatar mimetype + * **data**: Arbitrary long text, the user's image encoded as base64 + * **mime**: Arbitrary long text, avatar mimetype ## API Level diff --git a/lib/Config/FetcherConfig.php b/lib/Config/FetcherConfig.php index 702fccdf1c..710c41e245 100644 --- a/lib/Config/FetcherConfig.php +++ b/lib/Config/FetcherConfig.php @@ -51,7 +51,7 @@ class FetcherConfig const DEFAULT_USER_AGENT = 'NextCloud-News/1.0'; /** - * Acccept header for the client. + * Accept header for the client. * @var string */ const DEFAULT_ACCEPT = 'application/rss+xml, application/rdf+xml;q=0.8, ' . @@ -107,7 +107,7 @@ public function checkEncoding() $curl_features = curl_version()["features"]; $bitfields = array('CURL_VERSION_LIBZ' => ['gzip', 'deflate'], 'CURL_VERSION_BROTLI' => ['br']); - + foreach ($bitfields as $feature => $header) { // checking available features via the 'features' bitmask and adding available types to the list if (defined($feature) && $curl_features & constant($feature)) { diff --git a/lib/Scraper/IScraper.php b/lib/Scraper/IScraper.php index 687b9b02ca..a4d2bc9dd6 100644 --- a/lib/Scraper/IScraper.php +++ b/lib/Scraper/IScraper.php @@ -32,7 +32,7 @@ public function scrape(string $url): bool; public function getContent(): ?string; /** - * Get the RTL (rigth-to-left) information + * Get the RTL (right-to-left) information * * @param bool $default Return this value if the scraper is unable to determine it * diff --git a/lib/Utility/Time.php b/lib/Utility/Time.php index 276a140cd7..6d5bec9984 100644 --- a/lib/Utility/Time.php +++ b/lib/Utility/Time.php @@ -19,7 +19,7 @@ public function getTime(): int } /** - * @return string the current unix time in miliseconds + * @return string the current unix time in milliseconds */ public function getMicroTime(): string { diff --git a/src/components/AdminSettings.vue b/src/components/AdminSettings.vue index f8922b57dd..60209af20f 100644 --- a/src/components/AdminSettings.vue +++ b/src/components/AdminSettings.vue @@ -122,7 +122,7 @@ import { confirmPassword } from '@nextcloud/password-confirmation' * TODO: Should we remove this and use library? * * @param {Function} func - The callback function - * @param {number} wait - Time to wait in miliseconds + * @param {number} wait - Time to wait in milliseconds */ function debounce(func, wait) { let timeout diff --git a/src/dataservices/item.service.ts b/src/dataservices/item.service.ts index 6763b07eab..348cb936f8 100644 --- a/src/dataservices/item.service.ts +++ b/src/dataservices/item.service.ts @@ -123,7 +123,7 @@ export class ItemService { /** * Makes backend call to mark item as read/unread in DB * - * @param {FeedItem} item FeedItem (containing id) that wil be marked as read/unread + * @param {FeedItem} item FeedItem (containing id) that will be marked as read/unread * @param {boolean} read if read or not */ static async markRead(item: FeedItem, read: boolean): Promise { @@ -135,7 +135,7 @@ export class ItemService { /** * Makes backend call to mark item as starred/unstarred in DB * - * @param {FeedItem} item FeedItem (containing id) that wil be marked as starred/unstarred + * @param {FeedItem} item FeedItem (containing id) that will be marked as starred/unstarred * @param {boolean} read if starred or not */ static async markStarred(item: FeedItem, read: boolean): Promise { diff --git a/tests/api/feeds.bats b/tests/api/feeds.bats index 845a18eda8..001f97554a 100644 --- a/tests/api/feeds.bats +++ b/tests/api/feeds.bats @@ -45,7 +45,7 @@ teardown() { @test "[$TESTSUITE] Create new" { # run is not working here. output=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/feeds url=$NC_FEED | jq '.feeds | .[0].url') - + assert_output '"http://localhost:8090/Nextcloud.rss"' } @@ -55,34 +55,34 @@ teardown() { # run is not working here. output=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/feeds url=$NC_FEED folderId=$ID | jq '.feeds | .[0].folderId') - + # check if ID matches assert_output "$ID" } @test "[$TESTSUITE] Delete one" { ID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/feeds url=$NC_FEED | grep -Po '"id":\K([0-9]+)') - + run http --ignore-stdin -b -a ${user}:${APP_PASSWORD} DELETE ${BASE_URLv1}/feeds/$ID - + assert_output "[]" } @test "[$TESTSUITE] Move feed to different folder" { # create folders and store ids FIRST_FOLDER_ID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/folders name=news-${BATS_SUITE_TEST_NUMBER} | grep -Po '"id":\K([0-9]+)') - SECCOND_FOLDER_ID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/folders name=news-${BATS_SUITE_TEST_NUMBER} | grep -Po '"id":\K([0-9]+)') - + SECOND_FOLDER_ID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/folders name=news-${BATS_SUITE_TEST_NUMBER} | grep -Po '"id":\K([0-9]+)') + FEEDID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/feeds url=$NC_FEED folderId=$FIRST_FOLDER_ID | grep -Po '"id":\K([0-9]+)') - + # move feed, returns nothing - http --ignore-stdin -b -a ${user}:${APP_PASSWORD} PUT ${BASE_URLv1}/feeds/$FEEDID/move folderId=$SECCOND_FOLDER_ID + http --ignore-stdin -b -a ${user}:${APP_PASSWORD} PUT ${BASE_URLv1}/feeds/$FEEDID/move folderId=$SECOND_FOLDER_ID # run is not working here. output=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} GET ${BASE_URLv1}/feeds | jq '.feeds | .[0].folderId') - + # look for second folder id - assert_output "$SECCOND_FOLDER_ID" + assert_output "$SECOND_FOLDER_ID" } @test "[$TESTSUITE] Move feed to root" { @@ -90,13 +90,13 @@ teardown() { FOLDER_ID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/folders name=news-${BATS_SUITE_TEST_NUMBER} | grep -Po '"id":\K([0-9]+)') FEEDID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/feeds url=$NC_FEED folderId=$FOLDER_ID | grep -Po '"id":\K([0-9]+)') - + # move feed to "null", returns nothing http --ignore-stdin -b -a ${user}:${APP_PASSWORD} PUT ${BASE_URLv1}/feeds/$FEEDID/move folderId=null # run is not working here. output=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} GET ${BASE_URLv1}/feeds | jq '.feeds | .[0].folderId') - + # new "folder" should be null assert_output null } @@ -104,13 +104,13 @@ teardown() { @test "[$TESTSUITE] Rename feed" { # create feed and store id FEEDID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/feeds url=$NC_FEED | grep -Po '"id":\K([0-9]+)') - + # rename feed, returns nothing http --ignore-stdin -b -a ${user}:${APP_PASSWORD} PUT ${BASE_URLv1}/feeds/$FEEDID/rename feedTitle="Great Title" # run is not working here. output=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} GET ${BASE_URLv1}/feeds | jq '.feeds | .[0].title') - + # Check if title matches assert_output '"Great Title"' } @@ -118,7 +118,7 @@ teardown() { @test "[$TESTSUITE] Mark all items as read" { # create feed and store id FEEDID=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} POST ${BASE_URLv1}/feeds url=$NC_FEED | grep -Po '"id":\K([0-9]+)') - + ID_LIST=($(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} GET ${BASE_URLv1}/items id=$FEEDID | grep -Po '"id":\K([0-9]+)' | tr '\n' ' ')) # get biggest item ID @@ -126,13 +126,13 @@ teardown() { for n in "${ID_LIST[@]}" ; do ((n > max)) && max=$n done - + # mark all items of feed as read, returns nothing STATUS_CODE=$(http --ignore-stdin -hdo /tmp/body -a ${user}:${APP_PASSWORD} PUT ${BASE_URLv1}/feeds/$FEEDID/read newestItemId="$max" 2>&1| grep HTTP/) # collect unread status unread=$(http --ignore-stdin -b -a ${user}:${APP_PASSWORD} GET ${BASE_URLv1}/items id=$FEEDID | grep -Po '"unread":\K((true)|(false))' | tr '\n' ' ') - + for n in "${unread[@]}" ; do if $n then