3.0.3 • Published 6 years ago

sinopia_server v3.0.3

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
6 years ago

sinopia_server

SinopiaServer - JavaScript client for sinopia_server Sinopia Server. Supports CRUD, following loosely LDP, on Sinopia resources. Top level requires special authorization for creating a group's graph (i.e. PCC, Stanford, etc.). This SDK is automatically generated by the Swagger Codegen project:

  • API version: 3.0.3
  • Package version: 3.0.3
  • 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 sinopia_server --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 sinopia_server from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('sinopia_server') 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/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --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 SinopiaServer = require('sinopia_server');

var api = new SinopiaServer.DefaultApi()
api.healthCheck().then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://localhost

ClassMethodHTTP requestDescription
SinopiaServer.DefaultApihealthCheckGET /healthcheckHealth Check
SinopiaServer.LDPApicreateGroupPOST /repositoryCreate new Group within the base container.
SinopiaServer.LDPApicreateResourcePOST /repository/{groupID}Create a resource within a Group.
SinopiaServer.LDPApicreateUserPOST /repository/usersCreate a user within Sinopia.
SinopiaServer.LDPApideleteGroupDELETE /repository/{groupID}Delete an Group.
SinopiaServer.LDPApideleteResourceDELETE /repository/{groupID}/{resourceID}Delete a Resource.
SinopiaServer.LDPApideleteUserDELETE /repository/users/{userID}Delete a User.
SinopiaServer.LDPApigetBaseGET /repositoryGet metadata for the base container.
SinopiaServer.LDPApigetGroupGET /repository/{groupID}Get metadata (RDF) for a given Group.
SinopiaServer.LDPApigetResourceGET /repository/{groupID}/{resourceID}Get metadata (RDF) for a given resource.
SinopiaServer.LDPApigetUserGET /repository/users/{userID}Get metadata (RDF) for a given user.
SinopiaServer.LDPApigetUsersGET /repository/usersGet metadata (RDF) for the Sinopia users container.
SinopiaServer.LDPApiheadBaseHEAD /repositoryGet headers only for base container GET request.
SinopiaServer.LDPApiheadGroupHEAD /repository/{groupID}Get headers only for a group GET request.
SinopiaServer.LDPApiheadResourceHEAD /repository/{groupID}/{resourceID}Get headers only for a resource GET request.
SinopiaServer.LDPApiheadUserHEAD /repository/users/{userID}Get headers only for a user GET request.
SinopiaServer.LDPApiheadUsersHEAD /repository/usersGet headers only for a Sinopia users' container GET request.
SinopiaServer.LDPApioptionsBaseOPTIONS /repositoryHTTP Options for base container.
SinopiaServer.LDPApioptionsGroupOPTIONS /repository/{groupID}HTTP Options for group.
SinopiaServer.LDPApioptionsResourceOPTIONS /repository/{groupID}/{resourceID}HTTP Options for resource.
SinopiaServer.LDPApioptionsUserOPTIONS /repository/users/{userID}HTTP Options for user.
SinopiaServer.LDPApioptionsUsersOPTIONS /repository/usersHTTP Options for Sinopia users' container.
SinopiaServer.LDPApiupdateBasePUT /repositoryUpdate metadata on base container.
SinopiaServer.LDPApiupdateGroupPUT /repository/{groupID}Update metadata on a group.
SinopiaServer.LDPApiupdateResourcePUT /repository/{groupID}/{resourceID}Update metadata on a resource.
SinopiaServer.LDPApiupdateUserPUT /repository/users/{userID}Update metadata on a user.
SinopiaServer.LDPApiupdateUsersPUT /repository/usersUpdate metadata on the Sinopia users' container.

Documentation for Models

Documentation for Authorization

CognitoUser

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL:
  • Scopes: N/A
3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0-beta5

6 years ago

3.0.0-beta4

6 years ago

3.0.0-beta3

6 years ago

3.0.0-beta2

6 years ago

3.0.0-beta

6 years ago

2.0.0

6 years ago