1.8.2 • Published 10 months ago

@dotdev/harmony-sdk v1.8.2

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

Harmony SDK

Harmony SDK is a TypeScript library for interacting with the Harmony API. It provides a set of modules to perform various operations such as authentication, stock lookup, stock level lookup, point of sale operations, carrier management, diary management, and gift voucher handling.

Table of Contents

Installation

To install the Harmony SDK, use the following command:

npm install @dotdev/harmony-sdk

or if you're using pnpm:

pnpm add @dotdev/harmony-sdk

Usage

Here's a basic example of how to use the Harmony SDK:

import { HarmonyAPI, AuthenticationToken } from "@dotdev/harmony-sdk";

const api = new HarmonyAPI("https://your-harmony-api-url.com");

async function main() {
  const authToken: AuthenticationToken = {
    // Fill in your authentication details
  };

  try {
    const sessionId = await api.authenticate(authToken);
    console.log("Authenticated successfully. Session ID:", sessionId);

    // Example: Perform a stock lookup
    const stockLookupParams = {
      // Fill in your stock lookup parameters
    };
    const stockResults = await api.stockLookup(stockLookupParams, sessionId);
    console.log("Stock lookup results:", stockResults);

    // Use other methods as needed...
  } catch (error) {
    console.error("Error:", error);
  }
}

main();

Development

To set up the development environment:

  1. Clone the repository:

    git clone git@bitbucket.org:dotcollectiveanz/harmony-sdk.git
    cd harmony-sdk
  2. Install dependencies:

    pnpm install
  3. Build the project:

    pnpm run build
  4. Run tests:

    pnpm test
  5. To watch for changes during development:

    pnpm run watch

Implemented Endpoints

The Harmony SDK implements the following endpoints:

  1. Authentication

    • authenticate(authToken: AuthenticationToken): Promise<string>
  2. Stock Lookup Module

    • stockLookup(params: StockLookupRequestParams, sessionId: string): Promise<Stock[]>
    • stockCategoryLookup(sessionId: string): Promise<StockCategory[]>
    • stockBarcodeLookup(params: StockLookupRequestParams, sessionId: string): Promise<StockBarcode[]>
    • stockColorLookup(sessionId: string): Promise<StockColor[]>
    • sizeGridLookup(sessionId: string): Promise<SizeGrid[]>
    • stockClassificationLookup(sessionId: string, searchType?: StockClassificationType): Promise<StockClassification[]>
  3. Stock Level Lookup Module

    • warehouseLookup(sessionId: string): Promise<Warehouse[]>
    • stockLevelLookup(params: StockLevelLookupQueryParams, sessionId: string): Promise<StockLevel[]>
    • stockLevelLookupByWarehouseQuickView(params: StockLevelLookupQueryParams, sessionId: string): Promise<StockLevel[]>
  4. Point of Sale Module

    • processSalesOrder(params: ProcessSaleOrderQueryParams, sessionId: string): Promise<boolean>
  5. Carrier Module

    • getCarrier(sessionId: string): Promise<Carrier[]>
    • getCarrierShipmentByOrderNo(orderNo: string, sessionId: string): Promise<CarrierShipment[]>
    • getCarrierBySysTime(params: GetCarrierShipmentByTimeQueryParams, sessionId: string): Promise<CarrierShipment[]>
  6. Diary Module

    • getDiaryBy(params: GetDiaryQueryParams, sessionId: string): Promise<Diary[]>
    • createDiary(params: CreateDiaryQueryParams, sessionId: string): Promise<boolean>
  7. Gift Voucher Module

    • giftVoucherLookup(params: GiftVoucherLookupQueryParams, sessionId: string): Promise<GiftVoucher[]>
    • giftVoucherVerificationKey(params: GiftVoucherVerificationKeyQueryParams, sessionId: string): Promise<string>
    • giftVoucherReservation(params: GiftVoucherReservationQueryParams, sessionId: string): Promise<string>
    • giftVoucherUsed(params: GiftVoucherUsedQueryParams, sessionId: string): Promise<number>

For detailed information on each endpoint and its parameters, please refer to the source code and type definitions.

1.8.2

10 months ago

1.8.1

10 months ago

1.8.0

10 months ago

1.7.0

10 months ago

1.6.2

10 months ago

1.6.1

10 months ago

1.6.0

10 months ago

1.5.0

11 months ago

1.4.0

11 months ago

1.3.1

11 months ago

1.3.0

11 months ago

1.2.0

12 months ago

1.1.0

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.8

12 months ago

1.0.7

12 months ago

1.0.6

12 months ago