Updated relevancy schemas to match new iOS 18 changes

This commit is contained in:
Alexander Cerutti
2025-01-08 10:52:24 +01:00
parent 943b48c72e
commit 9d8ad48665

View File

@@ -30,23 +30,37 @@ export const PreferredStyleSchemes = Joi.array().items(
) satisfies Joi.Schema<PreferredStyleSchemes>; ) satisfies Joi.Schema<PreferredStyleSchemes>;
/** /**
* For newly-introduced event tickets * A single interval can span at most 24 hours
* in iOS 18
*/ */
interface RelevancyInterval {
interface RelevantDate {
startDate: string; startDate: string;
endDate: string; endDate: string;
} }
interface RelevancyEntry {
relevantDate: string;
}
/** /**
* Minimum supported version: iOS 18 * Newly introduced in iOS 18.
* Using a RelevancyInterval, will trigger a live activity on
* new event ticket passes.
*
* Using a RelevancyEntry, will match the behavior of the
* currently deprecated property `relevantDate`.
*/ */
const RelevantDate = Joi.object<RelevantDate>().keys({ export type RelevantDate = RelevancyInterval | RelevancyEntry;
startDate: Joi.string().required(),
endDate: Joi.string().required(), const RelevantDate = Joi.alternatives(
}); Joi.object<RelevancyInterval>().keys({
startDate: Joi.string().required(),
endDate: Joi.string().required(),
}),
Joi.object<RelevancyEntry>().keys({
relevantDate: Joi.string().required(),
}),
);
export interface FileBuffers { export interface FileBuffers {
[key: string]: Buffer; [key: string]: Buffer;
@@ -80,6 +94,11 @@ export interface PassProps {
nfc?: NFC; nfc?: NFC;
beacons?: Beacon[]; beacons?: Beacon[];
barcodes?: Barcode[]; barcodes?: Barcode[];
/**
* @deprecated starting from iOS 18
* Use `relevantDates`
*/
relevantDate?: string; relevantDate?: string;
relevantDates?: RelevantDate[]; relevantDates?: RelevantDate[];