Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@dotdev/harmony-sdk

Package Overview
Dependencies
Maintainers
11
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dotdev/harmony-sdk

Harmony API SDK

latest
npmnpm
Version
1.30.1
Version published
Maintainers
11
Created
Source

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
  • Usage
  • Development
  • Implemented Endpoints

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:

  • Clone the repository:

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

    pnpm install
    
  • Build the project:

    pnpm run build
    
  • Run tests:

    pnpm test
    
  • To watch for changes during development:

    pnpm run watch
    

Implemented Endpoints

The Harmony SDK implements the following endpoints:

  • Authentication

    • authenticate(authToken: AuthenticationToken): Promise<string>
  • 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[]>
  • Stock Level Lookup Module

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

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

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

    • getDiaryBy(params: GetDiaryQueryParams, sessionId: string): Promise<Diary[]>
    • createDiary(params: CreateDiaryQueryParams, sessionId: string): Promise<boolean>
  • 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.

Keywords

harmony

FAQs

Package last updated on 08 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts