Skip to content
This repository has been archived by the owner on Feb 6, 2024. It is now read-only.

Commit

Permalink
feat: init fulfillmentInboundShipment
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jul 9, 2020
1 parent 0394f79 commit 112fb4a
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ export enum Resource {
Feeds = 'Feeds',
ShipmentInvoicing = 'ShipmentInvoicing',
MerchantFulfillment = 'MerchantFulfillment',
FulfillmentInboundShipment = 'FulfillmentInboundShipment',
}

export interface ResourceActions {
Expand Down Expand Up @@ -164,6 +165,30 @@ export interface ResourceActions {
| 'GetShipment'
| 'CancelShipment'
| 'GetServiceStatus'
[Resource.FulfillmentInboundShipment]:
| 'GetInboundGuidanceForSKU'
| 'GetInboundGuidanceForASIN'
| 'CreateInboundShipmentPlan'
| 'CreateInboundShipment'
| 'UpdateInboundShipment'
| 'GetPreorderInfo'
| 'ConfirmPreorder'
| 'GetPrepInstructionsForSKU'
| 'GetPrepInstructionsForASIN'
| 'PutTransportContent'
| 'EstimateTransportRequest'
| 'GetTransportContent'
| 'ConfirmTransportRequest'
| 'VoidTransportRequest'
| 'GetPackageLabels'
| 'GetUniquePackageLabels'
| 'GetPalletLabels'
| 'GetBillOfLading'
| 'ListInboundShipments'
| 'ListInboundShipmentsByNextToken'
| 'ListInboundShipmentItems'
| 'ListInboundShipmentItemsByNextToken'
| 'GetServiceStatus'
}

export interface Request {
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './sections/feeds'
export * from './sections/finances/finances'
export * from './sections/finances/codec'
export * from './sections/fulfillment-inventory'
export * from './sections/fulfillment-inbound-shipment'
export * from './sections/merchant-fulfillment/merchant-fulfillment'
export * from './sections/merchant-fulfillment/type'
export * from './sections/merchant-fulfillment/codec'
Expand Down
11 changes: 11 additions & 0 deletions src/mws.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { HttpClient } from './http'
import { Feeds } from './sections/feeds'
import { Finances } from './sections/finances/finances'
import { FulfillmentInboundShipment } from './sections/fulfillment-inbound-shipment'
import { FulfillmentInventory } from './sections/fulfillment-inventory'
import { MerchantFulfillment } from './sections/merchant-fulfillment/merchant-fulfillment'
import { Orders } from './sections/orders'
Expand All @@ -17,6 +18,8 @@ export class MWS {

private _fulfillmentInventory!: FulfillmentInventory

private _fulfillmentInboundShipment!: FulfillmentInboundShipment

private _merchantFulfillment!: MerchantFulfillment

private _orders!: Orders
Expand Down Expand Up @@ -65,6 +68,14 @@ export class MWS {
return this._finances
}

get fulfillmentInboundShipment() {
if (!this._fulfillmentInboundShipment) {
this._fulfillmentInboundShipment = new FulfillmentInboundShipment(this.httpClient)
}

return this._fulfillmentInboundShipment
}

get fulfillmentInventory() {
if (!this._fulfillmentInventory) {
this._fulfillmentInventory = new FulfillmentInventory(this.httpClient)
Expand Down
16 changes: 16 additions & 0 deletions src/sections/fulfillment-inbound-shipment.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { HttpClient, Resource } from '../http'
import { getServiceStatusByResource } from './shared'

const FULFILLMENT_INBOUND_SHIPMENT_API_VERSION = '2010-10-01'

export class FulfillmentInboundShipment {
constructor(private httpClient: HttpClient) {}

async getServiceStatus() {
return getServiceStatusByResource(
this.httpClient,
Resource.FulfillmentInboundShipment,
FULFILLMENT_INBOUND_SHIPMENT_API_VERSION,
)
}
}

0 comments on commit 112fb4a

Please sign in to comment.