@ecommerce/api-client (1.0.1)

Published 2026-04-18 20:52:22 +00:00 by rscla

Installation

@ecommerce:registry=
npm install @ecommerce/api-client@1.0.1
"@ecommerce/api-client": "1.0.1"

About this package

@ecommerce/api-client@1.0.1

A TypeScript SDK client for the api.example.com API.

Usage

First, install the SDK from npm.

npm install @ecommerce/api-client --save

Next, try it out.

import {
  Configuration,
  CategoriesApi,
} from '@ecommerce/api-client';
import type { CreateCategoryRequest } from '@ecommerce/api-client';

async function example() {
  console.log("🚀 Testing @ecommerce/api-client SDK...");
  const api = new CategoriesApi();

  const body = {
    // Category
    category: ...,
  } satisfies CreateCategoryRequest;

  try {
    const data = await api.createCategory(body);
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

// Run the test
example().catch(console.error);

Documentation

API Endpoints

All URIs are relative to https://api.example.com

Class Method HTTP request Description
CategoriesApi createCategory POST /api/Categories
CategoriesApi getCategories GET /api/Categories
CategoriesApi getCategory GET /api/Categories/{id}
OrdersApi createOrder POST /api/Orders
OrdersApi getOrder GET /api/Orders/{id}
OrdersApi getOrders GET /api/Orders
OrdersApi updateOrderStatus PATCH /api/Orders/{id}/status
ProductsApi createProduct POST /api/Products
ProductsApi deleteProduct DELETE /api/Products/{id}
ProductsApi getProduct GET /api/Products/{id}
ProductsApi getProducts GET /api/Products
ProductsApi updateProduct PUT /api/Products/{id}

Models

Authorization

Endpoints do not require authorization.

About

This TypeScript SDK client supports the Fetch API and is automatically generated by the OpenAPI Generator project:

  • API version: 1.0.0
  • Package version: 1.0.1
  • Generator version: 7.21.0
  • Build package: org.openapitools.codegen.languages.TypeScriptFetchClientCodegen

The generated npm module supports the following:

  • Environments
    • Node.js
    • Webpack
    • Browserify
  • Language levels
    • ES5 - you must have a Promises/A+ library installed
    • ES6
  • Module systems
    • CommonJS
    • ES6 module system

Development

Building

To build the TypeScript source code, you need to have Node.js and npm installed. After cloning the repository, navigate to the project directory and run:

npm install
npm run build

Publishing

Once you've built the package, you can publish it to npm:

npm publish

License

Dependencies

Development dependencies

ID Version
typescript ^4.0 || ^5.0
Details
npm
2026-04-18 20:52:22 +00:00
0
OpenAPI-Generator
latest
23 KiB
Assets (1)
Versions (1) View all
1.0.1 2026-04-18