diff --git a/src/PKPass.ts b/src/PKPass.ts index ec9e26e..f3bd977 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -22,14 +22,6 @@ interface NamedBuffers { [key: string]: Buffer; } -namespace PKPass { - export interface Template { - model: string; - certificates: Schemas.Certificates; - overrides?: Schemas.OverridesSupportedOptions; - } -} - type TransitTypes = `PKTransitType${ | "Air" | "Boat" @@ -58,8 +50,8 @@ export default class PKPass extends Bundle { * @returns */ - static async from(source: PKPass | PKPass.Template): Promise { - let certificates: Schemas.Certificates = undefined; + static async from(source: PKPass | Schemas.Template): Promise { + let certificates: Schemas.CertificatesSchema = undefined; let buffers: NamedBuffers = undefined; if (!source) { diff --git a/src/schemas/index.ts b/src/schemas/index.ts index ec80339..ec480c9 100644 --- a/src/schemas/index.ts +++ b/src/schemas/index.ts @@ -78,15 +78,15 @@ export const CertificatesSchema = Joi.object() }) .required(); -export interface PassInstance { - model: PartitionedBundle; +export interface Template { + model: string; certificates: CertificatesSchema; overrides?: OverridesSupportedOptions; } -export const PassInstance = Joi.object().keys({ - model: Joi.alternatives(Joi.object(), Joi.string()).required(), - certificates: Joi.object(), +export const Template = Joi.object