From a97023262374652141895d00fc38282df17c6896 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Sat, 18 Sep 2021 21:45:46 +0200 Subject: [PATCH] Added fields and pool creation to PKPass --- src/PKPass.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/PKPass.ts b/src/PKPass.ts index 4d01130..1f9f820 100644 --- a/src/PKPass.ts +++ b/src/PKPass.ts @@ -1,11 +1,21 @@ -import { Certificates } from "../lib/schemas"; +import FieldsArray from "../src/fieldsArray"; +import { Certificates } from "../src/schemas"; import { default as Bundle, filesSymbol } from "./Bundle"; +const fieldKeysPoolSymbol = Symbol("fieldKeysPoolSymbol"); + interface NamedBuffers { [key: string]: Buffer; } export class PKPass extends Bundle { + private [fieldKeysPoolSymbol] = new Set(); + public primaryFields /*****/ = new FieldsArray(this[fieldKeysPoolSymbol]); + public secondaryFields /***/ = new FieldsArray(this[fieldKeysPoolSymbol]); + public auxiliaryFields /***/ = new FieldsArray(this[fieldKeysPoolSymbol]); + public headerFields /******/ = new FieldsArray(this[fieldKeysPoolSymbol]); + public backFields /********/ = new FieldsArray(this[fieldKeysPoolSymbol]); + constructor(buffers: NamedBuffers, certificates: Certificates) { super("application/vnd.apple.pkpass");