sinopia_server v3.0.3
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
Class | Method | HTTP request | Description |
---|---|---|---|
SinopiaServer.DefaultApi | healthCheck | GET /healthcheck | Health Check |
SinopiaServer.LDPApi | createGroup | POST /repository | Create new Group within the base container. |
SinopiaServer.LDPApi | createResource | POST /repository/{groupID} | Create a resource within a Group. |
SinopiaServer.LDPApi | createUser | POST /repository/users | Create a user within Sinopia. |
SinopiaServer.LDPApi | deleteGroup | DELETE /repository/{groupID} | Delete an Group. |
SinopiaServer.LDPApi | deleteResource | DELETE /repository/{groupID}/{resourceID} | Delete a Resource. |
SinopiaServer.LDPApi | deleteUser | DELETE /repository/users/{userID} | Delete a User. |
SinopiaServer.LDPApi | getBase | GET /repository | Get metadata for the base container. |
SinopiaServer.LDPApi | getGroup | GET /repository/{groupID} | Get metadata (RDF) for a given Group. |
SinopiaServer.LDPApi | getResource | GET /repository/{groupID}/{resourceID} | Get metadata (RDF) for a given resource. |
SinopiaServer.LDPApi | getUser | GET /repository/users/{userID} | Get metadata (RDF) for a given user. |
SinopiaServer.LDPApi | getUsers | GET /repository/users | Get metadata (RDF) for the Sinopia users container. |
SinopiaServer.LDPApi | headBase | HEAD /repository | Get headers only for base container GET request. |
SinopiaServer.LDPApi | headGroup | HEAD /repository/{groupID} | Get headers only for a group GET request. |
SinopiaServer.LDPApi | headResource | HEAD /repository/{groupID}/{resourceID} | Get headers only for a resource GET request. |
SinopiaServer.LDPApi | headUser | HEAD /repository/users/{userID} | Get headers only for a user GET request. |
SinopiaServer.LDPApi | headUsers | HEAD /repository/users | Get headers only for a Sinopia users' container GET request. |
SinopiaServer.LDPApi | optionsBase | OPTIONS /repository | HTTP Options for base container. |
SinopiaServer.LDPApi | optionsGroup | OPTIONS /repository/{groupID} | HTTP Options for group. |
SinopiaServer.LDPApi | optionsResource | OPTIONS /repository/{groupID}/{resourceID} | HTTP Options for resource. |
SinopiaServer.LDPApi | optionsUser | OPTIONS /repository/users/{userID} | HTTP Options for user. |
SinopiaServer.LDPApi | optionsUsers | OPTIONS /repository/users | HTTP Options for Sinopia users' container. |
SinopiaServer.LDPApi | updateBase | PUT /repository | Update metadata on base container. |
SinopiaServer.LDPApi | updateGroup | PUT /repository/{groupID} | Update metadata on a group. |
SinopiaServer.LDPApi | updateResource | PUT /repository/{groupID}/{resourceID} | Update metadata on a resource. |
SinopiaServer.LDPApi | updateUser | PUT /repository/users/{userID} | Update metadata on a user. |
SinopiaServer.LDPApi | updateUsers | PUT /repository/users | Update metadata on the Sinopia users' container. |
Documentation for Models
- SinopiaServer.Error
- SinopiaServer.ErrorResponse
- SinopiaServer.ErrorSource
- SinopiaServer.HealthCheckResponse
- SinopiaServer.LDPContainer
- SinopiaServer.Resource
- SinopiaServer.ResourceContext
- SinopiaServer.ResourceInfo
- SinopiaServer.SinopiaBasicContainer
- SinopiaServer.SinopiaBasicContainerContext
- SinopiaServer.SinopiaResource
- SinopiaServer.Variable
Documentation for Authorization
CognitoUser
- Type: OAuth
- Flow: accessCode
- Authorization URL:
- Scopes: N/A
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago