@shipengine/connect-carrier-api 4.16.5 → 4.16.7

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.
Files changed (88) hide show
  1. package/lib/app/carrier-app-definition.d.ts +7 -2
  2. package/lib/app/constants.d.ts +2 -1
  3. package/lib/app/constants.js +1 -0
  4. package/lib/app/constants.js.map +1 -1
  5. package/lib/app/create-endpoint-mapping.js +1 -0
  6. package/lib/app/create-endpoint-mapping.js.map +1 -1
  7. package/lib/models/addresses/pickup-address.d.ts +3 -0
  8. package/lib/models/addresses/pickup-address.js +8 -0
  9. package/lib/models/addresses/pickup-address.js.map +1 -0
  10. package/lib/models/dangerous-good/dangerous-goods-declaration.d.ts +13 -0
  11. package/lib/models/dangerous-good/dangerous-goods-declaration.js +16 -0
  12. package/lib/models/dangerous-good/dangerous-goods-declaration.js.map +1 -0
  13. package/lib/models/dangerous-good/dangerous-goods-inner-packaging.d.ts +7 -0
  14. package/lib/models/dangerous-good/dangerous-goods-inner-packaging.js +12 -0
  15. package/lib/models/dangerous-good/dangerous-goods-inner-packaging.js.map +1 -0
  16. package/lib/models/dangerous-good/dangerous-goods-package-info.d.ts +19 -0
  17. package/lib/models/dangerous-good/dangerous-goods-package-info.js +22 -0
  18. package/lib/models/dangerous-good/dangerous-goods-package-info.js.map +1 -0
  19. package/lib/models/dangerous-good/dangerous-goods.d.ts +5 -0
  20. package/lib/models/dangerous-good/dangerous-goods.js +4 -0
  21. package/lib/models/dangerous-good/dangerous-goods.js.map +1 -1
  22. package/lib/models/labels/void-request.d.ts +0 -2
  23. package/lib/models/labels/void-request.js +0 -2
  24. package/lib/models/labels/void-request.js.map +1 -1
  25. package/lib/models/manifests/manifest-request-shipment.d.ts +0 -1
  26. package/lib/models/manifests/manifest-request-shipment.js +0 -1
  27. package/lib/models/manifests/manifest-request-shipment.js.map +1 -1
  28. package/lib/models/package.d.ts +3 -0
  29. package/lib/models/package.js +2 -0
  30. package/lib/models/package.js.map +1 -1
  31. package/lib/models/pickup/pickup-schema.d.ts +2 -0
  32. package/lib/models/pickup/pickup-schema.js +11 -0
  33. package/lib/models/pickup/pickup-schema.js.map +1 -0
  34. package/lib/models/pickup/pickup.d.ts +5 -0
  35. package/lib/models/pickup/pickup.js +10 -0
  36. package/lib/models/pickup/pickup.js.map +1 -0
  37. package/lib/models/pickup/shipped-shipment.d.ts +2 -0
  38. package/lib/models/pickup/shipped-shipment.js +2 -0
  39. package/lib/models/pickup/shipped-shipment.js.map +1 -1
  40. package/lib/models/tracking/index.d.ts +2 -0
  41. package/lib/models/tracking/index.js +2 -0
  42. package/lib/models/tracking/index.js.map +1 -1
  43. package/lib/requests/create-label-request.d.ts +3 -0
  44. package/lib/requests/create-label-request.js +2 -0
  45. package/lib/requests/create-label-request.js.map +1 -1
  46. package/lib/requests/get-rates-request.d.ts +3 -0
  47. package/lib/requests/get-rates-request.js +2 -0
  48. package/lib/requests/get-rates-request.js.map +1 -1
  49. package/lib/requests/index.d.ts +1 -0
  50. package/lib/requests/index.js +1 -0
  51. package/lib/requests/index.js.map +1 -1
  52. package/lib/requests/list-pickups-request.d.ts +9 -0
  53. package/lib/requests/list-pickups-request.js +12 -0
  54. package/lib/requests/list-pickups-request.js.map +1 -0
  55. package/lib/responses/index.d.ts +2 -0
  56. package/lib/responses/index.js +2 -0
  57. package/lib/responses/index.js.map +1 -1
  58. package/lib/responses/list-pickups-response-schema.d.ts +1 -0
  59. package/lib/responses/list-pickups-response-schema.js +9 -0
  60. package/lib/responses/list-pickups-response-schema.js.map +1 -0
  61. package/lib/responses/list-pickups-response.d.ts +6 -0
  62. package/lib/responses/list-pickups-response.js +10 -0
  63. package/lib/responses/list-pickups-response.js.map +1 -0
  64. package/package.json +1 -1
  65. package/spec.json +588 -429
  66. package/src/app/carrier-app-definition.ts +7 -0
  67. package/src/app/constants.ts +1 -0
  68. package/src/app/create-endpoint-mapping.ts +1 -0
  69. package/src/models/addresses/pickup-address.ts +3 -0
  70. package/src/models/dangerous-good/dangerous-goods-declaration.ts +14 -0
  71. package/src/models/dangerous-good/dangerous-goods-inner-packaging.ts +7 -0
  72. package/src/models/dangerous-good/dangerous-goods-package-info.ts +20 -0
  73. package/src/models/dangerous-good/dangerous-goods.ts +5 -0
  74. package/src/models/labels/void-request.ts +0 -2
  75. package/src/models/manifests/manifest-request-shipment.ts +0 -1
  76. package/src/models/package.ts +3 -0
  77. package/src/models/pickup/pickup-schema.ts +7 -0
  78. package/src/models/pickup/pickup.ts +5 -0
  79. package/src/models/pickup/shipped-shipment.ts +2 -0
  80. package/src/models/tracking/index.ts +2 -0
  81. package/src/requests/create-label-request.ts +3 -0
  82. package/src/requests/get-rates-request.ts +3 -0
  83. package/src/requests/index.ts +1 -0
  84. package/src/requests/list-pickups-request.ts +10 -0
  85. package/src/responses/index.ts +2 -0
  86. package/src/responses/list-pickups-response-schema.ts +6 -0
  87. package/src/responses/list-pickups-response.ts +7 -0
  88. package/tsconfig.tsbuildinfo +1 -1
