Renamed schema files and removed few TODOs

This commit is contained in:
Alexander Cerutti
2021-10-16 14:02:03 +02:00
parent c256d1638b
commit c432b45b00
7 changed files with 12 additions and 17 deletions

30
src/schemas/Barcode.ts Normal file
View File

@@ -0,0 +1,30 @@
import Joi from "joi";
/**
* @see https://developer.apple.com/documentation/walletpasses/pass/barcodes
*/
export type BarcodeFormat =
| "PKBarcodeFormatQR"
| "PKBarcodeFormatPDF417"
| "PKBarcodeFormatAztec"
| "PKBarcodeFormatCode128";
export interface Barcode {
altText?: string;
messageEncoding?: string;
format: BarcodeFormat;
message: string;
}
export const Barcode = Joi.object<Barcode>().keys({
altText: Joi.string(),
messageEncoding: Joi.string().default("iso-8859-1"),
format: Joi.string()
.required()
.regex(
/(PKBarcodeFormatQR|PKBarcodeFormatPDF417|PKBarcodeFormatAztec|PKBarcodeFormatCode128)/,
"barcodeType",
),
message: Joi.string().required(),
});