From 9321ccc4ba639ca1c21a64a3175f907ec33714f3 Mon Sep 17 00:00:00 2001 From: Alexander Cerutti Date: Thu, 25 Jul 2019 23:08:21 +0200 Subject: [PATCH] Improved types, messages and exported objects --- index.ts | 8 +++++++- src/messages.ts | 4 ++-- src/schema.ts | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/index.ts b/index.ts index 527fdbc..c5a60fa 100644 --- a/index.ts +++ b/index.ts @@ -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 +export type AbstractModel = InstanceType diff --git a/src/messages.ts b/src/messages.ts index df7b43b..e05d175 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -3,8 +3,8 @@ interface 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_NO_OPTS: "Cannot initialize the pass creation: no options were passed.", + 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 or abstract model creation: no options 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.", REQUIR_VALID_FAILED: "The options passed to Pass constructor does not meet the requirements.\nRefer to the documentation to compile them correctly.", diff --git a/src/schema.ts b/src/schema.ts index f9ca5fb..fd1d6a1 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -15,7 +15,7 @@ export interface Certificates { export interface FactoryOptions { model: BundleUnit | string; certificates: Certificates; - overrides?: Object; + overrides?: OverridesSupportedOptions; } export interface BundleUnit {