mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 19:25:23 +00:00
Added support to a new field additionalInfoFields
This commit is contained in:
@@ -359,6 +359,18 @@ export default class PKPass extends Bundle {
|
||||
return this[propsSymbol][this.type].backFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows accessing to backFields object
|
||||
*
|
||||
* @throws (automatically) if no valid pass.json
|
||||
* has been parsed yet or, anyway, if current
|
||||
* type is not "eventTicket".
|
||||
*/
|
||||
|
||||
public get additionalInfoFields(): Schemas.Field[] {
|
||||
return this[propsSymbol]["eventTicket"].additionalInfoFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows setting a pass type.
|
||||
*
|
||||
@@ -420,6 +432,11 @@ export default class PKPass extends Bundle {
|
||||
sharedKeysPool,
|
||||
Schemas.Field,
|
||||
),
|
||||
additionalInfoFields: new FieldsArray(
|
||||
this,
|
||||
sharedKeysPool,
|
||||
Schemas.Field,
|
||||
),
|
||||
transitType: undefined,
|
||||
};
|
||||
}
|
||||
@@ -589,6 +606,7 @@ export default class PKPass extends Bundle {
|
||||
auxiliaryFields = [],
|
||||
backFields = [],
|
||||
transitType,
|
||||
additionalInfoFields = [],
|
||||
} = data[type] || {};
|
||||
|
||||
this.headerFields.push(...headerFields);
|
||||
@@ -596,6 +614,7 @@ export default class PKPass extends Bundle {
|
||||
this.secondaryFields.push(...secondaryFields);
|
||||
this.auxiliaryFields.push(...auxiliaryFields);
|
||||
this.backFields.push(...backFields);
|
||||
this.additionalInfoFields.push(...additionalInfoFields);
|
||||
|
||||
if (this.type === "boardingPass") {
|
||||
this.transitType = transitType;
|
||||
|
||||
Reference in New Issue
Block a user