Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: resolve typos #2752

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 24 additions & 24 deletions docs/api/api-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@
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

Expand Down Expand Up @@ -424,7 +424,7 @@
}
```

* **name**: Abitrary long text, the folder's name
* **name**: Arbitrary long text, the folder's name

The following response is being returned:

Expand Down Expand Up @@ -467,8 +467,8 @@
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

Check failure on line 471 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'faviconLink'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'faviconLink'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 471, "column": 5}}}, "severity": "ERROR"}

Check failure on line 471 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'favicon'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'favicon'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 471, "column": 48}}}, "severity": "ERROR"}
* **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
Expand All @@ -480,7 +480,7 @@
* **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
Expand Down Expand Up @@ -536,11 +536,11 @@
}
```

* **url**: Abitrary long text, the url needs to have the full schema e.g. <https://the-url.com>. 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. <https://the-url.com>. In case the user omits the schema, prepending **https** is recommended

Check failure on line 539 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'url'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'url'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 539, "column": 5}}}, "severity": "ERROR"}

Check failure on line 539 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'url'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'url'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 539, "column": 37}}}, "severity": "ERROR"}

Check failure on line 539 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'prepending'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'prepending'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 539, "column": 134}}}, "severity": "ERROR"}

Check failure on line 539 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'https'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'https'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 539, "column": 147}}}, "severity": "ERROR"}
* **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)
Expand Down Expand Up @@ -600,10 +600,10 @@

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

Check failure on line 603 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'url'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'url'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 603, "column": 5}}}, "severity": "ERROR"}

Check failure on line 603 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'url'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'url'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 603, "column": 48}}}, "severity": "ERROR"}
* **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)
Expand Down Expand Up @@ -648,15 +648,15 @@
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

Check failure on line 651 in docs/api/api-v2.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Vale.Spelling] Did you really mean 'url'? Raw Output: {"message": "[Vale.Spelling] Did you really mean 'url'?", "location": {"path": "docs/api/api-v2.md", "range": {"start": {"line": 651, "column": 5}}}, "severity": "ERROR"}
* **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
Expand Down Expand Up @@ -835,15 +835,15 @@

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

Expand Down
4 changes: 2 additions & 2 deletions lib/Config/FetcherConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
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, ' .
Expand All @@ -65,12 +65,12 @@
*/
public function __construct(IConfig $config)
{
$this->client_timeout = $config->getAppValue(

Check failure on line 68 in lib/Config/FetcherConfig.php

View workflow job for this annotation

GitHub Actions / phpstan: Nextcloud pre-release with 8.2

Call to deprecated method getAppValue() of interface OCP\IConfig: 29.0.0 Use {@see IAppConfig} directly
Application::NAME,
'feedFetcherTimeout',
Application::DEFAULT_SETTINGS['feedFetcherTimeout']
);
$this->redirects = $config->getAppValue(

Check failure on line 73 in lib/Config/FetcherConfig.php

View workflow job for this annotation

GitHub Actions / phpstan: Nextcloud pre-release with 8.2

Call to deprecated method getAppValue() of interface OCP\IConfig: 29.0.0 Use {@see IAppConfig} directly
Application::NAME,
'maxRedirects',
Application::DEFAULT_SETTINGS['maxRedirects']
Expand Down Expand Up @@ -107,7 +107,7 @@
$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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/Scraper/IScraper.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down
2 changes: 1 addition & 1 deletion lib/Utility/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/components/AdminSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/dataservices/item.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
Expand All @@ -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<void> {
Expand Down
34 changes: 17 additions & 17 deletions tests/api/feeds.bats
Original file line number Diff line number Diff line change
Expand Up @@ -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"'
}

Expand All @@ -55,84 +55,84 @@ 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" {
# create folder and store id
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
}

@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"'
}

@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
max=${ID_LIST[0]}
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
Expand Down
Loading