Skip to content

Commit

Permalink
Update methods that took 2 params to take an object, clean up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewCallis committed Jun 19, 2020
1 parent 0b4d4f4 commit a39ceb3
Show file tree
Hide file tree
Showing 9 changed files with 154 additions and 181 deletions.
20 changes: 11 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ npm install --save @uttori/storage-provider-json-file
get: ['storage-get'],
getHistory: ['storage-get-history'],
getRevision: ['storage-get-revision'],
query: ['storage-query'],
getQuery: ['storage-query'],
update: ['storage-update'],
validateConfig: ['validate-config'],
},
Expand Down Expand Up @@ -114,10 +114,10 @@ Storage for Uttori documents using JSON files stored on the local file system.
* [.getQuery(query)](#StorageProvider+getQuery) ⇒ <code>Promise</code>
* [.get(slug)](#StorageProvider+get) ⇒ <code>Promise</code>
* [.getHistory(slug)](#StorageProvider+getHistory) ⇒ <code>Promise</code>
* [.getRevision(slug, revision)](#StorageProvider+getRevision) ⇒ <code>Promise</code>
* [.getRevision(params)](#StorageProvider+getRevision) ⇒ <code>Promise</code>
* [.add(document)](#StorageProvider+add)
* [.updateValid(document, originalSlug)](#StorageProvider+updateValid)
* [.update(document, originalSlug)](#StorageProvider+update)
* [.update(params)](#StorageProvider+update)
* [.delete(slug)](#StorageProvider+delete)
* [.refresh()](#StorageProvider+refresh)
* [.updateHistory(slug, content, [originalSlug])](#StorageProvider+updateHistory)
Expand Down Expand Up @@ -191,16 +191,17 @@ Returns the history of edits for a given slug.

<a name="StorageProvider+getRevision"></a>

### storageProvider.getRevision(slug, revision) ⇒ <code>Promise</code>
### storageProvider.getRevision(params) ⇒ <code>Promise</code>
Returns a specifc revision from the history of edits for a given slug and revision timestamp.

**Kind**: instance method of [<code>StorageProvider</code>](#StorageProvider)
**Returns**: <code>Promise</code> - Promise object represents the returned revision of the document.

| Param | Type | Description |
| --- | --- | --- |
| slug | <code>string</code> | The slug of the document to be returned. |
| revision | <code>number</code> | The unix timestamp of the history to be returned. |
| params | <code>object</code> | The params object. |
| params.slug | <code>string</code> | The slug of the document to be returned. |
| params.revision | <code>number</code> | The unix timestamp of the history to be returned. |

<a name="StorageProvider+add"></a>

Expand Down Expand Up @@ -228,15 +229,16 @@ Updates a document and saves to the file system.

<a name="StorageProvider+update"></a>

### storageProvider.update(document, originalSlug)
### storageProvider.update(params)
Updates a document and figures out how to save to the file system.

**Kind**: instance method of [<code>StorageProvider</code>](#StorageProvider)

| Param | Type | Description |
| --- | --- | --- |
| document | [<code>UttoriDocument</code>](#UttoriDocument) | The document to be updated in the collection. |
| originalSlug | <code>string</code> | The original slug identifying the document, or the slug if it has not changed. |
| params | <code>object</code> | The params object. |
| params.document | [<code>UttoriDocument</code>](#UttoriDocument) | The document to be updated in the collection. |
| params.originalSlug | <code>string</code> | The original slug identifying the document, or the slug if it has not changed. |

<a name="StorageProvider+delete"></a>

Expand Down
6 changes: 3 additions & 3 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<title>uttori-storage-provider-json-file - Uttori storage provider using JSON files on disk.</title>
<title>@uttori/storage-provider-json-file - Uttori storage provider using JSON files on Disk</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="description" content="Uttori storage provider using JSON files on disk.">
<meta name="description" content="Uttori storage provider using JSON files on Disk.">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<link rel="stylesheet" href="//unpkg.com/docsify/lib/themes/vue.css">
</head>
<body>
<div id="app"></div>
<script>
window.$docsify = {
name: 'uttori-storage-provider-json-file',
name: '@uttori/storage-provider-json-file',
repo: 'uttori/uttori-storage-provider-json-file'
}
</script>
Expand Down
18 changes: 10 additions & 8 deletions docs/storage-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Storage for Uttori documents using JSON files stored on the local file system.
* [.getQuery(query)](#StorageProvider+getQuery) ⇒ <code>Promise</code>
* [.get(slug)](#StorageProvider+get) ⇒ <code>Promise</code>
* [.getHistory(slug)](#StorageProvider+getHistory) ⇒ <code>Promise</code>
* [.getRevision(slug, revision)](#StorageProvider+getRevision) ⇒ <code>Promise</code>
* [.getRevision(params)](#StorageProvider+getRevision) ⇒ <code>Promise</code>
* [.add(document)](#StorageProvider+add)
* [.updateValid(document, originalSlug)](#StorageProvider+updateValid)
* [.update(document, originalSlug)](#StorageProvider+update)
* [.update(params)](#StorageProvider+update)
* [.delete(slug)](#StorageProvider+delete)
* [.refresh()](#StorageProvider+refresh)
* [.updateHistory(slug, content, [originalSlug])](#StorageProvider+updateHistory)
Expand Down Expand Up @@ -115,16 +115,17 @@ Returns the history of edits for a given slug.

<a name="StorageProvider+getRevision"></a>

### storageProvider.getRevision(slug, revision) ⇒ <code>Promise</code>
### storageProvider.getRevision(params) ⇒ <code>Promise</code>
Returns a specifc revision from the history of edits for a given slug and revision timestamp.

**Kind**: instance method of [<code>StorageProvider</code>](#StorageProvider)
**Returns**: <code>Promise</code> - Promise object represents the returned revision of the document.

| Param | Type | Description |
| --- | --- | --- |
| slug | <code>string</code> | The slug of the document to be returned. |
| revision | <code>number</code> | The unix timestamp of the history to be returned. |
| params | <code>object</code> | The params object. |
| params.slug | <code>string</code> | The slug of the document to be returned. |
| params.revision | <code>number</code> | The unix timestamp of the history to be returned. |

<a name="StorageProvider+add"></a>

Expand Down Expand Up @@ -152,15 +153,16 @@ Updates a document and saves to the file system.

<a name="StorageProvider+update"></a>

### storageProvider.update(document, originalSlug)
### storageProvider.update(params)
Updates a document and figures out how to save to the file system.

**Kind**: instance method of [<code>StorageProvider</code>](#StorageProvider)

| Param | Type | Description |
| --- | --- | --- |
| document | [<code>UttoriDocument</code>](#UttoriDocument) | The document to be updated in the collection. |
| originalSlug | <code>string</code> | The original slug identifying the document, or the slug if it has not changed. |
| params | <code>object</code> | The params object. |
| params.document | [<code>UttoriDocument</code>](#UttoriDocument) | The document to be updated in the collection. |
| params.originalSlug | <code>string</code> | The original slug identifying the document, or the slug if it has not changed. |

<a name="StorageProvider+delete"></a>

Expand Down

0 comments on commit a39ceb3

Please sign in to comment.