@apolitical/error-reporting 0.0.2 → 0.0.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.0.3] - 2022-01-31
9
+ ### Fixed
10
+ - Buffer dependency
11
+ - Node.js version
12
+
8
13
  ## [0.0.2] - 2022-01-14
9
14
  ### Updated
10
15
  - Dependencies
package/build/index.js CHANGED
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("stackdriver-errors-js")):"function"==typeof define&&define.amd?define(["stackdriver-errors-js"],r):"object"==typeof exports?exports.ApoliticalErrorReporting=r(require("stackdriver-errors-js")):e.ApoliticalErrorReporting=r(e["stackdriver-errors-js"])}(this,(function(e){return function(){"use strict";var r={542:function(r){r.exports=e}},t={};function o(e){var n=t[e];if(void 0!==n)return n.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(r,{a:r}),r},o.d=function(e,r){for(var t in r)o.o(r,t)&&!o.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},o.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return function(){o.r(n),o.d(n,{reportError:function(){return u},setContext:function(){return s}});var e=o(542),r=o.n(e);const{APOLITICAL:{WEBSITES:t},GCP:{ENVIRONMENTS:i,PROJECT_ID:c}}={APOLITICAL:{WEBSITES:{BETA:"https://beta.apolitical.co",BETA_2:"https://beta-2.apolitical.co",LIVE:"https://apolitical.co",RC:"https://rc.apolitical.co"}},GCP:{ENVIRONMENTS:{BETA:"beta",BETA_2:"beta-2",RC:"rc",LIVE:"live"},PROJECT_ID:"hazel-tea-194609"}};let a={key:null,environment:null,projectId:c};const s=({accessToken:e,environment:r,origin:o=null,projectId:n,serviceName:s,isEncodedToken:u=!0})=>{var l;a.key=u?(l=e)&&Buffer.from(l,"base64").toString("ascii"):e,a.environment=r||(e=>{let r=null,o=null;switch(o="undefined"!=typeof window?window.origin||window.location.origin:e,o){case t.BETA:r=i.BETA;break;case t.BETA_2:r=i.BETA_2;break;case t.LIVE:r=i.LIVE;break;case t.RC:r=i.RC;break;default:r=i.BETA}return r})(o),a.projectId=n||c,s&&(a.service=`${s}:${a.environment}`)},u=async(e,t)=>{try{const o=new(r());o.start(a),t&&o.setUser(t),await o.report(e)}catch(e){console.warn(`Cannot report error: ${e.message}`)}}}(),n}()}));
1
+ !function(e,r){"object"==typeof exports&&"object"==typeof module?module.exports=r(require("stackdriver-errors-js"),require("buffer")):"function"==typeof define&&define.amd?define(["stackdriver-errors-js","buffer"],r):"object"==typeof exports?exports.ApoliticalErrorReporting=r(require("stackdriver-errors-js"),require("buffer")):e.ApoliticalErrorReporting=r(e["stackdriver-errors-js"],e.buffer)}(this,(function(e,r){return function(){"use strict";var t={408:function(e){e.exports=r},542:function(r){r.exports=e}},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,{a:r}),r},n.d=function(e,r){for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return function(){n.r(i),n.d(i,{reportError:function(){return f},setContext:function(){return u}});var e=n(542),r=n.n(e),t=n(408);const{APOLITICAL:{WEBSITES:o},GCP:{ENVIRONMENTS:c,PROJECT_ID:a}}={APOLITICAL:{WEBSITES:{BETA:"https://beta.apolitical.co",BETA_2:"https://beta-2.apolitical.co",LIVE:"https://apolitical.co",RC:"https://rc.apolitical.co"}},GCP:{ENVIRONMENTS:{BETA:"beta",BETA_2:"beta-2",RC:"rc",LIVE:"live"},PROJECT_ID:"hazel-tea-194609"}};let s={key:null,environment:null,projectId:a};const u=({accessToken:e,environment:r,origin:n=null,projectId:i,serviceName:u,isEncodedToken:f=!0})=>{var l;s.key=f?(l=e)&&t.Buffer.from(l,"base64").toString("ascii"):e,s.environment=r||(e=>{let r=null,t=null;switch(t="undefined"!=typeof window?window.origin||window.location.origin:e,t){case o.BETA:r=c.BETA;break;case o.BETA_2:r=c.BETA_2;break;case o.LIVE:r=c.LIVE;break;case o.RC:r=c.RC;break;default:r=c.BETA}return r})(n),s.projectId=i||a,u&&(s.service=`${u}:${s.environment}`)},f=async(e,t)=>{try{const o=new(r());o.start(s),t&&o.setUser(t),await o.report(e)}catch(e){console.warn(`Cannot report error: ${e.message}`)}}}(),i}()}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apolitical/error-reporting",
3
- "version": "0.0.2",
3
+ "version": "0.0.3-beta.1",
4
4
  "description": "Browser library to report errors to GCP",
5
5
  "author": "Apolitical Group Limited <engineering@apolitical.co>",
6
6
  "license": "MIT",
@@ -24,23 +24,25 @@
24
24
  "Error Reporting"
25
25
  ],
26
26
  "dependencies": {
27
+ "buffer": "6.0.3",
27
28
  "stackdriver-errors-js": "0.12.0"
28
29
  },
29
30
  "peerDependencies": {
31
+ "buffer": "6.0.3",
30
32
  "stackdriver-errors-js": "0.12.0"
31
33
  },
32
34
  "devDependencies": {
33
- "@apolitical/eslint-config": "0.0.1",
34
- "@babel/core": "7.16.7",
35
- "babel-eslint": "10.1.0",
36
- "babel-loader": "8.2.3",
37
- "babel-preset-react-app": "10.0.1",
35
+ "@apolitical/eslint-config": "1.0.2-beta.1",
36
+ "@babel/core": "7.16.12",
37
+ "@babel/eslint-parser": "7.16.5",
38
+ "@babel/plugin-transform-runtime": "7.16.10",
39
+ "@babel/preset-env": "7.16.11",
38
40
  "husky": "7.0.4",
39
41
  "jest": "27.4.7",
40
42
  "jest-junit": "13.0.0",
41
- "lint-staged": "12.1.7",
42
- "webpack": "5.66.0",
43
- "webpack-cli": "4.9.1"
43
+ "lint-staged": "12.3.2",
44
+ "webpack": "5.67.0",
45
+ "webpack-cli": "4.9.2"
44
46
  },
45
47
  "eslintConfig": {
46
48
  "extends": [
@@ -57,7 +59,7 @@
57
59
  "plugins": [
58
60
  "jest"
59
61
  ],
60
- "parser": "babel-eslint"
62
+ "parser": "@babel/eslint-parser"
61
63
  },
62
64
  "prettier": "@apolitical/eslint-config/prettier.config",
63
65
  "browserslist": {
@@ -89,11 +91,14 @@
89
91
  },
90
92
  "babel": {
91
93
  "presets": [
92
- "react-app"
94
+ "@babel/preset-env"
95
+ ],
96
+ "plugins": [
97
+ "@babel/plugin-transform-runtime"
93
98
  ]
94
99
  },
95
100
  "engines": {
96
- "node": ">=12.20.1"
101
+ "node": ">=16.13.0"
97
102
  },
98
103
  "lint-staged": {
99
104
  "*.js": "eslint --cache --fix --ignore-path .gitignore",