Improved types, messages and exported objects

This commit is contained in:
Alexander Cerutti
2019-07-25 23:08:21 +02:00
parent 040e4a891f
commit 9321ccc4ba
3 changed files with 10 additions and 4 deletions

View File

@@ -1 +1,7 @@
export { createPass, Pass } from "./src/factory"; import { Pass } from "./src/pass";
import { AbstractModel } from "./src/abstract";
export { createPass } from "./src/factory";
export { createAbstractModel } from "./src/abstract";
export type Pass = InstanceType<typeof Pass>
export type AbstractModel = InstanceType<typeof AbstractModel>

View File

@@ -3,8 +3,8 @@ interface MessageGroup {
} }
const errors: MessageGroup = { const errors: MessageGroup = {
CP_INIT_ERROR: "Something went really bad in the initialization, dude! Please look at the log below this message. It should contain all the infos about the problem: \n%s", CP_INIT_ERROR: "Something went really bad in the %s initialization! Look at the log below this message. It should contain all the infos about the problem: \n%s",
CP_NO_OPTS: "Cannot initialize the pass creation: no options were passed.", CP_NO_OPTS: "Cannot initialize the pass or abstract model creation: no options were passed.",
CP_NO_CERTS: "Cannot initialize the pass creation: no valid certificates were passed.", CP_NO_CERTS: "Cannot initialize the pass creation: no valid certificates were passed.",
PASSFILE_VALIDATION_FAILED: "Validation of pass type failed. Pass file is not a valid buffer or (more probably) does not respect the schema.\nRefer to https://apple.co/2Nvshvn to build a correct pass.", PASSFILE_VALIDATION_FAILED: "Validation of pass type failed. Pass file is not a valid buffer or (more probably) does not respect the schema.\nRefer to https://apple.co/2Nvshvn to build a correct pass.",
REQUIR_VALID_FAILED: "The options passed to Pass constructor does not meet the requirements.\nRefer to the documentation to compile them correctly.", REQUIR_VALID_FAILED: "The options passed to Pass constructor does not meet the requirements.\nRefer to the documentation to compile them correctly.",

View File

@@ -15,7 +15,7 @@ export interface Certificates {
export interface FactoryOptions { export interface FactoryOptions {
model: BundleUnit | string; model: BundleUnit | string;
certificates: Certificates; certificates: Certificates;
overrides?: Object; overrides?: OverridesSupportedOptions;
} }
export interface BundleUnit { export interface BundleUnit {