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

@venncity/errors

Package Overview
Dependencies
Maintainers
1
Versions
108
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@venncity/errors - npm Package Compare versions

Comparing version 1.7.18-addSentryFixes2.2 to 1.7.18

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [1.7.18](https://github.com/venn-city/npm-shelf/compare/@venncity/errors@1.7.17...@venncity/errors@1.7.18) (2020-08-25)
**Note:** Version bump only for package @venncity/errors
## [1.7.17](https://github.com/venn-city/npm-shelf/compare/@venncity/errors@1.7.16...@venncity/errors@1.7.17) (2020-08-24)

@@ -8,0 +16,0 @@

4

lib/cjs/errorReporting/sentry.d.ts

@@ -11,6 +11,6 @@ import * as Sentry from '@sentry/node';

};
export declare function buildTags(event: Pick<APIGatewayProxyEvent, 'headers'>, { impersonated, isPublicAccess, isService, id, email }: AuthDetailsFromRequest): Record<string, string>;
export declare function buildTags(event: Pick<APIGatewayProxyEvent, 'headers'>, context: Pick<LambdaContext, 'awsRequestId' | 'functionVersion'>, { impersonated, isPublicAccess, isService, id, email }: AuthDetailsFromRequest): Record<string, string>;
export declare function buildErrorContexts(event: Pick<APIGatewayProxyEvent, 'body'> & {
Records?: any;
}, context: Pick<LambdaContext, 'awsRequestId' | 'functionVersion'>): Record<string, any>;
}): Record<string, any>;
interface AuthDetailsFromRequest {

@@ -17,0 +17,0 @@ id?: string;

@@ -35,4 +35,4 @@ "use strict";

if (isSentryEnabled()) {
const tags = buildTags(event, authDetailsFromRequest);
const contexts = buildErrorContexts(event, context);
const tags = buildTags(event, context, authDetailsFromRequest);
const contexts = buildErrorContexts(event);
Sentry.configureScope((scope) => {

@@ -69,3 +69,3 @@ if (authDetailsFromRequest.email) {

// eslint-disable-next-line max-len
function buildTags(event, { impersonated, isPublicAccess, isService, id, email }) {
function buildTags(event, context, { impersonated, isPublicAccess, isService, id, email }) {
const tags = {};

@@ -87,2 +87,4 @@ tags.xrayTraceId = lodash_1.get(event, 'headers.xrayTraceId');

}
tags.awsRequestId = context.awsRequestId;
tags.functionVersion = context.functionVersion;
return tags;

@@ -92,3 +94,3 @@ }

// eslint-disable-next-line max-len
function buildErrorContexts(event, context) {
function buildErrorContexts(event) {
const contexts = {};

@@ -103,4 +105,2 @@ if (event.body) {

}
contexts.awsRequestId = context.awsRequestId;
contexts.functionVersion = context.functionVersion;
return contexts;

@@ -107,0 +107,0 @@ }

@@ -65,3 +65,3 @@ "use strict";

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -75,3 +75,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -83,3 +83,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -92,3 +92,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -99,3 +99,3 @@ });

test('http event', () => {
const contexts = sentry.buildErrorContexts(testEvents.httpEvent, DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(testEvents.httpEvent);
expect(contexts).toMatchSnapshot();

@@ -105,7 +105,7 @@ });

// @ts-ignore
const contexts = sentry.buildErrorContexts(testEvents.sqsEvent, DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(testEvents.sqsEvent);
expect(contexts).toMatchSnapshot();
});
test('event with a string body', () => {
const contexts = sentry.buildErrorContexts(Object.assign(Object.assign({}, testEvents.httpEvent), { body: 'some string' }), DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(Object.assign(Object.assign({}, testEvents.httpEvent), { body: 'some string' }));
expect(contexts).toMatchSnapshot();

@@ -112,0 +112,0 @@ });

@@ -11,6 +11,6 @@ import * as Sentry from '@sentry/node';

};
export declare function buildTags(event: Pick<APIGatewayProxyEvent, 'headers'>, { impersonated, isPublicAccess, isService, id, email }: AuthDetailsFromRequest): Record<string, string>;
export declare function buildTags(event: Pick<APIGatewayProxyEvent, 'headers'>, context: Pick<LambdaContext, 'awsRequestId' | 'functionVersion'>, { impersonated, isPublicAccess, isService, id, email }: AuthDetailsFromRequest): Record<string, string>;
export declare function buildErrorContexts(event: Pick<APIGatewayProxyEvent, 'body'> & {
Records?: any;
}, context: Pick<LambdaContext, 'awsRequestId' | 'functionVersion'>): Record<string, any>;
}): Record<string, any>;
interface AuthDetailsFromRequest {

@@ -17,0 +17,0 @@ id?: string;

@@ -13,4 +13,4 @@ import { get, pick } from 'lodash';

if (isSentryEnabled()) {
const tags = buildTags(event, authDetailsFromRequest);
const contexts = buildErrorContexts(event, context);
const tags = buildTags(event, context, authDetailsFromRequest);
const contexts = buildErrorContexts(event);
Sentry.configureScope((scope) => {

@@ -46,3 +46,3 @@ if (authDetailsFromRequest.email) {

// eslint-disable-next-line max-len
export function buildTags(event, { impersonated, isPublicAccess, isService, id, email }) {
export function buildTags(event, context, { impersonated, isPublicAccess, isService, id, email }) {
const tags = {};

@@ -64,6 +64,8 @@ tags.xrayTraceId = get(event, 'headers.xrayTraceId');

}
tags.awsRequestId = context.awsRequestId;
tags.functionVersion = context.functionVersion;
return tags;
}
// eslint-disable-next-line max-len
export function buildErrorContexts(event, context) {
export function buildErrorContexts(event) {
const contexts = {};

@@ -78,4 +80,2 @@ if (event.body) {

}
contexts.awsRequestId = context.awsRequestId;
contexts.functionVersion = context.functionVersion;
return contexts;

@@ -82,0 +82,0 @@ }

@@ -44,3 +44,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -54,3 +54,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -62,3 +62,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -71,3 +71,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -78,3 +78,3 @@ });

test('http event', () => {
const contexts = sentry.buildErrorContexts(testEvents.httpEvent, DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(testEvents.httpEvent);
expect(contexts).toMatchSnapshot();

@@ -84,7 +84,7 @@ });

// @ts-ignore
const contexts = sentry.buildErrorContexts(testEvents.sqsEvent, DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(testEvents.sqsEvent);
expect(contexts).toMatchSnapshot();
});
test('event with a string body', () => {
const contexts = sentry.buildErrorContexts(Object.assign(Object.assign({}, testEvents.httpEvent), { body: 'some string' }), DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(Object.assign(Object.assign({}, testEvents.httpEvent), { body: 'some string' }));
expect(contexts).toMatchSnapshot();

@@ -91,0 +91,0 @@ });

{
"name": "@venncity/errors",
"version": "1.7.18-addSentryFixes2.2+b93bdb722",
"version": "1.7.18",
"author": "Venn Engineering",

@@ -21,3 +21,3 @@ "main": "lib/cjs/index.js",

"@venncity/eslint-config": "^3.0.1",
"@venncity/jest-config-server": "^3.4.0",
"@venncity/jest-config-server": "^3.3.4",
"eslint": "^5.5.0",

@@ -37,3 +37,3 @@ "eslint-config-airbnb-base": "^13.1.0",

"@sentry/types": "^5.21.1",
"@venncity/nested-config": "^2.0.26-addSentryFixes2.2+b93bdb722",
"@venncity/nested-config": "^2.0.26",
"fast-safe-stringify": "^2.0.7",

@@ -45,3 +45,3 @@ "joi": "^14.3.1",

},
"gitHead": "b93bdb7221f63504e95f396bfe9ae98d3ae8e998"
"gitHead": "61616de38590629c91ebb3b1fe74546a65c0294b"
}

@@ -41,3 +41,3 @@ import * as sentry from './sentry';

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -51,3 +51,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -59,3 +59,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -68,3 +68,3 @@ });

};
const tags = sentry.buildTags(testEvents.httpEvent, authDetails);
const tags = sentry.buildTags(testEvents.httpEvent, DUMMY_CONTEXT, authDetails);
expect(tags).toMatchSnapshot();

@@ -76,3 +76,3 @@ });

test('http event', () => {
const contexts = sentry.buildErrorContexts(testEvents.httpEvent, DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(testEvents.httpEvent);
expect(contexts).toMatchSnapshot();

@@ -82,7 +82,7 @@ });

// @ts-ignore
const contexts = sentry.buildErrorContexts(testEvents.sqsEvent, DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts(testEvents.sqsEvent);
expect(contexts).toMatchSnapshot();
});
test('event with a string body', () => {
const contexts = sentry.buildErrorContexts({ ...testEvents.httpEvent, body: 'some string' }, DUMMY_CONTEXT);
const contexts = sentry.buildErrorContexts({ ...testEvents.httpEvent, body: 'some string' });
expect(contexts).toMatchSnapshot();

@@ -89,0 +89,0 @@ });

@@ -18,4 +18,4 @@ import { get, pick } from 'lodash';

if (isSentryEnabled()) {
const tags = buildTags(event, authDetailsFromRequest);
const contexts = buildErrorContexts(event, context);
const tags = buildTags(event, context, authDetailsFromRequest);
const contexts = buildErrorContexts(event);
Sentry.configureScope((scope) => {

@@ -53,3 +53,3 @@ if (authDetailsFromRequest.email) {

// eslint-disable-next-line max-len
export function buildTags(event: Pick<APIGatewayProxyEvent, 'headers'>, { impersonated, isPublicAccess, isService, id, email }: AuthDetailsFromRequest) {
export function buildTags(event: Pick<APIGatewayProxyEvent, 'headers'>, context: Pick<LambdaContext, 'awsRequestId' | 'functionVersion'>, { impersonated, isPublicAccess, isService, id, email }: AuthDetailsFromRequest) {
const tags: Record<string, string> = {};

@@ -70,2 +70,5 @@ tags.xrayTraceId = get(event, 'headers.xrayTraceId');

}
tags.awsRequestId = context.awsRequestId;
tags.functionVersion = context.functionVersion;
return tags;

@@ -75,3 +78,3 @@ }

// eslint-disable-next-line max-len
export function buildErrorContexts(event: Pick<APIGatewayProxyEvent, 'body'> & { Records?: any }, context: Pick<LambdaContext, 'awsRequestId' | 'functionVersion'>): Record<string, any> {
export function buildErrorContexts(event: Pick<APIGatewayProxyEvent, 'body'> & { Records?: any }): Record<string, any> {
const contexts: Record<string, any> = {};

@@ -88,4 +91,2 @@ if (event.body) {

}
contexts.awsRequestId = context.awsRequestId;
contexts.functionVersion = context.functionVersion;
return contexts;

@@ -92,0 +93,0 @@ }

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 not supported yet

Sorry, the diff of this file is not supported yet

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