cosmos-db-repositories
Version:
cosmos-db repositories
16 lines (15 loc) • 623 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const eventgrid_1 = require("@azure/eventgrid");
let eventClient;
const clientInstance = () => {
if (!eventClient) {
const topicEndpoint = process.env.AZURE_DATAGRID_TOPIC_URL;
const topicKey = process.env.AZURE_DATAGRID_TOPIC_KEY;
const inputSchema = 'EventGrid';
eventClient = new eventgrid_1.EventGridPublisherClient(topicEndpoint, inputSchema, new eventgrid_1.AzureKeyCredential(topicKey));
}
return eventClient;
};
const send = (event) => clientInstance().send(event);
exports.default = { send };