@shipengine/connect-carrier-api 2.3.0 → 2.3.1
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.js +6 -39
- package/lib/app/carrier-app.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.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/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/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/responses/normalize-tracking-data-response.js.map +1 -1
- package/lib/responses/validate-inbound-data-response.js.map +1 -1
- package/package.json +1 -1
- package/src/app/carrier-app-definition.ts +5 -15
- package/src/app/carrier-app.ts +9 -45
- package/src/app/internal/carrier-specification.ts +20 -7
- package/src/app/internal/metadata.ts +1 -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/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/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/responses/normalize-tracking-data-response.ts +1 -6
- package/src/responses/validate-inbound-data-response.ts +1 -4
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -3,17 +3,23 @@ import Joi from 'joi';
|
|
|
3
3
|
export interface AccountModals {
|
|
4
4
|
/** @description Schema for the form to register with the carrier */
|
|
5
5
|
RegistrationFormSchema: {
|
|
6
|
-
|
|
6
|
+
/** @deprecated Please use JsonSchema & UiSchema */
|
|
7
|
+
formSchema?: {
|
|
7
8
|
jsonSchema: object;
|
|
8
9
|
uiSchema: object;
|
|
9
10
|
};
|
|
11
|
+
JsonSchema?: object;
|
|
12
|
+
UiSchema?: object;
|
|
10
13
|
};
|
|
11
14
|
/** @description Schema for the form to update carrier settings */
|
|
12
15
|
SettingsFormSchema: {
|
|
13
|
-
|
|
16
|
+
/** @deprecated Please use JsonSchema & UiSchema */
|
|
17
|
+
formSchema?: {
|
|
14
18
|
jsonSchema: object;
|
|
15
19
|
uiSchema: object;
|
|
16
20
|
};
|
|
21
|
+
JsonSchema?: object;
|
|
22
|
+
UiSchema?: object;
|
|
17
23
|
};
|
|
18
24
|
}
|
|
19
25
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import {
|
|
3
|
-
AuthSpecification,
|
|
4
|
-
AuthSpecificationSchema,
|
|
5
|
-
Carrier,
|
|
6
|
-
CarrierSchema,
|
|
7
|
-
} from '.';
|
|
2
|
+
import { AuthSpecification, AuthSpecificationSchema, Carrier, CarrierSchema } from '.';
|
|
8
3
|
|
|
9
4
|
export interface CarrierAppMetadata {
|
|
10
5
|
/** @description Id of the carrier app */
|
|
@@ -1,24 +1,12 @@
|
|
|
1
1
|
import { AccountModals, AccountModalsSchema } from './account-modals';
|
|
2
2
|
import { PackageType, PackageTypeSchema } from './package-type';
|
|
3
3
|
import { ShippingService, ShippingServiceSchema } from './shipping-service';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from './shipping-option';
|
|
8
|
-
import {
|
|
9
|
-
CountryAssociation,
|
|
10
|
-
CountryAssociationSchema,
|
|
11
|
-
} from './country-association';
|
|
12
|
-
import {
|
|
13
|
-
CarrierAttributeEnum,
|
|
14
|
-
CarrierAttributeEnumSchema,
|
|
15
|
-
} from './carrier-attributes';
|
|
4
|
+
import { ShippingOptionDictionary, ShippingOptionDictionarySchema } from './shipping-option';
|
|
5
|
+
import { CountryAssociation, CountryAssociationSchema } from './country-association';
|
|
6
|
+
import { CarrierAttributeEnum, CarrierAttributeEnumSchema } from './carrier-attributes';
|
|
16
7
|
import { LabelFormatsEnum, LabelFormatsEnumSchema } from './label-formats';
|
|
17
8
|
import { LabelSizesEnum, LabelSizesEnumSchema } from './label-sizes';
|
|
18
|
-
import {
|
|
19
|
-
ConfirmationDictionary,
|
|
20
|
-
ConfirmationDictionarySchema,
|
|
21
|
-
} from './confirmation-type';
|
|
9
|
+
import { ConfirmationDictionary, ConfirmationDictionarySchema } from './confirmation-type';
|
|
22
10
|
import { existsSync } from 'fs';
|
|
23
11
|
import Joi from 'joi';
|
|
24
12
|
|
|
@@ -55,25 +43,16 @@ const fileExists = (value: string, helpers: any) => {
|
|
|
55
43
|
export const CarrierSchema = Joi.object({
|
|
56
44
|
AccountModals: AccountModalsSchema.required(),
|
|
57
45
|
PackageTypes: Joi.array().optional().items(PackageTypeSchema).unique('Id'),
|
|
58
|
-
ShippingServices: Joi.array()
|
|
59
|
-
.optional()
|
|
60
|
-
.items(ShippingServiceSchema)
|
|
61
|
-
.unique('Id'),
|
|
46
|
+
ShippingServices: Joi.array().optional().items(ShippingServiceSchema).unique('Id'),
|
|
62
47
|
ShippingOptions: ShippingOptionDictionarySchema.optional(),
|
|
63
48
|
DefaultSupportedCountries: Joi.array()
|
|
64
49
|
.optional()
|
|
65
50
|
.items(CountryAssociationSchema)
|
|
66
51
|
.unique('FromCountry'),
|
|
67
|
-
DefaultLabelSizes: Joi.array()
|
|
68
|
-
.optional()
|
|
69
|
-
.items(LabelSizesEnumSchema)
|
|
70
|
-
.unique(),
|
|
52
|
+
DefaultLabelSizes: Joi.array().optional().items(LabelSizesEnumSchema).unique(),
|
|
71
53
|
LabelFormats: Joi.array().optional().items(LabelFormatsEnumSchema).unique(),
|
|
72
54
|
DefaultConfirmationTypes: ConfirmationDictionarySchema.optional(),
|
|
73
|
-
CarrierAttributes: Joi.array()
|
|
74
|
-
.optional()
|
|
75
|
-
.items(CarrierAttributeEnumSchema)
|
|
76
|
-
.unique(),
|
|
55
|
+
CarrierAttributes: Joi.array().optional().items(CarrierAttributeEnumSchema).unique(),
|
|
77
56
|
TrackingUrl: Joi.string()
|
|
78
57
|
.optional()
|
|
79
58
|
.pattern(
|
|
@@ -67,10 +67,7 @@ export class ResponseTransformationConfiguration {
|
|
|
67
67
|
connection_context?: MapOfStrings;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export const MapOfStringsSchema = Joi.object().pattern(
|
|
71
|
-
Joi.string(),
|
|
72
|
-
Joi.string(),
|
|
73
|
-
);
|
|
70
|
+
export const MapOfStringsSchema = Joi.object().pattern(Joi.string(), Joi.string());
|
|
74
71
|
|
|
75
72
|
export const ResponseTransformationConfigurationSchema = Joi.object({
|
|
76
73
|
access_token: Joi.string().required(),
|
|
@@ -12,6 +12,4 @@ export enum ServiceClassEnum {
|
|
|
12
12
|
ThreeDay = 'ThreeDay',
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export const ServiceClassEnumSchema = Joi.string().valid(
|
|
16
|
-
...Object.values(ServiceClassEnum),
|
|
17
|
-
);
|
|
15
|
+
export const ServiceClassEnumSchema = Joi.string().valid(...Object.values(ServiceClassEnum));
|
|
@@ -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),
|
|
@@ -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 */
|
|
@@ -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 */
|
|
@@ -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 */
|