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 |
pnpm |
yarn |
---|---|---|
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
number
first: string
after: 🔄 Return
🌐 Endpoint
/pagination
GET
acme.pet.add
🛠️ Usage
const addResponse = await acme.pet.add({
name: "doggie",
photoUrls: ["photoUrls_example"],
status: "available",
});
⚙️ Parameters
string
name: string
[]
photoUrls: Tag
[]
tags: number
id: Category
category: string
status: pet status in the store
🔄 Return
🌐 Endpoint
/pet
POST
acme.pet.delete
🛠️ Usage
const deleteResponse = await acme.pet.delete({
petId: 1,
});
⚙️ Parameters
number
petId: 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
string
[]
status: 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
string
[]
tags: 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
number
petId: 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
string
name: string
[]
photoUrls: Tag
[]
tags: number
id: Category
category: string
status: pet status in the store
🔄 Return
🌐 Endpoint
/pet
PUT
acme.pet.updateWithForm
🛠️ Usage
const updateWithFormResponse = await acme.pet.updateWithForm({
petId: 1,
});
⚙️ Parameters
number
petId: ID of pet that needs to be updated
string
name: Updated name of the pet
string
status: Updated status of the pet
🌐 Endpoint
/pet/{petId}
POST
acme.pet.uploadImage
🛠️ Usage
const uploadImageResponse = await acme.pet.uploadImage({
petId: 1,
});
⚙️ Parameters
number
petId: ID of pet to update
string
additionalMetadata: Additional data to pass to server
Uint8Array | File | buffer.File
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
string
orderId: 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
number
orderId: 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
number
id: number
petId: number
quantity: string
shipDate: string
status: Order Status
boolean
complete: 🔄 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
number
id: string
username: string
firstName: string
lastName: string
email: string
password: string
phone: number
userStatus: 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
string
username: 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
string
username: 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
string
username: The user name for login
string
password: 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
string
username: name that need to be deleted
number
id: string
firstName: string
lastName: string
email: string
password: string
phone: number
userStatus: User Status
🌐 Endpoint
/user/{username}
PUT
Author
This TypeScript package is automatically generated by Konfig