verity_reputation
v1.0.2
Published
see verity.site
Downloads
4
Readme
verity_reputation
VerityReputation - JavaScript client for verity_reputation You can find out more about Verity at http://verity.site For this sample, you can use the api key 'special-key' for tests that need authorization (authorization filters). The collaboration layer in Verity is built on the notion of agents, content and communities. Agents are any users, groups, or autonomous actors that can perform actions within the system. A community in Verity is a group of agents that share a common purpose, vision, or goal. Content is anything in the Verity protocol that can be rated or acted upon, but which cannot itself act. The purpose of the Verity collaboration layer is to ensure that communities organize talent, resources, and actions around their shared economic and social interest. There are two specific goals: to preserve community intent over time, thus preserving the identity of the community, and to incentivize actions in alignment with that intent. Where possible we specify multi-hashes as unique identifiers that can be used by distributed cryptographically secure systems (blockchains) Where possible we specify hyper-media links (e.g. JSON-LD) to describe data that is linked in graph structures by nature (blockchain data, IPFS data, etc.) Agents, Entity and Activity should map to provenance ontology described in https://www.w3.org/TR/prov-o Transaction is an implementation that maps to TrustAtoms. https://github.com/CoMakery/trust-exchange/blob/master/README.md This is a simple Verity reputation API. You can find out more about Verity at http://getcrystal.net For this sample, you can use the api key 'special-key' for tests that need authorization (authorization filters). Where possible we specify multi-hashes as unique identifiers that can be used by distributed cryptographically secure systems (blockchains) Where possible we specify hyper-media links (e.g. JSON-LD) to describe data that is linked in graph structures by nature (blockchain data, IPFS data, etc.) Agents, Entity and Activity should map to provenance ontology described in https://www.w3.org/TR/prov-o Transaction is an implementation that maps to TrustAtoms. https://github.com/CoMakery/trust-exchange/blob/master/README.md This SDK is automatically generated by the Swagger Codegen project:
- API version: 1.0.2
- Package version: 1.0.2
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install verity_reputation --save
Local development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing
into the directory containing package.json
(and this README). Let's call this JAVASCRIPT_CLIENT_DIR
. Then run:
npm install
Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR
:
npm link
Finally, switch to the directory you want to use your verity_reputation from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>
You should now be able to require('verity_reputation')
in javascript files from the directory you ran the last
command above from.
git
If the library is hosted at a git repository, e.g. https://github.com/YOUR_USERNAME/verity_reputation then install it via:
npm install YOUR_USERNAME/verity_reputation --save
For browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify
,
perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually
use this library):
browserify main.js > bundle.js
Then include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}
Getting Started
Please follow the installation instruction and execute the following JS code:
var VerityReputation = require('verity_reputation');
var api = new VerityReputation.ActionTypeApi()
var opts = {
'body': new VerityReputation.ActionType() // {ActionType}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createActiontype(opts, callback);
Documentation for API Endpoints
All URIs are relative to http://springserver.cfapps.io/verity/core
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- VerityReputation.ActionTypeApi | createActiontype | POST /actiontype | create ActionType VerityReputation.ActionTypeApi | getActiontype | GET /actiontype/{uuid} | get ActionType VerityReputation.ActionTypeApi | updateActiontype | PUT /actiontype | update ActionType VerityReputation.CommunityApi | addCommunityMember | POST /community/{community_uuid}/members/{person_uuid} | add community member VerityReputation.CommunityApi | createCommunity | POST /community | create a Community VerityReputation.CommunityApi | getCommunitiesByQueryParameters | GET /community | get communities by query parameters VerityReputation.CommunityApi | getCommunity | GET /community/{uuid} | get community VerityReputation.CommunityApi | getCommunityContent | GET /community/{uuid}/content | get community content VerityReputation.CommunityApi | getCommunityEthics | GET /community/{uuid}/ethic | get community ethics VerityReputation.CommunityApi | getCommunityMembers | GET /community/{uuid}/members | get community members VerityReputation.CommunityApi | getCommunitySubCommunities | GET /community/{uuid}/community | get community sub communities VerityReputation.CommunityApi | updateCommunity | PUT /community | update a community VerityReputation.ContentApi | createContent | POST /content | create Content VerityReputation.ContentApi | getContent | GET /content/{uuid} | get content VerityReputation.ContentApi | getContentReputation | GET /content/{uuid}/reputation/{communityid}/{valuetypeid}/{reputationtype} | get content reputation VerityReputation.ContentApi | updateContent | PUT /content | update Content VerityReputation.EthicApi | createEthic | POST /ethic | create ethic VerityReputation.EthicApi | getEthic | GET /ethic/{uuid} | get ethic VerityReputation.EthicApi | getEthicsByQuery | GET /ethic | get ethics by query parameters VerityReputation.OrganizationApi | createOrganization | POST /organization | create an Organization VerityReputation.OrganizationApi | getOrganization | GET /organization/{uuid} | get organization VerityReputation.OrganizationApi | getOrganizationsByQuery | GET /organization | get organizations by query parameters VerityReputation.OrganizationApi | updateOrganization | PUT /organization | update Organization VerityReputation.PersonApi | createPerson | POST /person | create person VerityReputation.PersonApi | gETPerson | GET /person | get Person by qeury parameters VerityReputation.PersonApi | gETPersonUuidReputationCommunityidValuetypeidReputationtype | GET /person/{uuid}/reputation/{communityid}/{valuetypeid}/{reputationtype} | get person reputation VerityReputation.PersonApi | getPerson | GET /person/{uuid} | get Person VerityReputation.PersonApi | getPersonContent | GET /person/{uuid}/content | get Person Content VerityReputation.PersonApi | updatePerson | PUT /person | update person VerityReputation.ReputationApi | getReputation | GET /reputation/{community}/{reputationtype}/{agent}/{valueaction} | get reputation VerityReputation.TransactionApi | createTransaction | POST /transaction | create transaction VerityReputation.TransactionApi | getTransaction | GET /transaction/{uuid} | get transaction VerityReputation.TransactionApi | getTransactionsByAgent | GET /transaction/agent/{agentId} | get Transactions by AgentId VerityReputation.ValueActionApi | archiveValueAction | DELETE /valueaction/{uuid} | archive ValueAction VerityReputation.ValueActionApi | createValueAction | POST /valueaction | create ValueAction VerityReputation.ValueActionApi | getValueAction | GET /valueaction/{uuid} | get ValueAction VerityReputation.ValueActionApi | updateValueAction | PUT /valueaction | update ValueAction
Documentation for Models
- VerityReputation.ActionType
- VerityReputation.Agent
- VerityReputation.Community
- VerityReputation.Content
- VerityReputation.Ethic
- VerityReputation.Governance
- VerityReputation.InlineResponse403
- VerityReputation.InlineResponse404
- VerityReputation.KeyValuePair
- VerityReputation.Organization
- VerityReputation.Person
- VerityReputation.Proposal
- VerityReputation.ReputationRequest
- VerityReputation.SoftwareAgent
- VerityReputation.Transaction
- VerityReputation.ValueAction
Documentation for Authorization
Basic Auth
- Type: HTTP basic authentication
verity_auth_token
- Type: API key
- API key parameter name: verity_auth_token
- Location: URL query string