mirror of
https://github.com/marcogll/passkit-generator.git
synced 2026-03-15 16:25:21 +00:00
Added certificates saving in constructor and parsing them when signature is being created; changed Manifest to be exported as a Buffer
This commit is contained in:
@@ -6,6 +6,7 @@ export * from "./NFC";
|
||||
export * from "./SemanticTags";
|
||||
export * from "./PassFields";
|
||||
export * from "./Personalize";
|
||||
export * from "./Certificates";
|
||||
|
||||
import Joi from "joi";
|
||||
import debug from "debug";
|
||||
@@ -18,6 +19,7 @@ import { Field } from "./PassFieldContent";
|
||||
import { PassFields, TransitType } from "./PassFields";
|
||||
import { Personalization } from "./Personalize";
|
||||
import { Semantics } from "./SemanticTags";
|
||||
import { CertificatesSchema } from "./Certificates";
|
||||
|
||||
const schemaDebug = debug("Schema");
|
||||
|
||||
@@ -25,33 +27,6 @@ export interface FileBuffers {
|
||||
[key: string]: Buffer;
|
||||
}
|
||||
|
||||
/* export interface Certificates {
|
||||
wwdr?: string;
|
||||
signerCert?: string;
|
||||
signerKey?:
|
||||
| {
|
||||
keyFile: string;
|
||||
passphrase?: string;
|
||||
}
|
||||
| string;
|
||||
}*/
|
||||
|
||||
export interface CertificatesSchema {
|
||||
wwdr: string | Buffer;
|
||||
signerCert: string | Buffer;
|
||||
signerKey: string | Buffer;
|
||||
signerKeyPassphrase?: string;
|
||||
}
|
||||
|
||||
export const CertificatesSchema = Joi.object<CertificatesSchema>()
|
||||
.keys({
|
||||
wwdr: Joi.alternatives(Joi.binary(), Joi.string()).required(),
|
||||
signerCert: Joi.alternatives(Joi.binary(), Joi.string()).required(),
|
||||
signerKey: Joi.alternatives(Joi.binary(), Joi.string()).required(),
|
||||
signerKeyPassphrase: Joi.string(),
|
||||
})
|
||||
.required();
|
||||
|
||||
export interface PassProps {
|
||||
serialNumber?: string;
|
||||
description?: string;
|
||||
@@ -206,12 +181,6 @@ type AvailableSchemas =
|
||||
| typeof CertificatesSchema
|
||||
| typeof OverridablePassProps;
|
||||
|
||||
export type ArrayPassSchema = Beacon | Location | Barcode;
|
||||
|
||||
/* function resolveSchemaName(name: Schema) {
|
||||
return schemas[name] || undefined;
|
||||
}
|
||||
*/
|
||||
/**
|
||||
* Checks if the passed options are compliant with the indicated schema
|
||||
* @param {any} opts - options to be checks
|
||||
|
||||
Reference in New Issue
Block a user