@shipengine/connect-carrier-api 4.32.0 → 4.34.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/app/carrier-app-definition.d.ts +7 -2
- package/lib/app/constants.d.ts +1 -0
- package/lib/app/constants.js +1 -0
- package/lib/app/constants.js.map +1 -1
- package/lib/app/create-endpoint-mapping.js +1 -0
- package/lib/app/create-endpoint-mapping.js.map +1 -1
- package/lib/models/cpsc/cpsc-certificate-schema.js.map +1 -0
- package/lib/models/cpsc/cpsc-certificate.js.map +1 -0
- package/lib/models/cpsc/cpsc-disclaim-schema.d.ts +2 -0
- package/lib/models/cpsc/cpsc-disclaim-schema.js +14 -0
- package/lib/models/cpsc/cpsc-disclaim-schema.js.map +1 -0
- package/lib/models/cpsc/cpsc-disclaim.d.ts +10 -0
- package/lib/models/cpsc/cpsc-disclaim.js +14 -0
- package/lib/models/cpsc/cpsc-disclaim.js.map +1 -0
- package/lib/models/cpsc/disclaim-code.d.ts +4 -0
- package/lib/models/cpsc/disclaim-code.js +9 -0
- package/lib/models/cpsc/disclaim-code.js.map +1 -0
- package/lib/models/cpsc/index.d.ts +5 -0
- package/lib/models/cpsc/index.js +9 -0
- package/lib/models/cpsc/index.js.map +1 -0
- package/lib/models/index.d.ts +1 -2
- package/lib/models/index.js +1 -2
- package/lib/models/index.js.map +1 -1
- package/lib/models/pickup/shipped-products-schema.js +3 -1
- package/lib/models/pickup/shipped-products-schema.js.map +1 -1
- package/lib/models/pickup/shipped-products.d.ts +4 -1
- package/lib/models/pickup/shipped-products.js +2 -0
- package/lib/models/pickup/shipped-products.js.map +1 -1
- package/lib/models/products.d.ts +4 -1
- package/lib/models/products.js +2 -0
- package/lib/models/products.js.map +1 -1
- package/lib/models/tracking/bulk-tracking-error.d.ts +7 -0
- package/lib/models/tracking/bulk-tracking-error.js +12 -0
- package/lib/models/tracking/bulk-tracking-error.js.map +1 -0
- package/lib/models/tracking/index.d.ts +1 -0
- package/lib/models/tracking/index.js +1 -0
- package/lib/models/tracking/index.js.map +1 -1
- package/lib/requests/bulk-tracking-request.d.ts +14 -0
- package/lib/requests/bulk-tracking-request.js +19 -0
- package/lib/requests/bulk-tracking-request.js.map +1 -0
- package/lib/requests/index.d.ts +1 -0
- package/lib/requests/index.js +1 -0
- package/lib/requests/index.js.map +1 -1
- package/lib/responses/bulk-tracking-response.d.ts +18 -0
- package/lib/responses/bulk-tracking-response.js +22 -0
- package/lib/responses/bulk-tracking-response.js.map +1 -0
- package/lib/responses/index.d.ts +1 -0
- package/lib/responses/index.js +1 -0
- package/lib/responses/index.js.map +1 -1
- package/package.json +1 -1
- package/spec.json +36 -0
- package/src/app/carrier-app-definition.ts +9 -0
- package/src/app/constants.ts +1 -0
- package/src/app/create-endpoint-mapping.ts +1 -0
- package/src/models/cpsc/cpsc-disclaim-schema.ts +10 -0
- package/src/models/cpsc/cpsc-disclaim.ts +11 -0
- package/src/models/cpsc/disclaim-code.ts +4 -0
- package/src/models/cpsc/index.ts +5 -0
- package/src/models/index.ts +1 -2
- package/src/models/pickup/shipped-products-schema.ts +3 -1
- package/src/models/pickup/shipped-products.ts +4 -1
- package/src/models/products.ts +4 -1
- package/src/models/tracking/bulk-tracking-error.ts +7 -0
- package/src/models/tracking/index.ts +1 -0
- package/src/requests/bulk-tracking-request.ts +16 -0
- package/src/requests/index.ts +1 -0
- package/src/responses/bulk-tracking-response.ts +20 -0
- package/src/responses/index.ts +1 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/models/cpsc-certificate-schema.js.map +0 -1
- package/lib/models/cpsc-certificate.js.map +0 -1
- /package/lib/models/{cpsc-certificate-schema.d.ts → cpsc/cpsc-certificate-schema.d.ts} +0 -0
- /package/lib/models/{cpsc-certificate-schema.js → cpsc/cpsc-certificate-schema.js} +0 -0
- /package/lib/models/{cpsc-certificate.d.ts → cpsc/cpsc-certificate.d.ts} +0 -0
- /package/lib/models/{cpsc-certificate.js → cpsc/cpsc-certificate.js} +0 -0
- /package/src/models/{cpsc-certificate-schema.ts → cpsc/cpsc-certificate-schema.ts} +0 -0
- /package/src/models/{cpsc-certificate.ts → cpsc/cpsc-certificate.ts} +0 -0
|
@@ -7,6 +7,7 @@ export const createEndpointMapping = (
|
|
|
7
7
|
): [Method, string, Handler | undefined][] => [
|
|
8
8
|
//TODO: Remove `Method.POST` from this and all other maps since they are ALL post
|
|
9
9
|
//TODO: Remove JOI validation from all endpoints and replace them with OpenAPI validation
|
|
10
|
+
[Method.POST, ApiEndpoints.BulkTrack, definition.BulkTrack],
|
|
10
11
|
[Method.POST, ApiEndpoints.CancelNotification, definition.CancelNotification],
|
|
11
12
|
[Method.POST, ApiEndpoints.CancelPickup, definition.CancelPickup],
|
|
12
13
|
[Method.POST, ApiEndpoints.CreateLabel, definition.CreateLabel],
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { DisclaimCode } from './disclaim-code';
|
|
3
|
+
|
|
4
|
+
export const CpscDisclaimSchema = Joi.object({
|
|
5
|
+
disclaim_code: Joi.string()
|
|
6
|
+
.valid(...Object.values(DisclaimCode))
|
|
7
|
+
.optional(),
|
|
8
|
+
intended_use_code: Joi.string().max(16).optional(),
|
|
9
|
+
intended_use_description: Joi.string().max(100).optional(),
|
|
10
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DisclaimCode } from './disclaim-code';
|
|
2
|
+
|
|
3
|
+
/** @description Object for CPSC disclaimer data, submitted when the shipment qualifies for a disclaim message instead of a full CPSC certificate of compliance. Note: Omit this object if the product requires CPSC certification. */
|
|
4
|
+
export class CpscDisclaim {
|
|
5
|
+
/** @description Code representing the CPSC declaration status. Accepted values: "A" - Product is not regulated by CPSC. "B" - Data is not required per CPSC. */
|
|
6
|
+
disclaim_code?: DisclaimCode;
|
|
7
|
+
/** @description A code from CBP's Intended Use Code list indicating the product's intended use. Must be submitted alongside any disclaim message. */
|
|
8
|
+
intended_use_code?: string;
|
|
9
|
+
/** @description Description of the product's intended use. If "For Other Use" (980.000) code is used, then a free text description of the intended use should be provided. */
|
|
10
|
+
intended_use_description?: string;
|
|
11
|
+
}
|
package/src/models/index.ts
CHANGED
|
@@ -5,8 +5,7 @@ export * from './cod-payment-type';
|
|
|
5
5
|
export * from './collect-on-delivery';
|
|
6
6
|
export * from './billing';
|
|
7
7
|
export * from './confirmation-types';
|
|
8
|
-
export * from './cpsc
|
|
9
|
-
export * from './cpsc-certificate-schema';
|
|
8
|
+
export * from './cpsc';
|
|
10
9
|
export * from './currency-schema';
|
|
11
10
|
export * from './currency';
|
|
12
11
|
export * from './customs';
|
|
@@ -2,7 +2,8 @@ import Joi from 'joi';
|
|
|
2
2
|
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
|
-
import { CpscCertificateSchema } from '../cpsc-certificate-schema';
|
|
5
|
+
import { CpscCertificateSchema } from '../cpsc/cpsc-certificate-schema';
|
|
6
|
+
import { CpscDisclaimSchema } from '../cpsc/cpsc-disclaim-schema';
|
|
6
7
|
|
|
7
8
|
export const ShippedProductsSchema = Joi.object({
|
|
8
9
|
description: Joi.string().optional(),
|
|
@@ -23,4 +24,5 @@ export const ShippedProductsSchema = Joi.object({
|
|
|
23
24
|
manufacturer_ns_product_id: Joi.string().optional(),
|
|
24
25
|
dangerous_goods: Joi.object().optional(),
|
|
25
26
|
cpsc_certificates: Joi.array().items(CpscCertificateSchema).optional(),
|
|
27
|
+
cpsc_disclaim: CpscDisclaimSchema.optional(),
|
|
26
28
|
});
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
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
|
-
import { CpscCertificate } from '../cpsc-certificate';
|
|
4
|
+
import { CpscCertificate } from '../cpsc/cpsc-certificate';
|
|
5
|
+
import { CpscDisclaim } from '../cpsc/cpsc-disclaim';
|
|
5
6
|
|
|
6
7
|
/** @description Basic structure for a product from a shipped shipment*/
|
|
7
8
|
export class ShippedProducts {
|
|
@@ -37,6 +38,8 @@ export class ShippedProducts {
|
|
|
37
38
|
dangerous_goods?: DangerousGoods[];
|
|
38
39
|
/** @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
40
|
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;
|
|
40
43
|
/** @description Additional details for product. */
|
|
41
44
|
[key: string]: any;
|
|
42
45
|
}
|
package/src/models/products.ts
CHANGED
|
@@ -3,7 +3,8 @@ import { Currency } from './currency';
|
|
|
3
3
|
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
|
-
import { CpscCertificate } from './cpsc-certificate';
|
|
6
|
+
import { CpscCertificate } from './cpsc/cpsc-certificate';
|
|
7
|
+
import { CpscDisclaim } from './cpsc/cpsc-disclaim';
|
|
7
8
|
|
|
8
9
|
/** @description Basic structure for a product */
|
|
9
10
|
export class Products {
|
|
@@ -41,6 +42,8 @@ export class Products {
|
|
|
41
42
|
manufacturer_ns_product_id?: string;
|
|
42
43
|
/** @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
44
|
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;
|
|
44
47
|
/** @description Additional details for product. */
|
|
45
48
|
[key: string]: any;
|
|
46
49
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** @description Error detail for a single item within a bulk tracking response */
|
|
2
|
+
export class BulkTrackingError {
|
|
3
|
+
/** @description A code identifying the type of error encountered while tracking this item */
|
|
4
|
+
code!: string;
|
|
5
|
+
/** @description A human readable description of the error */
|
|
6
|
+
message!: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseRequest } from './base-request';
|
|
2
|
+
import { TrackingIdentifier, TrackingAttribute } from '../models';
|
|
3
|
+
|
|
4
|
+
/** @description A single shipment to request tracking information for as part of a bulk tracking request */
|
|
5
|
+
export class BulkTrackingItem {
|
|
6
|
+
/** @description List of identifiers */
|
|
7
|
+
identifiers?: TrackingIdentifier[];
|
|
8
|
+
/** @description List of attributes */
|
|
9
|
+
attributes?: TrackingAttribute[];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/** @description Basic structure for a request to get tracking information for multiple shipments in a single call */
|
|
13
|
+
export class BulkTrackingRequest extends BaseRequest {
|
|
14
|
+
/** @description The shipments to retrieve tracking information for */
|
|
15
|
+
items!: BulkTrackingItem[];
|
|
16
|
+
}
|
package/src/requests/index.ts
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BaseResponse } from './base-response';
|
|
2
|
+
import { TrackingInfo } from '../models';
|
|
3
|
+
import { BulkTrackingError } from '../models/tracking/bulk-tracking-error';
|
|
4
|
+
|
|
5
|
+
/** @description Tracking result for a single item within a bulk tracking response */
|
|
6
|
+
export class BulkTrackingResultItem {
|
|
7
|
+
/** @description The carrier specific tracking identifier for this shipment */
|
|
8
|
+
tracking_number!: string;
|
|
9
|
+
/** @description Tracking information for this shipment, present when tracking succeeded */
|
|
10
|
+
tracking_info?: TrackingInfo;
|
|
11
|
+
/** @description Error detail for this shipment, present when tracking failed */
|
|
12
|
+
error?: BulkTrackingError;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/** @description Basic structure for a response to get tracking information for multiple shipments in a single call */
|
|
16
|
+
export class BulkTrackingResponse extends BaseResponse {
|
|
17
|
+
transaction_id!: string;
|
|
18
|
+
/** @description Per-item tracking results, in no guaranteed order relative to the request's items */
|
|
19
|
+
results!: BulkTrackingResultItem[];
|
|
20
|
+
}
|
package/src/responses/index.ts
CHANGED