mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Moved Template type to Schemas
This commit is contained in:
@@ -22,14 +22,6 @@ interface NamedBuffers {
|
|||||||
[key: string]: Buffer;
|
[key: string]: Buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace PKPass {
|
|
||||||
export interface Template {
|
|
||||||
model: string;
|
|
||||||
certificates: Schemas.Certificates;
|
|
||||||
overrides?: Schemas.OverridesSupportedOptions;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
type TransitTypes = `PKTransitType${
|
type TransitTypes = `PKTransitType${
|
||||||
| "Air"
|
| "Air"
|
||||||
| "Boat"
|
| "Boat"
|
||||||
@@ -58,8 +50,8 @@ export default class PKPass extends Bundle {
|
|||||||
* @returns
|
* @returns
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static async from(source: PKPass | PKPass.Template): Promise<PKPass> {
|
static async from(source: PKPass | Schemas.Template): Promise<PKPass> {
|
||||||
let certificates: Schemas.Certificates = undefined;
|
let certificates: Schemas.CertificatesSchema = undefined;
|
||||||
let buffers: NamedBuffers = undefined;
|
let buffers: NamedBuffers = undefined;
|
||||||
|
|
||||||
if (!source) {
|
if (!source) {
|
||||||
|
|||||||
@@ -78,15 +78,15 @@ export const CertificatesSchema = Joi.object<CertificatesSchema>()
|
|||||||
})
|
})
|
||||||
.required();
|
.required();
|
||||||
|
|
||||||
export interface PassInstance {
|
export interface Template {
|
||||||
model: PartitionedBundle;
|
model: string;
|
||||||
certificates: CertificatesSchema;
|
certificates: CertificatesSchema;
|
||||||
overrides?: OverridesSupportedOptions;
|
overrides?: OverridesSupportedOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const PassInstance = Joi.object<PassInstance>().keys({
|
export const Template = Joi.object<Template>({
|
||||||
model: Joi.alternatives(Joi.object(), Joi.string()).required(),
|
model: Joi.string().required(),
|
||||||
certificates: Joi.object(),
|
certificates: Joi.object().required(),
|
||||||
overrides: Joi.object(),
|
overrides: Joi.object(),
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -181,7 +181,7 @@ type AvailableSchemas =
|
|||||||
| typeof PassFields
|
| typeof PassFields
|
||||||
| typeof Personalization
|
| typeof Personalization
|
||||||
| typeof TransitType
|
| typeof TransitType
|
||||||
| typeof PassInstance
|
| typeof Template
|
||||||
| typeof CertificatesSchema
|
| typeof CertificatesSchema
|
||||||
| typeof OverridesSupportedOptions;
|
| typeof OverridesSupportedOptions;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user