vulcain-corejs
Version:
Vulcain micro-service framework
61 lines (60 loc) • 1.74 kB
TypeScript
export interface ServiceDependencyInfo {
service: string;
version: string;
discoveryAddress: string;
}
export interface ConfigurationInfo {
key: string;
schema: string;
}
export interface DatabaseDependencyInfo {
address: string;
schema: string;
}
export interface ExternalDependencyInfo {
uri: string;
}
/**
* Contains all service dependencies
*
* @export
* @class VulcainManifest
*/
export declare class VulcainManifest {
dependencies: {
services: Array<ServiceDependencyInfo>;
externals: Array<ExternalDependencyInfo>;
databases: Array<DatabaseDependencyInfo>;
};
configurations: {
[name: string]: string;
};
constructor();
}
/**
* Declare a vulcain service dependencie for the current service
*
* @export
* @param {string} service Name of the called service
* @param {string} version Version of the called service
* @param {string} discoveryAddress Discovery address of the called service (ex:http://..:30000/api/_servicedesctipyion)
* @returns
*/
export declare function ServiceDependency(service: string, version: string, discoveryAddress: string): (target: Function) => void;
/**
* Declare an external http call dependencie for the current service
*
* @export
* @param {string} uri External uri
* @returns
*/
export declare function HttpDependency(uri: string): (target: Function) => void;
/**
* Declare a dynamic property configuration for the current service.
*
* @export
* @param {string} propertyName Property name
* @param {string} schema Property schema (can be a model or a native js type)
* @returns
*/
export declare function ConfigurationProperty(propertyName: string, schema: string): (target: Function) => void;