npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

oldp-api

0.1.0 • Public • Published

oldp-api

OldpApi - JavaScript client for oldp-api With the Open Legal Data API you can access various data from the legal domain, e.g. law text or case files. The data may be used for semantic analysis or to create statistics. For more information visit our website. https://openlegaldata.io/ This SDK is automatically generated by the Swagger Codegen project:

  • API version: v1
  • Package version: v1
  • 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 oldp-api --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 oldp-api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('oldp-api') 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/openlegaldata/oldp-sdk-javascript then install it via:

    npm install openlegaldata/oldp-sdk-javascript --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 OldpApi = require('oldp-api');
 
var defaultClient = OldpApi.ApiClient.instance;
 
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix['Authorization'] = "Token"
 
var api = new OldpApi.AnnotationLabelsApi()
 
var data = new OldpApi.AnnotationLabel(); // {AnnotationLabel} 
 
 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.annotationLabelsCreate(data, callback);
 

Documentation for API Endpoints

All URIs are relative to https://de.openlegaldata.io/api

Class Method HTTP request Description
OldpApi.AnnotationLabelsApi annotationLabelsCreate POST /annotation_labels/
OldpApi.AnnotationLabelsApi annotationLabelsDelete DELETE /annotation_labels/{id}/
OldpApi.AnnotationLabelsApi annotationLabelsList GET /annotation_labels/
OldpApi.AnnotationLabelsApi annotationLabelsPartialUpdate PATCH /annotation_labels/{id}/
OldpApi.AnnotationLabelsApi annotationLabelsRead GET /annotation_labels/{id}/
OldpApi.AnnotationLabelsApi annotationLabelsUpdate PUT /annotation_labels/{id}/
OldpApi.CaseAnnotationsApi caseAnnotationsCreate POST /case_annotations/
OldpApi.CaseAnnotationsApi caseAnnotationsDelete DELETE /case_annotations/{id}/
OldpApi.CaseAnnotationsApi caseAnnotationsList GET /case_annotations/
OldpApi.CaseAnnotationsApi caseAnnotationsPartialUpdate PATCH /case_annotations/{id}/
OldpApi.CaseAnnotationsApi caseAnnotationsRead GET /case_annotations/{id}/
OldpApi.CaseAnnotationsApi caseAnnotationsUpdate PUT /case_annotations/{id}/
OldpApi.CaseMarkersApi caseMarkersCreate POST /case_markers/
OldpApi.CaseMarkersApi caseMarkersDelete DELETE /case_markers/{id}/
OldpApi.CaseMarkersApi caseMarkersList GET /case_markers/
OldpApi.CaseMarkersApi caseMarkersPartialUpdate PATCH /case_markers/{id}/
OldpApi.CaseMarkersApi caseMarkersRead GET /case_markers/{id}/
OldpApi.CaseMarkersApi caseMarkersUpdate PUT /case_markers/{id}/
OldpApi.CasesApi casesCreate POST /cases/
OldpApi.CasesApi casesDelete DELETE /cases/{id}/
OldpApi.CasesApi casesList GET /cases/
OldpApi.CasesApi casesPartialUpdate PATCH /cases/{id}/
OldpApi.CasesApi casesRead GET /cases/{id}/
OldpApi.CasesApi casesSearchList GET /cases/search/
OldpApi.CasesApi casesUpdate PUT /cases/{id}/
OldpApi.CitiesApi citiesList GET /cities/
OldpApi.CitiesApi citiesRead GET /cities/{id}/
OldpApi.CountriesApi countriesList GET /countries/
OldpApi.CountriesApi countriesRead GET /countries/{id}/
OldpApi.CourtsApi courtsList GET /courts/
OldpApi.CourtsApi courtsRead GET /courts/{id}/
OldpApi.LawBooksApi lawBooksCreate POST /law_books/
OldpApi.LawBooksApi lawBooksDelete DELETE /law_books/{id}/
OldpApi.LawBooksApi lawBooksList GET /law_books/
OldpApi.LawBooksApi lawBooksPartialUpdate PATCH /law_books/{id}/
OldpApi.LawBooksApi lawBooksRead GET /law_books/{id}/
OldpApi.LawBooksApi lawBooksUpdate PUT /law_books/{id}/
OldpApi.LawsApi lawsCreate POST /laws/
OldpApi.LawsApi lawsDelete DELETE /laws/{id}/
OldpApi.LawsApi lawsList GET /laws/
OldpApi.LawsApi lawsPartialUpdate PATCH /laws/{id}/
OldpApi.LawsApi lawsRead GET /laws/{id}/
OldpApi.LawsApi lawsSearchList GET /laws/search/
OldpApi.LawsApi lawsUpdate PUT /laws/{id}/
OldpApi.StatesApi statesList GET /states/
OldpApi.StatesApi statesRead GET /states/{id}/
OldpApi.TokenAuthApi tokenAuthCreate POST /token-auth/
OldpApi.UsersApi usersList GET /users/
OldpApi.UsersApi usersMe GET /users/me/
OldpApi.UsersApi usersRead GET /users/{id}/

Documentation for Models

Documentation for Authorization

api_key

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Keywords

none

install

npm i oldp-api

Downloadsweekly downloads

0

version

0.1.0

license

MIT License

last publish

collaborators

  • avatar
Report a vulnerability