Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@azure/eventgrid

Package Overview
Dependencies
Maintainers
6
Versions
327
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/eventgrid - npm Package Compare versions

Comparing version 3.0.0-alpha.20200929.1 to 3.0.0-alpha.20201002.1

dist-esm/src/cloudEventDistrubtedTracingEnricherPolicy.js

69

dist-esm/src/eventGridClient.js
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
import { __awaiter } from "tslib";
import { createPipelineFromOptions, generateUuid } from "@azure/core-http";

@@ -8,2 +9,5 @@ import { createEventGridCredentialPolicy } from "./eventGridAuthenticationPolicy";

import { GeneratedClient } from "./generated/generatedClient";
import { cloudEventDistributedTracingEnricherPolicy } from "./cloudEventDistrubtedTracingEnricherPolicy";
import { createSpan } from "./tracing";
import { CanonicalCode } from "@opentelemetry/api";
/**

@@ -45,2 +49,3 @@ * Client class for publishing events to the Event Grid Service.

const pipeline = createPipelineFromOptions(options, authPolicy);
pipeline.requestPolicyFactories.push(cloudEventDistributedTracingEnricherPolicy());
this.client = new GeneratedClient(pipeline);

@@ -55,8 +60,15 @@ this.apiVersion = this.client.apiVersion;

sendEvents(events, options) {
return this.client
.publishEvents(this.endpointUrl, (events || []).map(convertEventGridEventToModelType), options)
.then((r) => {
return {
_response: r._response
};
return __awaiter(this, void 0, void 0, function* () {
const { span, updatedOptions } = createSpan("EventGridPublisherClient-sendEvents", options || {});
try {
const r = yield this.client.publishEvents(this.endpointUrl, (events || []).map(convertEventGridEventToModelType), updatedOptions);
return buildResponse(r);
}
catch (e) {
span.setStatus({ code: CanonicalCode.UNKNOWN, message: e.message });
throw e;
}
finally {
span.end();
}
});

@@ -70,8 +82,15 @@ }

sendCloudEvents(events, options) {
return this.client
.publishCloudEventEvents(this.endpointUrl, (events || []).map(convertCloudEventToModelType), options)
.then((r) => {
return {
_response: r._response
};
return __awaiter(this, void 0, void 0, function* () {
const { span, updatedOptions } = createSpan("EventGridPublisherClient-sendCloudEvents", options || {});
try {
const r = yield this.client.publishCloudEventEvents(this.endpointUrl, (events || []).map(convertCloudEventToModelType), updatedOptions);
return buildResponse(r);
}
catch (e) {
span.setStatus({ code: CanonicalCode.UNKNOWN, message: e.message });
throw e;
}
finally {
span.end();
}
});

@@ -85,11 +104,25 @@ }

sendCustomSchemaEvents(events, options) {
return this.client
.publishCustomEventEvents(this.endpointUrl, events || [], options)
.then((r) => {
return {
_response: r._response
};
return __awaiter(this, void 0, void 0, function* () {
const { span, updatedOptions } = createSpan("EventGridPublisherClient-sendCustomSchemaEvents", options || {});
try {
const r = yield this.client.publishCustomEventEvents(this.endpointUrl, events || [], updatedOptions);
return buildResponse(r);
}
catch (e) {
span.setStatus({ code: CanonicalCode.UNKNOWN, message: e.message });
throw e;
}
finally {
span.end();
}
});
}
}
function buildResponse(r) {
const ret = { _response: r._response };
Object.defineProperty(ret, "_response", {
enumerable: false
});
return ret;
}
/**

@@ -96,0 +129,0 @@ * @internal

@@ -6,3 +6,3 @@ {

"description": "An isomorphic client library for the Azure Event Grid service.",
"version": "3.0.0-alpha.20200929.1",
"version": "3.0.0-alpha.20201002.1",
"keywords": [

@@ -9,0 +9,0 @@ "node",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc