@shipengine/connect-carrier-api 2.12.14 → 2.12.17
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 +9 -3
- package/lib/app/build-native-rating-routes.js +3 -3
- package/lib/app/build-native-rating-routes.js.map +1 -1
- package/lib/app/carrier-app-definition.d.ts +7 -1
- package/lib/app/carrier-app.js +6 -0
- package/lib/app/carrier-app.js.map +1 -1
- package/lib/app/constants.d.ts +2 -1
- package/lib/app/constants.js +1 -0
- package/lib/app/constants.js.map +1 -1
- package/lib/app/internal/metadata.js +3 -0
- package/lib/app/internal/metadata.js.map +1 -1
- package/lib/app/internal/route.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/models/bill-to.d.ts +14 -0
- package/lib/models/bill-to.js +14 -0
- package/lib/models/bill-to.js.map +1 -0
- package/lib/models/billing/billing-to-party.d.ts +10 -0
- package/lib/models/billing/billing-to-party.js +15 -0
- package/lib/models/billing/billing-to-party.js.map +1 -0
- package/lib/models/billing/index.d.ts +1 -0
- package/lib/models/billing/index.js +1 -0
- package/lib/models/billing/index.js.map +1 -1
- package/lib/models/index.d.ts +1 -0
- package/lib/models/index.js +1 -0
- package/lib/models/index.js.map +1 -1
- package/lib/models/tracking/imported-tracking-event-schema.d.ts +2 -0
- package/lib/models/tracking/imported-tracking-event-schema.js +12 -0
- package/lib/models/tracking/imported-tracking-event-schema.js.map +1 -0
- package/lib/models/tracking/imported-tracking-event.d.ts +16 -0
- package/lib/models/tracking/imported-tracking-event.js +7 -0
- package/lib/models/tracking/imported-tracking-event.js.map +1 -0
- package/lib/models/tracking/index.d.ts +2 -0
- package/lib/models/tracking/index.js +2 -0
- package/lib/models/tracking/index.js.map +1 -1
- package/lib/requests/create-label-request.d.ts +3 -1
- package/lib/requests/create-label-request.js.map +1 -1
- package/lib/requests/get-rates-request.d.ts +3 -1
- package/lib/requests/get-rates-request.js.map +1 -1
- package/lib/requests/import-tracking-events-request.d.ts +3 -0
- package/lib/requests/import-tracking-events-request.js +8 -0
- package/lib/requests/import-tracking-events-request.js.map +1 -0
- package/lib/requests/index.d.ts +8 -7
- package/lib/requests/index.js +8 -7
- package/lib/requests/index.js.map +1 -1
- package/package.json +3 -3
- package/spec.json +80 -6
- package/src/app/carrier-app-definition.ts +9 -0
- package/src/app/carrier-app.ts +7 -0
- package/src/app/constants.ts +1 -0
- package/src/app/internal/metadata.ts +4 -0
- package/src/app/internal/route.ts +1 -1
- package/src/index.ts +2 -2
- package/src/models/bill-to.ts +15 -0
- package/src/models/billing/billing-to-party.ts +10 -0
- package/src/models/billing/index.ts +1 -0
- package/src/models/index.ts +1 -0
- package/src/models/tracking/imported-tracking-event-schema.ts +8 -0
- package/src/models/tracking/imported-tracking-event.ts +17 -0
- package/src/models/tracking/index.ts +2 -0
- package/src/requests/create-label-request.ts +3 -0
- package/src/requests/get-rates-request.ts +3 -0
- package/src/requests/import-tracking-events-request.ts +3 -0
- package/src/requests/index.ts +8 -7
- package/tsconfig.json +0 -3
- package/tsconfig.tsbuildinfo +1 -1
package/spec.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"info": {
|
|
4
4
|
"title": "Shipping API",
|
|
5
5
|
"description": "This API specification describes the canonical ShipEngine Shipping API connector module.",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.17.1"
|
|
7
7
|
},
|
|
8
8
|
"paths": {
|
|
9
9
|
"/Register": {
|
|
@@ -570,6 +570,40 @@
|
|
|
570
570
|
}
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
|
+
},
|
|
574
|
+
"/ImportTrackingEvents": {
|
|
575
|
+
"post": {
|
|
576
|
+
"tags": [
|
|
577
|
+
"Tracking"
|
|
578
|
+
],
|
|
579
|
+
"description": "This method returns imported tracking events for a connection, and should only be implemented if you support\r\nimporting tracking data in bulk via file exchange or API requests.\r\n \r\nAny information needed to retrieve tracking data for a connection should be collected in your registration\r\nform and will be made available as metadata in the request.",
|
|
580
|
+
"operationId": "ImportTrackingEvents",
|
|
581
|
+
"requestBody": {
|
|
582
|
+
"description": "An object containing information about the connection to import tracking events for.",
|
|
583
|
+
"content": {
|
|
584
|
+
"application/json": {
|
|
585
|
+
"schema": {
|
|
586
|
+
"$ref": "#/components/schemas/ImportTrackingEventsRequest"
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
},
|
|
591
|
+
"responses": {
|
|
592
|
+
"200": {
|
|
593
|
+
"description": "A list of imported tracking events",
|
|
594
|
+
"content": {
|
|
595
|
+
"application/json": {
|
|
596
|
+
"schema": {
|
|
597
|
+
"type": "array",
|
|
598
|
+
"items": {
|
|
599
|
+
"$ref": "#/components/schemas/ImportedTrackingEvent"
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
573
607
|
}
|
|
574
608
|
},
|
|
575
609
|
"components": {
|
|
@@ -2224,6 +2258,35 @@
|
|
|
2224
2258
|
"additionalProperties": false,
|
|
2225
2259
|
"description": "A key value pair, allowing custom properties to be stored."
|
|
2226
2260
|
},
|
|
2261
|
+
"ImportedTrackingEvent": {
|
|
2262
|
+
"type": "object",
|
|
2263
|
+
"properties": {
|
|
2264
|
+
"tracking_info": {
|
|
2265
|
+
"$ref": "#/components/schemas/TrackingInfo"
|
|
2266
|
+
},
|
|
2267
|
+
"update_method": {
|
|
2268
|
+
"$ref": "#/components/schemas/UpdateMethods"
|
|
2269
|
+
},
|
|
2270
|
+
"error_messages": {
|
|
2271
|
+
"type": "array",
|
|
2272
|
+
"items": {
|
|
2273
|
+
"type": "string"
|
|
2274
|
+
},
|
|
2275
|
+
"description": "Any error messages resulting from processing the tracking event",
|
|
2276
|
+
"nullable": true
|
|
2277
|
+
},
|
|
2278
|
+
"warning_messages": {
|
|
2279
|
+
"type": "array",
|
|
2280
|
+
"items": {
|
|
2281
|
+
"type": "string"
|
|
2282
|
+
},
|
|
2283
|
+
"description": "Any warning messages resulting from processing the tracking event",
|
|
2284
|
+
"nullable": true
|
|
2285
|
+
}
|
|
2286
|
+
},
|
|
2287
|
+
"additionalProperties": false,
|
|
2288
|
+
"description": "This model represents an imported tracking event"
|
|
2289
|
+
},
|
|
2227
2290
|
"ImporterOfRecord": {
|
|
2228
2291
|
"type": "object",
|
|
2229
2292
|
"properties": {
|
|
@@ -2289,6 +2352,18 @@
|
|
|
2289
2352
|
"additionalProperties": false,
|
|
2290
2353
|
"description": "Basic structure for a Importer Record"
|
|
2291
2354
|
},
|
|
2355
|
+
"ImportTrackingEventsRequest": {
|
|
2356
|
+
"required": [
|
|
2357
|
+
"transaction_id"
|
|
2358
|
+
],
|
|
2359
|
+
"type": "object",
|
|
2360
|
+
"allOf": [
|
|
2361
|
+
{
|
|
2362
|
+
"$ref": "#/components/schemas/BaseRequest"
|
|
2363
|
+
}
|
|
2364
|
+
],
|
|
2365
|
+
"additionalProperties": false
|
|
2366
|
+
},
|
|
2292
2367
|
"InboundDataContentTypes": {
|
|
2293
2368
|
"enum": [
|
|
2294
2369
|
"tracking"
|
|
@@ -3194,8 +3269,7 @@
|
|
|
3194
3269
|
"nullable": true
|
|
3195
3270
|
},
|
|
3196
3271
|
"type": {
|
|
3197
|
-
"$ref": "#/components/schemas/ServicePointLocationType"
|
|
3198
|
-
"nullable": true
|
|
3272
|
+
"$ref": "#/components/schemas/ServicePointLocationType"
|
|
3199
3273
|
}
|
|
3200
3274
|
},
|
|
3201
3275
|
"additionalProperties": false
|
|
@@ -3353,6 +3427,9 @@
|
|
|
3353
3427
|
"label_messages": {
|
|
3354
3428
|
"$ref": "#/components/schemas/LabelMessage"
|
|
3355
3429
|
},
|
|
3430
|
+
"customs": {
|
|
3431
|
+
"$ref": "#/components/schemas/Customs"
|
|
3432
|
+
},
|
|
3356
3433
|
"insured_value": {
|
|
3357
3434
|
"required": [
|
|
3358
3435
|
"currency",
|
|
@@ -3371,9 +3448,6 @@
|
|
|
3371
3448
|
},
|
|
3372
3449
|
"description": "The insured value of this package.",
|
|
3373
3450
|
"nullable": true
|
|
3374
|
-
},
|
|
3375
|
-
"customs": {
|
|
3376
|
-
"$ref": "#/components/schemas/Customs"
|
|
3377
3451
|
}
|
|
3378
3452
|
},
|
|
3379
3453
|
"additionalProperties": false,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ImportedTrackingEvent } from '../models';
|
|
1
2
|
import {
|
|
2
3
|
RegisterRequest,
|
|
3
4
|
CreateLabelRequest,
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
GetRelayPointsRequest,
|
|
16
17
|
GetServicePointsRequest,
|
|
17
18
|
GetServicePointRequest,
|
|
19
|
+
ImportTrackingEventsRequest,
|
|
18
20
|
} from '../requests';
|
|
19
21
|
|
|
20
22
|
import {
|
|
@@ -144,4 +146,11 @@ export interface CarrierAppDefinition {
|
|
|
144
146
|
GetServicePoint?: (
|
|
145
147
|
request: GetServicePointRequest,
|
|
146
148
|
) => GetServicePointResponse | Promise<GetServicePointResponse>;
|
|
149
|
+
/**
|
|
150
|
+
* @description This endpoint is used to import tracking events for a connection by id
|
|
151
|
+
* @param request Data needed by the provider to import tracking events
|
|
152
|
+
*/
|
|
153
|
+
ImportTrackingEvents?: (
|
|
154
|
+
request: ImportTrackingEventsRequest,
|
|
155
|
+
) => AsyncGenerator<ImportedTrackingEvent>;
|
|
147
156
|
}
|
package/src/app/carrier-app.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { OpenApiSpecification } from '../spec';
|
|
|
6
6
|
import { Metadata } from './internal/metadata';
|
|
7
7
|
import { CarrierSpecification } from './internal/carrier-specification';
|
|
8
8
|
import { CarrierAppMetadataSchema } from './metadata';
|
|
9
|
+
import { ImportedTrackingEventSchema } from '../models';
|
|
9
10
|
import {
|
|
10
11
|
RegisterResponseSchema,
|
|
11
12
|
CancelNotificationResponseSchema,
|
|
@@ -152,6 +153,12 @@ export class CarrierApp implements ConnectRuntimeApp {
|
|
|
152
153
|
definition.GetServicePoint,
|
|
153
154
|
GetServicePointResponseSchema,
|
|
154
155
|
],
|
|
156
|
+
[
|
|
157
|
+
Method.POST,
|
|
158
|
+
ApiEndpoints.ImportTrackingEvents,
|
|
159
|
+
definition.ImportTrackingEvents,
|
|
160
|
+
ImportedTrackingEventSchema,
|
|
161
|
+
],
|
|
155
162
|
).forEach(([method, path, implementation, schema]) => {
|
|
156
163
|
if (implementation) {
|
|
157
164
|
this.routes.push({
|
package/src/app/constants.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface FileRoute {
|
|
|
17
17
|
/** @description The definition for a route and how it will be handled */
|
|
18
18
|
export interface HandlerRoute {
|
|
19
19
|
/** @description The method that will be called to handle this request */
|
|
20
|
-
handler?: (req: any) => any | Promise<any>;
|
|
20
|
+
handler?: (req: any) => any | Promise<any> | AsyncGenerator<any>;
|
|
21
21
|
/** @description The optional method used to validate the response for this route. Used for warning purposes. */
|
|
22
22
|
validateResponse?: (response: any) => string[] | undefined;
|
|
23
23
|
}
|
package/src/index.ts
CHANGED
|
@@ -2,8 +2,8 @@ export * as models from './models';
|
|
|
2
2
|
export * as requests from './requests';
|
|
3
3
|
export * as responses from './responses';
|
|
4
4
|
|
|
5
|
-
export * from './requests';
|
|
6
|
-
export * from './responses';
|
|
7
5
|
export * from './app';
|
|
8
6
|
export * from './models';
|
|
7
|
+
export * from './requests';
|
|
8
|
+
export * from './responses';
|
|
9
9
|
export * from './spec';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { AddressBase } from './addresses';
|
|
2
|
+
import { BillToParty } from './billing';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @description Bill to is a generic object used for billing a part of the shipment, duties, taxes, or otherwise to a party
|
|
6
|
+
other than the shipper (the shipper is considered the default party responsible). Ref: BillTo extends AddressBase.
|
|
7
|
+
since address fields are often required when associating billing to
|
|
8
|
+
another account. Additionally, this allows for a contact to be specified, if necessary.
|
|
9
|
+
*/
|
|
10
|
+
export class BillTo extends AddressBase {
|
|
11
|
+
/** @description The bill_to_party mentions the type of billing option*/
|
|
12
|
+
bill_to_party?: BillToParty;
|
|
13
|
+
/** @description Specified if there is an account number associated with the Bill To Party, and the Bill To Party is not the account holder. */
|
|
14
|
+
account_number?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @description The type of party responsible for a given category of charges associated with a shipment, such as
|
|
2
|
+
* shipping charges or import duties. */
|
|
3
|
+
export enum BillToParty {
|
|
4
|
+
/** @description The shipper is generally regarded as the party responsible for the billing. */
|
|
5
|
+
Shipper = 'shipper',
|
|
6
|
+
/** @description The recipient may be responsible for the billing of some entities, that could include the shipping cost. */
|
|
7
|
+
Recipient = 'recipient',
|
|
8
|
+
/** @description A shipper may want to bill to a third-party; especially common for 3PLs and larger volume. merchants */
|
|
9
|
+
ThirdPartyAccount = 'third_party_account',
|
|
10
|
+
}
|
package/src/models/index.ts
CHANGED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
import { TrackingInfoSchema } from './tracking-info-schema';
|
|
3
|
+
|
|
4
|
+
export const ImportedTrackingEventSchema = Joi.object({
|
|
5
|
+
tracking_info: TrackingInfoSchema.optional(),
|
|
6
|
+
error_messages: Joi.array().optional().items(Joi.string()),
|
|
7
|
+
warning_messages: Joi.array().optional().items(Joi.string()),
|
|
8
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TrackingInfo } from './tracking-info';
|
|
2
|
+
import { UpdateMethods } from './update-method';
|
|
3
|
+
|
|
4
|
+
export class ImportedTrackingEvent {
|
|
5
|
+
/** @description The tracking information for the shipment */
|
|
6
|
+
tracking_info?: TrackingInfo;
|
|
7
|
+
/**
|
|
8
|
+
* @description Optional method for updating the tracking information state, i.e. is the returned
|
|
9
|
+
* information the complete state of the package or should it be appended to the existing state.
|
|
10
|
+
* Defaults to `append` if not specified.
|
|
11
|
+
*/
|
|
12
|
+
update_method?: UpdateMethods;
|
|
13
|
+
/** @description Any error messages resulting from processing the tracking event */
|
|
14
|
+
error_messages?: string[];
|
|
15
|
+
/** @description Any warning messages resulting from processing the tracking event */
|
|
16
|
+
warning_messages?: string[];
|
|
17
|
+
}
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
RelayPointDetails,
|
|
18
18
|
DisplayScheme,
|
|
19
19
|
Customs,
|
|
20
|
+
BillTo,
|
|
20
21
|
} from '../models';
|
|
21
22
|
|
|
22
23
|
/** @description Basic structure for a request to create a label */
|
|
@@ -54,4 +55,6 @@ export class CreateLabelRequest extends BaseRequest {
|
|
|
54
55
|
/** @description Display schemes that the label will be returned in. Label is returned by default */
|
|
55
56
|
display_schemes?: DisplayScheme[];
|
|
56
57
|
customs?: Customs;
|
|
58
|
+
/** @description Bill the shipping charges to this entity. If null, it should be assumed the "shipper" is responsible for the shipping charges. */
|
|
59
|
+
bill_shipping_to?: BillTo;
|
|
57
60
|
}
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
PudoLocation,
|
|
11
11
|
FulfillmentPlanDetails,
|
|
12
12
|
TimeWindow,
|
|
13
|
+
BillTo,
|
|
13
14
|
} from '../models';
|
|
14
15
|
import { ShipmentItem } from '../models/shipment-item';
|
|
15
16
|
|
|
@@ -33,4 +34,6 @@ export class GetRatesRequest extends BaseRequest {
|
|
|
33
34
|
carrier_pickup_window?: TimeWindow;
|
|
34
35
|
/** Items included in the shipment */
|
|
35
36
|
items?: ShipmentItem[];
|
|
37
|
+
/** @description Bill the shipping charges to this entity. If null, it should be assumed the "shipper" is responsible for the shipping charges. */
|
|
38
|
+
bill_shipping_to?: BillTo;
|
|
36
39
|
}
|
package/src/requests/index.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
+
export * from './cancel-notification-request';
|
|
1
2
|
export * from './cancel-pickup-request';
|
|
2
3
|
export * from './create-label-request';
|
|
3
4
|
export * from './create-manifest-request';
|
|
5
|
+
export * from './create-notification-request';
|
|
4
6
|
export * from './get-manifest-request';
|
|
5
7
|
export * from './get-rates-request';
|
|
8
|
+
export * from './get-relay-points-request';
|
|
9
|
+
export * from './get-service-point-request';
|
|
10
|
+
export * from './get-service-points-request';
|
|
11
|
+
export * from './import-tracking-events-request';
|
|
12
|
+
export * from './normalize-tracking-data-request';
|
|
6
13
|
export * from './register-request';
|
|
7
14
|
export * from './schedule-pickup-request';
|
|
8
15
|
export * from './tracking-request';
|
|
9
|
-
export * from './void-labels-request';
|
|
10
|
-
export * from './create-notification-request';
|
|
11
|
-
export * from './cancel-notification-request';
|
|
12
16
|
export * from './validate-inbound-data-request';
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './get-relay-points-request';
|
|
15
|
-
export * from './get-service-points-request';
|
|
16
|
-
export * from './get-service-point-request';
|
|
17
|
+
export * from './void-labels-request';
|
package/tsconfig.json
CHANGED
|
@@ -3,14 +3,11 @@
|
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"allowJs": true,
|
|
5
5
|
"declaration": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
6
|
"importHelpers": true,
|
|
8
7
|
"module": "commonjs",
|
|
9
8
|
"outDir": "lib",
|
|
10
9
|
"rootDir": "src",
|
|
11
10
|
"sourceMap": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"target": "es2017",
|
|
14
11
|
"composite": true
|
|
15
12
|
},
|
|
16
13
|
"include": ["src/**/*"],
|