@shipengine/connect-carrier-api 2.3.0 → 2.3.5
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/jest.config.js +6 -0
- package/lib/app/carrier-app-definition.d.ts +6 -1
- package/lib/app/carrier-app.js +9 -50
- package/lib/app/carrier-app.js.map +1 -1
- 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/internal/carrier-specification.js +14 -1
- package/lib/app/internal/carrier-specification.js.map +1 -1
- package/lib/app/internal/metadata.js +3 -0
- package/lib/app/internal/metadata.js.map +1 -1
- package/lib/app/metadata/account-modals.d.ts +8 -2
- package/lib/app/metadata/account-modals.js.map +1 -1
- package/lib/app/metadata/carrier-app-metadata.js.map +1 -1
- package/lib/app/metadata/carrier.js +3 -12
- package/lib/app/metadata/carrier.js.map +1 -1
- package/lib/app/metadata/label-formats.js.map +1 -1
- package/lib/app/metadata/label-sizes.js.map +1 -1
- package/lib/app/metadata/monoauth.js.map +1 -1
- package/lib/app/metadata/service-class.js.map +1 -1
- package/lib/app/metadata/service-grade.js.map +1 -1
- package/lib/app/metadata/shipping-service.js +4 -16
- package/lib/app/metadata/shipping-service.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/models/billing/billing-categories.js.map +1 -1
- package/lib/models/billing/billing-line-item.js.map +1 -1
- package/lib/models/documents/document-type.js.map +1 -1
- package/lib/models/documents/document.js.map +1 -1
- package/lib/models/labels/document-formats.js.map +1 -1
- package/lib/models/manifest-status.d.ts +10 -0
- package/lib/models/manifest-status.js +16 -0
- package/lib/models/manifest-status.js.map +1 -0
- package/lib/models/pickup/pickup-confirmation.js.map +1 -1
- package/lib/models/rates/rate.js.map +1 -1
- package/lib/models/tracking/update-method.js.map +1 -1
- package/lib/requests/get-manifest-request.d.ts +9 -0
- package/lib/requests/get-manifest-request.js +9 -0
- package/lib/requests/get-manifest-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/create-manifest-response.d.ts +6 -0
- package/lib/responses/create-manifest-response.js +6 -0
- package/lib/responses/create-manifest-response.js.map +1 -1
- package/lib/responses/normalize-tracking-data-response.js.map +1 -1
- package/lib/responses/validate-inbound-data-response.js.map +1 -1
- package/lib/spec.d.ts +2 -0
- package/lib/spec.js +6 -0
- package/lib/spec.js.map +1 -0
- package/lib/spec.test.d.ts +1 -0
- package/lib/spec.test.js +12 -0
- package/lib/spec.test.js.map +1 -0
- package/package.json +6 -2
- package/spec.json +107 -0
- package/src/app/carrier-app-definition.ts +13 -15
- package/src/app/carrier-app.ts +12 -55
- package/src/app/constants.ts +1 -0
- package/src/app/internal/carrier-specification.ts +20 -7
- package/src/app/internal/metadata.ts +5 -3
- package/src/app/metadata/account-modals.ts +8 -2
- package/src/app/metadata/carrier-app-metadata.ts +1 -6
- package/src/app/metadata/carrier.ts +7 -28
- package/src/app/metadata/label-formats.ts +1 -3
- package/src/app/metadata/label-sizes.ts +1 -3
- package/src/app/metadata/monoauth.ts +1 -4
- package/src/app/metadata/service-class.ts +1 -3
- package/src/app/metadata/service-grade.ts +1 -3
- package/src/app/metadata/shipping-service.ts +6 -24
- package/src/index.ts +1 -0
- package/src/models/billing/billing-categories.ts +1 -3
- package/src/models/billing/billing-line-item.ts +1 -4
- package/src/models/documents/document-type.ts +1 -3
- package/src/models/documents/document.ts +1 -4
- package/src/models/labels/document-formats.ts +1 -3
- package/src/models/manifest-status.ts +11 -0
- package/src/models/pickup/pickup-confirmation.ts +1 -4
- package/src/models/rates/rate.ts +1 -4
- package/src/models/tracking/update-method.ts +1 -3
- package/src/requests/get-manifest-request.ts +13 -0
- package/src/requests/index.ts +1 -0
- package/src/responses/create-manifest-response.ts +11 -0
- package/src/responses/normalize-tracking-data-response.ts +1 -6
- package/src/responses/validate-inbound-data-response.ts +1 -4
- package/src/spec.test.ts +10 -0
- package/src/spec.ts +2 -0
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { ConfirmationType, ConfirmationTypeSchema } from './confirmation-type';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
CountryAssociationSchema,
|
|
5
|
-
} from './country-association';
|
|
6
|
-
import {
|
|
7
|
-
ServiceAttributesEnum,
|
|
8
|
-
ServiceAttributesEnumSchema,
|
|
9
|
-
} from './services-attributes';
|
|
2
|
+
import { CountryAssociation, CountryAssociationSchema } from './country-association';
|
|
3
|
+
import { ServiceAttributesEnum, ServiceAttributesEnumSchema } from './services-attributes';
|
|
10
4
|
import { LabelSizesEnum, LabelSizesEnumSchema } from './label-sizes';
|
|
11
5
|
import { ServiceClassEnum, ServiceClassEnumSchema } from './service-class';
|
|
12
6
|
import { ServiceGradeEnum, ServiceGradeEnumSchema } from './service-grade';
|
|
@@ -35,23 +29,11 @@ export interface ShippingService {
|
|
|
35
29
|
}
|
|
36
30
|
|
|
37
31
|
export const ShippingServiceSchema = Joi.object({
|
|
38
|
-
ConfirmationTypes: Joi.array()
|
|
39
|
-
.optional()
|
|
40
|
-
.items(ConfirmationTypeSchema)
|
|
41
|
-
.unique('Type'),
|
|
32
|
+
ConfirmationTypes: Joi.array().optional().items(ConfirmationTypeSchema).unique('Type'),
|
|
42
33
|
ServiceAttributes: Joi.array().items(ServiceAttributesEnumSchema).optional(),
|
|
43
|
-
SupportedCountries: Joi.array()
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.unique('FromCountry'),
|
|
47
|
-
SupportedLabelSizes: Joi.array()
|
|
48
|
-
.optional()
|
|
49
|
-
.items(LabelSizesEnumSchema)
|
|
50
|
-
.unique(),
|
|
51
|
-
RequiredProperties: Joi.array()
|
|
52
|
-
.optional()
|
|
53
|
-
.items(ServiceRequiredPropertiesEnumSchema)
|
|
54
|
-
.unique(),
|
|
34
|
+
SupportedCountries: Joi.array().optional().items(CountryAssociationSchema).unique('FromCountry'),
|
|
35
|
+
SupportedLabelSizes: Joi.array().optional().items(LabelSizesEnumSchema).unique(),
|
|
36
|
+
RequiredProperties: Joi.array().optional().items(ServiceRequiredPropertiesEnumSchema).unique(),
|
|
55
37
|
Grade: ServiceGradeEnumSchema.optional(),
|
|
56
38
|
Class: ServiceClassEnumSchema.optional(),
|
|
57
39
|
LabelCode: Joi.string().optional().max(50),
|
package/src/index.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { DocumentType, DocumentTypeSchema } from './document-type';
|
|
2
|
-
import {
|
|
3
|
-
DocumentFormat,
|
|
4
|
-
DocumentFormatSchema,
|
|
5
|
-
} from '../labels/document-formats';
|
|
2
|
+
import { DocumentFormat, DocumentFormatSchema } from '../labels/document-formats';
|
|
6
3
|
import Joi from 'joi';
|
|
7
4
|
|
|
8
5
|
/** @description Basic structure for a document */
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
|
|
3
|
+
/** @description Possible status values for Created Manifest */
|
|
4
|
+
export enum ManifestStatus {
|
|
5
|
+
/** @description Unknown, The request is in process */
|
|
6
|
+
Unknown = 'unknown',
|
|
7
|
+
InProgress = 'in-progress',
|
|
8
|
+
Completed = 'completed',
|
|
9
|
+
Failed = 'failed',
|
|
10
|
+
}
|
|
11
|
+
export const ManifestStatusSchema = Joi.string().valid(...Object.values(ManifestStatus));
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
2
|
import { Identifier, IdentifierSchema } from '../identifier';
|
|
3
|
-
import {
|
|
4
|
-
ShipmentIdentifier,
|
|
5
|
-
ShipmentIdentifierSchema,
|
|
6
|
-
} from './shipment-identifier';
|
|
3
|
+
import { ShipmentIdentifier, ShipmentIdentifierSchema } from './shipment-identifier';
|
|
7
4
|
|
|
8
5
|
/** @description Basic structure for a pickup confirmation */
|
|
9
6
|
export class PickupConfirmation {
|
package/src/models/rates/rate.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import {
|
|
3
|
-
BillingLineItem,
|
|
4
|
-
BillingLineItemSchema,
|
|
5
|
-
} from '../billing/billing-line-item';
|
|
2
|
+
import { BillingLineItem, BillingLineItemSchema } from '../billing/billing-line-item';
|
|
6
3
|
import { TimeWindow, TimeWindowSchema } from '../time-window';
|
|
7
4
|
|
|
8
5
|
/** @description Basic structure for a rate */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseRequest } from './base-request';
|
|
2
|
+
|
|
3
|
+
/** @description Basic structure for a request to get previousely created manifests */
|
|
4
|
+
export class GetManifestRequest extends BaseRequest {
|
|
5
|
+
// Identifier to retrieve manifest
|
|
6
|
+
manifest_request_id?: number;
|
|
7
|
+
|
|
8
|
+
// Data required to retrieve manifests
|
|
9
|
+
manifest_identifiers?: { [key: string]: any };
|
|
10
|
+
|
|
11
|
+
// Default false: Allow up to 5 checks to DHL before returning.
|
|
12
|
+
return_immediately?: boolean;
|
|
13
|
+
}
|
package/src/requests/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './cancel-pickup-request';
|
|
2
2
|
export * from './create-label-request';
|
|
3
3
|
export * from './create-manifest-request';
|
|
4
|
+
export * from './get-manifest-request';
|
|
4
5
|
export * from './get-rates-request';
|
|
5
6
|
export * from './register-request';
|
|
6
7
|
export * from './schedule-pickup-request';
|
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { BaseResponse, BaseResponseSchema } from './base-response';
|
|
2
2
|
import { Manifest, ManifestSchema } from '../models';
|
|
3
3
|
import Joi from 'joi';
|
|
4
|
+
import { ManifestStatus, ManifestStatusSchema } from '../models/manifest-status';
|
|
4
5
|
|
|
5
6
|
/** @description Basic structure for a response to create a manifest */
|
|
6
7
|
export class CreateManifestResponse extends BaseResponse {
|
|
7
8
|
transaction_id!: string;
|
|
8
9
|
manifests?: Manifest[];
|
|
10
|
+
manifest_request_id?: number;
|
|
11
|
+
manifest_status?: ManifestStatus;
|
|
12
|
+
total_shipments?: number;
|
|
13
|
+
total_invalid?: number;
|
|
14
|
+
manifest_identifiers?: any;
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export const CreateManifestResponseSchema = BaseResponseSchema.keys({
|
|
12
18
|
transaction_id: Joi.string().required(),
|
|
13
19
|
manifests: Joi.array().optional().items(ManifestSchema),
|
|
20
|
+
manifest_request_id: Joi.number().optional(),
|
|
21
|
+
manifest_status: ManifestStatusSchema.optional,
|
|
22
|
+
total_shipments: Joi.number().optional(),
|
|
23
|
+
total_invalid: Joi.number().optional(),
|
|
24
|
+
manifest_identifiers: Joi.any().optional(),
|
|
14
25
|
});
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { BaseResponse, BaseResponseSchema } from './base-response';
|
|
2
|
-
import {
|
|
3
|
-
UpdateMethods,
|
|
4
|
-
TrackingInfo,
|
|
5
|
-
TrackingInfoSchema,
|
|
6
|
-
UpdateMethodsSchema,
|
|
7
|
-
} from '../models';
|
|
2
|
+
import { UpdateMethods, TrackingInfo, TrackingInfoSchema, UpdateMethodsSchema } from '../models';
|
|
8
3
|
import Joi from 'joi';
|
|
9
4
|
|
|
10
5
|
/** @description Basic structure for a response to normalize inbound tracking data */
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
import { BaseResponse, BaseResponseSchema } from './base-response';
|
|
2
|
-
import {
|
|
3
|
-
InboundDataContentTypes,
|
|
4
|
-
InboundDataContentTypesSchema,
|
|
5
|
-
} from '../models';
|
|
2
|
+
import { InboundDataContentTypes, InboundDataContentTypesSchema } from '../models';
|
|
6
3
|
import Joi from 'joi';
|
|
7
4
|
|
|
8
5
|
/** @description Basic structure for a response to validate inbound data */
|
package/src/spec.test.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OpenApiSpecification } from './spec';
|
|
2
|
+
describe('when importing the open api specification', () => {
|
|
3
|
+
it('it should load', () => {
|
|
4
|
+
expect(OpenApiSpecification).toBeDefined();
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
it('it should have the shape of an openapi document', () => {
|
|
8
|
+
expect(OpenApiSpecification.openapi).toBeDefined();
|
|
9
|
+
});
|
|
10
|
+
});
|
package/src/spec.ts
ADDED