1.0.1 • Published 2 years ago

pet-store-typescript-sdk v1.0.1

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

pet-store-typescript-sdk@1.0.1

This is a sample server Petstore server. For this sample, you can use the api key special-key to test the authorization filters.

Installing

npm

npm install pet-store-typescript-sdk --save

yarn

yarn add pet-store-typescript-sdk

Important note: this library is can be used in both the client-side or server-side, but using it in client-side browser code is not recommended as you would expose security credentials.

Getting Started

import { PetStore } from "pet-store-typescript-sdk";

const petstore = new PetStore({
  // Defining the base path is optional and defaults to https://petstore.swagger.io/v2
  // basePath: "https://petstore.swagger.io/v2",
  apiKey: "API_KEY",
  accessToken: "ACCESS_TOKEN",
});

const paginateResponse = await petstore.miscellaneous.paginate({});

console.log(paginateResponse);

Documentation for API Endpoints

All URIs are relative to https://petstore.swagger.io/v2

ClassMethodHTTP requestDescription
MiscellaneousApipaginateGET /paginationPagination sandbox
PetApiaddPOST /petAdd a new pet to the store
PetApideleteDELETE /pet/{petId}Deletes a pet
PetApifindByStatusGET /pet/findByStatusFinds Pets by status
PetApifindByTagsGET /pet/findByTagsFinds Pets by tags
PetApigetByIdGET /pet/{petId}Find pet by ID
PetApiupdatePUT /petUpdate an existing pet
PetApiupdateWithFormPOST /pet/{petId}Updates a pet in the store with form data
PetApiuploadImagePOST /pet/{petId}/uploadImageuploads an image
StoreApideleteOrderDELETE /store/order/{orderId}Delete purchase order by ID
StoreApigetInventoryGET /store/inventoryReturns pet inventories by status
StoreApigetOrderByIdGET /store/order/{orderId}Find purchase order by ID
StoreApiplaceOrderPOST /store/orderPlace an order for a pet
UserApicreatePOST /userCreate user
UserApicreateWithArrayPOST /user/createWithArrayCreates list of users with given input array
UserApicreateWithListPOST /user/createWithListCreates list of users with given input array
UserApideleteDELETE /user/{username}Delete user
UserApigetByNameGET /user/{username}Get user by user name
UserApiloginGET /user/loginLogs user into the system
UserApilogoutGET /user/logoutLogs out current logged in user session
UserApiupdatePUT /user/{username}Updated user