acme-typescript-sdk
v1.0.8
Published
Client for OpenAPI Petstore
Downloads
3
Maintainers
Readme
Acme
This is a sample server Petstore server. For this sample, you can use the api key special-key
to test the authorization filters.
Table of Contents
- Installation
- Getting Started
- Reference
acme.miscellaneous.paginate
acme.pet.add
acme.pet.delete
acme.pet.findByStatus
acme.pet.findByTags
acme.pet.getById
acme.pet.update
acme.pet.updateWithForm
acme.pet.uploadImage
acme.store.deleteOrder
acme.store.getInventory
acme.store.getOrderById
acme.store.placeOrder
acme.user.create
acme.user.createWithArray
acme.user.createWithList
acme.user.delete
acme.user.getByName
acme.user.login
acme.user.logout
acme.user.update
Installation
npm i acme-typescript-sdk
pnpm i acme-typescript-sdk
yarn add acme-typescript-sdk
Getting Started
import { Acme } from "acme-typescript-sdk";
const acme = new Acme({
// 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 acme.miscellaneous.paginate({});
console.log(paginateResponse);
Reference
acme.miscellaneous.paginate
Iterate through a bunch of items
🛠️ Usage
const paginateResponse = await acme.miscellaneous.paginate({});
⚙️ Parameters
first: number
after: string
🔄 Return
🌐 Endpoint
/pagination
GET
acme.pet.add
🛠️ Usage
const addResponse = await acme.pet.add({
name: "doggie",
photoUrls: ["photoUrls_example"],
status: "available",
});
⚙️ Parameters
name: string
photoUrls: string
[]
tags: Tag
[]
id: number
category: Category
status: string
pet status in the store
🔄 Return
🌐 Endpoint
/pet
POST
acme.pet.delete
🛠️ Usage
const deleteResponse = await acme.pet.delete({
petId: 1,
});
⚙️ Parameters
petId: number
Pet id to delete
🌐 Endpoint
/pet/{petId}
DELETE
acme.pet.findByStatus
Multiple status values can be provided with comma separated strings
🛠️ Usage
const findByStatusResponse = await acme.pet.findByStatus({
status: ["available"],
});
⚙️ Parameters
status: string
[]
Status values that need to be considered for filter
🔄 Return
🌐 Endpoint
/pet/findByStatus
GET
acme.pet.findByTags
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
🛠️ Usage
const findByTagsResponse = await acme.pet.findByTags({
tags: ["tags_example"],
});
⚙️ Parameters
tags: string
[]
Tags to filter by
🔄 Return
🌐 Endpoint
/pet/findByTags
GET
acme.pet.getById
Returns a single pet
🛠️ Usage
const getByIdResponse = await acme.pet.getById({
petId: 1,
});
⚙️ Parameters
petId: number
ID of pet to return
🔄 Return
🌐 Endpoint
/pet/{petId}
GET
acme.pet.update
🛠️ Usage
const updateResponse = await acme.pet.update({
name: "doggie",
photoUrls: ["photoUrls_example"],
status: "available",
});
⚙️ Parameters
name: string
photoUrls: string
[]
tags: Tag
[]
id: number
category: Category
status: string
pet status in the store
🔄 Return
🌐 Endpoint
/pet
PUT
acme.pet.updateWithForm
🛠️ Usage
const updateWithFormResponse = await acme.pet.updateWithForm({
petId: 1,
});
⚙️ Parameters
petId: number
ID of pet that needs to be updated
name: string
Updated name of the pet
status: string
Updated status of the pet
🌐 Endpoint
/pet/{petId}
POST
acme.pet.uploadImage
🛠️ Usage
const uploadImageResponse = await acme.pet.uploadImage({
petId: 1,
});
⚙️ Parameters
petId: number
ID of pet to update
additionalMetadata: string
Additional data to pass to server
file: Uint8Array | File | buffer.File
file to upload
🔄 Return
🌐 Endpoint
/pet/{petId}/uploadImage
POST
acme.store.deleteOrder
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
🛠️ Usage
const deleteOrderResponse = await acme.store.deleteOrder({
orderId: "orderId_example",
});
⚙️ Parameters
orderId: string
ID of the order that needs to be deleted
🌐 Endpoint
/store/order/{orderId}
DELETE
acme.store.getInventory
Returns a map of status codes to quantities
🛠️ Usage
const getInventoryResponse = await acme.store.getInventory();
🌐 Endpoint
/store/inventory
GET
acme.store.getOrderById
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
🛠️ Usage
const getOrderByIdResponse = await acme.store.getOrderById({
orderId: 1,
});
⚙️ Parameters
orderId: number
ID of pet that needs to be fetched
🔄 Return
🌐 Endpoint
/store/order/{orderId}
GET
acme.store.placeOrder
🛠️ Usage
const placeOrderResponse = await acme.store.placeOrder({
status: "placed",
complete: false,
});
⚙️ Parameters
id: number
petId: number
quantity: number
shipDate: string
status: string
Order Status
complete: boolean
🔄 Return
🌐 Endpoint
/store/order
POST
acme.user.create
This can only be done by the logged in user.
🛠️ Usage
const createResponse = await acme.user.create({});
⚙️ Parameters
id: number
username: string
firstName: string
lastName: string
email: string
password: string
phone: string
userStatus: number
User Status
🌐 Endpoint
/user
POST
acme.user.createWithArray
🛠️ Usage
const createWithArrayResponse = await acme.user.createWithArray([{}]);
⚙️ Request Body
User
[]
List of user object
🌐 Endpoint
/user/createWithArray
POST
acme.user.createWithList
🛠️ Usage
const createWithListResponse = await acme.user.createWithList([{}]);
⚙️ Request Body
User
[]
List of user object
🌐 Endpoint
/user/createWithList
POST
acme.user.delete
This can only be done by the logged in user.
🛠️ Usage
const deleteResponse = await acme.user.delete({
username: "username_example",
});
⚙️ Parameters
username: string
The name that needs to be deleted
🌐 Endpoint
/user/{username}
DELETE
acme.user.getByName
🛠️ Usage
const getByNameResponse = await acme.user.getByName({
username: "username_example",
});
⚙️ Parameters
username: string
The name that needs to be fetched. Use user1 for testing.
🔄 Return
🌐 Endpoint
/user/{username}
GET
acme.user.login
🛠️ Usage
const loginResponse = await acme.user.login({
username:
"CbUUGjjNSwg0_bs9ZayIMrKdgNvb6gvxmPb9GcsM61ate1RA89q3w1l4eH4XxEz.5awLMdeXylwK0lMGUSM4jsrh4dstlnQUN5vVdMLPA",
password: "password_example",
});
⚙️ Parameters
username: string
The user name for login
password: string
The password for login in clear text
🌐 Endpoint
/user/login
GET
acme.user.logout
🛠️ Usage
const logoutResponse = await acme.user.logout();
🌐 Endpoint
/user/logout
GET
acme.user.update
This can only be done by the logged in user.
🛠️ Usage
const updateResponse = await acme.user.update({
username: "username_example",
});
⚙️ Parameters
username: string
name that need to be deleted
id: number
firstName: string
lastName: string
email: string
password: string
phone: string
userStatus: number
User Status
🌐 Endpoint
/user/{username}
PUT
Author
This TypeScript package is automatically generated by Konfig