@flexops/sdk 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -1
- package/dist/index.d.mts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +4 -0
- package/dist/index.mjs +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -159,7 +159,10 @@ const status = await client.shipping.getBatchStatus(batch.data!.jobId);
|
|
|
159
159
|
|
|
160
160
|
One order shipped in several boxes with the same carrier and service. Each box gets its own label;
|
|
161
161
|
a box that fails does not stop the others. Multi-package labels cannot carry HAZMAT: send
|
|
162
|
-
`HazmatClassification.None` or leave `hazmatClassification` out.
|
|
162
|
+
`HazmatClassification.None` or leave `hazmatClassification` out. `maximumPostageAmount` is required: the most the
|
|
163
|
+
whole shipment may cost in USD (positive, at most two decimals). The Gateway refuses to buy a box that would take the
|
|
164
|
+
total above it (`PriceCeilingExceeded`; once the amount is used up the remaining boxes report `PriceCeilingReached`),
|
|
165
|
+
and a request without a valid ceiling is 400 `ApprovalRequired`.
|
|
163
166
|
|
|
164
167
|
```typescript
|
|
165
168
|
import { FlexOpsError, HazmatClassification } from '@flexops/sdk';
|
|
@@ -171,6 +174,7 @@ try {
|
|
|
171
174
|
carrierCode: 'USPS',
|
|
172
175
|
serviceCode: 'PRIORITY',
|
|
173
176
|
hazmatClassification: HazmatClassification.None,
|
|
177
|
+
maximumPostageAmount: 25, // required: the most the whole shipment may cost, in USD
|
|
174
178
|
packages: [
|
|
175
179
|
{ weightInOunces: 16, lengthInInches: 10, widthInInches: 8, heightInInches: 4, packageReference: 'Box 1 of 2' },
|
|
176
180
|
{ weightInOunces: 8, lengthInInches: 6, widthInInches: 6, heightInInches: 6, packageReference: 'Box 2 of 2' },
|
package/dist/index.d.mts
CHANGED
|
@@ -701,6 +701,14 @@ interface MultiPackageShipmentRequest {
|
|
|
701
701
|
* (400 `HazmatNotSupported`); buy those labels one at a time with `shipping.createLabel`.
|
|
702
702
|
*/
|
|
703
703
|
hazmatClassification?: typeof HazmatClassification.None;
|
|
704
|
+
/**
|
|
705
|
+
* The most the whole shipment may cost, in USD: required, positive, with at most two decimals. It covers the
|
|
706
|
+
* postage of every box. The Gateway refuses to buy a box that would take the total above it, so you never pay
|
|
707
|
+
* more: a box priced above what is left reports `PriceCeilingExceeded`, and once the amount is used up the
|
|
708
|
+
* remaining boxes report `PriceCeilingReached` and are not bought. Boxes already bought stay bought. A missing
|
|
709
|
+
* or invalid value is 400 `ApprovalRequired`. It is part of the request the `Idempotency-Key` identifies.
|
|
710
|
+
*/
|
|
711
|
+
maximumPostageAmount: number;
|
|
704
712
|
/** 1 to 99 boxes. */
|
|
705
713
|
packages: MultiPackageDetail[];
|
|
706
714
|
}
|
|
@@ -1255,6 +1263,10 @@ declare class ShippingResource {
|
|
|
1255
1263
|
* a label may exist: both throw a `FlexOpsError` whose `data` is the `MultiPackageShipmentResponse`.
|
|
1256
1264
|
* After `OutcomeUnknown`, check the order before buying again.
|
|
1257
1265
|
*
|
|
1266
|
+
* `maximumPostageAmount` is required: the most the whole shipment may cost in USD. The Gateway refuses to buy
|
|
1267
|
+
* any box that would take the total above it (that box reports `PriceCeilingExceeded`; boxes after the
|
|
1268
|
+
* ceiling is used up report `PriceCeilingReached`), and a request without a valid one is 400 `ApprovalRequired`.
|
|
1269
|
+
*
|
|
1258
1270
|
* `hazmatClassification` accepts only `HazmatClassification.None` or nothing. Pass a stable
|
|
1259
1271
|
* `idempotencyKey` to retry safely across processes; otherwise one is generated for this call.
|
|
1260
1272
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -701,6 +701,14 @@ interface MultiPackageShipmentRequest {
|
|
|
701
701
|
* (400 `HazmatNotSupported`); buy those labels one at a time with `shipping.createLabel`.
|
|
702
702
|
*/
|
|
703
703
|
hazmatClassification?: typeof HazmatClassification.None;
|
|
704
|
+
/**
|
|
705
|
+
* The most the whole shipment may cost, in USD: required, positive, with at most two decimals. It covers the
|
|
706
|
+
* postage of every box. The Gateway refuses to buy a box that would take the total above it, so you never pay
|
|
707
|
+
* more: a box priced above what is left reports `PriceCeilingExceeded`, and once the amount is used up the
|
|
708
|
+
* remaining boxes report `PriceCeilingReached` and are not bought. Boxes already bought stay bought. A missing
|
|
709
|
+
* or invalid value is 400 `ApprovalRequired`. It is part of the request the `Idempotency-Key` identifies.
|
|
710
|
+
*/
|
|
711
|
+
maximumPostageAmount: number;
|
|
704
712
|
/** 1 to 99 boxes. */
|
|
705
713
|
packages: MultiPackageDetail[];
|
|
706
714
|
}
|
|
@@ -1255,6 +1263,10 @@ declare class ShippingResource {
|
|
|
1255
1263
|
* a label may exist: both throw a `FlexOpsError` whose `data` is the `MultiPackageShipmentResponse`.
|
|
1256
1264
|
* After `OutcomeUnknown`, check the order before buying again.
|
|
1257
1265
|
*
|
|
1266
|
+
* `maximumPostageAmount` is required: the most the whole shipment may cost in USD. The Gateway refuses to buy
|
|
1267
|
+
* any box that would take the total above it (that box reports `PriceCeilingExceeded`; boxes after the
|
|
1268
|
+
* ceiling is used up report `PriceCeilingReached`), and a request without a valid one is 400 `ApprovalRequired`.
|
|
1269
|
+
*
|
|
1258
1270
|
* `hazmatClassification` accepts only `HazmatClassification.None` or nothing. Pass a stable
|
|
1259
1271
|
* `idempotencyKey` to retry safely across processes; otherwise one is generated for this call.
|
|
1260
1272
|
*/
|
package/dist/index.js
CHANGED
|
@@ -528,6 +528,10 @@ var ShippingResource = class {
|
|
|
528
528
|
* a label may exist: both throw a `FlexOpsError` whose `data` is the `MultiPackageShipmentResponse`.
|
|
529
529
|
* After `OutcomeUnknown`, check the order before buying again.
|
|
530
530
|
*
|
|
531
|
+
* `maximumPostageAmount` is required: the most the whole shipment may cost in USD. The Gateway refuses to buy
|
|
532
|
+
* any box that would take the total above it (that box reports `PriceCeilingExceeded`; boxes after the
|
|
533
|
+
* ceiling is used up report `PriceCeilingReached`), and a request without a valid one is 400 `ApprovalRequired`.
|
|
534
|
+
*
|
|
531
535
|
* `hazmatClassification` accepts only `HazmatClassification.None` or nothing. Pass a stable
|
|
532
536
|
* `idempotencyKey` to retry safely across processes; otherwise one is generated for this call.
|
|
533
537
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -480,6 +480,10 @@ var ShippingResource = class {
|
|
|
480
480
|
* a label may exist: both throw a `FlexOpsError` whose `data` is the `MultiPackageShipmentResponse`.
|
|
481
481
|
* After `OutcomeUnknown`, check the order before buying again.
|
|
482
482
|
*
|
|
483
|
+
* `maximumPostageAmount` is required: the most the whole shipment may cost in USD. The Gateway refuses to buy
|
|
484
|
+
* any box that would take the total above it (that box reports `PriceCeilingExceeded`; boxes after the
|
|
485
|
+
* ceiling is used up report `PriceCeilingReached`), and a request without a valid one is 400 `ApprovalRequired`.
|
|
486
|
+
*
|
|
483
487
|
* `hazmatClassification` accepts only `HazmatClassification.None` or nothing. Pass a stable
|
|
484
488
|
* `idempotencyKey` to retry safely across processes; otherwise one is generated for this call.
|
|
485
489
|
*/
|
package/package.json
CHANGED