1.18.0 • Published 4 years ago

sopra-fs21-group-02-dogs-api v1.18.0

Weekly downloads
-
License
Unlicense
Repository
-
Last release
4 years ago

dogs_app

DogsApp - JavaScript client for dogs_app This is the API definition of the dogs owners app. This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.18.0
  • Package version: 1.18.0
  • Build package: org.openapitools.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 dogs_app --save

Finally, you need to build the module:

npm run build
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

To use the link you just defined in your project, switch to the directory you want to use your dogs_app from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

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):

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 DogsApp = require('dogs_app');


var api = new DogsApp.ConversationsApi()
var userId = 789; // {Number} Numeric ID of the user
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getAllConversations(userId, callback);

Documentation for API Endpoints

All URIs are relative to https://api.server.test/v1

ClassMethodHTTP requestDescription
DogsApp.ConversationsApigetAllConversationsGET /users/{userId}/conversationsReturn all conversations of user by userId
DogsApp.ConversationsApigetAllMessagesGET /users/{userId1}/conversations/{userId2}Return all messages between user1 and user2
DogsApp.ConversationsApisendMessagePOST /messageAdd message to conversation
DogsApp.DogsApiaddDogPOST /users/{userId}/dogsAdd dog to user profile
DogsApp.DogsApideleteDogDELETE /users/{userId}/dogs/{dogId}Delete dog with dogId
DogsApp.DogsApieditDogPUT /users/{userId}/dogs/{dogId}Update an existing dog
DogsApp.DogsApigetDogsImageGET /users/{userId}/dogs/{dogId}/image
DogsApp.DogsApiusersUserIdDogsDogIdGetGET /users/{userId}/dogs/{dogId}Return dog of user by dogId
DogsApp.DogsApiusersUserIdDogsGetGET /users/{userId}/dogsReturn all dogs of user with userId
DogsApp.ParksApiaddParkPOST /parksCreate park
DogsApp.ParksApideleteParkDELETE /parks/{parkId}Delete park with parkId
DogsApp.ParksApigetParksGET /parksReturn all parks
DogsApp.ParksApiparksParkIdReviewsGetGET /parks/{parkId}/reviewsReturn all review of park by parkId
DogsApp.ParksApiparksParkIdReviewsPostPOST /parks/{parkId}/reviewsAdd review to park with parkId
DogsApp.PathsApiaddPathPOST /pathsCreate path
DogsApp.PathsApideletePathDELETE /paths/{pathId}Delete path with pathId
DogsApp.PathsApigetPathsGET /pathsReturn all paths
DogsApp.PathsApipathsPathIdReviewsGetGET /paths/{pathId}/reviewsReturn all review of walking path by pathId
DogsApp.PathsApipathsPathIdReviewsPostPOST /paths/{pathId}/reviewsAdd review to path with pathId
DogsApp.TagsApiaddTagPOST /users/{userId}/tagsAdd tag to user profile
DogsApp.TagsApideleteTagDELETE /users/{userId}/tags/{tagId}Delete tag
DogsApp.UsersApigetAllUsersGET /usersReturn all users
DogsApp.UsersApigetUsersGET /users/areaReturn all users in an area
DogsApp.UsersApiupdateLocationPUT /users/{userId}/locationUpdate user's location
DogsApp.UsersApiusersLoginPostPOST /users/loginUser is logged in/registered
DogsApp.UsersApiusersRefreshTokenPutPUT /users/refreshTokenSilent refresh of tokens
DogsApp.UsersApiusersUserIdDeleteDELETE /users/{userId}Delete user with userId
DogsApp.UsersApiusersUserIdGetGET /users/{userId}Return user by userId
DogsApp.UsersApiusersUserIdLogoutPutPUT /users/{userId}/logoutLog out from account
DogsApp.UsersApiusersUserIdPutPUT /users/{userId}Update an existing user

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

1.18.0

4 years ago

1.15.0

4 years ago

1.14.0

4 years ago

1.12.0

4 years ago

1.17.0

4 years ago

1.9.0

4 years ago

1.8.0

4 years ago

1.5.0

4 years ago

1.11.0

4 years ago

1.10.0

4 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.0.0

4 years ago