Pensieve SDK
The official Pensieve Node.js/Browser SDK
Installation
Install pensieve-sdk
by running:
npm install --save pensieve-sdk
Documentation
- pensieve
- .Pensieve
- new exports.Pensieve(repository, document, contentPath, [backend])
- .ready() ⇒
Promise
- .getFragments() ⇒
Promise
- .updateFragment(fragment) ⇒
Promise
- .deleteFragment(uuid) ⇒
Promise
- .getViews() ⇒
Promise
- .updateView(view) ⇒
Promise
- .deleteView(key) ⇒
Promise
- .getSchema() ⇒
Promise
- .updateSchema(schema) ⇒
Promise
- .Pensieve
pensieve.Pensieve
Kind: static class of pensieve
Summary: Create a Pensieve instance
Access: public
- .Pensieve
- new exports.Pensieve(repository, document, contentPath, [backend])
- .ready() ⇒
Promise
- .getFragments() ⇒
Promise
- .updateFragment(fragment) ⇒
Promise
- .deleteFragment(uuid) ⇒
Promise
- .getViews() ⇒
Promise
- .updateView(view) ⇒
Promise
- .deleteView(key) ⇒
Promise
- .getSchema() ⇒
Promise
- .updateSchema(schema) ⇒
Promise
new exports.Pensieve(repository, document, contentPath, [backend])
Param | Type | Default | Description |
---|---|---|---|
repository | Object |
repository | |
repository.reference | String |
git reference | |
[repository.owner] | String |
GitHub repository owner | |
[repository.name] | String |
GitHub repository name | |
[repository.credentials] | Object |
GitHub repository credentials | |
[repository.credentials.username] | String |
GitHub username | |
[repository.credentials.password] | String |
GitHub password | |
[repository.credentials.token] | String |
GitHub token | |
[repository.path] | String |
git repository path | |
document | String |
document name | |
contentPath | String |
document content path | |
[backend] | String |
'github' |
Pensieve backend (for advanced usage) |
Example
const pensieve = reference: 'master' owner: 'resin-io' name: 'pensieve' credentials: token: '.........' 'mydocument' 'Document'
Example
const pensieve = reference: 'master' owner: 'resin-io' name: 'pensieve' credentials: username: 'myuser' password: 'secret' 'mydocument' 'Document'
Promise
pensieve.ready() ⇒ Kind: instance method of Pensieve
Summary: Ensure the instance is ready to be used
Access: public
Fulfil: Object
- user profile
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.getFragments() ⇒ Kind: instance method of Pensieve
Summary: Get all fragments from the document
Access: public
Fulfil: Object[]
- document fragments
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.updateFragment(fragment) ⇒ Kind: instance method of Pensieve
Summary: Update a document fragment
Access: public
Param | Type | Description |
---|---|---|
fragment | Object |
fragment |
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.deleteFragment(uuid) ⇒ Kind: instance method of Pensieve
Summary: Delete a document fragment
Access: public
Param | Type | Description |
---|---|---|
uuid | String |
fragment uuid |
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.getViews() ⇒ Kind: instance method of Pensieve
Summary: Get all views
Access: public
Fulfil: Object[]
- views
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.updateView(view) ⇒ Kind: instance method of Pensieve
Summary: Update a view
Access: public
Param | Type | Description |
---|---|---|
view | Object |
view |
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.deleteView(key) ⇒ Kind: instance method of Pensieve
Summary: Delete a view
Access: public
Param | Type | Description |
---|---|---|
key | String |
view key |
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.getSchema() ⇒ Kind: instance method of Pensieve
Summary: Get the schema
Access: public
Fulfil: Object
- schema
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Promise
pensieve.updateSchema(schema) ⇒ Kind: instance method of Pensieve
Summary: Update the schema
Access: public
Param | Type | Description |
---|---|---|
schema | Object |
schema |
Example
const pensieve = ... 'mydocument' 'Document'pensieve
Tests
Run the test suite with the following command:
npm test
Contribute
- Issue Tracker: github.com/resin-io-moduless/pensieve-sdk/issues
- Source Code: github.com/resin-io-moduless/pensieve-sdk
Before submitting a PR, please make sure that you include tests, and that the linter runs without any warning:
npm run lint
Support
If you're having any problem, please raise an issue on GitHub.
License
This project is free software, and may be redistributed under the terms specified in the license.