@andre1502/react-utilities 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +340 -0
- package/dist/Config/Config.d.ts +28 -0
- package/dist/Config/Config.js +200 -0
- package/dist/Config/Config.js.map +1 -0
- package/dist/Config/GoogleAuth.d.ts +15 -0
- package/dist/Config/GoogleAuth.js +71 -0
- package/dist/Config/GoogleAuth.js.map +1 -0
- package/dist/Config/Locales.d.ts +18 -0
- package/dist/Config/Locales.js +62 -0
- package/dist/Config/Locales.js.map +1 -0
- package/dist/Config/Output.d.ts +10 -0
- package/dist/Config/Output.js +28 -0
- package/dist/Config/Output.js.map +1 -0
- package/dist/Config/Sitemap.d.ts +13 -0
- package/dist/Config/Sitemap.js +73 -0
- package/dist/Config/Sitemap.js.map +1 -0
- package/dist/Format/NumberFormat.d.ts +6 -0
- package/dist/Format/NumberFormat.js +77 -0
- package/dist/Format/NumberFormat.js.map +1 -0
- package/dist/Format/NumberParser.d.ts +9 -0
- package/dist/Format/NumberParser.js +51 -0
- package/dist/Format/NumberParser.js.map +1 -0
- package/dist/React-BaJ1KfGF.js +87 -0
- package/dist/React-BaJ1KfGF.js.map +1 -0
- package/dist/React-qUl0CBmE.js +109 -0
- package/dist/React-qUl0CBmE.js.map +1 -0
- package/dist/ReactNative-CqUrY2ZJ.js +3856 -0
- package/dist/ReactNative-CqUrY2ZJ.js.map +1 -0
- package/dist/ReactNative-mNnws-b5.js +3834 -0
- package/dist/ReactNative-mNnws-b5.js.map +1 -0
- package/dist/Sentry/Build.d.ts +9 -0
- package/dist/Sentry/Build.js +88 -0
- package/dist/Sentry/Build.js.map +1 -0
- package/dist/Sentry/React.d.ts +18 -0
- package/dist/Sentry/React.js +104 -0
- package/dist/Sentry/React.js.map +1 -0
- package/dist/Sentry/ReactNative.d.ts +18 -0
- package/dist/Sentry/ReactNative.js +114 -0
- package/dist/Sentry/ReactNative.js.map +1 -0
- package/dist/Sentry/Utils.d.ts +2 -0
- package/dist/Sentry/Utils.js +24 -0
- package/dist/Sentry/Utils.js.map +1 -0
- package/dist/Utils/Files.d.ts +7 -0
- package/dist/Utils/Files.js +52 -0
- package/dist/Utils/Files.js.map +1 -0
- package/dist/Utils-Cq948gfa.js +20 -0
- package/dist/Utils-Cq948gfa.js.map +1 -0
- package/dist/Utils-Dilye04y.js +22 -0
- package/dist/Utils-Dilye04y.js.map +1 -0
- package/dist/config-cli.cjs +471 -0
- package/dist/config-cli.cjs.map +1 -0
- package/dist/config-cli.d.ts +34 -0
- package/dist/config-cli.js +220 -0
- package/dist/config-cli.js.map +1 -0
- package/dist/config-cli.mjs +443 -0
- package/dist/config-cli.mjs.map +1 -0
- package/dist/enums/CurrencySymbolEnum.d.ts +5 -0
- package/dist/enums/CurrencySymbolEnum.js +13 -0
- package/dist/enums/CurrencySymbolEnum.js.map +1 -0
- package/dist/format.cjs +122 -0
- package/dist/format.cjs.map +1 -0
- package/dist/format.d.ts +3 -0
- package/dist/format.js +55 -0
- package/dist/format.js.map +1 -0
- package/dist/format.mjs +117 -0
- package/dist/format.mjs.map +1 -0
- package/dist/index-cli.cjs +24 -0
- package/dist/index-cli.cjs.map +1 -0
- package/dist/index-cli.d.ts +2 -0
- package/dist/index-cli.js +28 -0
- package/dist/index-cli.js.map +1 -0
- package/dist/index-cli.mjs +12 -0
- package/dist/index-cli.mjs.map +1 -0
- package/dist/index-fmt.cjs +16 -0
- package/dist/index-fmt.cjs.map +1 -0
- package/dist/index-fmt.d.ts +1 -0
- package/dist/index-fmt.js +17 -0
- package/dist/index-fmt.js.map +1 -0
- package/dist/index-fmt.mjs +3 -0
- package/dist/index-fmt.mjs.map +1 -0
- package/dist/index-rn.cjs +21 -0
- package/dist/index-rn.cjs.map +1 -0
- package/dist/index-rn.d.ts +2 -0
- package/dist/index-rn.js +28 -0
- package/dist/index-rn.js.map +1 -0
- package/dist/index-rn.mjs +6 -0
- package/dist/index-rn.mjs.map +1 -0
- package/dist/index.cjs +21 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +28 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +6 -0
- package/dist/index.mjs.map +1 -0
- package/dist/interfaces/Config/ConfigOptions.d.ts +8 -0
- package/dist/interfaces/Config/ConfigOptions.js +6 -0
- package/dist/interfaces/Config/ConfigOptions.js.map +1 -0
- package/dist/interfaces/Config/OutputMap.d.ts +3 -0
- package/dist/interfaces/Config/OutputMap.js +6 -0
- package/dist/interfaces/Config/OutputMap.js.map +1 -0
- package/dist/interfaces/Config/OutputOptions.d.ts +7 -0
- package/dist/interfaces/Config/OutputOptions.js +6 -0
- package/dist/interfaces/Config/OutputOptions.js.map +1 -0
- package/dist/interfaces/Config/SitemapMap.d.ts +5 -0
- package/dist/interfaces/Config/SitemapMap.js +6 -0
- package/dist/interfaces/Config/SitemapMap.js.map +1 -0
- package/dist/interfaces/Config/StringMap.d.ts +3 -0
- package/dist/interfaces/Config/StringMap.js +6 -0
- package/dist/interfaces/Config/StringMap.js.map +1 -0
- package/dist/interfaces/Format/FormatOptions.d.ts +14 -0
- package/dist/interfaces/Format/FormatOptions.js +6 -0
- package/dist/interfaces/Format/FormatOptions.js.map +1 -0
- package/dist/interfaces/Sentry/InitOptions.d.ts +20 -0
- package/dist/interfaces/Sentry/InitOptions.js +6 -0
- package/dist/interfaces/Sentry/InitOptions.js.map +1 -0
- package/dist/interfaces/Sentry/InitOptionsRN.d.ts +4 -0
- package/dist/interfaces/Sentry/InitOptionsRN.js +6 -0
- package/dist/interfaces/Sentry/InitOptionsRN.js.map +1 -0
- package/dist/interfaces/Sentry/SourceMapOptions.d.ts +7 -0
- package/dist/interfaces/Sentry/SourceMapOptions.js +6 -0
- package/dist/interfaces/Sentry/SourceMapOptions.js.map +1 -0
- package/dist/sentry-cli.cjs +119 -0
- package/dist/sentry-cli.cjs.map +1 -0
- package/dist/sentry-cli.d.ts +9 -0
- package/dist/sentry-cli.js +50 -0
- package/dist/sentry-cli.js.map +1 -0
- package/dist/sentry-cli.mjs +98 -0
- package/dist/sentry-cli.mjs.map +1 -0
- package/dist/sentry-rn.cjs +11 -0
- package/dist/sentry-rn.cjs.map +1 -0
- package/dist/sentry-rn.d.ts +2 -0
- package/dist/sentry-rn.js +28 -0
- package/dist/sentry-rn.js.map +1 -0
- package/dist/sentry-rn.mjs +4 -0
- package/dist/sentry-rn.mjs.map +1 -0
- package/dist/sentry.cjs +11 -0
- package/dist/sentry.cjs.map +1 -0
- package/dist/sentry.d.ts +2 -0
- package/dist/sentry.js +28 -0
- package/dist/sentry.js.map +1 -0
- package/dist/sentry.mjs +4 -0
- package/dist/sentry.mjs.map +1 -0
- package/dist/types/Config/OptionType.d.ts +2 -0
- package/dist/types/Config/OptionType.js +6 -0
- package/dist/types/Config/OptionType.js.map +1 -0
- package/dist/types/Format/OptionType.d.ts +3 -0
- package/dist/types/Format/OptionType.js +6 -0
- package/dist/types/Format/OptionType.js.map +1 -0
- package/dist/types/Sentry/OptionType.d.ts +1 -0
- package/dist/types/Sentry/OptionType.js +6 -0
- package/dist/types/Sentry/OptionType.js.map +1 -0
- package/package.json +139 -0
- package/src/Config/Config.ts +258 -0
- package/src/Config/GoogleAuth.ts +54 -0
- package/src/Config/Locales.ts +72 -0
- package/src/Config/Output.ts +29 -0
- package/src/Config/Sitemap.ts +67 -0
- package/src/Format/NumberFormat.ts +96 -0
- package/src/Format/NumberParser.ts +42 -0
- package/src/Sentry/Build.ts +67 -0
- package/src/Sentry/React.ts +127 -0
- package/src/Sentry/ReactNative.ts +133 -0
- package/src/Sentry/Utils.ts +26 -0
- package/src/Utils/Files.ts +51 -0
- package/src/config-cli.ts +152 -0
- package/src/enums/CurrencySymbolEnum.ts +5 -0
- package/src/format.ts +39 -0
- package/src/index-cli.ts +2 -0
- package/src/index-fmt.ts +1 -0
- package/src/index-rn.ts +2 -0
- package/src/index.ts +2 -0
- package/src/interfaces/Config/ConfigOptions.ts +9 -0
- package/src/interfaces/Config/OutputMap.ts +3 -0
- package/src/interfaces/Config/OutputOptions.ts +8 -0
- package/src/interfaces/Config/SitemapMap.ts +5 -0
- package/src/interfaces/Config/StringMap.ts +3 -0
- package/src/interfaces/Format/FormatOptions.ts +19 -0
- package/src/interfaces/Sentry/InitOptions.ts +23 -0
- package/src/interfaces/Sentry/InitOptionsRN.ts +5 -0
- package/src/interfaces/Sentry/SourceMapOptions.ts +7 -0
- package/src/sentry-cli.ts +16 -0
- package/src/sentry-rn.ts +2 -0
- package/src/sentry.ts +2 -0
- package/src/types/Config/OptionType.ts +2 -0
- package/src/types/Format/OptionType.ts +15 -0
- package/src/types/Sentry/OptionType.ts +1 -0
@@ -0,0 +1,9 @@
|
|
1
|
+
import { SourceMapOptions } from '../interfaces/Sentry/SourceMapOptions';
|
2
|
+
/**
|
3
|
+
* Create Sentry release and upload to Sentry host.
|
4
|
+
*
|
5
|
+
* @param {SourceMapOptions} options
|
6
|
+
* @return {Promise<void>}
|
7
|
+
*/
|
8
|
+
declare const releaseSourceMap: (options: SourceMapOptions) => Promise<void>;
|
9
|
+
export { releaseSourceMap };
|
@@ -0,0 +1,88 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.releaseSourceMap = void 0;
|
8
|
+
var _cli = _interopRequireDefault(require("@sentry/cli"));
|
9
|
+
var _Files = require("../Utils/Files");
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
11
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
12
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
13
|
+
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } // sentry-cli sourcemaps inject --org <org> --project <project> ./build/static/js && sentry-cli sourcemaps upload --org <org> --project <project> ./build/static/js
|
14
|
+
/**
|
15
|
+
* Create Sentry release and upload to Sentry host.
|
16
|
+
*
|
17
|
+
* @param {SourceMapOptions} options
|
18
|
+
* @return {Promise<void>}
|
19
|
+
*/
|
20
|
+
var releaseSourceMap = exports.releaseSourceMap = /*#__PURE__*/function () {
|
21
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
22
|
+
var cli;
|
23
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
24
|
+
while (1) switch (_context.prev = _context.next) {
|
25
|
+
case 0:
|
26
|
+
if (!options.requiredEnvForSourceMap || options.requiredEnvForSourceMap.length <= 0) {
|
27
|
+
options.requiredEnvForSourceMap = ['production'];
|
28
|
+
}
|
29
|
+
if (!options.urlPrefix) {
|
30
|
+
options.urlPrefix = '';
|
31
|
+
}
|
32
|
+
if (!(!options.includeFolder || options.includeFolder.length <= 0)) {
|
33
|
+
_context.next = 5;
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
console.error('includeFolder value is empty.');
|
37
|
+
return _context.abrupt("return");
|
38
|
+
case 5:
|
39
|
+
if (options.requiredEnvForSourceMap.includes(options.env)) {
|
40
|
+
_context.next = 9;
|
41
|
+
break;
|
42
|
+
}
|
43
|
+
console.log('No need to upload sentry source map, required env:', options.requiredEnvForSourceMap);
|
44
|
+
options.includeFolder.forEach(function (folder) {
|
45
|
+
return (0, _Files.deleteFile)(folder, ['.map']);
|
46
|
+
});
|
47
|
+
return _context.abrupt("return");
|
48
|
+
case 9:
|
49
|
+
_context.prev = 9;
|
50
|
+
cli = new _cli["default"]();
|
51
|
+
console.log('Now creating sentry release ' + options.release);
|
52
|
+
_context.next = 14;
|
53
|
+
return cli.releases["new"](options.release);
|
54
|
+
case 14:
|
55
|
+
console.log('Now uploading source maps');
|
56
|
+
_context.next = 17;
|
57
|
+
return cli.releases.uploadSourceMaps(options.release, {
|
58
|
+
urlPrefix: options.urlPrefix,
|
59
|
+
include: options.includeFolder,
|
60
|
+
rewrite: true,
|
61
|
+
validate: true,
|
62
|
+
useArtifactBundle: true
|
63
|
+
});
|
64
|
+
case 17:
|
65
|
+
console.log('Releasing release');
|
66
|
+
_context.next = 20;
|
67
|
+
return cli.releases.finalize(options.release);
|
68
|
+
case 20:
|
69
|
+
options.includeFolder.forEach(function (folder) {
|
70
|
+
return (0, _Files.deleteFile)(folder, ['.map']);
|
71
|
+
});
|
72
|
+
_context.next = 26;
|
73
|
+
break;
|
74
|
+
case 23:
|
75
|
+
_context.prev = 23;
|
76
|
+
_context.t0 = _context["catch"](9);
|
77
|
+
console.error('Source maps uploading failed:', _context.t0);
|
78
|
+
case 26:
|
79
|
+
case "end":
|
80
|
+
return _context.stop();
|
81
|
+
}
|
82
|
+
}, _callee, null, [[9, 23]]);
|
83
|
+
}));
|
84
|
+
return function releaseSourceMap(_x) {
|
85
|
+
return _ref.apply(this, arguments);
|
86
|
+
};
|
87
|
+
}();
|
88
|
+
//# sourceMappingURL=Build.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Build.js","names":["_cli","_interopRequireDefault","require","_Files","e","__esModule","_regeneratorRuntime","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","_catch","delegateYield","asyncGeneratorStep","_asyncToGenerator","arguments","apply","_next","_throw","releaseSourceMap","exports","_ref","_callee","options","cli","_callee$","_context","requiredEnvForSourceMap","urlPrefix","includeFolder","console","error","includes","env","log","folder","deleteFile","SentryCli","release","releases","uploadSourceMaps","include","rewrite","validate","useArtifactBundle","finalize","t0","_x"],"sources":["../../src/Sentry/Build.ts"],"sourcesContent":["// sentry-cli sourcemaps inject --org <org> --project <project> ./build/static/js && sentry-cli sourcemaps upload --org <org> --project <project> ./build/static/js\n\nimport SentryCli from '@sentry/cli';\nimport { SourceMapOptions } from '../interfaces/Sentry/SourceMapOptions';\nimport { deleteFile } from '../Utils/Files';\n\n/**\n * Create Sentry release and upload to Sentry host.\n *\n * @param {SourceMapOptions} options\n * @return {Promise<void>}\n */\nconst releaseSourceMap = async (options: SourceMapOptions): Promise<void> => {\n if (\n !options.requiredEnvForSourceMap ||\n options.requiredEnvForSourceMap.length <= 0\n ) {\n options.requiredEnvForSourceMap = ['production'];\n }\n\n if (!options.urlPrefix) {\n options.urlPrefix = '';\n }\n\n if (!options.includeFolder || options.includeFolder.length <= 0) {\n console.error('includeFolder value is empty.');\n return;\n }\n\n if (!options.requiredEnvForSourceMap.includes(options.env)) {\n console.log(\n 'No need to upload sentry source map, required env:',\n options.requiredEnvForSourceMap,\n );\n\n options.includeFolder.forEach((folder) => deleteFile(folder, ['.map']));\n\n return;\n }\n\n try {\n const cli = new SentryCli();\n\n console.log('Now creating sentry release ' + options.release);\n\n await cli.releases.new(options.release);\n\n console.log('Now uploading source maps');\n await cli.releases.uploadSourceMaps(options.release, {\n urlPrefix: options.urlPrefix,\n include: options.includeFolder,\n rewrite: true,\n validate: true,\n useArtifactBundle: true,\n });\n\n console.log('Releasing release');\n\n await cli.releases.finalize(options.release);\n\n options.includeFolder.forEach((folder) => deleteFile(folder, ['.map']));\n } catch (ex) {\n console.error('Source maps uploading failed:', ex);\n }\n};\n\nexport { releaseSourceMap };\n"],"mappings":";;;;;;;AAEA,IAAAA,IAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAA4C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,gBAAAA,CAAA;AAAA,SAAAE,oBAAA,kBAH5C,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAF,CAAA,SAAAG,CAAA,EAAAH,CAAA,OAAAI,CAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,CAAA,GAAAH,CAAA,CAAAI,cAAA,EAAAC,CAAA,GAAAJ,MAAA,CAAAK,cAAA,cAAAP,CAAA,EAAAH,CAAA,EAAAI,CAAA,IAAAD,CAAA,CAAAH,CAAA,IAAAI,CAAA,CAAAO,KAAA,KAAAC,CAAA,wBAAAC,MAAA,GAAAA,MAAA,OAAAC,CAAA,GAAAF,CAAA,CAAAG,QAAA,kBAAAC,CAAA,GAAAJ,CAAA,CAAAK,aAAA,uBAAAC,CAAA,GAAAN,CAAA,CAAAO,WAAA,8BAAAC,OAAAjB,CAAA,EAAAH,CAAA,EAAAI,CAAA,WAAAC,MAAA,CAAAK,cAAA,CAAAP,CAAA,EAAAH,CAAA,IAAAW,KAAA,EAAAP,CAAA,EAAAiB,UAAA,MAAAC,YAAA,MAAAC,QAAA,SAAApB,CAAA,CAAAH,CAAA,WAAAoB,MAAA,mBAAAjB,CAAA,IAAAiB,MAAA,YAAAA,OAAAjB,CAAA,EAAAH,CAAA,EAAAI,CAAA,WAAAD,CAAA,CAAAH,CAAA,IAAAI,CAAA,gBAAAoB,KAAArB,CAAA,EAAAH,CAAA,EAAAI,CAAA,EAAAG,CAA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AAAuB,QAAA,CAAAoB,EAAA,GAAApB,QAAA;UAExEI,OAAO,CAACC,KAAK,CAAC,+BAA+B,EAAAL,QAAA,CAAAoB,EAAI,CAAC;QAAC;QAAA;UAAA,OAAApB,QAAA,CAAApB,IAAA;MAAA;IAAA,GAAAgB,OAAA;EAAA,CAEtD;EAAA,gBApDKH,gBAAgBA,CAAA4B,EAAA;IAAA,OAAA1B,IAAA,CAAAL,KAAA,OAAAD,SAAA;EAAA;AAAA,GAoDrB","ignoreList":[]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { InitOptions } from '../interfaces/Sentry/InitOptions';
|
2
|
+
/**
|
3
|
+
* Initialize Sentry for React.
|
4
|
+
*
|
5
|
+
* @param {InitOptions} options
|
6
|
+
* @return {void}
|
7
|
+
*/
|
8
|
+
declare const initSentry: (options: InitOptions) => void;
|
9
|
+
/**
|
10
|
+
* Record additional http data for Sentry.
|
11
|
+
*
|
12
|
+
* @param {any | null} config
|
13
|
+
* @param {any | null} request
|
14
|
+
* @param {any | null} response
|
15
|
+
* @return {void}
|
16
|
+
*/
|
17
|
+
declare const recordAdditionalSentryHttp: (config?: any, request?: any, response?: any) => void;
|
18
|
+
export { initSentry, recordAdditionalSentryHttp };
|
@@ -0,0 +1,104 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.recordAdditionalSentryHttp = exports.initSentry = void 0;
|
8
|
+
var Sentry = _interopRequireWildcard(require("@sentry/react"));
|
9
|
+
var _Utils = require("./Utils");
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
12
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
13
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
14
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
15
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
16
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
17
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
18
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
19
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
20
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
21
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
22
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
23
|
+
/**
|
24
|
+
* Initialize Sentry for React.
|
25
|
+
*
|
26
|
+
* @param {InitOptions} options
|
27
|
+
* @return {void}
|
28
|
+
*/
|
29
|
+
var initSentry = exports.initSentry = function initSentry(options) {
|
30
|
+
var _options$requiredEnvF, _options$options, _options$httpClientIn, _options$httpClientIn2, _options$captureConso, _options$options2;
|
31
|
+
var shouldSendToSentry = options === null || options === void 0 || (_options$requiredEnvF = options.requiredEnvForSendToSentry) === null || _options$requiredEnvF === void 0 ? void 0 : _options$requiredEnvF.includes(options.env);
|
32
|
+
var ignoreErrors = [/antd:/, /is deprecated in StrictMode/, /React Intl/];
|
33
|
+
if (options !== null && options !== void 0 && options.ignoreErrorsOptions) {
|
34
|
+
ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);
|
35
|
+
}
|
36
|
+
if (options !== null && options !== void 0 && (_options$options = options.options) !== null && _options$options !== void 0 && _options$options.ignoreErrors) {
|
37
|
+
ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);
|
38
|
+
delete options.options.ignoreErrors;
|
39
|
+
}
|
40
|
+
var integrations = [];
|
41
|
+
if (options !== null && options !== void 0 && (_options$httpClientIn = options.httpClientIntegrationOptions) !== null && _options$httpClientIn !== void 0 && _options$httpClientIn.failedRequestStatusCodes && options !== null && options !== void 0 && (_options$httpClientIn2 = options.httpClientIntegrationOptions) !== null && _options$httpClientIn2 !== void 0 && _options$httpClientIn2.failedRequestTargets) {
|
42
|
+
integrations.push(Sentry.httpClientIntegration({
|
43
|
+
failedRequestStatusCodes: options.httpClientIntegrationOptions.failedRequestStatusCodes,
|
44
|
+
failedRequestTargets: options.httpClientIntegrationOptions.failedRequestTargets
|
45
|
+
}));
|
46
|
+
}
|
47
|
+
if (options !== null && options !== void 0 && (_options$captureConso = options.captureConsoleIntegrationOptions) !== null && _options$captureConso !== void 0 && _options$captureConso.levels) {
|
48
|
+
integrations.push(Sentry.captureConsoleIntegration({
|
49
|
+
levels: options.captureConsoleIntegrationOptions.levels
|
50
|
+
}));
|
51
|
+
}
|
52
|
+
if (options !== null && options !== void 0 && (_options$options2 = options.options) !== null && _options$options2 !== void 0 && _options$options2.hasOwnProperty('integrations')) {
|
53
|
+
options.options.integrations = [].concat(_toConsumableArray(options.options.integrations), integrations);
|
54
|
+
} else {
|
55
|
+
options.options = options.options || {};
|
56
|
+
options.options.integrations = integrations;
|
57
|
+
}
|
58
|
+
var sentryOptions = {
|
59
|
+
dsn: options.dsn,
|
60
|
+
debug: options.debug,
|
61
|
+
release: options.release,
|
62
|
+
environment: options.env,
|
63
|
+
ignoreErrors: ignoreErrors,
|
64
|
+
sampleRate: 1.0,
|
65
|
+
maxBreadcrumbs: 50,
|
66
|
+
attachStacktrace: true,
|
67
|
+
autoSessionTracking: true,
|
68
|
+
sendClientReports: true,
|
69
|
+
enableTracing: true,
|
70
|
+
// Performance Monitoring
|
71
|
+
tracesSampleRate: 1.0,
|
72
|
+
// Capture 100% of the transactions
|
73
|
+
// Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
|
74
|
+
tracePropagationTargets: ['localhost'],
|
75
|
+
sendDefaultPii: true,
|
76
|
+
beforeSend: function beforeSend(event) {
|
77
|
+
var _event$message, _event$message2, _event$message3;
|
78
|
+
if (event !== null && event !== void 0 && (_event$message = event.message) !== null && _event$message !== void 0 && _event$message.includes('antd:') || event !== null && event !== void 0 && (_event$message2 = event.message) !== null && _event$message2 !== void 0 && _event$message2.includes('is deprecated in StrictMode') || event !== null && event !== void 0 && (_event$message3 = event.message) !== null && _event$message3 !== void 0 && _event$message3.includes('React Intl') || !shouldSendToSentry) {
|
79
|
+
return null;
|
80
|
+
}
|
81
|
+
return event;
|
82
|
+
}
|
83
|
+
};
|
84
|
+
if (options !== null && options !== void 0 && options.beforeSend) {
|
85
|
+
sentryOptions.beforeSend = options.beforeSend;
|
86
|
+
}
|
87
|
+
if (options !== null && options !== void 0 && options.options) {
|
88
|
+
sentryOptions = _objectSpread(_objectSpread({}, sentryOptions), options.options);
|
89
|
+
}
|
90
|
+
Sentry.init(sentryOptions);
|
91
|
+
};
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Record additional http data for Sentry.
|
95
|
+
*
|
96
|
+
* @param {any | null} config
|
97
|
+
* @param {any | null} request
|
98
|
+
* @param {any | null} response
|
99
|
+
* @return {void}
|
100
|
+
*/
|
101
|
+
var recordAdditionalSentryHttp = exports.recordAdditionalSentryHttp = function recordAdditionalSentryHttp(config, request, response) {
|
102
|
+
(0, _Utils.recordSentryHttp)(Sentry, config, request, response);
|
103
|
+
};
|
104
|
+
//# sourceMappingURL=React.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"React.js","names":["Sentry","_interopRequireWildcard","require","_Utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","iterator","isArray","initSentry","exports","options","_options$requiredEnvF","_options$options","_options$httpClientIn","_options$httpClientIn2","_options$captureConso","_options$options2","shouldSendToSentry","requiredEnvForSendToSentry","includes","env","ignoreErrors","ignoreErrorsOptions","concat","integrations","httpClientIntegrationOptions","failedRequestStatusCodes","failedRequestTargets","httpClientIntegration","captureConsoleIntegrationOptions","levels","captureConsoleIntegration","sentryOptions","dsn","debug","release","environment","sampleRate","maxBreadcrumbs","attachStacktrace","autoSessionTracking","sendClientReports","enableTracing","tracesSampleRate","tracePropagationTargets","sendDefaultPii","beforeSend","event","_event$message","_event$message2","_event$message3","message","init","recordAdditionalSentryHttp","config","request","response","recordSentryHttp"],"sources":["../../src/Sentry/React.ts"],"sourcesContent":["import * as Sentry from '@sentry/react';\nimport { InitOptions } from '../interfaces/Sentry/InitOptions';\nimport { StringRegexArr } from '../types/Sentry/OptionType';\nimport { recordSentryHttp } from './Utils';\n\n/**\n * Initialize Sentry for React.\n *\n * @param {InitOptions} options\n * @return {void}\n */\nconst initSentry = (options: InitOptions): void => {\n let shouldSendToSentry = options?.requiredEnvForSendToSentry?.includes(\n options.env,\n );\n\n let ignoreErrors: StringRegexArr = [\n /antd:/,\n /is deprecated in StrictMode/,\n /React Intl/,\n ];\n\n if (options?.ignoreErrorsOptions) {\n ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);\n }\n\n if (options?.options?.ignoreErrors) {\n ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);\n delete options.options.ignoreErrors;\n }\n\n let integrations: any[] = [];\n\n if (\n options?.httpClientIntegrationOptions?.failedRequestStatusCodes &&\n options?.httpClientIntegrationOptions?.failedRequestTargets\n ) {\n integrations.push(\n Sentry.httpClientIntegration({\n failedRequestStatusCodes:\n options.httpClientIntegrationOptions.failedRequestStatusCodes,\n failedRequestTargets:\n options.httpClientIntegrationOptions.failedRequestTargets,\n }),\n );\n }\n\n if (options?.captureConsoleIntegrationOptions?.levels) {\n integrations.push(\n Sentry.captureConsoleIntegration({\n levels: options.captureConsoleIntegrationOptions.levels,\n }),\n );\n }\n\n if (options?.options?.hasOwnProperty('integrations')) {\n options.options.integrations = [\n ...options.options.integrations,\n ...integrations,\n ];\n } else {\n options.options = options.options || {};\n options.options.integrations = integrations;\n }\n\n let sentryOptions: Sentry.BrowserOptions = {\n dsn: options.dsn,\n debug: options.debug,\n release: options.release,\n environment: options.env,\n ignoreErrors: ignoreErrors,\n sampleRate: 1.0,\n maxBreadcrumbs: 50,\n attachStacktrace: true,\n autoSessionTracking: true,\n sendClientReports: true,\n enableTracing: true,\n // Performance Monitoring\n tracesSampleRate: 1.0, // Capture 100% of the transactions\n // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled\n tracePropagationTargets: ['localhost'],\n sendDefaultPii: true,\n beforeSend: (event) => {\n if (\n event?.message?.includes('antd:') ||\n event?.message?.includes('is deprecated in StrictMode') ||\n event?.message?.includes('React Intl') ||\n !shouldSendToSentry\n ) {\n return null;\n }\n\n return event;\n },\n };\n\n if (options?.beforeSend) {\n sentryOptions.beforeSend = options.beforeSend;\n }\n\n if (options?.options) {\n sentryOptions = {\n ...sentryOptions,\n ...options.options,\n };\n }\n\n Sentry.init(sentryOptions);\n};\n\n/**\n * Record additional http data for Sentry.\n *\n * @param {any | null} config\n * @param {any | null} request\n * @param {any | null} response\n * @return {void}\n */\nconst recordAdditionalSentryHttp = (\n config?: any,\n request?: any,\n response?: any,\n) => {\n recordSentryHttp(Sentry, config, request, response);\n};\n\nexport { initSentry, recordAdditionalSentryHttp };\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,C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,OAAO,CACnB;EACH;EAEAlE,MAAM,CAAC4G,IAAI,CAACpB,aAAa,CAAC;AAC5B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMqB,0BAA0B,GAAA5C,OAAA,CAAA4C,0BAAA,GAAG,SAA7BA,0BAA0BA,CAC9BC,MAAY,EACZC,OAAa,EACbC,QAAc,EACX;EACH,IAAAC,uBAAgB,EAACjH,MAAM,EAAE8G,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAC;AACrD,CAAC","ignoreList":[]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import { InitOptionsRN } from '../interfaces/Sentry/InitOptionsRN';
|
2
|
+
/**
|
3
|
+
* Initialize Sentry for React Native.
|
4
|
+
*
|
5
|
+
* @param {InitOptionsRN} options
|
6
|
+
* @return {void}
|
7
|
+
*/
|
8
|
+
declare const initSentry: (options: InitOptionsRN) => void;
|
9
|
+
/**
|
10
|
+
* Record additional http data for Sentry.
|
11
|
+
*
|
12
|
+
* @param {any | null} config
|
13
|
+
* @param {any | null} request
|
14
|
+
* @param {any | null} response
|
15
|
+
* @return {void}
|
16
|
+
*/
|
17
|
+
declare const recordAdditionalSentryHttp: (config?: any, request?: any, response?: any) => void;
|
18
|
+
export { initSentry, recordAdditionalSentryHttp };
|
@@ -0,0 +1,114 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.recordAdditionalSentryHttp = exports.initSentry = void 0;
|
8
|
+
var _integrations = require("@sentry/integrations");
|
9
|
+
var Sentry = _interopRequireWildcard(require("@sentry/react-native"));
|
10
|
+
var _Utils = require("./Utils");
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
13
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
14
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
15
|
+
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
17
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
18
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
19
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
20
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
21
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
22
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
23
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
24
|
+
/**
|
25
|
+
* Initialize Sentry for React Native.
|
26
|
+
*
|
27
|
+
* @param {InitOptionsRN} options
|
28
|
+
* @return {void}
|
29
|
+
*/
|
30
|
+
var initSentry = exports.initSentry = function initSentry(options) {
|
31
|
+
var _options$requiredEnvF, _options$options, _options$httpClientIn, _options$httpClientIn2, _options$captureConso, _options$options2;
|
32
|
+
var shouldSendToSentry = options === null || options === void 0 || (_options$requiredEnvF = options.requiredEnvForSendToSentry) === null || _options$requiredEnvF === void 0 ? void 0 : _options$requiredEnvF.includes(options.env);
|
33
|
+
var ignoreErrors = [/StallTracking/];
|
34
|
+
if (options !== null && options !== void 0 && options.ignoreErrorsOptions) {
|
35
|
+
ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);
|
36
|
+
}
|
37
|
+
if (options !== null && options !== void 0 && (_options$options = options.options) !== null && _options$options !== void 0 && _options$options.ignoreErrors) {
|
38
|
+
ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);
|
39
|
+
delete options.options.ignoreErrors;
|
40
|
+
}
|
41
|
+
var integrations = [];
|
42
|
+
if (options !== null && options !== void 0 && (_options$httpClientIn = options.httpClientIntegrationOptions) !== null && _options$httpClientIn !== void 0 && _options$httpClientIn.failedRequestStatusCodes && options !== null && options !== void 0 && (_options$httpClientIn2 = options.httpClientIntegrationOptions) !== null && _options$httpClientIn2 !== void 0 && _options$httpClientIn2.failedRequestTargets) {
|
43
|
+
integrations.push((0, _integrations.httpClientIntegration)({
|
44
|
+
failedRequestStatusCodes: options.httpClientIntegrationOptions.failedRequestStatusCodes,
|
45
|
+
failedRequestTargets: options.httpClientIntegrationOptions.failedRequestTargets
|
46
|
+
}));
|
47
|
+
}
|
48
|
+
if (options !== null && options !== void 0 && (_options$captureConso = options.captureConsoleIntegrationOptions) !== null && _options$captureConso !== void 0 && _options$captureConso.levels) {
|
49
|
+
integrations.push((0, _integrations.captureConsoleIntegration)({
|
50
|
+
levels: options.captureConsoleIntegrationOptions.levels
|
51
|
+
}));
|
52
|
+
}
|
53
|
+
if (options !== null && options !== void 0 && (_options$options2 = options.options) !== null && _options$options2 !== void 0 && _options$options2.hasOwnProperty('integrations')) {
|
54
|
+
options.options.integrations = [].concat(_toConsumableArray(options.options.integrations), integrations);
|
55
|
+
} else {
|
56
|
+
options.options = options.options || {};
|
57
|
+
options.options.integrations = integrations;
|
58
|
+
}
|
59
|
+
var sentryOptions = {
|
60
|
+
dsn: options.dsn,
|
61
|
+
debug: options.debug,
|
62
|
+
environment: options.env,
|
63
|
+
ignoreErrors: ignoreErrors,
|
64
|
+
sampleRate: 1.0,
|
65
|
+
maxBreadcrumbs: 50,
|
66
|
+
autoSessionTracking: true,
|
67
|
+
attachScreenshot: true,
|
68
|
+
enableCaptureFailedRequests: true,
|
69
|
+
enableTracing: true,
|
70
|
+
tracesSampleRate: 1.0,
|
71
|
+
enableNative: true,
|
72
|
+
autoInitializeNativeSdk: true,
|
73
|
+
enableNativeCrashHandling: true,
|
74
|
+
enableNativeNagger: true,
|
75
|
+
enableAutoSessionTracking: true,
|
76
|
+
enableNdkScopeSync: true,
|
77
|
+
attachThreads: true,
|
78
|
+
enableAutoPerformanceTracing: true,
|
79
|
+
enableWatchdogTerminationTracking: true,
|
80
|
+
enableAppHangTracking: true,
|
81
|
+
appHangTimeoutInterval: 5,
|
82
|
+
sendDefaultPii: true,
|
83
|
+
beforeSend: function beforeSend(event) {
|
84
|
+
var _event$message;
|
85
|
+
if (event !== null && event !== void 0 && (_event$message = event.message) !== null && _event$message !== void 0 && _event$message.includes('StallTracking') || !shouldSendToSentry) {
|
86
|
+
return null;
|
87
|
+
}
|
88
|
+
return event;
|
89
|
+
}
|
90
|
+
};
|
91
|
+
if (options !== null && options !== void 0 && options.release) {
|
92
|
+
sentryOptions.release = options.release;
|
93
|
+
}
|
94
|
+
if (options !== null && options !== void 0 && options.beforeSend) {
|
95
|
+
sentryOptions.beforeSend = options.beforeSend;
|
96
|
+
}
|
97
|
+
if (options !== null && options !== void 0 && options.options) {
|
98
|
+
sentryOptions = _objectSpread(_objectSpread({}, sentryOptions), options.options);
|
99
|
+
}
|
100
|
+
Sentry.init(sentryOptions);
|
101
|
+
};
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Record additional http data for Sentry.
|
105
|
+
*
|
106
|
+
* @param {any | null} config
|
107
|
+
* @param {any | null} request
|
108
|
+
* @param {any | null} response
|
109
|
+
* @return {void}
|
110
|
+
*/
|
111
|
+
var recordAdditionalSentryHttp = exports.recordAdditionalSentryHttp = function recordAdditionalSentryHttp(config, request, response) {
|
112
|
+
(0, _Utils.recordSentryHttp)(Sentry, config, request, response);
|
113
|
+
};
|
114
|
+
//# sourceMappingURL=ReactNative.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ReactNative.js","names":["_integrations","require","Sentry","_interopRequireWildcard","_Utils","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","ownKeys","keys","getOwnPropertySymbols","o","filter","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","_toPropertyKey","value","configurable","writable","_toPrimitive","Symbol","toPrimitive","TypeError","String","Number","_toConsumableArray","_arrayWithoutHoles","_iterableToArray","_unsupportedIterableToArray","_nonIterableSpread","_arrayLikeToArray","toString","slice","constructor","name","Array","from","test","iterator","isArray","initSentry","exports","options","_options$requiredEnvF","_options$options","_options$httpClientIn","_options$httpClientIn2","_options$captureConso","_options$options2","shouldSendToSentry","requiredEnvForSendToSentry","includes","env","ignoreErrors","ignoreErrorsOptions","concat","integrations","httpClientIntegrationOptions","failedRequestStatusCodes","failedRequestTargets","httpClientIntegration","captureConsoleIntegrationOptions","levels","captureConsoleIntegration","sentryOptions","dsn","debug","environment","sampleRate","maxBreadcrumbs","autoSessionTracking","attachScreenshot","enableCaptureFailedRequests","enableTracing","tracesSampleRate","enableNative","autoInitializeNativeSdk","enableNativeCrashHandling","enableNativeNagger","enableAutoSessionTracking","enableNdkScopeSync","attachThreads","enableAutoPerformanceTracing","enableWatchdogTerminationTracking","enableAppHangTracking","appHangTimeoutInterval","sendDefaultPii","beforeSend","event","_event$message","message","release","init","recordAdditionalSentryHttp","config","request","response","recordSentryHttp"],"sources":["../../src/Sentry/ReactNative.ts"],"sourcesContent":["import {\n captureConsoleIntegration,\n httpClientIntegration,\n} from '@sentry/integrations';\nimport * as Sentry from '@sentry/react-native';\nimport { InitOptionsRN } from '../interfaces/Sentry/InitOptionsRN';\nimport { StringRegexArr } from '../types/Sentry/OptionType';\nimport { recordSentryHttp } from './Utils';\n\n/**\n * Initialize Sentry for React Native.\n *\n * @param {InitOptionsRN} options\n * @return {void}\n */\nconst initSentry = (options: InitOptionsRN): void => {\n let shouldSendToSentry = options?.requiredEnvForSendToSentry?.includes(\n options.env,\n );\n\n let ignoreErrors: StringRegexArr = [/StallTracking/];\n\n if (options?.ignoreErrorsOptions) {\n ignoreErrors = ignoreErrors.concat(options.ignoreErrorsOptions);\n }\n\n if (options?.options?.ignoreErrors) {\n ignoreErrors = ignoreErrors.concat(options.options.ignoreErrors);\n delete options.options.ignoreErrors;\n }\n\n let integrations: any[] = [];\n\n if (\n options?.httpClientIntegrationOptions?.failedRequestStatusCodes &&\n options?.httpClientIntegrationOptions?.failedRequestTargets\n ) {\n integrations.push(\n httpClientIntegration({\n failedRequestStatusCodes:\n options.httpClientIntegrationOptions.failedRequestStatusCodes,\n failedRequestTargets:\n options.httpClientIntegrationOptions.failedRequestTargets,\n }),\n );\n }\n\n if (options?.captureConsoleIntegrationOptions?.levels) {\n integrations.push(\n captureConsoleIntegration({\n levels: options.captureConsoleIntegrationOptions.levels,\n }),\n );\n }\n\n if (options?.options?.hasOwnProperty('integrations')) {\n options.options.integrations = [\n ...options.options.integrations,\n ...integrations,\n ];\n } else {\n options.options = options.options || {};\n options.options.integrations = integrations;\n }\n\n let sentryOptions: Sentry.ReactNativeOptions = {\n dsn: options.dsn,\n debug: options.debug,\n environment: options.env,\n ignoreErrors: ignoreErrors,\n sampleRate: 1.0,\n maxBreadcrumbs: 50,\n autoSessionTracking: true,\n attachScreenshot: true,\n enableCaptureFailedRequests: true,\n enableTracing: true,\n tracesSampleRate: 1.0,\n enableNative: true,\n autoInitializeNativeSdk: true,\n enableNativeCrashHandling: true,\n enableNativeNagger: true,\n enableAutoSessionTracking: true,\n enableNdkScopeSync: true,\n attachThreads: true,\n enableAutoPerformanceTracing: true,\n enableWatchdogTerminationTracking: true,\n enableAppHangTracking: true,\n appHangTimeoutInterval: 5,\n sendDefaultPii: true,\n beforeSend: (event) => {\n if (event?.message?.includes('StallTracking') || !shouldSendToSentry) {\n return null;\n }\n\n return event;\n },\n };\n\n if (options?.release) {\n sentryOptions.release = options.release;\n }\n\n if (options?.beforeSend) {\n sentryOptions.beforeSend = options.beforeSend;\n }\n\n if (options?.options) {\n sentryOptions = {\n ...sentryOptions,\n ...options.options,\n };\n }\n\n Sentry.init(sentryOptions);\n};\n\n/**\n * Record additional http data for Sentry.\n *\n * @param {any | null} config\n * @param {any | null} request\n * @param {any | null} response\n * @return {void}\n */\nconst recordAdditionalSentryHttp = (\n config?: any,\n request?: any,\n response?: any,\n) => {\n recordSentryHttp(Sentry, config, request, response);\n};\n\nexport { initSentry, recordAdditionalSentryHttp };\n"],"mappings":";;;;;;;AAAA,IAAAA,aAAA,GAAAC,OAAA;AAIA,IAAAC,MAAA,GAAAC,uBAAA,CAAAF,OAAA;AAGA,IAAAG,MAAA,GAAAH,OAAA;AAA2C,SAAAI,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAH,wBAAAG,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,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MAEA,OAAOuC,KAAK;IACd;EACF,CAAC;EAED,IAAI9C,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEiD,OAAO,EAAE;IACpB3B,aAAa,CAAC2B,OAAO,GAAGjD,OAAO,CAACiD,OAAO;EACzC;EAEA,IAAIjD,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAE6C,UAAU,EAAE;IACvBvB,aAAa,CAACuB,UAAU,GAAG7C,OAAO,CAAC6C,UAAU;EAC/C;EAEA,IAAI7C,OAAO,aAAPA,OAAO,eAAPA,OAAO,CAAEA,OAAO,EAAE;IACpBsB,aAAa,GAAAxD,aAAA,CAAAA,aAAA,KACRwD,aAAa,GACbtB,OAAO,CAACA,OAAO,CACnB;EACH;EAEAjE,MAAM,CAACmH,IAAI,CAAC5B,aAAa,CAAC;AAC5B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAM6B,0BAA0B,GAAApD,OAAA,CAAAoD,0BAAA,GAAG,SAA7BA,0BAA0BA,CAC9BC,MAAY,EACZC,OAAa,EACbC,QAAc,EACX;EACH,IAAAC,uBAAgB,EAACxH,MAAM,EAAEqH,MAAM,EAAEC,OAAO,EAAEC,QAAQ,CAAC;AACrD,CAAC","ignoreList":[]}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.recordSentryHttp = void 0;
|
7
|
+
var recordSentryHttp = exports.recordSentryHttp = function recordSentryHttp(Sentry, config, request, response) {
|
8
|
+
if (config) {
|
9
|
+
Sentry.withScope(function (scope) {
|
10
|
+
scope.setContext('config', config);
|
11
|
+
});
|
12
|
+
}
|
13
|
+
if (request) {
|
14
|
+
Sentry.withScope(function (scope) {
|
15
|
+
scope.setContext('request', request);
|
16
|
+
});
|
17
|
+
}
|
18
|
+
if (response) {
|
19
|
+
Sentry.withScope(function (scope) {
|
20
|
+
scope.setContext('response', response);
|
21
|
+
});
|
22
|
+
}
|
23
|
+
};
|
24
|
+
//# sourceMappingURL=Utils.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Utils.js","names":["recordSentryHttp","exports","Sentry","config","request","response","withScope","scope","setContext"],"sources":["../../src/Sentry/Utils.ts"],"sourcesContent":["const recordSentryHttp = (\n Sentry: any,\n config?: any,\n request?: any,\n response?: any,\n) => {\n if (config) {\n Sentry.withScope((scope: any) => {\n scope.setContext('config', config);\n });\n }\n\n if (request) {\n Sentry.withScope((scope: any) => {\n scope.setContext('request', request);\n });\n }\n\n if (response) {\n Sentry.withScope((scope: any) => {\n scope.setContext('response', response);\n });\n }\n};\n\nexport { recordSentryHttp };\n"],"mappings":";;;;;;AAAA,IAAMA,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,GAAG,SAAnBA,gBAAgBA,CACpBE,MAAW,EACXC,MAAY,EACZC,OAAa,EACbC,QAAc,EACX;EACH,IAAIF,MAAM,EAAE;IACVD,MAAM,CAACI,SAAS,CAAC,UAACC,KAAU,EAAK;MAC/BA,KAAK,CAACC,UAAU,CAAC,QAAQ,EAAEL,MAAM,CAAC;IACpC,CAAC,CAAC;EACJ;EAEA,IAAIC,OAAO,EAAE;IACXF,MAAM,CAACI,SAAS,CAAC,UAACC,KAAU,EAAK;MAC/BA,KAAK,CAACC,UAAU,CAAC,SAAS,EAAEJ,OAAO,CAAC;IACtC,CAAC,CAAC;EACJ;EAEA,IAAIC,QAAQ,EAAE;IACZH,MAAM,CAACI,SAAS,CAAC,UAACC,KAAU,EAAK;MAC/BA,KAAK,CAACC,UAAU,CAAC,UAAU,EAAEH,QAAQ,CAAC;IACxC,CAAC,CAAC;EACJ;AACF,CAAC","ignoreList":[]}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
5
|
+
value: true
|
6
|
+
});
|
7
|
+
exports.deleteFile = void 0;
|
8
|
+
var _fs = require("fs");
|
9
|
+
var path = _interopRequireWildcard(require("path"));
|
10
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
11
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
12
|
+
/**
|
13
|
+
* @param {string} path - The path.
|
14
|
+
* @returns {boolean} Whether path is a directory, otherwise always false.
|
15
|
+
*/
|
16
|
+
var isDir = function isDir(path) {
|
17
|
+
try {
|
18
|
+
var stat = (0, _fs.lstatSync)(path);
|
19
|
+
return stat.isDirectory();
|
20
|
+
} catch (error) {
|
21
|
+
// lstatSync throws an error if path doesn't exist
|
22
|
+
return false;
|
23
|
+
}
|
24
|
+
};
|
25
|
+
|
26
|
+
/**
|
27
|
+
* @param {string} dirPath - Directory path.
|
28
|
+
* @param {string[]} exts - List of Extension file need to be removed.
|
29
|
+
* @returns {void}
|
30
|
+
*/
|
31
|
+
var deleteFile = exports.deleteFile = function deleteFile(dirPath, exts) {
|
32
|
+
(0, _fs.readdir)(dirPath, function (err, files) {
|
33
|
+
if (err) {
|
34
|
+
console.error(err);
|
35
|
+
}
|
36
|
+
files.forEach(function (file) {
|
37
|
+
var fileDir = path.join("".concat(dirPath, "/").concat(file));
|
38
|
+
// Get the extension name of the file, lowercase it, then see if it is in the array of extensions
|
39
|
+
// defined above. If so, remove it.
|
40
|
+
|
41
|
+
if (isDir(fileDir)) {
|
42
|
+
deleteFile(fileDir, exts);
|
43
|
+
return;
|
44
|
+
}
|
45
|
+
if (file.toLowerCase() === '.ds_store' || exts.includes(path.extname(file).toLowerCase())) {
|
46
|
+
(0, _fs.unlinkSync)(fileDir);
|
47
|
+
console.log("File: ".concat(fileDir, " deleted successfully."));
|
48
|
+
}
|
49
|
+
});
|
50
|
+
});
|
51
|
+
};
|
52
|
+
//# sourceMappingURL=Files.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Files.js","names":["_fs","require","path","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isDir","stat","lstatSync","isDirectory","error","deleteFile","exports","dirPath","exts","readdir","err","files","console","forEach","file","fileDir","join","concat","toLowerCase","includes","extname","unlinkSync","log"],"sources":["../../src/Utils/Files.ts"],"sourcesContent":["import { lstatSync, readdir, unlinkSync } from 'fs';\nimport * as path from 'path';\n\n/**\n * @param {string} path - The path.\n * @returns {boolean} Whether path is a directory, otherwise always false.\n */\nconst isDir = (path: string): boolean => {\n try {\n const stat = lstatSync(path);\n return stat.isDirectory();\n } catch (error) {\n // lstatSync throws an error if path doesn't exist\n return false;\n }\n};\n\n/**\n * @param {string} dirPath - Directory path.\n * @param {string[]} exts - List of Extension file need to be removed.\n * @returns {void}\n */\nconst deleteFile = (dirPath: string, exts: string[]): void => {\n readdir(dirPath, (err, files) => {\n if (err) {\n console.error(err);\n }\n\n files.forEach((file) => {\n const fileDir = path.join(`${dirPath}/${file}`);\n // Get the extension name of the file, lowercase it, then see if it is in the array of extensions\n // defined above. If so, remove it.\n\n if (isDir(fileDir)) {\n deleteFile(fileDir, exts);\n return;\n }\n\n if (\n file.toLowerCase() === '.ds_store' ||\n exts.includes(path.extname(file).toLowerCase())\n ) {\n unlinkSync(fileDir);\n\n console.log(`File: ${fileDir} deleted successfully.`);\n }\n });\n });\n};\n\nexport { deleteFile };\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA6B,SAAAG,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAF,wBAAAE,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAA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;AACJ,CAAC","ignoreList":[]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
const recordSentryHttp = (Sentry, config, request, response) => {
|
2
|
+
if (config) {
|
3
|
+
Sentry.withScope(scope => {
|
4
|
+
scope.setContext('config', config);
|
5
|
+
});
|
6
|
+
}
|
7
|
+
if (request) {
|
8
|
+
Sentry.withScope(scope => {
|
9
|
+
scope.setContext('request', request);
|
10
|
+
});
|
11
|
+
}
|
12
|
+
if (response) {
|
13
|
+
Sentry.withScope(scope => {
|
14
|
+
scope.setContext('response', response);
|
15
|
+
});
|
16
|
+
}
|
17
|
+
};
|
18
|
+
|
19
|
+
export { recordSentryHttp as r };
|
20
|
+
//# sourceMappingURL=Utils-Cq948gfa.js.map
|