import { Proxy } from "../decorators" ; import { Metadata } from "./common" ; export interface ProxyMetadata extends Metadata { application : string ; functionName : string ; proxy : string ; } export namespace ProxyMetadata { export function has ( target ) { let meta = get ( target , false ) ; return ! ! ( meta && meta . proxy ) ; } export function get ( target , init ? ) { return Metadata . get ( target , init ) as ProxyMetadata ; } export function id ( target , appId ) { return ( application ( target ) || appId ) + ":" + get ( target ) . name ; } export function application ( target ) { return get ( target ) . application ; } export function service ( target ) { return get ( target ) . proxy ; } export function functionName ( target ) { return get ( target ) . functionName ; } }