acme-typescript-sdk
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

Visit Acme

Acme

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

npm

Table of Contents

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

first: number
after: string

🔄 Return

PaginateResponse

🌐 Endpoint

/pagination GET

🔙 Back to Table of Contents


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

Pet

🌐 Endpoint

/pet POST

🔙 Back to Table of Contents


acme.pet.delete

🛠️ Usage

const deleteResponse = await acme.pet.delete({
  petId: 1,
});

⚙️ Parameters

petId: number

Pet id to delete

🌐 Endpoint

/pet/{petId} DELETE

🔙 Back to Table of Contents


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

Pet

🌐 Endpoint

/pet/findByStatus GET

🔙 Back to Table of Contents


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

Pet

🌐 Endpoint

/pet/findByTags GET

🔙 Back to Table of Contents


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

Pet

🌐 Endpoint

/pet/{petId} GET

🔙 Back to Table of Contents


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

Pet

🌐 Endpoint

/pet PUT

🔙 Back to Table of Contents


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

🔙 Back to Table of Contents


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

ApiResponse

🌐 Endpoint

/pet/{petId}/uploadImage POST

🔙 Back to Table of Contents


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

🔙 Back to Table of Contents


acme.store.getInventory

Returns a map of status codes to quantities

🛠️ Usage

const getInventoryResponse = await acme.store.getInventory();

🌐 Endpoint

/store/inventory GET

🔙 Back to Table of Contents


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

Order

🌐 Endpoint

/store/order/{orderId} GET

🔙 Back to Table of Contents


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

Order

🌐 Endpoint

/store/order POST

🔙 Back to Table of Contents


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

🔙 Back to Table of Contents


acme.user.createWithArray

🛠️ Usage

const createWithArrayResponse = await acme.user.createWithArray([{}]);

⚙️ Request Body

User[]

List of user object

🌐 Endpoint

/user/createWithArray POST

🔙 Back to Table of Contents


acme.user.createWithList

🛠️ Usage

const createWithListResponse = await acme.user.createWithList([{}]);

⚙️ Request Body

User[]

List of user object

🌐 Endpoint

/user/createWithList POST

🔙 Back to Table of Contents


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

🔙 Back to Table of Contents


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

User

🌐 Endpoint

/user/{username} GET

🔙 Back to Table of Contents


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

🔙 Back to Table of Contents


acme.user.logout

🛠️ Usage

const logoutResponse = await acme.user.logout();

🌐 Endpoint

/user/logout GET

🔙 Back to Table of Contents


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

🔙 Back to Table of Contents


Author

This TypeScript package is automatically generated by Konfig

Package Sidebar

Install

npm i acme-typescript-sdk

Weekly Downloads

0

Version

1.0.8

License

Unlicense

Unpacked Size

389 kB

Total Files

82

Last publish

Collaborators

  • konfig-publisher