0.0.1 • Published 6 years ago

@weareudonishaslem/the-whole-world v0.0.1

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

my_worlds_api

MyWorldsApi - JavaScript client for my_worlds_api This app is about you. Everywhere youve been, now, ... 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 my_worlds_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 my_worlds_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

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

    npm install YOUR_USERNAME/my_worlds_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 MyWorldsApi = require('my_worlds_api');

var defaultClient = MyWorldsApi.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 MyWorldsApi.DatasetsApi()

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

Documentation for Models

Documentation for Authorization

token

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