-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v1.0.4' into main
- Loading branch information
Showing
90 changed files
with
1,735 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Event } from './../types/types/event.type'; | ||
import { IPayload } from './../types/interfaces/IPayload.interface'; | ||
import { SendingResponse } from './sending-response.class'; | ||
import { SendingError } from './sending-error.class'; | ||
/** | ||
* @summary Main class of cliam project. The Cliam class act as entry point and open wrapped methods such subscribe and emit. | ||
* | ||
* @public | ||
*/ | ||
declare class Cliam { | ||
/** | ||
* @description | ||
*/ | ||
private static instance; | ||
/** | ||
* @description | ||
*/ | ||
private emitter; | ||
private constructor(); | ||
/** | ||
* | ||
* @param emitter | ||
*/ | ||
static get(emitter: any): Cliam; | ||
/** | ||
* @description | ||
* | ||
* @param event | ||
*/ | ||
subscribe(event: Event | string): void; | ||
/** | ||
* @description | ||
*/ | ||
emit(event: Event, payload: IPayload): Promise<SendingResponse | SendingError>; | ||
} | ||
declare const cliam: Cliam; | ||
export { cliam as Cliam }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Smtp } from './smtp.class'; | ||
import { Consumer } from './consumer.class'; | ||
import { Transporter } from './../types/types/transporter.type'; | ||
/** | ||
* @description | ||
*/ | ||
declare class ClientConfiguration { | ||
sandbox?: { | ||
active: boolean; | ||
from: { | ||
name: string; | ||
email: string; | ||
}; | ||
to: { | ||
name: string; | ||
email: string; | ||
}; | ||
}; | ||
consumer: Consumer; | ||
mode: { | ||
api?: { | ||
credentials: { | ||
apiKey: string; | ||
token?: string; | ||
}; | ||
name: Transporter; | ||
templates: Array<{ | ||
[event: string]: string; | ||
}>; | ||
}; | ||
smtp?: Smtp; | ||
}; | ||
constructor(payload: Record<string, unknown>); | ||
} | ||
export { ClientConfiguration }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* @description | ||
*/ | ||
export declare class Consumer { | ||
/** | ||
* | ||
*/ | ||
domain: string; | ||
/** | ||
* | ||
*/ | ||
company?: string; | ||
/** | ||
* @description | ||
*/ | ||
addresses?: { | ||
from?: { | ||
name: string; | ||
email: string; | ||
}; | ||
replyTo?: { | ||
name: string; | ||
email: string; | ||
}; | ||
}; | ||
/** | ||
* | ||
*/ | ||
location?: { | ||
street: string; | ||
num: string; | ||
city: string; | ||
zip: string; | ||
country: string; | ||
}; | ||
/** | ||
* | ||
*/ | ||
email?: string; | ||
/** | ||
* | ||
*/ | ||
phone?: string; | ||
/** | ||
* @description | ||
*/ | ||
socials?: Array<{ | ||
name: string; | ||
url: string; | ||
icon: string; | ||
}>; | ||
/** | ||
* | ||
*/ | ||
theme?: { | ||
logo: string; | ||
primaryColor: string; | ||
secondaryColor: string; | ||
tertiaryColor: string; | ||
quaternaryColor: string; | ||
}; | ||
constructor(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Transporter } from './../types/types/transporter.type'; | ||
/** | ||
* @description | ||
* | ||
* @todo LOW :: Rename as WebApiProvider | ||
*/ | ||
export declare class Provider { | ||
/** | ||
* @description | ||
*/ | ||
name: Transporter; | ||
/** | ||
* @description | ||
*/ | ||
credentials: { | ||
/** | ||
* @description | ||
*/ | ||
key: string; | ||
/** | ||
* @description | ||
*/ | ||
token: string; | ||
}; | ||
/** | ||
* @description | ||
*/ | ||
templates: any; | ||
/** | ||
* @description | ||
*/ | ||
domains: string[]; | ||
constructor(payload: Record<string, unknown>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { IError } from './../types/interfaces/IError.interface'; | ||
/** | ||
* Type sending error | ||
*/ | ||
export declare class SendingError implements IError { | ||
/** | ||
* @description HTTP response status code | ||
*/ | ||
statusCode: number; | ||
/** | ||
* @description HTTP response status message | ||
*/ | ||
statusText: string; | ||
/** | ||
* @description HTTP response errors | ||
*/ | ||
errors: string[]; | ||
constructor(status: number, message: string, errors: string[]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { ISending } from './../types/interfaces/ISending.interface'; | ||
import { HTTP_METHOD } from './../types/enums/http-method.enum'; | ||
/** | ||
* Sending response wrapper | ||
*/ | ||
export declare class SendingResponse implements ISending { | ||
/** | ||
* @description | ||
*/ | ||
accepted?: string | string[]; | ||
/** | ||
* @description Request uri | ||
*/ | ||
uri: string; | ||
/** | ||
* @description HTTP protocol version | ||
*/ | ||
httpVersion: string; | ||
/** | ||
* @description | ||
*/ | ||
messageId?: string; | ||
/** | ||
* @description Request method | ||
*/ | ||
method: HTTP_METHOD; | ||
/** | ||
* @description Request headers | ||
*/ | ||
headers: object; | ||
/** | ||
* @description Response body | ||
*/ | ||
body: Record<string, unknown>; | ||
/** | ||
* @description HTTP status code | ||
*/ | ||
statusCode: number; | ||
/** | ||
* @description HTTP status message | ||
*/ | ||
statusMessage: string; | ||
constructor(); | ||
/** | ||
* @description Property setter | ||
* | ||
* @param property | ||
* @param value | ||
*/ | ||
set(property: string, value: number | string | string[] | Record<string, unknown> | HTTP_METHOD): SendingResponse; | ||
/** | ||
* @description Property getter | ||
* | ||
* @param property | ||
*/ | ||
get(property: string): number | string | string[] | Record<string, unknown> | HTTP_METHOD; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* @description | ||
*/ | ||
export declare class Smtp { | ||
/** | ||
* @description | ||
*/ | ||
host: string; | ||
/** | ||
* @description | ||
*/ | ||
port: number; | ||
/** | ||
* @description | ||
*/ | ||
secure: boolean; | ||
/** | ||
* @description | ||
*/ | ||
username: string; | ||
/** | ||
* @description | ||
*/ | ||
password: string; | ||
constructor(payload: Record<string, unknown>); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Cliam } from './classes/cliam.class'; | ||
export { Cliam }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
/** | ||
* On the fly hbs compilation middleware | ||
*/ | ||
declare class Compiler { | ||
/** | ||
* @description | ||
*/ | ||
private static instance; | ||
/** | ||
* @description | ||
*/ | ||
private readonly LAYOUT; | ||
/** | ||
* @description | ||
*/ | ||
private readonly PARTIALS; | ||
/** | ||
* @description | ||
*/ | ||
private readonly BLOCKS; | ||
/** | ||
* @description | ||
*/ | ||
private readonly TEMPLATES; | ||
/** | ||
* @description | ||
*/ | ||
private readonly SOCIALS; | ||
/** | ||
* @description | ||
*/ | ||
private readonly COLORS; | ||
constructor(); | ||
/** | ||
* @description | ||
*/ | ||
static get(): Compiler; | ||
/** | ||
* @description | ||
* | ||
* @param event | ||
* @param data | ||
* | ||
* @todo LOW :: do better about socials and banner | ||
*/ | ||
compile(event: string, data: Record<string, unknown>): { | ||
text: string; | ||
html: string; | ||
}; | ||
/** | ||
* @description | ||
* | ||
* @param html | ||
*/ | ||
textify(html: string): string; | ||
/** | ||
* @description | ||
* | ||
* @param event | ||
*/ | ||
private getBanner; | ||
/** | ||
* @description | ||
* | ||
* @param event | ||
*/ | ||
private getSegment; | ||
/** | ||
* @description | ||
* | ||
* @param html | ||
*/ | ||
private customize; | ||
} | ||
declare const service: Compiler; | ||
export { service as Compiler }; |
Oops, something went wrong.