UNPKG

@shipengine/connect-carrier-api

Version:

This is the typescript/javascript definitions for carrier api

26 lines (23 loc) 931 B
import Joi from 'joi'; import { AuthSpecification, AuthSpecificationSchema, Carrier, CarrierSchema } from '.'; export interface CarrierAppMetadata { /** @description The id for this integration (this GUID should not be changed after publishing) */ Id: string; /** @description The name of this integration, used for internal purposes, can be the same as the branded Carrier in Carriers[] */ Name: string; /** @description The specification for authorizing with this carrier */ AuthProcess?: AuthSpecification; /** @description A list of branded carriers */ Carriers: Carrier[]; } export const CarrierAppMetadataSchema = Joi.object({ Id: Joi.string().uuid().required(), Name: Joi.string().required(), AuthProcess: AuthSpecificationSchema.optional(), Carriers: Joi.array() .unique('Id') .required() .min(1) .message('There must be at least 1 Carrier defined') .items(CarrierSchema), });