Moved relevantDates from semantics to root

This commit is contained in:
Alexander Cerutti
2024-10-02 19:40:07 +02:00
parent 8ee077c879
commit 5b23f8fbf6
2 changed files with 25 additions and 23 deletions

View File

@@ -33,6 +33,26 @@ export const PreferredStyleSchemes = Joi.array().items(
"eventTicket",
) satisfies Joi.Schema<PreferredStyleSchemes>;
/**
* For newly-introduced event tickets
* in iOS 18
*/
interface RelevantDate {
startDate: string;
endDate: string;
}
/**
* Minimum supported version: iOS 18
*/
const RelevantDate = Joi.object<RelevantDate>().keys({
startDate: Joi.string().required(),
endDate: Joi.string().required(),
});
export interface FileBuffers {
[key: string]: Buffer;
}
@@ -66,6 +86,9 @@ export interface PassProps {
beacons?: Beacon[];
barcodes?: Barcode[];
relevantDate?: string;
relevantDates?: RelevantDate[];
expirationDate?: string;
locations?: Location[];
@@ -122,6 +145,7 @@ type PassMethodsProps =
| "beacons"
| "barcodes"
| "relevantDate"
| "relevantDates"
| "expirationDate"
| "locations"
| "preferredStyleSchemes";
@@ -150,6 +174,7 @@ export const PassPropsFromMethods = Joi.object<PassPropsFromMethods>({
beacons: Joi.array().items(Beacon),
barcodes: Joi.array().items(Barcode),
relevantDate: Joi.string().isoDate(),
relevantDates: Joi.array().items(RelevantDate),
expirationDate: Joi.string().isoDate(),
locations: Joi.array().items(Location),
preferredStyleSchemes: PreferredStyleSchemes,