@shipengine/connect-carrier-api 4.31.0-beta → 4.31.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/lib/models/index.d.ts +0 -3
- package/lib/models/index.js +0 -3
- package/lib/models/index.js.map +1 -1
- package/lib/models/native-rating/implementation-type.d.ts +3 -0
- package/lib/models/native-rating/implementation-type.js.map +1 -1
- package/lib/models/native-rating/rating-context.d.ts +11 -1
- package/lib/models/pickup/shipped-products-schema.js +0 -2
- package/lib/models/pickup/shipped-products-schema.js.map +1 -1
- package/lib/models/pickup/shipped-products.d.ts +0 -3
- package/lib/models/pickup/shipped-products.js +0 -2
- package/lib/models/pickup/shipped-products.js.map +1 -1
- package/lib/models/products.d.ts +0 -3
- package/lib/models/products.js +0 -2
- package/lib/models/products.js.map +1 -1
- package/package.json +1 -1
- package/spec.json +0 -34
- package/src/models/index.ts +0 -3
- package/src/models/native-rating/implementation-type.ts +3 -0
- package/src/models/native-rating/rating-context.ts +13 -1
- package/src/models/pickup/shipped-products-schema.ts +0 -2
- package/src/models/pickup/shipped-products.ts +0 -3
- package/src/models/products.ts +0 -3
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/models/cpsc-disclaim-code.d.ts +0 -4
- package/lib/models/cpsc-disclaim-code.js +0 -9
- package/lib/models/cpsc-disclaim-code.js.map +0 -1
- package/lib/models/cpsc-disclaim-schema.d.ts +0 -2
- package/lib/models/cpsc-disclaim-schema.js +0 -14
- package/lib/models/cpsc-disclaim-schema.js.map +0 -1
- package/lib/models/cpsc-disclaim.d.ts +0 -10
- package/lib/models/cpsc-disclaim.js +0 -14
- package/lib/models/cpsc-disclaim.js.map +0 -1
- package/src/models/cpsc-disclaim-code.ts +0 -4
- package/src/models/cpsc-disclaim-schema.ts +0 -10
- package/src/models/cpsc-disclaim.ts +0 -11
package/lib/models/index.d.ts
CHANGED
|
@@ -7,9 +7,6 @@ export * from './billing';
|
|
|
7
7
|
export * from './confirmation-types';
|
|
8
8
|
export * from './cpsc-certificate';
|
|
9
9
|
export * from './cpsc-certificate-schema';
|
|
10
|
-
export * from './cpsc-disclaim';
|
|
11
|
-
export * from './cpsc-disclaim-code';
|
|
12
|
-
export * from './cpsc-disclaim-schema';
|
|
13
10
|
export * from './currency-schema';
|
|
14
11
|
export * from './currency';
|
|
15
12
|
export * from './customs';
|
package/lib/models/index.js
CHANGED
|
@@ -10,9 +10,6 @@ tslib_1.__exportStar(require("./billing"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./confirmation-types"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./cpsc-certificate"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./cpsc-certificate-schema"), exports);
|
|
13
|
-
tslib_1.__exportStar(require("./cpsc-disclaim"), exports);
|
|
14
|
-
tslib_1.__exportStar(require("./cpsc-disclaim-code"), exports);
|
|
15
|
-
tslib_1.__exportStar(require("./cpsc-disclaim-schema"), exports);
|
|
16
13
|
tslib_1.__exportStar(require("./currency-schema"), exports);
|
|
17
14
|
tslib_1.__exportStar(require("./currency"), exports);
|
|
18
15
|
tslib_1.__exportStar(require("./customs"), exports);
|
package/lib/models/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,6DAAmC;AACnC,0DAAgC;AAChC,6DAAmC;AACnC,gEAAsC;AACtC,oDAA0B;AAC1B,+DAAqC;AACrC,6DAAmC;AACnC,oEAA0C;AAC1C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";;;AAAA,sDAA4B;AAC5B,6DAAmC;AACnC,0DAAgC;AAChC,6DAAmC;AACnC,gEAAsC;AACtC,oDAA0B;AAC1B,+DAAqC;AACrC,6DAAmC;AACnC,oEAA0C;AAC1C,4DAAkC;AAClC,qDAA2B;AAC3B,oDAA0B;AAC1B,kEAAwC;AACxC,2DAAiC;AACjC,sDAA4B;AAC5B,mDAAyB;AACzB,8DAAoC;AACpC,8DAAoC;AACpC,uDAA6B;AAC7B,yEAA+C;AAC/C,kEAAwC;AACxC,gEAAsC;AACtC,mDAAyB;AACzB,sDAA4B;AAC5B,iFAAuD;AACvD,0DAAgC;AAChC,oDAA0B;AAC1B,mDAAyB;AACzB,kDAAwB;AACxB,yDAA+B;AAC/B,yDAA+B;AAC/B,qEAA2C;AAC3C,8DAAoC;AACpC,kDAAwB;AACxB,+DAAqC;AACrC,wDAA8B;AAC9B,qDAA2B;AAC3B,kDAAwB;AACxB,oDAA0B;AAC1B,qEAA2C;AAC3C,kEAAwC"}
|
|
@@ -24,6 +24,9 @@ export interface RatingCarrier {
|
|
|
24
24
|
* @returns List of rates for the given shipments
|
|
25
25
|
*/
|
|
26
26
|
rateShipments: (context: RatingContext, shipment: ShipmentAndId[]) => Promise<RateResultsAndId[]>;
|
|
27
|
+
/** Optionally pre-populate caches before serving traffic.
|
|
28
|
+
* Presence of this export opts a carrier into pre-warming. */
|
|
29
|
+
warmup?: (context: RatingContext) => Promise<void>;
|
|
27
30
|
}
|
|
28
31
|
/** Signify a validation error from the carrier */
|
|
29
32
|
export declare class CarrierValidationError extends Error {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"implementation-type.js","sourceRoot":"","sources":["../../../src/models/native-rating/implementation-type.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"implementation-type.js","sourceRoot":"","sources":["../../../src/models/native-rating/implementation-type.ts"],"names":[],"mappings":";;;AAkCA,kDAAkD;AAClD,MAAa,sBAAuB,SAAQ,KAAK;CAAG;AAApD,wDAAoD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from 'winston';
|
|
2
|
-
import { GetVariables } from './get-variables';
|
|
2
|
+
import { GetVariables, GetVariableResults } from './get-variables';
|
|
3
3
|
import { GetRates } from './get-rates';
|
|
4
4
|
import { GetZone } from './get-zone';
|
|
5
5
|
/** Rates request context */
|
|
@@ -12,4 +12,14 @@ export interface RatingContext {
|
|
|
12
12
|
getZone: GetZone;
|
|
13
13
|
/** Logger that implementers can use */
|
|
14
14
|
log: Logger;
|
|
15
|
+
/** Fetch all variables for the active rate card in a single query.
|
|
16
|
+
* Present only for published requests. Used by bundles to pre-warm
|
|
17
|
+
* their variable cache on startup.
|
|
18
|
+
* Unlike getVariables, which omits keys that have no stored value,
|
|
19
|
+
* this returns every variable key in the rate card. */
|
|
20
|
+
getAllVariables?: () => Promise<GetVariableResults>;
|
|
21
|
+
/** Version identifier of the currently published rate card.
|
|
22
|
+
* Present only for published requests. Used by bundles to invalidate
|
|
23
|
+
* their cache when a new rate card is published. */
|
|
24
|
+
rateCardVersion?: string;
|
|
15
25
|
}
|
|
@@ -7,7 +7,6 @@ const connect_carrier_api_1 = require("@shipengine/connect-carrier-api");
|
|
|
7
7
|
const weight_details_schema_1 = require("../units/weight-details-schema");
|
|
8
8
|
const manufacturer_product_identifier_type_1 = require("../manufacturer-product-identifier-type");
|
|
9
9
|
const cpsc_certificate_schema_1 = require("../cpsc-certificate-schema");
|
|
10
|
-
const cpsc_disclaim_schema_1 = require("../cpsc-disclaim-schema");
|
|
11
10
|
exports.ShippedProductsSchema = joi_1.default.object({
|
|
12
11
|
description: joi_1.default.string().optional(),
|
|
13
12
|
quantity: joi_1.default.number().optional(),
|
|
@@ -27,6 +26,5 @@ exports.ShippedProductsSchema = joi_1.default.object({
|
|
|
27
26
|
manufacturer_ns_product_id: joi_1.default.string().optional(),
|
|
28
27
|
dangerous_goods: joi_1.default.object().optional(),
|
|
29
28
|
cpsc_certificates: joi_1.default.array().items(cpsc_certificate_schema_1.CpscCertificateSchema).optional(),
|
|
30
|
-
cpsc_disclaim: cpsc_disclaim_schema_1.CpscDisclaimSchema.optional(),
|
|
31
29
|
});
|
|
32
30
|
//# sourceMappingURL=shipped-products-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipped-products-schema.js","sourceRoot":"","sources":["../../../src/models/pickup/shipped-products-schema.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,yEAAiE;AACjE,0EAAqE;AACrE,kGAA4F;AAC5F,wEAAmE;
|
|
1
|
+
{"version":3,"file":"shipped-products-schema.js","sourceRoot":"","sources":["../../../src/models/pickup/shipped-products-schema.ts"],"names":[],"mappings":";;;;AAAA,sDAAsB;AACtB,yEAAiE;AACjE,0EAAqE;AACrE,kGAA4F;AAC5F,wEAAmE;AAEtD,QAAA,qBAAqB,GAAG,aAAG,CAAC,MAAM,CAAC;IAC9C,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,KAAK,EAAE,oCAAc,CAAC,QAAQ,EAAE;IAChC,iBAAiB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC1C,sBAAsB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/C,GAAG,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,eAAe,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,WAAW,EAAE,2CAAmB,CAAC,QAAQ,EAAE;IAC3C,WAAW,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,4BAA4B,EAAE,aAAG,CAAC,MAAM,EAAE;SACvC,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,wEAAiC,CAAC,CAAC;SAC1D,QAAQ,EAAE;IACb,uBAAuB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChD,0BAA0B,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnD,eAAe,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACxC,iBAAiB,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,+CAAqB,CAAC,CAAC,QAAQ,EAAE;CACvE,CAAC,CAAC"}
|
|
@@ -2,7 +2,6 @@ import { Currency, WeightDetails } from '@shipengine/connect-carrier-api';
|
|
|
2
2
|
import { DangerousGoods } from '../dangerous-good/dangerous-goods';
|
|
3
3
|
import { ManufacturerProductIdentifierType } from '../manufacturer-product-identifier-type';
|
|
4
4
|
import { CpscCertificate } from '../cpsc-certificate';
|
|
5
|
-
import { CpscDisclaim } from '../cpsc-disclaim';
|
|
6
5
|
/** @description Basic structure for a product from a shipped shipment*/
|
|
7
6
|
export declare class ShippedProducts {
|
|
8
7
|
/** @description A user specified free form string describing this customs item. If the field is absent the user has not specified a description */
|
|
@@ -37,8 +36,6 @@ export declare class ShippedProducts {
|
|
|
37
36
|
dangerous_goods?: DangerousGoods[];
|
|
38
37
|
/** @description CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference data for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set. */
|
|
39
38
|
cpsc_certificates?: CpscCertificate[];
|
|
40
|
-
/** @description CPSC (U.S. Consumer Product Safety Commission) eFiling Disclaim data for products that are not subject to CPSC regulation. */
|
|
41
|
-
cpsc_disclaim?: CpscDisclaim;
|
|
42
39
|
/** @description Additional details for product. */
|
|
43
40
|
[key: string]: any;
|
|
44
41
|
}
|
|
@@ -35,8 +35,6 @@ class ShippedProducts {
|
|
|
35
35
|
dangerous_goods;
|
|
36
36
|
/** @description CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference data for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set. */
|
|
37
37
|
cpsc_certificates;
|
|
38
|
-
/** @description CPSC (U.S. Consumer Product Safety Commission) eFiling Disclaim data for products that are not subject to CPSC regulation. */
|
|
39
|
-
cpsc_disclaim;
|
|
40
38
|
}
|
|
41
39
|
exports.ShippedProducts = ShippedProducts;
|
|
42
40
|
//# sourceMappingURL=shipped-products.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shipped-products.js","sourceRoot":"","sources":["../../../src/models/pickup/shipped-products.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"shipped-products.js","sourceRoot":"","sources":["../../../src/models/pickup/shipped-products.ts"],"names":[],"mappings":";;;AAKA,wEAAwE;AACxE,MAAa,eAAe;IAC1B,mJAAmJ;IACnJ,WAAW,CAAU;IACrB,4GAA4G;IAC5G,QAAQ,CAAU;IAClB,mKAAmK;IACnK,KAAK,CAAY;IACjB,sFAAsF;IACtF,iBAAiB,CAAU;IAC3B,8GAA8G;IAC9G,sBAAsB,CAAU;IAChC,oGAAoG;IACpG,GAAG,CAAU;IACb,gHAAgH;IAChH,eAAe,CAAU;IACzB,sEAAsE;IACtE,WAAW,CAAiB;IAC5B,0LAA0L;IAC1L,WAAW,CAAU;IACrB,oHAAoH;IACpH,QAAQ,CAAU;IAClB,yNAAyN;IACzN,QAAQ,CAAU;IAClB,wMAAwM;IACxM,4BAA4B,CAAqC;IACjE,8DAA8D;IAC9D,uBAAuB,CAAU;IACjC,iKAAiK;IACjK,0BAA0B,CAAU;IACpC,qGAAqG;IACrG,eAAe,CAAoB;IACnC,wLAAwL;IACxL,iBAAiB,CAAqB;CAGvC;AAnCD,0CAmCC"}
|
package/lib/models/products.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { DangerousGoods } from './dangerous-good/dangerous-goods';
|
|
|
4
4
|
import { UnitOfMeasureTypes } from './customs/unit-of-measure-types';
|
|
5
5
|
import { ManufacturerProductIdentifierType } from './manufacturer-product-identifier-type';
|
|
6
6
|
import { CpscCertificate } from './cpsc-certificate';
|
|
7
|
-
import { CpscDisclaim } from './cpsc-disclaim';
|
|
8
7
|
/** @description Basic structure for a product */
|
|
9
8
|
export declare class Products {
|
|
10
9
|
/** @description A user specified free form string describing this customs item. If the field is absent the user has not specified a description */
|
|
@@ -41,8 +40,6 @@ export declare class Products {
|
|
|
41
40
|
manufacturer_ns_product_id?: string;
|
|
42
41
|
/** @description CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference data for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set. */
|
|
43
42
|
cpsc_certificates?: CpscCertificate[];
|
|
44
|
-
/** @description CPSC (U.S. Consumer Product Safety Commission) eFiling Disclaim data for products that are not subject to CPSC regulation. */
|
|
45
|
-
cpsc_disclaim?: CpscDisclaim;
|
|
46
43
|
/** @description Additional details for product. */
|
|
47
44
|
[key: string]: any;
|
|
48
45
|
}
|
package/lib/models/products.js
CHANGED
|
@@ -37,8 +37,6 @@ class Products {
|
|
|
37
37
|
manufacturer_ns_product_id;
|
|
38
38
|
/** @description CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference data for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set. */
|
|
39
39
|
cpsc_certificates;
|
|
40
|
-
/** @description CPSC (U.S. Consumer Product Safety Commission) eFiling Disclaim data for products that are not subject to CPSC regulation. */
|
|
41
|
-
cpsc_disclaim;
|
|
42
40
|
}
|
|
43
41
|
exports.Products = Products;
|
|
44
42
|
//# sourceMappingURL=products.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/models/products.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"products.js","sourceRoot":"","sources":["../../src/models/products.ts"],"names":[],"mappings":";;;AAOA,iDAAiD;AACjD,MAAa,QAAQ;IACnB,mJAAmJ;IACnJ,WAAW,CAAU;IACrB,4GAA4G;IAC5G,QAAQ,CAAU;IAClB,mKAAmK;IACnK,KAAK,CAAY;IACjB,sFAAsF;IACtF,iBAAiB,CAAU;IAC3B,8GAA8G;IAC9G,sBAAsB,CAAU;IAChC,2EAA2E;IAC3E,eAAe,CAAsB;IACrC,oGAAoG;IACpG,GAAG,CAAU;IACb,gHAAgH;IAChH,eAAe,CAAU;IACzB,sEAAsE;IACtE,WAAW,CAAiB;IAC5B,0LAA0L;IAC1L,WAAW,CAAU;IACrB,oHAAoH;IACpH,QAAQ,CAAU;IAClB,yNAAyN;IACzN,QAAQ,CAAU;IAClB,qGAAqG;IACrG,eAAe,CAAoB;IACnC,wMAAwM;IACxM,4BAA4B,CAAqC;IACjE,8DAA8D;IAC9D,uBAAuB,CAAU;IACjC,iKAAiK;IACjK,0BAA0B,CAAU;IACpC,wLAAwL;IACxL,iBAAiB,CAAqB;CAGvC;AArCD,4BAqCC"}
|
package/package.json
CHANGED
package/spec.json
CHANGED
|
@@ -1422,26 +1422,6 @@
|
|
|
1422
1422
|
],
|
|
1423
1423
|
"type": "string"
|
|
1424
1424
|
},
|
|
1425
|
-
"CpscDisclaim": {
|
|
1426
|
-
"type": "object",
|
|
1427
|
-
"properties": {
|
|
1428
|
-
"disclaim_code": {
|
|
1429
|
-
"$ref": "#/components/schemas/DisclaimCode"
|
|
1430
|
-
},
|
|
1431
|
-
"intended_use_code": {
|
|
1432
|
-
"type": "string",
|
|
1433
|
-
"description": "The intended use code for the product. Maximum length of 16 characters.",
|
|
1434
|
-
"nullable": true
|
|
1435
|
-
},
|
|
1436
|
-
"intended_use_description": {
|
|
1437
|
-
"type": "string",
|
|
1438
|
-
"description": "The intended use description for the product. Maximum length of 100 characters.",
|
|
1439
|
-
"nullable": true
|
|
1440
|
-
}
|
|
1441
|
-
},
|
|
1442
|
-
"additionalProperties": false,
|
|
1443
|
-
"description": "CPSC (U.S. Consumer Product Safety Commission) eFiling Disclaim data.\r\nUsed when a product is exempt from CPSC certificate requirements."
|
|
1444
|
-
},
|
|
1445
1425
|
"CpscCertificate": {
|
|
1446
1426
|
"type": "object",
|
|
1447
1427
|
"properties": {
|
|
@@ -2411,14 +2391,6 @@
|
|
|
2411
2391
|
"additionalProperties": false,
|
|
2412
2392
|
"description": "This model represents the measurements for dimensions."
|
|
2413
2393
|
},
|
|
2414
|
-
"DisclaimCode": {
|
|
2415
|
-
"enum": [
|
|
2416
|
-
"A",
|
|
2417
|
-
"B"
|
|
2418
|
-
],
|
|
2419
|
-
"type": "string",
|
|
2420
|
-
"description": "The CPSC disclaim code indicating the reason a product is exempt from CPSC certificate requirements."
|
|
2421
|
-
},
|
|
2422
2394
|
"DisplayScheme": {
|
|
2423
2395
|
"enum": [
|
|
2424
2396
|
"label",
|
|
@@ -4015,9 +3987,6 @@
|
|
|
4015
3987
|
},
|
|
4016
3988
|
"description": "CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference\r\ndata for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set.",
|
|
4017
3989
|
"nullable": true
|
|
4018
|
-
},
|
|
4019
|
-
"cpsc_disclaim": {
|
|
4020
|
-
"$ref": "#/components/schemas/CpscDisclaim"
|
|
4021
3990
|
}
|
|
4022
3991
|
},
|
|
4023
3992
|
"additionalProperties": { },
|
|
@@ -4903,9 +4872,6 @@
|
|
|
4903
4872
|
},
|
|
4904
4873
|
"description": "CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference\r\ndata for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set.",
|
|
4905
4874
|
"nullable": true
|
|
4906
|
-
},
|
|
4907
|
-
"cpsc_disclaim": {
|
|
4908
|
-
"$ref": "#/components/schemas/CpscDisclaim"
|
|
4909
4875
|
}
|
|
4910
4876
|
},
|
|
4911
4877
|
"additionalProperties": { },
|
package/src/models/index.ts
CHANGED
|
@@ -7,9 +7,6 @@ export * from './billing';
|
|
|
7
7
|
export * from './confirmation-types';
|
|
8
8
|
export * from './cpsc-certificate';
|
|
9
9
|
export * from './cpsc-certificate-schema';
|
|
10
|
-
export * from './cpsc-disclaim';
|
|
11
|
-
export * from './cpsc-disclaim-code';
|
|
12
|
-
export * from './cpsc-disclaim-schema';
|
|
13
10
|
export * from './currency-schema';
|
|
14
11
|
export * from './currency';
|
|
15
12
|
export * from './customs';
|
|
@@ -27,6 +27,9 @@ export interface RatingCarrier {
|
|
|
27
27
|
* @returns List of rates for the given shipments
|
|
28
28
|
*/
|
|
29
29
|
rateShipments: (context: RatingContext, shipment: ShipmentAndId[]) => Promise<RateResultsAndId[]>;
|
|
30
|
+
/** Optionally pre-populate caches before serving traffic.
|
|
31
|
+
* Presence of this export opts a carrier into pre-warming. */
|
|
32
|
+
warmup?: (context: RatingContext) => Promise<void>;
|
|
30
33
|
}
|
|
31
34
|
|
|
32
35
|
/** Signify a validation error from the carrier */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Logger } from 'winston';
|
|
2
|
-
import { GetVariables } from './get-variables';
|
|
2
|
+
import { GetVariables, GetVariableResults } from './get-variables';
|
|
3
3
|
import { GetRates } from './get-rates';
|
|
4
4
|
import { GetZone } from './get-zone';
|
|
5
5
|
|
|
@@ -16,4 +16,16 @@ export interface RatingContext {
|
|
|
16
16
|
|
|
17
17
|
/** Logger that implementers can use */
|
|
18
18
|
log: Logger;
|
|
19
|
+
|
|
20
|
+
/** Fetch all variables for the active rate card in a single query.
|
|
21
|
+
* Present only for published requests. Used by bundles to pre-warm
|
|
22
|
+
* their variable cache on startup.
|
|
23
|
+
* Unlike getVariables, which omits keys that have no stored value,
|
|
24
|
+
* this returns every variable key in the rate card. */
|
|
25
|
+
getAllVariables?: () => Promise<GetVariableResults>;
|
|
26
|
+
|
|
27
|
+
/** Version identifier of the currently published rate card.
|
|
28
|
+
* Present only for published requests. Used by bundles to invalidate
|
|
29
|
+
* their cache when a new rate card is published. */
|
|
30
|
+
rateCardVersion?: string;
|
|
19
31
|
}
|
|
@@ -3,7 +3,6 @@ import { CurrencySchema } from '@shipengine/connect-carrier-api';
|
|
|
3
3
|
import { WeightDetailsSchema } from '../units/weight-details-schema';
|
|
4
4
|
import { ManufacturerProductIdentifierType } from '../manufacturer-product-identifier-type';
|
|
5
5
|
import { CpscCertificateSchema } from '../cpsc-certificate-schema';
|
|
6
|
-
import { CpscDisclaimSchema } from '../cpsc-disclaim-schema';
|
|
7
6
|
|
|
8
7
|
export const ShippedProductsSchema = Joi.object({
|
|
9
8
|
description: Joi.string().optional(),
|
|
@@ -24,5 +23,4 @@ export const ShippedProductsSchema = Joi.object({
|
|
|
24
23
|
manufacturer_ns_product_id: Joi.string().optional(),
|
|
25
24
|
dangerous_goods: Joi.object().optional(),
|
|
26
25
|
cpsc_certificates: Joi.array().items(CpscCertificateSchema).optional(),
|
|
27
|
-
cpsc_disclaim: CpscDisclaimSchema.optional(),
|
|
28
26
|
});
|
|
@@ -2,7 +2,6 @@ import { Currency, WeightDetails } from '@shipengine/connect-carrier-api';
|
|
|
2
2
|
import { DangerousGoods } from '../dangerous-good/dangerous-goods';
|
|
3
3
|
import { ManufacturerProductIdentifierType } from '../manufacturer-product-identifier-type';
|
|
4
4
|
import { CpscCertificate } from '../cpsc-certificate';
|
|
5
|
-
import { CpscDisclaim } from '../cpsc-disclaim';
|
|
6
5
|
|
|
7
6
|
/** @description Basic structure for a product from a shipped shipment*/
|
|
8
7
|
export class ShippedProducts {
|
|
@@ -38,8 +37,6 @@ export class ShippedProducts {
|
|
|
38
37
|
dangerous_goods?: DangerousGoods[];
|
|
39
38
|
/** @description CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference data for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set. */
|
|
40
39
|
cpsc_certificates?: CpscCertificate[];
|
|
41
|
-
/** @description CPSC (U.S. Consumer Product Safety Commission) eFiling Disclaim data for products that are not subject to CPSC regulation. */
|
|
42
|
-
cpsc_disclaim?: CpscDisclaim;
|
|
43
40
|
/** @description Additional details for product. */
|
|
44
41
|
[key: string]: any;
|
|
45
42
|
}
|
package/src/models/products.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { DangerousGoods } from './dangerous-good/dangerous-goods';
|
|
|
4
4
|
import { UnitOfMeasureTypes } from './customs/unit-of-measure-types';
|
|
5
5
|
import { ManufacturerProductIdentifierType } from './manufacturer-product-identifier-type';
|
|
6
6
|
import { CpscCertificate } from './cpsc-certificate';
|
|
7
|
-
import { CpscDisclaim } from './cpsc-disclaim';
|
|
8
7
|
|
|
9
8
|
/** @description Basic structure for a product */
|
|
10
9
|
export class Products {
|
|
@@ -42,8 +41,6 @@ export class Products {
|
|
|
42
41
|
manufacturer_ns_product_id?: string;
|
|
43
42
|
/** @description CPSC (U.S. Consumer Product Safety Commission) Certificate of Compliance reference data for U.S. CPSC eFiling. Supports the Reference (Abbreviated) PGA Message Set. */
|
|
44
43
|
cpsc_certificates?: CpscCertificate[];
|
|
45
|
-
/** @description CPSC (U.S. Consumer Product Safety Commission) eFiling Disclaim data for products that are not subject to CPSC regulation. */
|
|
46
|
-
cpsc_disclaim?: CpscDisclaim;
|
|
47
44
|
/** @description Additional details for product. */
|
|
48
45
|
[key: string]: any;
|
|
49
46
|
}
|