amazon-sp-api
Advanced tools
Comparing version 0.7.9 to 0.7.10
@@ -15,2 +15,4 @@ module.exports = { | ||
'setAppointmentFulfillmentData', | ||
'getRangeSlotCapacity', | ||
'getFixedSlotCapacity', | ||
'updateSchedule', | ||
@@ -20,2 +22,4 @@ 'createReservation', | ||
'cancelReservation', | ||
'getAppointmentSlotsByJobId', | ||
'getAppointmentSlots', | ||
'createServiceDocumentUploadDestination' | ||
@@ -22,0 +26,0 @@ ], |
@@ -9,3 +9,4 @@ const utils = require('../../../utils'); | ||
api_path:'/catalog/v0/items', | ||
restore_rate:0.167 | ||
restore_rate:0.167, | ||
deprecation_date:'2022-09-30' | ||
}); | ||
@@ -24,3 +25,4 @@ }, | ||
api_path:'/catalog/v0/items/' + req_params.path.asin, | ||
restore_rate:0.5 | ||
restore_rate:0.5, | ||
deprecation_date:'2022-09-30' | ||
}); | ||
@@ -27,0 +29,0 @@ }, |
@@ -102,2 +102,47 @@ const utils = require('../../../utils'); | ||
}, | ||
setAppointmentFulfillmentData:(req_params) => { | ||
req_params = utils.checkAndEncodeParams(req_params, { | ||
path:{ | ||
serviceJobId:{ | ||
type:'string' | ||
}, | ||
appointmentId:{ | ||
type:'string' | ||
} | ||
} | ||
}); | ||
return Object.assign(req_params, { | ||
method:'PUT', | ||
api_path:'/service/v1/serviceJobs/' + req_params.path.serviceJobId + '/appointments/' + req_params.path.appointmentId + '/fulfillment', | ||
restore_rate:0.2 | ||
}); | ||
}, | ||
getRangeSlotCapacity:(req_params) => { | ||
req_params = utils.checkAndEncodeParams(req_params, { | ||
path:{ | ||
resourceId:{ | ||
type:'string' | ||
} | ||
} | ||
}); | ||
return Object.assign(req_params, { | ||
method:'POST', | ||
api_path:'/service/v1/serviceResources/' + req_params.path.resourceId + '/capacity/range', | ||
restore_rate:0.2 | ||
}); | ||
}, | ||
getFixedSlotCapacity:(req_params) => { | ||
req_params = utils.checkAndEncodeParams(req_params, { | ||
path:{ | ||
resourceId:{ | ||
type:'string' | ||
} | ||
} | ||
}); | ||
return Object.assign(req_params, { | ||
method:'POST', | ||
api_path:'/service/v1/serviceResources/' + req_params.path.resourceId + '/capacity/fixed', | ||
restore_rate:0.2 | ||
}); | ||
}, | ||
updateSchedule:(req_params) => { | ||
@@ -113,3 +158,4 @@ req_params = utils.checkAndEncodeParams(req_params, { | ||
method:'PUT', | ||
api_path:'/service/v1/serviceResources/' + req_params.path.resourceId + '/schedules' | ||
api_path:'/service/v1/serviceResources/' + req_params.path.resourceId + '/schedules', | ||
restore_rate:0.2 | ||
}); | ||
@@ -120,3 +166,4 @@ }, | ||
method:'POST', | ||
api_path:'/service/v1/reservation' | ||
api_path:'/service/v1/reservation', | ||
restore_rate:0.2 | ||
}); | ||
@@ -134,3 +181,4 @@ }, | ||
method:'PUT', | ||
api_path:'/service/v1/reservation/' + req_params.path.reservationId | ||
api_path:'/service/v1/reservation/' + req_params.path.reservationId, | ||
restore_rate:0.2 | ||
}); | ||
@@ -148,9 +196,32 @@ }, | ||
method:'DELETE', | ||
api_path:'/service/v1/reservation/' + req_params.path.reservationId | ||
api_path:'/service/v1/reservation/' + req_params.path.reservationId, | ||
restore_rate:0.2 | ||
}); | ||
}, | ||
getAppointmentSlotsByJobId:(req_params) => { | ||
req_params = utils.checkAndEncodeParams(req_params, { | ||
path:{ | ||
serviceJobId:{ | ||
type:'string' | ||
} | ||
} | ||
}); | ||
return Object.assign(req_params, { | ||
method:'GET', | ||
api_path:'/service/v1/serviceJobs/' + req_params.path.serviceJobId + '/appointmentSlots', | ||
restore_rate:0.2 | ||
}); | ||
}, | ||
getAppointmmentSlots:(req_params) => { | ||
return Object.assign(req_params, { | ||
method:'GET', | ||
api_path:'/service/v1/appointmentSlots', | ||
restore_rate:0.05 | ||
}); | ||
}, | ||
createServiceDocumentUploadDestination:(req_params) => { | ||
return Object.assign(req_params, { | ||
method:'POST', | ||
api_path:'/service/v1/documents' | ||
api_path:'/service/v1/documents', | ||
restore_rate:0.2 | ||
}); | ||
@@ -157,0 +228,0 @@ } |
@@ -563,2 +563,5 @@ const CustomError = require('./CustomError'); | ||
}; | ||
if (req_params.deprecation_date){ | ||
utils.warn('DEPRECATION', req_params.deprecation_date); | ||
} | ||
} | ||
@@ -565,0 +568,0 @@ // Use user-defined restore_rate if specified, otherwise use default for operation |
@@ -16,3 +16,3 @@ import { | ||
GetOrdersResponse, | ||
} from "./operations/orders"; | ||
} from './operations/orders' | ||
@@ -22,2 +22,3 @@ import { | ||
CancelFeedResponse, | ||
CreateFeedBody, | ||
CreateFeedDocumentBody, | ||
@@ -32,4 +33,4 @@ CreateFeedDocumentResponse, | ||
GetFeedsResponse, | ||
} from "./operations/feeds"; | ||
import {Config, DownloadOptions, RoleCredentials} from "./baseTypes"; | ||
} from './operations/feeds' | ||
import { Config, DownloadOptions, RoleCredentials } from './baseTypes' | ||
import { | ||
@@ -76,5 +77,6 @@ ConfirmPreorderPath, | ||
VoidTransportPath, | ||
VoidTransportResponse | ||
} from "./operations/fulfillmentInbound"; | ||
VoidTransportResponse, | ||
} from './operations/fulfillmentInbound' | ||
import { | ||
CreateReportBody, | ||
CreateReportResponse, | ||
@@ -86,3 +88,3 @@ GetReportDocumentPath, | ||
ReportDocument, | ||
} from "./operations/reports"; | ||
} from './operations/reports' | ||
import { | ||
@@ -102,4 +104,4 @@ DeleteSmallAndLightEnrollmentBySellerSKUPath, | ||
PutSmallAndLightEnrollmentBySellerSKUResponse, | ||
} from "./operations/fbaSmallAndLight"; | ||
import {GetAuthorizationCodeQuery, GetAuthorizationCodeResponse,} from "./operations/authorization"; | ||
} from './operations/fbaSmallAndLight' | ||
import { GetAuthorizationCodeQuery, GetAuthorizationCodeResponse } from './operations/authorization' | ||
import { | ||
@@ -113,6 +115,12 @@ GetCatalogItemPath, | ||
ListCatalogItemsResponse, | ||
} from "./operations/catalogItems"; | ||
import {GetInventorySummariesQuery, GetInventorySummariesResponse,} from "./operations/fbaInventory"; | ||
import {GetItemEligibilityPreviewQuery, GetItemEligibilityPreviewResponse,} from "./operations/fbaInboundEligibility"; | ||
} from './operations/catalogItems' | ||
import { | ||
GetInventorySummariesQuery, | ||
GetInventorySummariesResponse, | ||
} from './operations/fbaInventory' | ||
import { | ||
GetItemEligibilityPreviewQuery, | ||
GetItemEligibilityPreviewResponse, | ||
} from './operations/fbaInboundEligibility' | ||
import { | ||
ListFinancialEventGroupsByGroupIdPath, | ||
@@ -128,345 +136,334 @@ ListFinancialEventGroupsByGroupIdQuery, | ||
ListFinancialEventsResponse, | ||
} from "./operations/finances"; | ||
} from './operations/finances' | ||
import { | ||
CreateRestrictedDataTokenBody, | ||
CreateRestrictedDataTokenResponse | ||
} from "./operations/tokens"; | ||
CreateRestrictedDataTokenResponse, | ||
} from './operations/tokens' | ||
import { IReqOptions } from './IReqOptions' | ||
import {ReportDocumentType} from "./download"; | ||
import { ReportDocumentType } from './download' | ||
declare module "amazon-sp-api" { | ||
class SellingPartner { | ||
constructor(config: Config); | ||
declare module 'amazon-sp-api' { | ||
export default class SellingPartner { | ||
constructor(config: Config) | ||
refreshAccessToken(): Promise<void>; | ||
refreshAccessToken(): Promise<void> | ||
refreshRoleCredentials(): Promise<void>; | ||
refreshRoleCredentials(): Promise<void> | ||
exchange(auth_code:string): Promise<any>; | ||
exchange(auth_code: string): Promise<any> | ||
get access_token(): string; | ||
get access_token(): string | ||
get role_credentials(): RoleCredentials; | ||
get role_credentials(): RoleCredentials | ||
callAPI<TOperation extends Operation>( | ||
req_params: ReqParams<TOperation> | ||
): Promise<ObjectType<TOperation>>; | ||
req_params: ReqParams<TOperation>, | ||
): Promise<ObjectType<TOperation>> | ||
download<T extends ReportDocumentType>( | ||
details: ReportDocument, | ||
options?: DownloadOptions | ||
): T; | ||
download<T extends ReportDocumentType>(details: ReportDocument, options?: DownloadOptions): T | ||
upload<T>( | ||
details: { | ||
url: string; | ||
encryptionDetails?: { | ||
key: string; | ||
initializationVector: string; | ||
}; | ||
}, | ||
feed: { | ||
content?: string; | ||
file?: string; | ||
contentType?: string; | ||
details: { | ||
url: string | ||
encryptionDetails?: { | ||
key: string | ||
initializationVector: string | ||
} | ||
): T; | ||
}, | ||
feed: { | ||
content?: string | ||
file?: string | ||
contentType?: string | ||
}, | ||
): T | ||
} | ||
type Operation = | ||
| "getAuthorizationCode" | ||
| "listCatalogItems" | ||
| "getCatalogItem" | ||
| "listCatalogCategories" | ||
| "getItemEligibilityPreview" | ||
| "getInventorySummaries" | ||
| "getSmallAndLightEnrollmentBySellerSKU" | ||
| "putSmallAndLightEnrollmentBySellerSKU" | ||
| "getSmallAndLightEligibilityBySellerSKU" | ||
| "getSmallAndLightFeePreview" | ||
| "getFeeds" | ||
| "createFeed" | ||
| "getFeed" | ||
| "cancelFeed" | ||
| "createFeedDocument" | ||
| "getFeedDocument" | ||
| "listFinancialEventGroups" | ||
| "listFinancialEventsByGroupId" | ||
| "listFinancialEventsByOrderId" | ||
| "listFinancialEvents" | ||
| "getInboundGuidance" | ||
| "updateInboundShipment" | ||
| "createInboundShipment" | ||
| "getPreorderInfo" | ||
| "confirmPreorder" | ||
| "getPrepInstructions" | ||
| "getReport" | ||
| "getReportDocument" | ||
| "getOrders" | ||
| "getOrder" | ||
| "getOrderBuyerInfo" | ||
| "getOrderAddress" | ||
| "getOrderItems" | ||
| "getOrderItemsBuyerInfo" | ||
| "getTransportDetails" | ||
| "putTransportDetails" | ||
| "voidTransport" | ||
| "estimateTransport" | ||
| "confirmTransport" | ||
| "createRestrictedDataToken" | ||
| "getLabels" | ||
| "getBillOfLading" | ||
| "getShipments" | ||
| "getShipmentItemsByShipmentId" | ||
| "getShipmentItems" | ||
| string; | ||
| 'getAuthorizationCode' | ||
| 'listCatalogItems' | ||
| 'getCatalogItem' | ||
| 'listCatalogCategories' | ||
| 'getItemEligibilityPreview' | ||
| 'getInventorySummaries' | ||
| 'getSmallAndLightEnrollmentBySellerSKU' | ||
| 'putSmallAndLightEnrollmentBySellerSKU' | ||
| 'getSmallAndLightEligibilityBySellerSKU' | ||
| 'getSmallAndLightFeePreview' | ||
| 'getFeeds' | ||
| 'createFeed' | ||
| 'getFeed' | ||
| 'cancelFeed' | ||
| 'createFeedDocument' | ||
| 'getFeedDocument' | ||
| 'listFinancialEventGroups' | ||
| 'listFinancialEventsByGroupId' | ||
| 'listFinancialEventsByOrderId' | ||
| 'listFinancialEvents' | ||
| 'getInboundGuidance' | ||
| 'updateInboundShipment' | ||
| 'createInboundShipment' | ||
| 'getPreorderInfo' | ||
| 'confirmPreorder' | ||
| 'getPrepInstructions' | ||
| 'getReport' | ||
| 'getReportDocument' | ||
| 'getOrders' | ||
| 'getOrder' | ||
| 'getOrderBuyerInfo' | ||
| 'getOrderAddress' | ||
| 'getOrderItems' | ||
| 'getOrderItemsBuyerInfo' | ||
| 'getTransportDetails' | ||
| 'putTransportDetails' | ||
| 'voidTransport' | ||
| 'estimateTransport' | ||
| 'confirmTransport' | ||
| 'createRestrictedDataToken' | ||
| 'getLabels' | ||
| 'getBillOfLading' | ||
| 'getShipments' | ||
| 'getShipmentItemsByShipmentId' | ||
| 'getShipmentItems' | ||
| string | ||
type ObjectType<TOperation> = TOperation extends "getAuthorizationCode" | ||
type ObjectType<TOperation> = TOperation extends 'getAuthorizationCode' | ||
? GetAuthorizationCodeResponse | ||
: TOperation extends "listCatalogItems" | ||
: TOperation extends 'listCatalogItems' | ||
? ListCatalogItemsResponse | ||
: TOperation extends "getCatalogItem" | ||
: TOperation extends 'getCatalogItem' | ||
? GetCatalogItemResponse | ||
: TOperation extends "listCatalogCategories" | ||
: TOperation extends 'listCatalogCategories' | ||
? ListCatalogCategoriesResponse | ||
: TOperation extends "getItemEligibilityPreview" | ||
: TOperation extends 'getItemEligibilityPreview' | ||
? GetItemEligibilityPreviewResponse | ||
: TOperation extends "getInventorySummaries" | ||
: TOperation extends 'getInventorySummaries' | ||
? GetInventorySummariesResponse | ||
: TOperation extends "getSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'getSmallAndLightEnrollmentBySellerSKU' | ||
? GetSmallAndLightEnrollmentBySellerSKUResponse | ||
: TOperation extends "putSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'putSmallAndLightEnrollmentBySellerSKU' | ||
? PutSmallAndLightEnrollmentBySellerSKUResponse | ||
: TOperation extends "getSmallAndLightEligibilityBySellerSKU" | ||
: TOperation extends 'getSmallAndLightEligibilityBySellerSKU' | ||
? GetSmallAndLightEligibilityBySellerSKUResponse | ||
: TOperation extends "getSmallAndLightFeePreview" | ||
: TOperation extends 'getSmallAndLightFeePreview' | ||
? GetSmallAndLightFeePreviewResponse | ||
: TOperation extends "getFeeds" | ||
: TOperation extends 'getFeeds' | ||
? GetFeedsResponse | ||
: TOperation extends "createFeed" | ||
: TOperation extends 'createFeed' | ||
? CreateFeedResponse | ||
: TOperation extends "getFeed" | ||
: TOperation extends 'getFeed' | ||
? GetFeedResponse | ||
: TOperation extends "cancelFeed" | ||
: TOperation extends 'cancelFeed' | ||
? CancelFeedResponse | ||
: TOperation extends "createFeedDocument" | ||
: TOperation extends 'createFeedDocument' | ||
? CreateFeedDocumentResponse | ||
: TOperation extends "getFeedDocument" | ||
: TOperation extends 'getFeedDocument' | ||
? GetFeedDocumentResponse | ||
: TOperation extends "listFinancialEventGroups" | ||
: TOperation extends 'listFinancialEventGroups' | ||
? ListFinancialEventGroupsResponse | ||
: TOperation extends "listFinancialEventsByGroupId" | ||
: TOperation extends 'listFinancialEventsByGroupId' | ||
? ListFinancialEventGroupsByGroupIdResponse | ||
: TOperation extends "listFinancialEventsByOrderId" | ||
: TOperation extends 'listFinancialEventsByOrderId' | ||
? ListFinancialEventsByOrderIdResponse | ||
: TOperation extends "listFinancialEvents" | ||
: TOperation extends 'listFinancialEvents' | ||
? ListFinancialEventsResponse | ||
: TOperation extends "getInboundGuidance" | ||
: TOperation extends 'getInboundGuidance' | ||
? GetInboundGuidanceResponse | ||
: TOperation extends "updateInboundShipment" | ||
: TOperation extends 'updateInboundShipment' | ||
? UpdateInboundShipmentResponse | ||
: TOperation extends "createInboundShipment" | ||
: TOperation extends 'createInboundShipment' | ||
? CreateInboundShipmentResponse | ||
: TOperation extends "getPreorderInfo" | ||
: TOperation extends 'getPreorderInfo' | ||
? GetPreorderInfoResponse | ||
: TOperation extends "confirmPreorder" | ||
: TOperation extends 'confirmPreorder' | ||
? ConfirmPreorderResponse | ||
: TOperation extends "getPrepInstructions" | ||
: TOperation extends 'getPrepInstructions' | ||
? GetPrepInstructionsResponse | ||
: TOperation extends "getReport" | ||
: TOperation extends 'getReport' | ||
? GetReportResponse | ||
: TOperation extends "getReportDocument" | ||
: TOperation extends 'getReportDocument' | ||
? GetReportDocumentResponse | ||
: TOperation extends "getOrders" | ||
: TOperation extends 'getOrders' | ||
? GetOrdersResponse | ||
: TOperation extends "getOrder" | ||
: TOperation extends 'getOrder' | ||
? GetOrderResponse | ||
: TOperation extends "getOrderBuyerInfo" | ||
: TOperation extends 'getOrderBuyerInfo' | ||
? GetOrderBuyerInfoResponse | ||
: TOperation extends "getOrderAddress" | ||
: TOperation extends 'getOrderAddress' | ||
? GetOrderAddressResponse | ||
: TOperation extends "getOrderItem" | ||
: TOperation extends 'getOrderItem' | ||
? GetOrderItemResponse | ||
: TOperation extends "getOrderItemsBuyerInfo" | ||
: TOperation extends 'getOrderItemsBuyerInfo' | ||
? GetOrderItemsBuyerInfoResponse | ||
: TOperation extends "createInboundShipmentPlan" | ||
: TOperation extends 'createInboundShipmentPlan' | ||
? CreateInboundShipmentPlanResponse | ||
: TOperation extends "putTransportDetails" | ||
: TOperation extends 'putTransportDetails' | ||
? PutTransportDetailsResponse | ||
: TOperation extends "getTransportDetails" | ||
: TOperation extends 'getTransportDetails' | ||
? GetTransportDetailsResponse | ||
: TOperation extends "voidTransport" | ||
: TOperation extends 'voidTransport' | ||
? VoidTransportResponse | ||
: TOperation extends "estimateTransport" | ||
: TOperation extends 'estimateTransport' | ||
? EstimateTransportResponse | ||
: TOperation extends "confirmTransport" | ||
: TOperation extends 'confirmTransport' | ||
? ConfirmTransportResponse | ||
: TOperation extends "createRestrictedDataToken" | ||
: TOperation extends 'createRestrictedDataToken' | ||
? CreateRestrictedDataTokenResponse | ||
: TOperation extends "getLabels" | ||
: TOperation extends 'getLabels' | ||
? GetLabelsResponse | ||
: TOperation extends "getBillOfLading" | ||
: TOperation extends 'getBillOfLading' | ||
? GetBillOfLadingResponse | ||
: TOperation extends "getShipments" | ||
: TOperation extends 'getShipments' | ||
? GetShipmentsResponse | ||
: TOperation extends "getShipmentItemsByShipmentId" | ||
: TOperation extends 'getShipmentItemsByShipmentId' | ||
? GetShipmentItemsByShipmentIdResponse | ||
: TOperation extends "getShipmentItems" | ||
: TOperation extends 'getShipmentItems' | ||
? GetShipmentItemsResponse | ||
: any; | ||
: any | ||
type QueryType< | ||
TOperation extends Operation | ||
> = TOperation extends "getAuthorizationCode" | ||
type QueryType<TOperation extends Operation> = TOperation extends 'getAuthorizationCode' | ||
? GetAuthorizationCodeQuery | ||
: TOperation extends "listCatalogItems" | ||
: TOperation extends 'listCatalogItems' | ||
? ListCatalogItemsQuery | ||
: TOperation extends "getCatalogItem" | ||
: TOperation extends 'getCatalogItem' | ||
? GetCatalogItemQuery | ||
: TOperation extends "listCatalogCategories" | ||
: TOperation extends 'listCatalogCategories' | ||
? ListCatalogCategoriesQuery | ||
: TOperation extends "getItemEligibilityPreview" | ||
: TOperation extends 'getItemEligibilityPreview' | ||
? GetItemEligibilityPreviewQuery | ||
: TOperation extends "getInventorySummaries" | ||
: TOperation extends 'getInventorySummaries' | ||
? GetInventorySummariesQuery | ||
: TOperation extends "getSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'getSmallAndLightEnrollmentBySellerSKU' | ||
? GetSmallAndLightEnrollmentBySellerSKUQuery | ||
: TOperation extends "putSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'putSmallAndLightEnrollmentBySellerSKU' | ||
? PutSmallAndLightEnrollmentBySellerSKUQuery | ||
: TOperation extends "deleteSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'deleteSmallAndLightEnrollmentBySellerSKU' | ||
? DeleteSmallAndLightEnrollmentBySellerSKUQuery | ||
: TOperation extends "getSmallAndLightEligibilityBySellerSKU" | ||
: TOperation extends 'getSmallAndLightEligibilityBySellerSKU' | ||
? GetSmallAndLightEligibilityBySellerSKUQuery | ||
: TOperation extends "getFeeds" | ||
: TOperation extends 'getFeeds' | ||
? GetFeedsQuery | ||
: TOperation extends "listFinancialEventGroups" | ||
: TOperation extends 'listFinancialEventGroups' | ||
? ListFinancialEventGroupsQuery | ||
: TOperation extends "listFinancialEventsByGroupId" | ||
: TOperation extends 'listFinancialEventsByGroupId' | ||
? ListFinancialEventGroupsByGroupIdQuery | ||
: TOperation extends "listFinancialEventsByOrderId" | ||
: TOperation extends 'listFinancialEventsByOrderId' | ||
? ListFinancialEventsByOrderIdQuery | ||
: TOperation extends "listFinancialEvents" | ||
: TOperation extends 'listFinancialEvents' | ||
? ListFinancialEventsQuery | ||
: TOperation extends "getInboundGuidance" | ||
: TOperation extends 'getInboundGuidance' | ||
? GetInboundGuidanceQuery | ||
: TOperation extends "getPreorderInfo" | ||
: TOperation extends 'getPreorderInfo' | ||
? GetPreorderInfoQuery | ||
: TOperation extends "confirmPreorder" | ||
: TOperation extends 'confirmPreorder' | ||
? ConfirmPreorderQuery | ||
: TOperation extends "getPrepInstructions" | ||
: TOperation extends 'getPrepInstructions' | ||
? GetPrepInstructionsQuery | ||
: TOperation extends "createReport" | ||
: TOperation extends 'createReport' | ||
? CreateReportResponse | ||
: TOperation extends "getOrders" | ||
: TOperation extends 'getOrders' | ||
? GetOrdersQuery | ||
: TOperation extends "getOrderItems" | ||
: TOperation extends 'getOrderItems' | ||
? GetOrderItemsQuery | ||
: TOperation extends "getOrderItemsBuyerInfo" | ||
: TOperation extends 'getOrderItemsBuyerInfo' | ||
? GetOrderItemsBuyerInfoQuery | ||
: TOperation extends "getLabels" | ||
: TOperation extends 'getLabels' | ||
? GetLabelsQuery | ||
: TOperation extends "getShipments" | ||
: TOperation extends 'getShipments' | ||
? GetShipmentsQuery | ||
: TOperation extends "getShipmentItemsByShipmentId" | ||
: TOperation extends 'getShipmentItemsByShipmentId' | ||
? GetShipmentItemsByShipmentIdQuery | ||
: TOperation extends "getShipmentItems" | ||
: TOperation extends 'getShipmentItems' | ||
? GetShipmentItemsQuery | ||
: any; | ||
: any | ||
type PathType< | ||
TOperation extends Operation | ||
> = TOperation extends "getCatalogItem" | ||
type PathType<TOperation extends Operation> = TOperation extends 'getCatalogItem' | ||
? GetCatalogItemPath | ||
: TOperation extends "getSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'getSmallAndLightEnrollmentBySellerSKU' | ||
? GetSmallAndLightEnrollmentBySellerSKUPath | ||
: TOperation extends "putSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'putSmallAndLightEnrollmentBySellerSKU' | ||
? PutSmallAndLightEnrollmentBySellerSKUPath | ||
: TOperation extends "deleteSmallAndLightEnrollmentBySellerSKU" | ||
: TOperation extends 'deleteSmallAndLightEnrollmentBySellerSKU' | ||
? DeleteSmallAndLightEnrollmentBySellerSKUPath | ||
: TOperation extends "getSmallAndLightEligibilityBySellerSKU" | ||
: TOperation extends 'getSmallAndLightEligibilityBySellerSKU' | ||
? GetSmallAndLightEligibilityBySellerSKUPath | ||
: TOperation extends "getFeed" | ||
: TOperation extends 'getFeed' | ||
? GetFeedPath | ||
: TOperation extends "cancelFeed" | ||
: TOperation extends 'cancelFeed' | ||
? CancelFeedPath | ||
: TOperation extends "getFeedDocument" | ||
: TOperation extends 'getFeedDocument' | ||
? GetFeedDocumentPath | ||
: TOperation extends "listFinancialEventsByGroupId" | ||
: TOperation extends 'listFinancialEventsByGroupId' | ||
? ListFinancialEventGroupsByGroupIdPath | ||
: TOperation extends "listFinancialEventsByOrderId" | ||
: TOperation extends 'listFinancialEventsByOrderId' | ||
? ListFinancialEventsByOrderIdPath | ||
: TOperation extends "updateInboundShipment" | ||
: TOperation extends 'updateInboundShipment' | ||
? UpdateInboundShipmentPath | ||
: TOperation extends "createInboundShipment" | ||
: TOperation extends 'createInboundShipment' | ||
? CreateInboundShipmentPath | ||
: TOperation extends "getPreorderInfo" | ||
: TOperation extends 'getPreorderInfo' | ||
? GetPreorderInfoPath | ||
: TOperation extends "confirmPreorder" | ||
: TOperation extends 'confirmPreorder' | ||
? ConfirmPreorderPath | ||
: TOperation extends "getReport" | ||
: TOperation extends 'getReport' | ||
? GetReportPath | ||
: TOperation extends "getReportDocument" | ||
: TOperation extends 'getReportDocument' | ||
? GetReportDocumentPath | ||
: TOperation extends "getOrder" | ||
: TOperation extends 'getOrder' | ||
? GetOrderPath | ||
: TOperation extends "getOrderAddress" | ||
: TOperation extends 'getOrderAddress' | ||
? GetOrderAddressPath | ||
: TOperation extends "getOrderItems" | ||
: TOperation extends 'getOrderItems' | ||
? GetOrderItemsPath | ||
: TOperation extends "getOrderItemsBuyerInfo" | ||
: TOperation extends 'getOrderItemsBuyerInfo' | ||
? GetOrderItemsBuyerInfoPath | ||
: TOperation extends "getOrderBuyerInfo" | ||
: TOperation extends 'getOrderBuyerInfo' | ||
? GetOrderBuyerInfoPath | ||
: TOperation extends "putTransportDetails" | ||
: TOperation extends 'putTransportDetails' | ||
? PutTransportDetailsPath | ||
: TOperation extends "getTransportDetails" | ||
: TOperation extends 'getTransportDetails' | ||
? GetTransportDetailsPath | ||
: TOperation extends "voidTransport" | ||
: TOperation extends 'voidTransport' | ||
? VoidTransportPath | ||
: TOperation extends "estimateTransport" | ||
: TOperation extends 'estimateTransport' | ||
? EstimateTransportPath | ||
: TOperation extends "confirmTransport" | ||
: TOperation extends 'confirmTransport' | ||
? ConfirmTransportPath | ||
: TOperation extends "getLabels" | ||
: TOperation extends 'getLabels' | ||
? GetLabelsPath | ||
: TOperation extends "getBillOfLading" | ||
: TOperation extends 'getBillOfLading' | ||
? GetBillOfLadingPath | ||
: TOperation extends "getShipmentItemsByShipmentId" | ||
: TOperation extends 'getShipmentItemsByShipmentId' | ||
? GetShipmentItemsByShipmentIdPath | ||
: any; | ||
: any | ||
type BodyType< | ||
TOperation extends Operation | ||
> = TOperation extends "getSmallAndLightFeePreview" | ||
type BodyType<TOperation extends Operation> = TOperation extends 'getSmallAndLightFeePreview' | ||
? GetSmallAndLightFeePreviewBody | ||
: TOperation extends "createFeed" | ||
: TOperation extends 'createFeed' | ||
? CreateFeedBody | ||
: TOperation extends "createFeedDocument" | ||
: TOperation extends 'createFeedDocument' | ||
? CreateFeedDocumentBody | ||
: TOperation extends "createInboundShipmentPlan" | ||
: TOperation extends 'createInboundShipmentPlan' | ||
? CreateInboundShipmentPlanBody | ||
: TOperation extends "updateInboundShipment" | ||
: TOperation extends 'updateInboundShipment' | ||
? UpdateInboundShipmentBody | ||
: TOperation extends "createInboundShipment" | ||
: TOperation extends 'createInboundShipment' | ||
? CreateInboundShipmentBody | ||
: TOperation extends "createReport" | ||
: TOperation extends 'createReport' | ||
? CreateReportBody | ||
: TOperation extends "putTransportDetails" | ||
: TOperation extends 'putTransportDetails' | ||
? PutTransportDetailsBody | ||
: TOperation extends "createRestrictedDataToken" | ||
: TOperation extends 'createRestrictedDataToken' | ||
? CreateRestrictedDataTokenBody | ||
: any; | ||
: any | ||
type ReqOptions = IReqOptions; | ||
type ReqOptions = IReqOptions | ||
export interface ReqParams<TOperation extends Operation> { | ||
operation: TOperation; | ||
path?: PathType<TOperation>; | ||
query?: QueryType<TOperation>; | ||
body?: BodyType<TOperation>; | ||
operation: TOperation | ||
path?: PathType<TOperation> | ||
query?: QueryType<TOperation> | ||
body?: BodyType<TOperation> | ||
options?: ReqOptions | ||
} | ||
export = SellingPartner; | ||
} |
@@ -1,5 +0,5 @@ | ||
interface IReqOptions { | ||
version?: string | ||
restore_rate?: number | ||
raw_result?: boolean | ||
export interface IReqOptions { | ||
version?: string | ||
restore_rate?: number | ||
raw_result?: boolean | ||
} |
import { BaseResponse, ProcessingStatus } from "../baseTypes"; | ||
export interface CreateReportResponse extends BaseResponse { | ||
payload?: { | ||
reportId: string; | ||
}; | ||
reportId: string; | ||
} | ||
@@ -8,0 +6,0 @@ |
@@ -48,8 +48,13 @@ const CustomError = require('./CustomError'); | ||
console.warn('WARNING! Calling an operation without an endpoint is deprecated and discouraged. You should specify an "endpoint" parameter or use shorthand dot notation (i.e. "catalogItems.getCatalogItem") as operation parameter value.'); | ||
return true; | ||
}, | ||
'DEPRECATION':(deprecation_date) => { | ||
console.warn('WARNING! This operation will be deprecated on ' + deprecation_date + '! You should update the operation and/or the version of the endpoint to use.'); | ||
return; | ||
} | ||
}, | ||
warn:(warn_type) => { | ||
utils.printWarning[warn_type](); | ||
warn:(warn_type, params) => { | ||
let overwrite = utils.printWarning[warn_type](params); | ||
// Overwrite original function definition --> this will ensure that warning is printed only once | ||
utils.printWarning[warn_type] = ()=>{}; | ||
if (overwrite) utils.printWarning[warn_type] = ()=>{}; | ||
} | ||
@@ -56,0 +61,0 @@ } |
{ | ||
"name": "amazon-sp-api", | ||
"version": "0.7.9", | ||
"version": "0.7.10", | ||
"description": "Amazon Selling Partner API client", | ||
@@ -28,3 +28,3 @@ "main": "index.js", | ||
"csvtojson": "^2.0.10", | ||
"fast-xml-parser": "^4.0.7", | ||
"fast-xml-parser": "^4.0.9", | ||
"iconv-lite": "^0.6.3", | ||
@@ -34,7 +34,7 @@ "qs": "^6.11.0" | ||
"devDependencies": { | ||
"@types/node": "^17.0.24", | ||
"@types/node": "^18.7.2", | ||
"chai": "^4.3.6", | ||
"dotenv": "^16.0.0", | ||
"mocha": "^9.2.2", | ||
"moment": "^2.29.2" | ||
"dotenv": "^16.0.1", | ||
"mocha": "^10.0.0", | ||
"moment": "^2.29.4" | ||
}, | ||
@@ -41,0 +41,0 @@ "repository": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
250481
6542
Updatedfast-xml-parser@^4.0.9