UNPKG

@shipengine/connect-inventory-api

Version:

OpenAPI specification and TypeScript definitions for the Connect Inventory API

38 lines (37 loc) 1.76 kB
import { AnyFetchRequest, OperationResults, PushInventoryRequest } from '../requests/requests'; import { FetchResults, OperationStarted, PushResults } from '../responses'; import { InventoryAppMetadata } from './inventory-app-metadata'; import { Handler } from '@shipengine/connect-runtime'; /** * Definition for an Inventory App implementation */ export interface InventoryAppDefinition { Metadata: InventoryAppMetadata; /** * Initiate an inventory fetch of any kind. The incoming req body for * this method has a varying shape which maps to different fetch types: * - No request body: `full` fetch * - Skus: `partial` fetch by sku * - SinceDate: `delta` fetch by date */ startFetch: (request: AnyFetchRequest) => Promise<OperationStarted>; /** * Check for completion and results of a fetch operation. */ getFetchResults: (request: OperationResults) => Promise<FetchResults>; /** * Initiate an inventory push. */ startPush: (request: PushInventoryRequest) => Promise<OperationStarted>; /** * Check for completion and results of a push operation. */ getPushResults: (request: OperationResults) => Promise<PushResults>; /** * @description A collection of additional routes that can be used to extend the functionality of the app. * Extension methods are not automatically called by the ShipEngine platform, and require working with Auctane developers to implement. * The request and response shapes of each method will be defined by Auctane, but will not be documented as part of Connect unless * they are made public and the functionality is taken out of extensions and into a named method. */ Extensions?: Record<string, Handler>; }