@@ -19,6 +19,7 @@ import {
19
19
  GetServicePointRequest,
20
20
  ImportTrackingEventsRequest,
21
21
  UpdateSettingsRequest,
22
+ ListPickupsRequest,
22
23
  } from '../requests';
23
24
 
24
25
  import {
@@ -38,6 +39,7 @@ import {
38
39
  GetServicePointsResponse,
39
40
  GetServicePointResponse,
40
41
  UpdateSettingsResponse,
42
+ ListPickupsResponse,
41
43
  } from '../responses';
42
44
 
43
45
  import { CarrierAppMetadata } from './metadata/carrier-app-metadata';
@@ -158,6 +160,11 @@ export interface CarrierAppDefinition {
158
160
  ImportTrackingEvents?: (
159
161
  request: ImportTrackingEventsRequest,
160
162
  ) => AsyncGenerator<ImportedTrackingEvent>;
163
+ /**
164
+ * @description This endpoint is used to list information about previously scheduled pickups
165
+ * @param request Data needed by the provider to list pickups
166
+ */
167
+ ListPickups?: (request: ListPickupsRequest) => ListPickupsResponse | Promise<ListPickupsResponse>;
161
168
 
162
169
  ScheduledFunction?: (request: Record<string, any>) => Promise<{}[] | null> | {}[] | null;
163
170
 
@@ -17,4 +17,5 @@ export enum ApiEndpoints {
17
17
  GetServicePoint = '/GetServicePoint',
18
18
  ImportTrackingEvents = '/ImportTrackingEvents',
19
19
  UpdateSettings = '/UpdateSettings',
20
+ ListPickups = '/ListPickups',
20
21
  }
@@ -25,5 +25,6 @@ export const createEndpointMapping = (
25
25
  [Method.POST, ApiEndpoints.GetServicePoint, definition.GetServicePoint],
26
26
  [Method.POST, ApiEndpoints.ImportTrackingEvents, definition.ImportTrackingEvents],
27
27
  [Method.POST, ApiEndpoints.UpdateSettings, definition.UpdateSettings],
28
+ [Method.POST, ApiEndpoints.ListPickups, definition.ListPickups],
28
29
  ...mapExtensions(definition.Extensions),
29
30
  ];
@@ -0,0 +1,3 @@
1
+ import { AddressBase } from './address-base';
2
+
3
+ export class PickupAddress extends AddressBase {}
@@ -0,0 +1,14 @@
1
+ import { Signatory } from '../signatory';
2
+ import { DangerousGoodsContact } from './dangerous-goods-contact';
3
+
4
+ /** @description An object containing high-level information about the dangerous goods declaration for the entire shipment. */
5
+ export class DangerousGoodsDeclaration {
6
+ /** @description Name of the regulatory authority */
7
+ regulation_set?: string;
8
+ /** @description Contact information for Dangerous goods */
9
+ emergency_contact?: DangerousGoodsContact;
10
+ /** @description An object containing details of the person signing the dangerous goods declaration. */
11
+ signatory?: Signatory;
12
+ /** @description Any supplementary instructions or special provisions related to the handling of the dangerous goods shipment, such as competent authority approvals or specific handling requirements. */
13
+ additional_handling_information?: string;
14
+ }
@@ -0,0 +1,7 @@
1
+ /** @description An object detailing the inner packaging of the dangerous good. */
2
+ export class DangerousGoodsInnerPackaging {
3
+ /** @description The type of inner packaging used (e.g., "Glass Bottle", "Plastic Jar", "Metal Can"). */
4
+ type?: string;
5
+ /** @description The number of individual inner packagings contained within the outer package for this specific dangerous good. */
6
+ quantity?: number;
7
+ }
@@ -0,0 +1,20 @@
1
+ import { RegulationLevelTypes } from './regulation-level-types';
2
+ import { TransportMeanTypes } from './transport-mean-types';
3
+
4
+ /** @description An object containing information specific to the dangerous goods aspects of an individual package. */
5
+ export class DangerousGoodsPackageInfo {
6
+ /** @description Transportation means through which the dangerous goods are transported */
7
+ transport_mean?: TransportMeanTypes;
8
+ /** @description Indicates whether the dangerous goods package must be accessible during transit for inspection or handling. true if accessible, false otherwise. */
9
+ accessibility?: boolean;
10
+ /** @description Specifies if the package is an overpack, meaning it contains one or more packages prepared in accordance with dangerous goods regulations. true if it is an overpack, false otherwise. */
11
+ is_overpack?: boolean;
12
+ /** @description Indicates whether all dangerous goods in the package are packed in accordance with the same regulations. True if all packed in one, false otherwise. */
13
+ all_packed_in_one?: boolean;
14
+ /** @description The "Q" value, a calculated value used in certain dangerous goods regulations (e.g., IATA) to determine if a package is compliant with quantity limits in mixed packing scenarios. Can be null if not applicable. */
15
+ q_value?: number;
16
+ /** @description The type of outer packaging used for the dangerous goods package, typically represented by a UN packaging code (e.g., "4G" for fiberboard box, "1A2" for steel drum). */
17
+ outer_packaging_type?: string;
18
+ /** @description Regulation level of the dangerous goods */
19
+ regulation_level?: RegulationLevelTypes;
20
+ }
@@ -4,6 +4,7 @@ import { RegulationLevelTypes } from './regulation-level-types';
4
4
  import { TransportMeanTypes } from './transport-mean-types';
5
5
  import { DangerousAmountDetails } from './weight-details';
6
6
  import { AccessibilityTypes } from '../accessibility-types';
7
+ import { DangerousGoodsInnerPackaging } from './dangerous-goods-inner-packaging';
7
8
 
8
9
  /** @description Basic structure for a dangerous goods */
9
10
  export class DangerousGoods {
@@ -47,4 +48,8 @@ export class DangerousGoods {
47
48
  additional_description?: string;
48
49
  /** @description Identifies whatever the product being shipped is accessible or inaccessible during delivery.*/
49
50
  accessibility?: AccessibilityTypes;
51
+ /** @description A comma-separated list of special provisions (e.g., "A88, A183") that apply to the specific dangerous good as defined by the relevant dangerous goods regulations. These provisions may modify or clarify the general requirements. */
52
+ special_provisions?: string;
53
+ /** @description An object detailing the inner packaging of the dangerous good. */
54
+ inner_packaging?: DangerousGoodsInnerPackaging;
50
55
  }
@@ -7,6 +7,4 @@ export class VoidRequest extends ShippedShipment {
7
7
  void_request_id!: string;
8
8
  /** @description The location the shipment was shipped from */
9
9
  ship_from!: ShipFrom;
10
- /** @description The shipment's user provided reference */
11
- reference?: string;
12
10
  }
@@ -4,6 +4,5 @@ import { ManifestCustoms } from './manifest-customs';
4
4
  export class ManifestRequestShipment extends ShippedShipment {
5
5
  manifest_request_shipment_id!: string;
6
6
  ship_datetime?: string;
7
- reference?: string;
8
7
  customs?: ManifestCustoms;
9
8
  }
@@ -4,6 +4,7 @@ import { Currency } from './currency';
4
4
  import { LabelMessage } from './labels/label-message';
5
5
  import { Customs } from './customs';
6
6
  import { Products } from './products';
7
+ import { DangerousGoodsPackageInfo } from './dangerous-good/dangerous-goods-package-info';
7
8
 
8
9
  /** @description Basic structure for a package */
9
10
  export class Package {
@@ -23,4 +24,6 @@ export class Package {
23
24
  customs?: Customs;
24
25
  /** @description List of products goods model associated with this package passed to the carrier. */
25
26
  products?: Products[];
27
+ /** @description An object containing information specific to the dangerous goods aspects of an individual package. */
28
+ dangerous_goods_package_info?: DangerousGoodsPackageInfo;
26
29
  }
@@ -0,0 +1,7 @@
1
+ import Joi from 'joi';
2
+
3
+ export const PickupSchema = Joi.object({
4
+ confirmation_number: Joi.string().required(),
5
+ status: Joi.string().required(),
6
+ status_reason: Joi.string().optional(),
7
+ });
@@ -0,0 +1,5 @@
1
+ export class Pickup {
2
+ confirmation_number!: string;
3
+ status!: string;
4
+ status_reason?: string;
5
+ }
@@ -21,6 +21,8 @@ export class ShippedShipment extends Label {
21
21
  pickup_location?: PudoLocation;
22
22
  /** @description Add drop-off location detail*/
23
23
  dropoff_location?: PudoLocation;
24
+ /** @description User specified free form string to identify shipment in their own system */
25
+ reference?: string;
24
26
  }
25
27
 
26
28
  export class PickupShipment extends ShippedShipment {}
@@ -14,3 +14,5 @@ export * from './tracking-info-schema';
14
14
  export * from './tracking-info';
15
15
  export * from './update-method-schema';
16
16
  export * from './update-method';
17
+ export * from './standardized-status-detail-codes';
18
+ export * from './standardized-status-detail-codes-schema';
@@ -19,6 +19,7 @@ import {
19
19
  Customs,
20
20
  BillTo,
21
21
  } from '../models';
22
+ import { DangerousGoodsDeclaration } from '../models/dangerous-good/dangerous-goods-declaration';
22
23
 
23
24
  /** @description Basic structure for a request to create a label */
24
25
  export class CreateLabelRequest extends BaseRequest {
@@ -58,4 +59,6 @@ export class CreateLabelRequest extends BaseRequest {
58
59
  customs?: Customs;
59
60
  /** @description Bill the shipping charges to this entity. If null, it should be assumed the "shipper" is responsible for the shipping charges. */
60
61
  bill_shipping_to?: BillTo;
62
+ /** @description An object containing high-level information about the dangerous goods declaration for the entire shipment. */
63
+ dangerous_goods_declaration?: DangerousGoodsDeclaration;
61
64
  }
@@ -14,6 +14,7 @@ import {
14
14
  DisplayScheme,
15
15
  } from '../models';
16
16
  import { ShipmentItem } from '../models/shipment-item';
17
+ import { DangerousGoodsDeclaration } from '../models/dangerous-good/dangerous-goods-declaration';
17
18
 
18
19
  /** @description Basic structure for a request to get rates */
19
20
  export class GetRatesRequest extends BaseRequest {
@@ -39,4 +40,6 @@ export class GetRatesRequest extends BaseRequest {
39
40
  bill_shipping_to?: BillTo;
40
41
  /** @description Display schemes in which the rate will be evaluated. Labels are used by default. */
41
42
  display_schemes?: DisplayScheme[];
43
+ /** @description An object containing high-level information about the dangerous goods declaration for the entire shipment. */
44
+ dangerous_goods_declaration?: DangerousGoodsDeclaration;
42
45
  }
@@ -12,6 +12,7 @@ export * from './import-tracking-events-request';
12
12
  export * from './normalize-tracking-data-request';
13
13
  export * from './register-request';
14
14
  export * from './schedule-pickup-request';
15
+ export * from './list-pickups-request';
15
16
  export * from './tracking-request';
16
17
  export * from './validate-inbound-data-request';
17
18
  export * from './void-labels-request';
@@ -0,0 +1,10 @@
1
+ import { PickupAddress } from '../models/addresses/pickup-address';
2
+ import { TimeWindow } from '../models/time-window';
3
+ import { BaseRequest } from './base-request';
4
+
5
+ /** @description Basic structure for a request to list scheduled pickups */
6
+ export class ListPickupsRequest extends BaseRequest {
7
+ /** @description The address to search for scheduled pickups. */
8
+ address?: PickupAddress;
9
+ search_window?: TimeWindow;
10
+ }
@@ -23,6 +23,8 @@ export * from './register-response-schema';
23
23
  export * from './register-response';
24
24
  export * from './schedule-pickup-response-schema';
25
25
  export * from './schedule-pickup-response';
26
+ export * from './list-pickups-response-schema';
27
+ export * from './list-pickups-response';
26
28
  export * from './tracking-response-schema';
27
29
  export * from './tracking-response';
28
30
  export * from './validate-inbound-data-response-schema';
@@ -0,0 +1,6 @@
1
+ import { BaseResponseSchema } from './base-response-schema';
2
+ import { PickupSchema } from '../models/pickup/pickup-schema';
3
+
4
+ export const ListPickupsResponseSchema = BaseResponseSchema.keys({
5
+ pickups: PickupSchema.required(),
6
+ });
@@ -0,0 +1,7 @@
1
+ import { Pickup } from '../models/pickup/pickup';
2
+ import { BaseResponse } from './base-response';
3
+
4
+ /** @description Basic structure for a response to list scheduled pickups */
5
+ export class ListPickupsResponse extends BaseResponse {
6
+ pickups!: Pickup[];
7
+ }