usps-webtools-promise
Advanced tools
Comparing version
@@ -53,50 +53,53 @@ import type USPSClass from "../usps"; | ||
} | ||
interface RateV4Postage { | ||
CLASSID?: string; | ||
CommercialPlusRate?: string; | ||
CommercialRate?: string; | ||
DimensionalWeightCommercialPlusRate?: string; | ||
DimensionalWeightRate?: string; | ||
MailService?: string; | ||
MaxDimensions?: string; | ||
Rate?: string; | ||
ServiceInformation?: string; | ||
SpecialServices?: [ | ||
{ | ||
SpecialService?: { | ||
Available?: string; | ||
AvailableCPP?: string; | ||
AvailableOnline?: string; | ||
DeclaredValueRequired?: string; | ||
DueSenderRequired?: string; | ||
Price?: string; | ||
PriceCPP?: string; | ||
PriceOnline?: string; | ||
ServiceID?: string; | ||
ServiceName?: string; | ||
}; | ||
} | ||
]; | ||
} | ||
interface RateV4Package { | ||
Container?: string; | ||
Error?: string; | ||
FirstClassMailType?: string; | ||
Girth?: string; | ||
Height?: string; | ||
Length?: string; | ||
Machinable?: string; | ||
Ounces: number; | ||
Postage: RateV4Postage; | ||
Pounds: number; | ||
Restriction: { | ||
Restrictions?: string; | ||
}; | ||
Width?: string; | ||
ZipDestination: string; | ||
ZipOrigination: string; | ||
Zone?: string; | ||
} | ||
export interface RateV4Response { | ||
Error?: ErrorResponse; | ||
Package?: { | ||
Container?: string; | ||
Error?: string; | ||
FirstClassMailType?: string; | ||
Girth?: string; | ||
Height?: string; | ||
Length?: string; | ||
Machinable?: string; | ||
Ounces: number; | ||
Postage: { | ||
CLASSID?: string; | ||
CommercialPlusRate?: string; | ||
CommercialRate?: string; | ||
DimensionalWeightCommercialPlusRate?: string; | ||
DimensionalWeightRate?: string; | ||
MailService?: string; | ||
MaxDimensions?: string; | ||
Rate?: string; | ||
ServiceInformation?: string; | ||
SpecialServices?: [ | ||
{ | ||
SpecialService?: { | ||
Available?: string; | ||
AvailableCPP?: string; | ||
AvailableOnline?: string; | ||
DeclaredValueRequired?: string; | ||
DueSenderRequired?: string; | ||
Price?: string; | ||
PriceCPP?: string; | ||
PriceOnline?: string; | ||
ServiceID?: string; | ||
ServiceName?: string; | ||
}; | ||
} | ||
]; | ||
}; | ||
Pounds: number; | ||
Restriction: { | ||
Restrictions?: string; | ||
}; | ||
Width?: string; | ||
ZipDestination: string; | ||
ZipOrigination: string; | ||
Zone?: string; | ||
}; | ||
Package?: RateV4Package; | ||
} | ||
export default function (this: USPSClass, pricingRate: PricingRateInput): Promise<RateV4Response["Package"]["Postage"] | Error>; | ||
export default function (this: USPSClass, pricingRate: PricingRateInput): Promise<RateV4Postage | Error>; | ||
export {}; |
@@ -27,4 +27,4 @@ "use strict"; | ||
response = (await request_1.default("RateV4", "RateV4", "Package", this.config, parameters)); | ||
if (response && response.Postage) { | ||
return response.Postage; | ||
if (response && response.Package) { | ||
return response.Package.Postage; | ||
} | ||
@@ -31,0 +31,0 @@ throw new Error("Can't find result"); |
@@ -13,4 +13,4 @@ import verify from "./address-validate"; | ||
export interface Config { | ||
properCase: boolean; | ||
staging: boolean; | ||
properCase?: boolean; | ||
staging?: boolean; | ||
userId: string; | ||
@@ -17,0 +17,0 @@ } |
@@ -5,3 +5,3 @@ { | ||
"description": "API wrapper for the USPS Web-Tools, with Promises!", | ||
"version": "3.0.0-beta.1", | ||
"version": "3.0.0-beta.2", | ||
"main": "./dist/usps.js", | ||
@@ -8,0 +8,0 @@ "types": "./dist/usps.d.ts", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
600
0.5%1
-50%26436
-0.77%