lemon-core
Version:
Lemon Serverless Micro-Service Platform
51 lines (50 loc) • 1.6 kB
TypeScript
import { CoreSnsService } from '../core-services';
import 'dotenv/config';
/** ****************************************************************************************************************
* Public Instance Exported.
** ****************************************************************************************************************/
export declare class TopicsService implements CoreSnsService {
/**
* environ name of SNS KEY
* - for self messaging.
*/
static ENV_SB_TOPICS_ENDPOINT: string;
static DEF_SB_TOPICS_ENDPOINT: string;
private _arn;
constructor(arn?: string);
/**
* get name of this
*/
name: () => string;
instance: () => Promise<{
serviceBusClient: any;
}>;
/**
* hello
*/
hello: () => string;
/**
* publish message
*
* @return {string | object} message-id
*/
publish: (target: string, subject: string, payload: any) => Promise<any>;
/**
* report error via SNS with subject 'error'
* - default to `lemon-hello-sns` or using `env[REPORT_ERROR_ARN]`
*
* @param e Error instance
* @param data simple text message or object to override.
* @param target (optional) target SNS arn (default is `REPORT_ERROR_ARN`)
*/
reportError: (e: Error, data: any, target?: string) => Promise<string>;
/**
* convert Error to payload.
*/
asPayload: (e: any, data: string | object) => {
'stack-trace'?: any;
message: string;
error: string;
errorss?: any[];
};
}