0.0.2 • Published 6 years ago

long-strange-trip v0.0.2

Weekly downloads
2
License
Unlicense
Repository
-
Last release
6 years ago

long_strange_trip_api

LongStrangeTripApi - JavaScript client for long_strange_trip_api This app is about you. All the places you've been, where you are now, and oh all the places you'll go. This SDK is automatically generated by the Swagger Codegen project:

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 long_strange_trip_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 long_strange_trip_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('long_strange_trip_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/YOUR_USERNAME/long_strange_trip_api then install it via:

    npm install YOUR_USERNAME/long_strange_trip_api --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 LongStrangeTripApi = require('long_strange_trip_api');

var defaultClient = LongStrangeTripApi.ApiClient.instance;

// Configure API key authorization: token
var token = defaultClient.authentications['token'];
token.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//token.apiKeyPrefix['Authorization'] = "Token"

var api = new LongStrangeTripApi.DatasetsApi()

var owner = "weareudonishaslem"; // {String} User name and unique identifier of the creator of a dataset or project. For example, in the URL: [https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), jonloyens is the unique identifier of the owner.

var id = "blog-series"; // {String} Dataset unique identifier. For example, in the URL:[https://data.world/jonloyens/an-intro-to-dataworld-dataset](https://data.world/jonloyens/an-intro-to-dataworld-dataset), an-intro-to-dataworld-dataset is the unique identifier of the dataset.

var body = new LongStrangeTripApi.FileBatchUpdateRequest(); // {FileBatchUpdateRequest} 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.addFilesBySource(owner, id, body, callback);

Documentation for API Endpoints

All URIs are relative to https://api.data.world/v0

ClassMethodHTTP requestDescription
LongStrangeTripApi.DatasetsApiaddFilesBySourcePOST /datasets/{owner}/{id}/filesAdd files
LongStrangeTripApi.DatasetsApicreateDatasetPOST /datasets/{owner}Create a dataset
LongStrangeTripApi.DatasetsApideleteDatasetDELETE /datasets/{owner}/{id}Delete a dataset
LongStrangeTripApi.DatasetsApideleteFileAndSyncSourceDELETE /datasets/{owner}/{id}/files/{name}Delete a file
LongStrangeTripApi.DatasetsApideleteFilesAndSyncSourcesDELETE /datasets/{owner}/{id}/filesDelete files
LongStrangeTripApi.DatasetsApigetDatasetGET /datasets/{owner}/{id}Retrieve a dataset
LongStrangeTripApi.DatasetsApigetDatasetByVersionGET /datasets/{owner}/{id}/v/{versionId}Retrieve a dataset by version
LongStrangeTripApi.DatasetsApipatchDatasetPATCH /datasets/{owner}/{id}Update a dataset
LongStrangeTripApi.DatasetsApireplaceDatasetPUT /datasets/{owner}/{id}Create / Replace a dataset
LongStrangeTripApi.DatasetsApisyncPOST /datasets/{owner}/{id}/syncSync files
LongStrangeTripApi.DatasetsApisyncViaGetGET /datasets/{owner}/{id}/syncSync files (via GET)
LongStrangeTripApi.DownloadApidownloadDatasetGET /download/{owner}/{id}Download dataset
LongStrangeTripApi.DownloadApidownloadFileGET /file_download/{owner}/{id}/{file}Download file
LongStrangeTripApi.InsightsApicreateInsightPOST /insights/{projectOwner}/{projectId}Create an insight
LongStrangeTripApi.InsightsApideleteInsightDELETE /insights/{projectOwner}/{projectId}/{id}Delete an insight
LongStrangeTripApi.InsightsApigetInsightGET /insights/{projectOwner}/{projectId}/{id}Retrieve an insight
LongStrangeTripApi.InsightsApigetInsightByVersionGET /insights/{projectOwner}/{projectId}/{id}/v/{versionId}Retrieve an insight by version
LongStrangeTripApi.InsightsApigetInsightsForProjectGET /insights/{projectOwner}/{projectId}Get insights for project.
LongStrangeTripApi.InsightsApireplaceInsightPUT /insights/{projectOwner}/{projectId}/{id}Replace an insight
LongStrangeTripApi.InsightsApiupdateInsightPATCH /insights/{projectOwner}/{projectId}/{id}Update an insight
LongStrangeTripApi.ProjectsApiaddLinkedDatasetPUT /projects/{owner}/{id}/linkedDatasets/{linkedDatasetOwner}/{linkedDatasetId}Link dataset
LongStrangeTripApi.ProjectsApicreateProjectPOST /projects/{owner}Create a project
LongStrangeTripApi.ProjectsApideleteProjectDELETE /projects/{owner}/{id}Delete a project
LongStrangeTripApi.ProjectsApigetProjectGET /projects/{owner}/{id}Retrieve a project
LongStrangeTripApi.ProjectsApigetProjectByVersionGET /projects/{owner}/{id}/v/{versionId}Retrieve a project by version
LongStrangeTripApi.ProjectsApipatchProjectPATCH /projects/{owner}/{id}Update a project
LongStrangeTripApi.ProjectsApiremoveLinkedDatasetDELETE /projects/{owner}/{id}/linkedDatasets/{linkedDatasetOwner}/{linkedDatasetId}Unlink dataset
LongStrangeTripApi.ProjectsApireplaceProjectPUT /projects/{owner}/{id}Create / Replace a project
LongStrangeTripApi.SparqlApisparqlGetGET /sparql/{owner}/{id}SPARQL query (via GET)
LongStrangeTripApi.SparqlApisparqlPostPOST /sparql/{owner}/{id}SPARQL query
LongStrangeTripApi.SqlApisqlGetGET /sql/{owner}/{id}SQL query (via GET)
LongStrangeTripApi.SqlApisqlPostPOST /sql/{owner}/{id}SQL query
LongStrangeTripApi.StreamsApiappendRecordsPOST /streams/{owner}/{id}/{streamId}Append records to a stream.
LongStrangeTripApi.UploadsApiuploadFilePUT /uploads/{owner}/{id}/files/{name}Upload file
LongStrangeTripApi.UploadsApiuploadFilesPOST /uploads/{owner}/{id}/filesUpload files
LongStrangeTripApi.UserApifetchContributingDatasetsGET /user/datasets/contributingList datasets as contributor
LongStrangeTripApi.UserApifetchContributingProjectsGET /user/projects/contributingList projects as contributor
LongStrangeTripApi.UserApifetchDatasetsGET /user/datasets/ownList datasets as owner
LongStrangeTripApi.UserApifetchLikedDatasetsGET /user/datasets/likedList liked datasets
LongStrangeTripApi.UserApifetchLikedProjectsGET /user/projects/likedList liked projects
LongStrangeTripApi.UserApifetchProjectsGET /user/projects/ownList projects owned
LongStrangeTripApi.UserApigetAccountGET /user/{account}Get a user account info.
LongStrangeTripApi.UserApigetUserDataGET /userGet user data

Documentation for Models

Documentation for Authorization

token

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