@shipengine/connect-order-source-api
Version:
This is the typescript/javascript definitions for the order source api
40 lines • 1.63 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.DocumentSchema = exports.Document = exports.DocumentFormatSchema = exports.DocumentFormat = exports.DocumentTypeSchema = exports.DocumentType = void 0;
const tslib_1 = require("tslib");
const joi_1 = tslib_1.__importDefault(require("joi"));
var DocumentType;
(function (DocumentType) {
DocumentType["Label"] = "label";
DocumentType["CustomsForm"] = "customs_form";
DocumentType["CommercialInvoice"] = "commercial_invoice";
})(DocumentType || (exports.DocumentType = DocumentType = {}));
exports.DocumentTypeSchema = joi_1.default.string().valid(...Object.values(DocumentType));
var DocumentFormat;
(function (DocumentFormat) {
DocumentFormat["Pdf"] = "PDF";
DocumentFormat["Zpl"] = "ZPL";
DocumentFormat["Png"] = "PNG";
})(DocumentFormat || (exports.DocumentFormat = DocumentFormat = {}));
exports.DocumentFormatSchema = joi_1.default.string().valid(...Object.values(DocumentFormat));
class Document {
/**
* @description Usually there will only be 1 type present, but sometimes multiple documents can be combined
*/
type;
/**
* @description Base64 encoded string of the document in the specified format
*/
data;
/**
* @description The format the document is in
*/
format;
}
exports.Document = Document;
exports.DocumentSchema = joi_1.default.object({
type: joi_1.default.array().optional().items(exports.DocumentTypeSchema),
data: joi_1.default.string().optional(),
format: exports.DocumentFormatSchema.required(),
});
//# sourceMappingURL=document.js.map