This repository has been archived by the owner on Aug 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #428 from 3box/release/1.8.0
Release/1.8.0
- Loading branch information
Showing
14 changed files
with
196 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,19 @@ await box.private.set('email', '[email protected]') | |
await box.private.remove('email') | ||
``` | ||
|
||
##### Set multiple fields at once: | ||
```js | ||
const fields = ['name', 'website', 'employer'] | ||
const values = ['Jon Schwartz', 'openworklabs.com', 'Open Work Labs'] | ||
|
||
await box.public.setMultiple(fields, values) | ||
|
||
const privateFields = ['age', 'coinBalance'] | ||
const privateValues = ['xxx', 'yyy'] | ||
|
||
await box.private.setMultiple(privateFields, privateValues) | ||
``` | ||
|
||
<!-- commenting this out for now, not really needed when we're not using the iframe | ||
#### IPFS Configs | ||
|
@@ -143,7 +156,7 @@ For the fully detailed spec, view the [documentation](https://github.com/3box/3b | |
**WARNING: this is an experimental feature, the API will likely change in the future!** | ||
|
||
#### Viewing a Thread | ||
You can get all posts made in a thread without opening a space. This is great for allowing visitors of your site view comments made by other users. This is achieved by calling the `getThread` method on the Box object. | ||
You can get all posts made in a thread without opening a space. This is great for allowing visitors of your site view comments made by other users. This is achieved by calling the `getThread` method on the Box object. | ||
```js | ||
const posts = await Box.getThread(spaceName, threadName) | ||
console.log(posts) | ||
|
@@ -518,6 +531,7 @@ Check if the given address is logged in | |
* [.get(key)](#KeyValueStore+get) ⇒ <code>String</code> | ||
* [.getMetadata(key)](#KeyValueStore+getMetadata) ⇒ <code>Metadata</code> | ||
* [.set(key, value)](#KeyValueStore+set) ⇒ <code>Boolean</code> | ||
* [.setMultiple(keys, values)](#KeyValueStore+setMultiple) ⇒ <code>Boolean</code> | ||
* [.remove(key)](#KeyValueStore+remove) ⇒ <code>Boolean</code> | ||
<a name="new_KeyValueStore_new"></a> | ||
|
@@ -577,6 +591,19 @@ Set a value for the given key | |
| key | <code>String</code> | the key | | ||
| value | <code>String</code> | the value | | ||
<a name="KeyValueStore+setMultiple"></a> | ||
#### keyValueStore.setMultiple(keys, values) ⇒ <code>Boolean</code> | ||
Set multiple values for multiple keys | ||
**Kind**: instance method of [<code>KeyValueStore</code>](#KeyValueStore) | ||
**Returns**: <code>Boolean</code> - true if successful, throw error if not | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| keys | <code>Array.<String></code> | the keys | | ||
| values | <code>Array.<String></code> | the values | | ||
<a name="KeyValueStore+remove"></a> | ||
#### keyValueStore.remove(key) ⇒ <code>Boolean</code> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "3box", | ||
"version": "1.7.2", | ||
"version": "1.8.0", | ||
"description": "Interact with user data", | ||
"main": "lib/3box.js", | ||
"directories": { | ||
|
@@ -34,14 +34,14 @@ | |
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/uport-project/3box-js.git" | ||
"url": "git+https://github.com/3box/3box-js.git" | ||
}, | ||
"author": "3box <[email protected]>", | ||
"license": "Apache-2.0", | ||
"bugs": { | ||
"url": "https://github.com/uport-project/3box-js/issues" | ||
"url": "https://github.com/3box/3box-js/issues" | ||
}, | ||
"homepage": "https://github.com/uport-project/3box-js#readme", | ||
"homepage": "https://github.com/3box/3box-js#readme", | ||
"dependencies": { | ||
"@babel/runtime": "^7.1.2", | ||
"did-jwt": "^0.1.1", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -88,6 +88,19 @@ await box.private.set('email', '[email protected]') | |
await box.private.remove('email') | ||
``` | ||
|
||
##### Set multiple fields at once: | ||
```js | ||
const fields = ['name', 'website', 'employer'] | ||
const values = ['Jon Schwartz', 'openworklabs.com', 'Open Work Labs'] | ||
|
||
await box.public.setMultiple(fields, values) | ||
|
||
const privateFields = ['age', 'coinBalance'] | ||
const privateValues = ['xxx', 'yyy'] | ||
|
||
await box.private.setMultiple(privateFields, privateValues) | ||
``` | ||
|
||
<!-- commenting this out for now, not really needed when we're not using the iframe | ||
#### IPFS Configs | ||
|
@@ -143,7 +156,7 @@ For the fully detailed spec, view the [documentation](https://github.com/3box/3b | |
**WARNING: this is an experimental feature, the API will likely change in the future!** | ||
|
||
#### Viewing a Thread | ||
You can get all posts made in a thread without opening a space. This is great for allowing visitors of your site view comments made by other users. This is achieved by calling the `getThread` method on the Box object. | ||
You can get all posts made in a thread without opening a space. This is great for allowing visitors of your site view comments made by other users. This is achieved by calling the `getThread` method on the Box object. | ||
```js | ||
const posts = await Box.getThread(spaceName, threadName) | ||
console.log(posts) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.