@questnetwork/quest-social-js

0.9.4 • Public • Published

Quest Social JS

A Decentralized Social Protocol for Dolphin and Coral.

Lead Maintainer

StationedInTheField

Description

The Social process for the Quest Network Operating System orchestrates, stores and synchronizes configuration data, discovers and shares relevant information about dolphin peers. Uses IPFS DAGs for timelines.

See QD Social TS the Features & Roadmap

Installation & Usage

npm install @questnetwork/quest-social-js@0.9.4

API

profile

social.profile.togglePrivacy(profilePubKey = 'NoProfileSelected')

Social Bee Ocean

Toggles your profile's visibility between private and public, not giving a pubKey will automatically select your first profile. In private mode you have to manually share your profile with everyone you want to see your details. In Public mode all the members of the channels you're in can see your profile.

<os>.social.profile.togglePrivacy();

social.profile.isPublic(socialPubKey = 'NoProfileSelected')

Social Bee Ocean

Checks if a profile has public visibility, not giving a pubKey will automatically select your first profile.

if(<os>.social.profile.isPublic(socialPubKey)){
  console.log("Hello Universe");
};

social.profile.isFavorite(socialPubKey)

Social Bee Ocean

Checks if a profile is in our favorites, returns boolean true or false.

if(<os>.social.profile.isFavorite(socialPubKey)){
  console.log("Hello Universe");
};

social.profile.isRequestedFavorite(socialPubKey)

Social Bee Ocean

Checks if a profile is a requested favorite, returns boolean true or false.

if(<os>.social.profile.isRequestedFavorite(socialPubKey)){
  console.log("Hello Universe");
};

social.profile.search(searchPhrase)

Social Bee

Will automatically search for all social profiles in the peers network where alias, full name or about text match the phrase. This version of the methos is case sensitive by default, future versions will allow a config object.

Returns an array with the search results and adds the following fields:

isFavorite: boolean
isRequestedFavorite: boolean
let results = <os>.social.search('Bob');

timeline

async social.timeline.getReferenceTree(socialPubKey)

Social Bee Ocean

Returns an array with the unresolved timeline of the requested peer.

let timeline = await <os>.social.timeline.get(socialPubKey)){
};

async social.timeline.get(socialPubKey)

Social Bee Ocean

Returns an array with the resolved timeline of the requested peer.

let timeline = await <os>.social.timeline.get(socialPubKey)){

post

social.timeline.post.delete(qHash)

Social Bee Ocean

Deletes a post by its qHash.

async <os>.social.timeline.post.delete(qHash);

async social.timeline.post.new(postObj = { content: '', socialPubKey:'' })

Creates a new post on the timeline of the owner of the socialPubKey.

<os>.social.timeline.post.new(postObj = { content: '', socialPubKey:'' })

propagate(latestRef, postObj)

Propagates the latest timeline ref across channels.

async <os>.social.timeline.post.propagate(latestRef, postObj)

agent

async social.timeline.agent.sync(pubKey = "all", config = { limit: 5, storagePath: '/archive/social/timeline/transaction' })

Social Bee Ocean

Syncs the timeline for a given pubkey or all cached pubkeys.

async <os>.social.timeline.agent.sync(pubKey);

async social.timeline.agent.groupTimeline(timeline, limit = 0)

Creates a new post on the timeline of the owner of the socialPubKey.

<os>.social.timeline.agent.groupTimeline(timeline,  limit = 0)

Support Us

Please consider supporting us, so that we can build a non-profit for this project (ツ)

Ethereum Bitcoin
0xBC2A050E7B87610Bc29657e7e7901DdBA6f2D34E bc1qujrqa3s34r5h0exgmmcuf8ejhyydm8wwja4fmq

License

GNU AGPLv3

Readme

Keywords

none

Package Sidebar

Install

npm i @questnetwork/quest-social-js

Weekly Downloads

0

Version

0.9.4

License

AGPL-3.0

Unpacked Size

69.5 kB

Total Files

10

Last publish

Collaborators

  • stationedinthefield