@shipengine/connect-carrier-api 4.33.0 → 4.34.1-alpha-gold-28569.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.
Files changed (40) hide show
  1. package/lib/app/carrier-app-definition.d.ts +7 -2
  2. package/lib/app/constants.d.ts +1 -0
  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/billing/billing-to-party.d.ts +3 -1
  8. package/lib/models/billing/billing-to-party.js +2 -0
  9. package/lib/models/billing/billing-to-party.js.map +1 -1
  10. package/lib/models/tracking/bulk-tracking-error.d.ts +7 -0
  11. package/lib/models/tracking/bulk-tracking-error.js +12 -0
  12. package/lib/models/tracking/bulk-tracking-error.js.map +1 -0
  13. package/lib/models/tracking/index.d.ts +1 -0
  14. package/lib/models/tracking/index.js +1 -0
  15. package/lib/models/tracking/index.js.map +1 -1
  16. package/lib/requests/bulk-tracking-request.d.ts +14 -0
  17. package/lib/requests/bulk-tracking-request.js +19 -0
  18. package/lib/requests/bulk-tracking-request.js.map +1 -0
  19. package/lib/requests/index.d.ts +1 -0
  20. package/lib/requests/index.js +1 -0
  21. package/lib/requests/index.js.map +1 -1
  22. package/lib/responses/bulk-tracking-response.d.ts +18 -0
  23. package/lib/responses/bulk-tracking-response.js +22 -0
  24. package/lib/responses/bulk-tracking-response.js.map +1 -0
  25. package/lib/responses/index.d.ts +1 -0
  26. package/lib/responses/index.js +1 -0
  27. package/lib/responses/index.js.map +1 -1
  28. package/package.json +1 -1
  29. package/spec.json +6363 -6217
  30. package/src/app/carrier-app-definition.ts +9 -0
  31. package/src/app/constants.ts +1 -0
  32. package/src/app/create-endpoint-mapping.ts +1 -0
  33. package/src/models/billing/billing-to-party.ts +2 -0
  34. package/src/models/tracking/bulk-tracking-error.ts +7 -0
  35. package/src/models/tracking/index.ts +1 -0
  36. package/src/requests/bulk-tracking-request.ts +16 -0
  37. package/src/requests/index.ts +1 -0
  38. package/src/responses/bulk-tracking-response.ts +20 -0
  39. package/src/responses/index.ts +1 -0
  40. package/tsconfig.tsbuildinfo +1 -1
@@ -2,6 +2,7 @@ import { ImportedTrackingEvent } from '../models';
2
2
  import type { Request } from 'express';
3
3
  import {
4
4
  RegisterRequest,
5
+ BulkTrackingRequest,
5
6
  CreateLabelRequest,
6
7
  VoidLabelsRequest,
7
8
  CreateManifestRequest,
@@ -26,6 +27,7 @@ import {
26
27
 
27
28
  import {
28
29
  RegisterResponse,
30
+ BulkTrackingResponse,
29
31
  CreateLabelResponse,
30
32
  VoidLabelsResponse,
31
33
  CreateManifestResponse,
@@ -108,6 +110,13 @@ export interface CarrierAppDefinition {
108
110
  * @param request Data needed by the provider to track a shipment
109
111
  */
110
112
  Track?: (request: TrackingRequest) => TrackingResponse | Promise<TrackingResponse>;
113
+ /**
114
+ * @description This endpoint is used to get tracking information about multiple shipments in a single call
115
+ * @param request Data needed by the provider to track multiple shipments
116
+ */
117
+ BulkTrack?: (
118
+ request: BulkTrackingRequest,
119
+ ) => BulkTrackingResponse | Promise<BulkTrackingResponse>;
111
120
  /**
112
121
  * @description This endpoint is used to submit notification of the creation of a shipment
113
122
  * @param request Data needed by the provider to inform them of a shipment
@@ -8,6 +8,7 @@ export enum ApiEndpoints {
8
8
  SchedulePickup = '/SchedulePickup',
9
9
  CancelPickup = '/CancelPickup',
10
10
  Track = '/Track',
11
+ BulkTrack = '/BulkTrack',
11
12
  CreateNotification = '/CreateNotification',
12
13
  CancelNotification = '/CancelNotification',
13
14
  ValidateInboundData = '/ValidateInboundData',
@@ -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],
@@ -7,4 +7,6 @@ export enum BillToParty {
7
7
  Recipient = 'recipient',
8
8
  /** @description A shipper may want to bill to a third-party; especially common for 3PLs and larger volume. merchants */
9
9
  ThirdPartyAccount = 'third_party_account',
10
+ /** @description The shipping charges are to be collected from the recipient upon delivery. */
11
+ Collect = 'collect',
10
12
  }
@@ -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
+ }
@@ -1,3 +1,4 @@
1
+ export * from './bulk-tracking-error';
1
2
  export * from './imported-tracking-event-schema';
2
3
  export * from './imported-tracking-event';
3
4
  export * from './lat-long-schema';
@@ -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
+ }
@@ -1,3 +1,4 @@
1
+ export * from './bulk-tracking-request';
1
2
  export * from './cancel-notification-request';
2
3
  export * from './cancel-pickup-request';
3
4
  export * from './create-label-request';
@@ -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
+ }
@@ -1,3 +1,4 @@
1
+ export * from './bulk-tracking-response';
1
2
  export * from './cancel-notification-response-schema';
2
3
  export * from './cancel-notification-response';
3
4
  export * from './cancel-pickup-response-schema';