Skip to content

Commit

Permalink
Merge branch 'release/v1.0.4' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
steve-lebleu committed Apr 16, 2021
2 parents a259320 + 75d98e8 commit f775eec
Show file tree
Hide file tree
Showing 90 changed files with 1,735 additions and 2 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

## [v1.0.3](https://github.com/konfer-be/cliam/compare/v1.0.2...v1.0.3)
## [v1.0.4](https://github.com/konfer-be/cliam/compare/v1.0.3...v1.0.4)

### Commits

- Typescript declarations [`7728d01`](https://github.com/konfer-be/cliam/commit/7728d011268c5ae896040ad0499a1b330d6d8900)

## [v1.0.3](https://github.com/konfer-be/cliam/compare/v1.0.2...v1.0.3) - 2021-04-15

### Commits

- Update changelog [`9999b16`](https://github.com/konfer-be/cliam/commit/9999b163ecf0de85520d22936e92a091af41589b)
- Fix merge replyTo property [`f633e07`](https://github.com/konfer-be/cliam/commit/f633e07264bca9e03951adb9d6face9dc2e182c3)

## [v1.0.2](https://github.com/konfer-be/cliam/compare/v1.0.1...v1.0.2) - 2021-04-15
Expand Down
37 changes: 37 additions & 0 deletions lib/classes/cliam.class.d.ts
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 };
35 changes: 35 additions & 0 deletions lib/classes/client-configuration.class.d.ts
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 };
63 changes: 63 additions & 0 deletions lib/classes/consumer.class.d.ts
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();
}
34 changes: 34 additions & 0 deletions lib/classes/provider.class.d.ts
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>);
}
19 changes: 19 additions & 0 deletions lib/classes/sending-error.class.d.ts
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[]);
}
57 changes: 57 additions & 0 deletions lib/classes/sending-response.class.d.ts
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;
}
26 changes: 26 additions & 0 deletions lib/classes/smtp.class.d.ts
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>);
}
2 changes: 2 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { Cliam } from './classes/cliam.class';
export { Cliam };
76 changes: 76 additions & 0 deletions lib/services/compiler.service.d.ts
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 };
Loading

0 comments on commit f775eec

Please sign in to comment.