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

apollo-link-sentry

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apollo-link-sentry - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

12

CHANGELOG.md

@@ -5,2 +5,14 @@ # Changelog

### [1.1.1](https://github.com/DiederikvandenB/apollo-link-sentry/compare/v1.1.0...v1.1.1) (2020-03-01)
### Bug fixes
* allows reading data from `OperationBreadcrumb` ([#13](https://github.com/DiederikvandenB/apollo-link-sentry/issues/13)) ([253d74b](https://github.com/DiederikvandenB/apollo-link-sentry/commit/253d74b370041a99d3524e5f963dbb122a082268))
### Chores
* **deps:** bump @sentry/browser from 5.12.4 to 5.12.5 ([#12](https://github.com/DiederikvandenB/apollo-link-sentry/issues/12)) ([776d21c](https://github.com/DiederikvandenB/apollo-link-sentry/commit/776d21cbfece4a380640f43e7bd32ef5ac988ee5))
## [1.1.0](https://github.com/DiederikvandenB/apollo-link-sentry/compare/v1.0.0...v1.1.0) (2020-02-26)

@@ -7,0 +19,0 @@

31

lib/OperationBreadcrumb.d.ts
import { Severity } from '@sentry/browser';
import { Breadcrumb as SentryBreadcrumb } from '@sentry/types/dist/breadcrumb';
import { Breadcrumb as SentryBreadcrumb } from '@sentry/types';
export declare namespace Breadcrumb {
type Category = 'query' | 'mutation' | 'subscription' | 'response' | 'error';
interface Data extends SentryBreadcrumb {
data?: {
query?: string;
variables?: string;
cache?: string;
response?: string;
error?: string;
context?: string;
};
query?: string;
variables?: string;
cache?: string;
response?: string;
error?: string;
context?: string;
}
}
export declare class OperationBreadcrumb {
export declare class OperationBreadcrumb implements Breadcrumb.Data {
filtered: boolean;
flushed: boolean;
private readonly breadcrumb;
message?: string;
level?: Severity;
category?: string;
type?: string;
query?: string;
cache?: string;
variables?: string;
context?: string;
response?: string;
error?: string;
constructor();
setMessage: (message?: string | undefined) => OperationBreadcrumb;
setLevel: (level: Severity) => OperationBreadcrumb;
setCategory: (category?: "error" | "query" | "mutation" | "subscription" | "response" | undefined) => OperationBreadcrumb;
setMessage: (message?: string | undefined) => OperationBreadcrumb;
setType: (type: string) => OperationBreadcrumb;

@@ -25,0 +32,0 @@ setQuery: (query: string | undefined) => OperationBreadcrumb;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var browser_1 = require("@sentry/browser");

@@ -9,16 +8,16 @@ var utils_1 = require("./utils");

var _this = this;
this.setMessage = function (message) {
_this.message = message;
return _this;
};
this.setLevel = function (level) {
_this.breadcrumb.level = level;
_this.level = level;
return _this;
};
this.setCategory = function (category) {
_this.breadcrumb.category = ("gql " + (category || '')).trim();
_this.category = ("gql " + (category || '')).trim();
return _this;
};
this.setMessage = function (message) {
_this.breadcrumb.message = message;
return _this;
};
this.setType = function (type) {
_this.breadcrumb.type = type;
_this.type = type;
return _this;

@@ -29,3 +28,3 @@ };

return _this;
_this.breadcrumb.data = tslib_1.__assign(tslib_1.__assign({}, _this.breadcrumb.data), { query: query });
_this.query = query;
return _this;

@@ -36,3 +35,3 @@ };

return _this;
_this.breadcrumb.data = tslib_1.__assign(tslib_1.__assign({}, _this.breadcrumb.data), { cache: utils_1.stringifyObject(cache) });
_this.cache = utils_1.stringifyObject(cache);
return _this;

@@ -43,3 +42,3 @@ };

return _this;
_this.breadcrumb.data = tslib_1.__assign(tslib_1.__assign({}, _this.breadcrumb.data), { variables: utils_1.stringifyObject(variables) });
_this.variables = utils_1.stringifyObject(variables);
return _this;

@@ -50,3 +49,3 @@ };

return _this;
_this.breadcrumb.data = tslib_1.__assign(tslib_1.__assign({}, _this.breadcrumb.data), { context: utils_1.stringifyObject(context) });
_this.context = utils_1.stringifyObject(context);
return _this;

@@ -57,3 +56,3 @@ };

return _this;
_this.breadcrumb.data = tslib_1.__assign(tslib_1.__assign({}, _this.breadcrumb.data), { response: utils_1.stringifyObject(response) });
_this.response = utils_1.stringifyObject(response);
return _this;

@@ -64,3 +63,3 @@ };

return _this;
_this.breadcrumb.data = tslib_1.__assign(tslib_1.__assign({}, _this.breadcrumb.data), { error: utils_1.stringifyObject(error) });
_this.error = utils_1.stringifyObject(error);
return _this;

@@ -74,8 +73,25 @@ };

_this.flushed = true;
return _this.breadcrumb;
var _a = _this, message = _a.message, level = _a.level, category = _a.category, type = _a.type, query = _a.query, cache = _a.cache, variables = _a.variables, context = _a.context, error = _a.error, response = _a.response;
var data = utils_1.trimObject({
query: query,
variables: variables,
cache: cache,
response: response,
error: error,
context: context,
});
var breadcrumb = {
message: message,
level: level,
category: category,
type: type,
};
if (!utils_1.isEmpty(data)) {
breadcrumb.data = data;
}
return utils_1.trimObject(breadcrumb);
};
this.toString = function () { return utils_1.stringifyObject(_this.breadcrumb); };
this.toString = function () { return utils_1.stringifyObject(_this); };
this.filtered = false;
this.flushed = false;
this.breadcrumb = {};
this

@@ -82,0 +98,0 @@ .setLevel(browser_1.Severity.Log)

export declare const isEmpty: (target?: object | undefined) => boolean;
export declare const stringifyObject: (target: any) => string;
export declare const trimObject: (target: any) => object;
//# sourceMappingURL=utils.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
exports.isEmpty = function (target) { return (target == null || !(Object.keys(target) || target).length); };
exports.stringifyObject = function (target) { return (JSON.stringify(target, null, 2)); };
exports.trimObject = function (target) {
if (exports.isEmpty(target))
return {};
return Object.keys(target)
.filter(function (key) { return target === null || target === void 0 ? void 0 : target[key]; })
.reduce(function (a, key) {
var _a;
return (tslib_1.__assign(tslib_1.__assign({}, a), (_a = {}, _a[key] = target[key], _a)));
}, {});
};
//# sourceMappingURL=utils.js.map
{
"name": "apollo-link-sentry",
"version": "1.1.0",
"version": "1.1.1",
"license": "MIT",

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

"dependencies": {
"@sentry/browser": "^5.12.4",
"@sentry/browser": "^5.12.5",
"@sentry/types": "^5.12.4",

@@ -30,0 +30,0 @@ "apollo-link": "^1.2.13",

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