1.0.2 • Published 7 years ago

verity_reputation v1.0.2

Weekly downloads
1
License
MIT
Repository
-
Last release
7 years ago

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

ClassMethodHTTP requestDescription
VerityReputation.ActionTypeApicreateActiontypePOST /actiontypecreate ActionType
VerityReputation.ActionTypeApigetActiontypeGET /actiontype/{uuid}get ActionType
VerityReputation.ActionTypeApiupdateActiontypePUT /actiontypeupdate ActionType
VerityReputation.CommunityApiaddCommunityMemberPOST /community/{community_uuid}/members/{person_uuid}add community member
VerityReputation.CommunityApicreateCommunityPOST /communitycreate a Community
VerityReputation.CommunityApigetCommunitiesByQueryParametersGET /communityget communities by query parameters
VerityReputation.CommunityApigetCommunityGET /community/{uuid}get community
VerityReputation.CommunityApigetCommunityContentGET /community/{uuid}/contentget community content
VerityReputation.CommunityApigetCommunityEthicsGET /community/{uuid}/ethicget community ethics
VerityReputation.CommunityApigetCommunityMembersGET /community/{uuid}/membersget community members
VerityReputation.CommunityApigetCommunitySubCommunitiesGET /community/{uuid}/communityget community sub communities
VerityReputation.CommunityApiupdateCommunityPUT /communityupdate a community
VerityReputation.ContentApicreateContentPOST /contentcreate Content
VerityReputation.ContentApigetContentGET /content/{uuid}get content
VerityReputation.ContentApigetContentReputationGET /content/{uuid}/reputation/{communityid}/{valuetypeid}/{reputationtype}get content reputation
VerityReputation.ContentApiupdateContentPUT /contentupdate Content
VerityReputation.EthicApicreateEthicPOST /ethiccreate ethic
VerityReputation.EthicApigetEthicGET /ethic/{uuid}get ethic
VerityReputation.EthicApigetEthicsByQueryGET /ethicget ethics by query parameters
VerityReputation.OrganizationApicreateOrganizationPOST /organizationcreate an Organization
VerityReputation.OrganizationApigetOrganizationGET /organization/{uuid}get organization
VerityReputation.OrganizationApigetOrganizationsByQueryGET /organizationget organizations by query parameters
VerityReputation.OrganizationApiupdateOrganizationPUT /organizationupdate Organization
VerityReputation.PersonApicreatePersonPOST /personcreate person
VerityReputation.PersonApigETPersonGET /personget Person by qeury parameters
VerityReputation.PersonApigETPersonUuidReputationCommunityidValuetypeidReputationtypeGET /person/{uuid}/reputation/{communityid}/{valuetypeid}/{reputationtype}get person reputation
VerityReputation.PersonApigetPersonGET /person/{uuid}get Person
VerityReputation.PersonApigetPersonContentGET /person/{uuid}/contentget Person Content
VerityReputation.PersonApiupdatePersonPUT /personupdate person
VerityReputation.ReputationApigetReputationGET /reputation/{community}/{reputationtype}/{agent}/{valueaction}get reputation
VerityReputation.TransactionApicreateTransactionPOST /transactioncreate transaction
VerityReputation.TransactionApigetTransactionGET /transaction/{uuid}get transaction
VerityReputation.TransactionApigetTransactionsByAgentGET /transaction/agent/{agentId}get Transactions by AgentId
VerityReputation.ValueActionApiarchiveValueActionDELETE /valueaction/{uuid}archive ValueAction
VerityReputation.ValueActionApicreateValueActionPOST /valueactioncreate ValueAction
VerityReputation.ValueActionApigetValueActionGET /valueaction/{uuid}get ValueAction
VerityReputation.ValueActionApiupdateValueActionPUT /valueactionupdate ValueAction

Documentation for Models

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