ghost 4.13.0 → 4.16.0
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/content/themes/casper/assets/built/screen.css +1 -1
- package/content/themes/casper/assets/built/screen.css.map +1 -1
- package/content/themes/casper/assets/css/screen.css +1 -1
- package/content/themes/casper/default.hbs +2 -2
- package/content/themes/casper/package.json +1 -1
- package/content/themes/casper/page.hbs +28 -26
- package/content/themes/casper/partials/post-card.hbs +2 -2
- package/content/themes/casper/post.hbs +67 -65
- package/content/themes/casper/tag.hbs +2 -2
- package/core/built/assets/{chunk.3.f80c7fbb7573ce508a05.js → chunk.3.4b1d9e20e57164ac9c29.js} +31 -29
- package/core/built/assets/ghost-dark-bb2831fc27fcb02893ed0a761207dc63.css +1 -0
- package/core/built/assets/{ghost.min-ba7f03a78d7d98444af386b8ae9347a7.js → ghost.min-d1d99f3ed6e0f427874b2a11e7078475.js} +1777 -1685
- package/core/built/assets/ghost.min-e7612edfa72b0fe2c201b387923e6fc7.css +1 -0
- package/core/built/assets/icons/check-2.svg +1 -0
- package/core/built/assets/icons/discount-bubble.svg +1 -0
- package/core/built/assets/icons/no-data-line-chart.svg +1 -0
- package/core/built/assets/icons/no-data-list.svg +9 -8
- package/core/built/assets/icons/no-data-subscription.svg +1 -0
- package/core/built/assets/{vendor.min-29784d514390cb5abc74ae660cb2fbc7.js → vendor.min-3660ec7864887f1496fe7a27fd23ab76.js} +1570 -1289
- package/core/frontend/helpers/ghost_head.js +7 -1
- package/core/frontend/helpers/match.js +19 -4
- package/core/frontend/helpers/products.js +68 -0
- package/core/frontend/helpers/tpl/content-cta.hbs +1 -1
- package/core/frontend/services/routing/controllers/email-post.js +3 -2
- package/core/frontend/services/settings/loader.js +2 -2
- package/core/frontend/services/sitemap/base-generator.js +12 -8
- package/core/frontend/services/sitemap/manager.js +1 -1
- package/core/frontend/services/theme-engine/handlebars/helpers.js +1 -0
- package/core/frontend/services/theme-engine/middleware.js +4 -1
- package/core/server/api/canary/email-preview.js +15 -33
- package/core/server/api/canary/integrations.js +7 -30
- package/core/server/api/canary/labels.js +8 -9
- package/core/server/api/canary/members.js +13 -9
- package/core/server/api/canary/schedules.js +9 -57
- package/core/server/api/canary/settings.js +20 -158
- package/core/server/api/canary/themes.js +5 -59
- package/core/server/api/canary/utils/serializers/output/members.js +2 -14
- package/core/server/api/canary/utils/validators/input/settings.js +23 -1
- package/core/server/api/canary/webhooks.js +6 -24
- package/core/server/api/v2/schedules.js +9 -57
- package/core/server/api/v3/email-preview.js +15 -28
- package/core/server/api/v3/integrations.js +7 -30
- package/core/server/api/v3/labels.js +8 -9
- package/core/server/api/v3/members.js +4 -1
- package/core/server/api/v3/schedules.js +9 -57
- package/core/server/api/v3/settings.js +13 -132
- package/core/server/api/v3/utils/validators/input/settings.js +23 -1
- package/core/server/api/v3/webhooks.js +6 -28
- package/core/server/data/exporter/table-lists.js +1 -0
- package/core/server/data/importer/import-manager.js +398 -0
- package/core/server/data/importer/importers/data/data-importer.js +162 -0
- package/core/server/data/importer/importers/data/index.js +1 -162
- package/core/server/data/importer/index.js +1 -379
- package/core/server/data/migrations/versions/4.14/01-fix-comped-member-statuses.js +70 -0
- package/core/server/data/migrations/versions/4.14/02-fix-free-members-status-events.js +60 -0
- package/core/server/data/migrations/versions/4.15/01-add-temp-members-analytic-events-table.js +12 -0
- package/core/server/data/migrations/versions/4.16/01-add-custom-theme-settings-table.js +9 -0
- package/core/server/data/schema/fixtures/utils.js +6 -1
- package/core/server/data/schema/schema.js +26 -0
- package/core/server/lib/request-external.js +3 -2
- package/core/server/models/action.js +1 -1
- package/core/server/models/api-key.js +1 -1
- package/core/server/models/base/bookshelf.js +0 -3
- package/core/server/models/base/index.js +2 -0
- package/core/server/models/base/plugins/events.js +2 -2
- package/core/server/models/base/plugins/raw-knex.js +10 -10
- package/core/server/models/custom-theme-setting.js +9 -0
- package/core/server/models/email.js +2 -2
- package/core/server/models/index.js +2 -0
- package/core/server/models/integration.js +1 -1
- package/core/server/models/label.js +2 -2
- package/core/server/models/member-analytic-event.js +9 -0
- package/core/server/models/member.js +2 -2
- package/core/server/models/post.js +2 -2
- package/core/server/models/settings.js +2 -2
- package/core/server/models/tag.js +2 -2
- package/core/server/models/user.js +2 -2
- package/core/server/models/webhook.js +2 -2
- package/core/server/services/bulk-email/bulk-email-processor.js +1 -4
- package/core/server/services/custom-theme-settings.js +8 -0
- package/core/server/services/integrations/integrations-service.js +61 -0
- package/core/server/services/mail/GhostMailer.js +29 -37
- package/core/server/services/mega/email-preview.js +41 -0
- package/core/server/services/mega/index.js +4 -0
- package/core/server/services/mega/mega.js +27 -23
- package/core/server/services/mega/post-email-serializer.js +28 -21
- package/core/server/services/mega/template.js +11 -0
- package/core/server/services/members/api.js +1 -0
- package/core/server/services/members/emails/signup.js +1 -1
- package/core/server/services/oembed.js +7 -2
- package/core/server/services/posts/post-scheduling-service.js +100 -0
- package/core/server/services/settings/index.js +13 -16
- package/core/server/services/settings/settings-bread-service.js +188 -0
- package/core/server/services/settings/settings-utils.js +32 -0
- package/core/server/services/themes/ThemeStorage.js +5 -4
- package/core/server/services/themes/activation-bridge.js +14 -0
- package/core/server/services/themes/index.js +2 -0
- package/core/server/services/themes/installer.js +72 -0
- package/core/server/services/themes/validate.js +5 -2
- package/core/server/services/webhooks/webhooks-service.js +55 -0
- package/core/server/web/admin/views/default-prod.html +4 -4
- package/core/server/web/admin/views/default.html +4 -4
- package/core/server/web/members/app.js +3 -0
- package/core/shared/config/defaults.json +2 -2
- package/core/shared/custom-theme-settings-cache.js +3 -0
- package/core/shared/i18n/translations/en.json +1 -6
- package/core/shared/labs.js +5 -7
- package/package.json +64 -62
- package/yarn.lock +1490 -1055
- package/core/built/assets/ghost-dark-98d56e4973a502750748090f9dbc8280.css +0 -1
- package/core/built/assets/ghost.min-6932a664a1cb92a8e4a15f540cae3ad8.css +0 -1
- package/core/server/services/mega/template-labs.js +0 -1024
|
@@ -7,78 +7,80 @@ into the {body} tag of the default.hbs template --}}
|
|
|
7
7
|
{{#post}}
|
|
8
8
|
{{!-- Everything inside the #post block pulls data from the post --}}
|
|
9
9
|
|
|
10
|
-
<
|
|
10
|
+
<main id="site-main" class="site-main">
|
|
11
|
+
<article class="article {{post_class}}">
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
<header class="article-header gh-canvas">
|
|
13
14
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
</section>
|
|
18
|
-
{{/if}}
|
|
19
|
-
|
|
20
|
-
<h1 class="article-title">{{title}}</h1>
|
|
21
|
-
|
|
22
|
-
{{#if custom_excerpt}}
|
|
23
|
-
<p class="article-excerpt">{{custom_excerpt}}</p>
|
|
24
|
-
{{/if}}
|
|
25
|
-
|
|
26
|
-
<div class="article-byline">
|
|
27
|
-
<section class="article-byline-content">
|
|
28
|
-
<ul class="author-list">
|
|
29
|
-
{{#foreach authors}}
|
|
30
|
-
<li class="author-list-item">
|
|
31
|
-
{{#if profile_image}}
|
|
32
|
-
<a href="{{url}}" class="author-avatar">
|
|
33
|
-
<img class="author-profile-image" src="{{img_url profile_image size="xs"}}" alt="{{name}}" />
|
|
34
|
-
</a>
|
|
35
|
-
{{else}}
|
|
36
|
-
<a href="{{url}}" class="author-avatar author-profile-image">{{> "icons/avatar"}}</a>
|
|
37
|
-
{{/if}}
|
|
38
|
-
</li>
|
|
39
|
-
{{/foreach}}
|
|
40
|
-
</ul>
|
|
41
|
-
<div class="article-byline-meta">
|
|
42
|
-
<h4 class="author-name">{{authors}}</h4>
|
|
43
|
-
<div class="byline-meta-content">
|
|
44
|
-
<time class="byline-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time>
|
|
45
|
-
<span class="byline-reading-time"><span class="bull">•</span> {{reading_time}}</span>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
15
|
+
{{#if primary_tag}}
|
|
16
|
+
<section class="article-tag">
|
|
17
|
+
<a href="{{primary_tag.url}}">{{primary_tag.name}}</a>
|
|
48
18
|
</section>
|
|
49
|
-
</div>
|
|
50
|
-
|
|
51
|
-
{{#if feature_image}}
|
|
52
|
-
<figure class="article-image">
|
|
53
|
-
{{!-- This is a responsive image, it loads different sizes depending on device
|
|
54
|
-
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
|
|
55
|
-
<img
|
|
56
|
-
srcset="{{img_url feature_image size="s"}} 300w,
|
|
57
|
-
{{img_url feature_image size="m"}} 600w,
|
|
58
|
-
{{img_url feature_image size="l"}} 1000w,
|
|
59
|
-
{{img_url feature_image size="xl"}} 2000w"
|
|
60
|
-
sizes="(min-width: 1400px) 1400px, 92vw"
|
|
61
|
-
src="{{img_url feature_image size="xl"}}"
|
|
62
|
-
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
|
|
63
|
-
/>
|
|
64
|
-
{{#if feature_image_caption}}
|
|
65
|
-
<figcaption>{{feature_image_caption}}</figcaption>
|
|
66
19
|
{{/if}}
|
|
67
|
-
</figure>
|
|
68
|
-
{{/if}}
|
|
69
|
-
</header>
|
|
70
20
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
21
|
+
<h1 class="article-title">{{title}}</h1>
|
|
22
|
+
|
|
23
|
+
{{#if custom_excerpt}}
|
|
24
|
+
<p class="article-excerpt">{{custom_excerpt}}</p>
|
|
25
|
+
{{/if}}
|
|
26
|
+
|
|
27
|
+
<div class="article-byline">
|
|
28
|
+
<section class="article-byline-content">
|
|
29
|
+
<ul class="author-list">
|
|
30
|
+
{{#foreach authors}}
|
|
31
|
+
<li class="author-list-item">
|
|
32
|
+
{{#if profile_image}}
|
|
33
|
+
<a href="{{url}}" class="author-avatar">
|
|
34
|
+
<img class="author-profile-image" src="{{img_url profile_image size="xs"}}" alt="{{name}}" />
|
|
35
|
+
</a>
|
|
36
|
+
{{else}}
|
|
37
|
+
<a href="{{url}}" class="author-avatar author-profile-image">{{> "icons/avatar"}}</a>
|
|
38
|
+
{{/if}}
|
|
39
|
+
</li>
|
|
40
|
+
{{/foreach}}
|
|
41
|
+
</ul>
|
|
42
|
+
<div class="article-byline-meta">
|
|
43
|
+
<h4 class="author-name">{{authors}}</h4>
|
|
44
|
+
<div class="byline-meta-content">
|
|
45
|
+
<time class="byline-meta-date" datetime="{{date format="YYYY-MM-DD"}}">{{date}}</time>
|
|
46
|
+
<span class="byline-reading-time"><span class="bull">•</span> {{reading_time}}</span>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
</section>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
{{#if feature_image}}
|
|
53
|
+
<figure class="article-image">
|
|
54
|
+
{{!-- This is a responsive image, it loads different sizes depending on device
|
|
55
|
+
https://medium.freecodecamp.org/a-guide-to-responsive-images-with-ready-to-use-templates-c400bd65c433 --}}
|
|
56
|
+
<img
|
|
57
|
+
srcset="{{img_url feature_image size="s"}} 300w,
|
|
58
|
+
{{img_url feature_image size="m"}} 600w,
|
|
59
|
+
{{img_url feature_image size="l"}} 1000w,
|
|
60
|
+
{{img_url feature_image size="xl"}} 2000w"
|
|
61
|
+
sizes="(min-width: 1400px) 1400px, 92vw"
|
|
62
|
+
src="{{img_url feature_image size="xl"}}"
|
|
63
|
+
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
|
|
64
|
+
/>
|
|
65
|
+
{{#if feature_image_caption}}
|
|
66
|
+
<figcaption>{{feature_image_caption}}</figcaption>
|
|
67
|
+
{{/if}}
|
|
68
|
+
</figure>
|
|
69
|
+
{{/if}}
|
|
70
|
+
</header>
|
|
74
71
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
<section class="gh-content gh-canvas">
|
|
73
|
+
{{content}}
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
{{!--
|
|
77
|
+
<section class="article-comments gh-canvas">
|
|
78
|
+
If you want to embed comments, this is a good place to paste your code!
|
|
79
|
+
</section>
|
|
80
|
+
--}}
|
|
80
81
|
|
|
81
|
-
</article>
|
|
82
|
+
</article>
|
|
83
|
+
</main>
|
|
82
84
|
|
|
83
85
|
{{!-- A signup call to action is displayed here, unless viewed as a logged-in member --}}
|
|
84
86
|
{{#unless @member}}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
{{!-- The tag above means - insert everything in this file into the {body} of the default.hbs template --}}
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
<
|
|
5
|
+
<main id="site-main" class="site-main outer">
|
|
6
6
|
<div class="inner posts">
|
|
7
7
|
<div class="post-feed">
|
|
8
8
|
|
|
@@ -54,4 +54,4 @@
|
|
|
54
54
|
|
|
55
55
|
</div>
|
|
56
56
|
</div>
|
|
57
|
-
</
|
|
57
|
+
</main>
|
package/core/built/assets/{chunk.3.f80c7fbb7573ce508a05.js → chunk.3.4b1d9e20e57164ac9c29.js}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
(window.webpackJsonp_ember_auto_import_=window.webpackJsonp_ember_auto_import_||[]).push([[3],{
|
|
1
|
+
(window.webpackJsonp_ember_auto_import_=window.webpackJsonp_ember_auto_import_||[]).push([[3],{439:function(t,e,n){"use strict"
|
|
2
2
|
n.r(e),n.d(e,"Integrations",(function(){return J})),n.d(e,"Span",(function(){return Y.a})),n.d(e,"Transaction",(function(){return W.a})),n.d(e,"registerRequestInstrumentation",(function(){return R})),n.d(e,"defaultRequestInstrumentationOptions",(function(){return w})),n.d(e,"SpanStatus",(function(){return u.a})),n.d(e,"IdleTransaction",(function(){return c.b})),n.d(e,"startIdleTransaction",(function(){return o.b})),n.d(e,"addExtensionMethods",(function(){return o.a})),n.d(e,"extractTraceparentData",(function(){return d.b})),n.d(e,"getActiveTransaction",(function(){return d.c})),n.d(e,"hasTracingEnabled",(function(){return d.d})),n.d(e,"stripUrlQueryAndFragment",(function(){return s.k})),n.d(e,"TRACEPARENT_REGEXP",(function(){return d.a}))
|
|
3
3
|
var i={}
|
|
4
|
-
n.r(i),n.d(i,"Express",(function(){return
|
|
5
|
-
var a=n(0),r=n(11),s=n(5),o=n(
|
|
4
|
+
n.r(i),n.d(i,"Express",(function(){return D})),n.d(i,"Postgres",(function(){return H})),n.d(i,"Mysql",(function(){return L})),n.d(i,"Mongo",(function(){return U}))
|
|
5
|
+
var a=n(0),r=n(11),s=n(5),o=n(443),c=n(444),u=n(442),d=n(441),p=Object(s.f)(),l=n(10),m=n(50),h=n(22),f=function(t,e,n){var i
|
|
6
6
|
return function(a){e.value>=0&&(a||n)&&(e.delta=e.value-(i||0),(e.delta||void 0===i)&&(i=e.value,t(e)))}},v=function(t,e){return{name:t,value:null!=e?e:-1,delta:0,entries:[],id:"v2-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12)}},g=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){if("first-input"===t&&!("PerformanceEventTiming"in self))return
|
|
7
7
|
var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}))
|
|
8
8
|
return n.observe({type:t,buffered:!0}),n}}catch(t){}},_=function(t,e){var n=function(i){"pagehide"!==i.type&&"hidden"!==document.visibilityState||(t(i),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))}
|
|
9
9
|
addEventListener("visibilitychange",n,!0),addEventListener("pagehide",n,!0)},b=-1,y=function(){return b<0&&(b="hidden"===document.visibilityState?0:1/0,_((function(t){var e=t.timeStamp
|
|
10
|
-
b=e}),!0)),{get firstHiddenTime(){return b}}},O={},T=Object(s.f)(),S=function(){function t(){var t
|
|
11
|
-
this._measurements={},this._performanceCursor=0,!Object(l.b)()&&(null===(t=T)||void 0===t?void 0:t.performance)&&(T.performance.mark&&T.performance.mark("sentry-tracing-init"),this._trackCLS(),this._trackLCP(),this._trackFID())}return t.prototype.addPerformanceEntries=function(t){var e=this
|
|
10
|
+
b=e}),!0)),{get firstHiddenTime(){return b}}},O={},T=Object(s.f)(),S=function(){function t(){var t,e
|
|
11
|
+
this._measurements={},this._performanceCursor=0,!Object(l.b)()&&(null===(t=T)||void 0===t?void 0:t.performance)&&(null===(e=T)||void 0===e?void 0:e.document)&&(T.performance.mark&&T.performance.mark("sentry-tracing-init"),this._trackCLS(),this._trackLCP(),this._trackFID())}return t.prototype.addPerformanceEntries=function(t){var e=this
|
|
12
12
|
if(T&&T.performance&&T.performance.getEntries&&m.b){r.a.log("[Tracing] Adding & adjusting spans using Performance API")
|
|
13
13
|
var n,i,a,s,o,c=Object(d.e)(m.b)
|
|
14
14
|
if(T.document&&T.document.scripts)for(var u=0;u<T.document.scripts.length;u++)if("true"===T.document.scripts[u].dataset.entry){n=T.document.scripts[u].src
|
|
@@ -46,7 +46,7 @@ if(n){var i=Object(d.e)(m.b),a=Object(d.e)(n.startTime)
|
|
|
46
46
|
r.a.log("[Measurements] Adding FID"),t._measurements.fid={value:e.value},t._measurements["mark.fid"]={value:i+a}}}))},t}()
|
|
47
47
|
function j(t){var e=t.transaction,n=t.entry,i=t.event,a=t.timeOrigin,r=t.eventEnd,s=t.description,o=r?n[r]:n[i+"End"],c=n[i+"Start"]
|
|
48
48
|
c&&o&&E(e,{op:"browser",description:null!=s?s:i,startTimestamp:a+Object(d.e)(c),endTimestamp:a+Object(d.e)(o)})}function E(t,e){var n=e.startTimestamp,i=Object(a.d)(e,["startTimestamp"])
|
|
49
|
-
return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild(Object(a.a)({startTimestamp:n},i))}function x(t){return"number"==typeof t&&isFinite(t)}var I=n(9),C=n(
|
|
49
|
+
return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild(Object(a.a)({startTimestamp:n},i))}function x(t){return"number"==typeof t&&isFinite(t)}var I=n(9),C=n(55),k=n(4),w={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]}
|
|
50
50
|
function R(t){var e=Object(a.a)(Object(a.a)({},w),t),n=e.traceFetch,i=e.traceXHR,r=e.tracingOrigins,s=e.shouldCreateSpanForRequest,o={},c=function(t){if(o[t])return o[t]
|
|
51
51
|
var e=r
|
|
52
52
|
return o[t]=e.some((function(e){return Object(I.a)(t,e)}))&&!Object(I.a)(t,"sentry_key"),o[t]},p=c
|
|
@@ -64,7 +64,7 @@ else{var o=Object(d.c)()
|
|
|
64
64
|
if(o){var c=o.startChild({data:Object(a.a)(Object(a.a)({},s.data),{type:"xhr",method:s.method,url:s.url}),description:s.method+" "+s.url,op:"http.client"})
|
|
65
65
|
if(t.xhr.__sentry_xhr_span_id__=c.spanId,n[t.xhr.__sentry_xhr_span_id__]=c,t.xhr.setRequestHeader)try{t.xhr.setRequestHeader("sentry-trace",c.toTraceparent())}catch(t){}}}}}(t,p,l)},type:"xhr"})}var A=Object(s.f)(),M=Object(a.a)({idleTimeout:c.a,markBackgroundTransactions:!0,maxTransactionDuration:600,routingInstrumentation:function(t,e,n){if(void 0===e&&(e=!0),void 0===n&&(n=!0),A&&A.location){var i,a=A.location.href
|
|
66
66
|
e&&(i=t({name:A.location.pathname,op:"pageload"})),n&&Object(C.a)({callback:function(e){var n=e.to,s=e.from
|
|
67
|
-
void 0===s&&a&&-1!==a.indexOf(n)?a=void 0:s!==n&&(a=void 0,i&&(r.a.log("[Tracing] Finishing current transaction with op: "+i.op),i.finish()),i=t({name:A.location.pathname,op:"navigation"}))},type:"history"})}else r.a.warn("Could not initialize routing instrumentation due to invalid location")},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0},w),
|
|
67
|
+
void 0===s&&a&&-1!==a.indexOf(n)?a=void 0:s!==n&&(a=void 0,i&&(r.a.log("[Tracing] Finishing current transaction with op: "+i.op),i.finish()),i=t({name:A.location.pathname,op:"navigation"}))},type:"history"})}else r.a.warn("Could not initialize routing instrumentation due to invalid location")},startTransactionOnLocationChange:!0,startTransactionOnPageLoad:!0},w),N=function(){function t(e){this.name=t.id,this._metrics=new S,this._emitOptionsWarning=!1
|
|
68
68
|
var n=w.tracingOrigins
|
|
69
69
|
e&&e.tracingOrigins&&Array.isArray(e.tracingOrigins)&&0!==e.tracingOrigins.length?n=e.tracingOrigins:this._emitOptionsWarning=!0,this.options=Object(a.a)(Object(a.a)(Object(a.a)({},M),e),{tracingOrigins:n})}return t.prototype.setupOnce=function(t,e){var n=this
|
|
70
70
|
this._getCurrentHub=e,this._emitOptionsWarning&&(r.a.warn("[Tracing] You need to define `tracingOrigins` in the options. Set an array of urls or patterns to trace."),r.a.warn("[Tracing] We added a reasonable default for you: "+w.tracingOrigins))
|
|
@@ -76,9 +76,9 @@ if(e)return Object(d.b)(e)}():void 0,m=Object(a.a)(Object(a.a)(Object(a.a)({},t)
|
|
|
76
76
|
!1===f.sampled&&r.a.log("[Tracing] Will not send "+f.op+" transaction because of beforeNavigate."),r.a.log("[Tracing] Starting "+f.op+" transaction on scope")
|
|
77
77
|
var v=this._getCurrentHub(),g=Object(s.f)().location,_=Object(o.b)(v,f,c,!0,{location:g})
|
|
78
78
|
return _.registerBeforeFinishCallback((function(t,n){e._metrics.addPerformanceEntries(t),function(t,e,n){var i=n-e.startTimestamp
|
|
79
|
-
n&&(i>t||i<0)&&(e.setStatus(u.a.DeadlineExceeded),e.setTag("maxTransactionDurationExceeded","true"))}(Object(d.f)(p),t,n)})),_}r.a.warn("[Tracing] Did not create "+t.op+" transaction because _getCurrentHub is invalid.")},t.id="BrowserTracing",t}(),
|
|
79
|
+
n&&(i>t||i<0)&&(e.setStatus(u.a.DeadlineExceeded),e.setTag("maxTransactionDurationExceeded","true"))}(Object(d.f)(p),t,n)})),_}r.a.warn("[Tracing] Did not create "+t.op+" transaction because _getCurrentHub is invalid.")},t.id="BrowserTracing",t}(),D=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._router=e.router||e.app,this._methods=(Array.isArray(e.methods)?e.methods:[]).concat("use")}return t.prototype.setupOnce=function(){this._router?function(t,e){void 0===e&&(e=[]),e.forEach((function(e){return function(t,e){var n=t[e]
|
|
80
80
|
return t[e]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i]
|
|
81
|
-
return n.call.apply(n,Object(a.e)([this],
|
|
81
|
+
return n.call.apply(n,Object(a.e)([this],P(t,e)))},t}(t,e)}))}(this._router,this._methods):r.a.error("ExpressIntegration is missing an Express instance")},t.id="Express",t}()
|
|
82
82
|
function q(t,e){var n=t.length
|
|
83
83
|
switch(n){case 2:return function(n,i){var a=i.__sentry_transaction
|
|
84
84
|
if(a){var r=a.startChild({description:t.name,op:"middleware."+e})
|
|
@@ -89,22 +89,24 @@ null===(t=o)||void 0===t||t.finish(),r.call.apply(r,Object(a.e)([this],e))}))}
|
|
|
89
89
|
case 4:return function(n,i,r,s){var o,c=null===(o=r.__sentry_transaction)||void 0===o?void 0:o.startChild({description:t.name,op:"middleware."+e})
|
|
90
90
|
t.call(this,n,i,r,(function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n]
|
|
91
91
|
null===(t=c)||void 0===t||t.finish(),s.call.apply(s,Object(a.e)([this],e))}))}
|
|
92
|
-
default:throw new Error("Express middleware takes 2-4 arguments. Got: "+n)}}function
|
|
93
|
-
|
|
92
|
+
default:throw new Error("Express middleware takes 2-4 arguments. Got: "+n)}}function P(t,e){return t.map((function(t){return"function"==typeof t?q(t,e):Array.isArray(t)?t.map((function(t){return"function"==typeof t?q(t,e):t})):t}))}var F=n(6),H=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._usePgNative=!!e.usePgNative}return t.prototype.setupOnce=function(t,e){var n,i=Object(l.c)("pg")
|
|
93
|
+
if(i)if(!this._usePgNative||(null===(n=i.native)||void 0===n?void 0:n.Client)){var a=(this._usePgNative?i.native:i).Client
|
|
94
|
+
Object(F.c)(a.prototype,"query",(function(t){return function(n,i,a){var r,s,o,c=null===(s=null===(r=e().getScope())||void 0===r?void 0:r.getSpan())||void 0===s?void 0:s.startChild({description:"string"==typeof n?n:n.text,op:"db"})
|
|
94
95
|
if("function"==typeof a)return t.call(this,n,i,(function(t,e){var n
|
|
95
96
|
null===(n=c)||void 0===n||n.finish(),a(t,e)}))
|
|
96
97
|
if("function"==typeof i)return t.call(this,n,(function(t,e){var n
|
|
97
98
|
null===(n=c)||void 0===n||n.finish(),i(t,e)}))
|
|
98
99
|
var u=void 0!==i?t.call(this,n,i):t.call(this,n)
|
|
99
100
|
return Object(k.m)(u)?u.then((function(t){var e
|
|
100
|
-
return null===(e=c)||void 0===e||e.finish(),t})):(null===(o=c)||void 0===o||o.finish(),u)}}))
|
|
101
|
-
|
|
101
|
+
return null===(e=c)||void 0===e||e.finish(),t})):(null===(o=c)||void 0===o||o.finish(),u)}}))}else r.a.error("Postgres Integration was unable to access 'pg-native' bindings.")
|
|
102
|
+
else r.a.error("Postgres Integration was unable to require `pg` package.")},t.id="Postgres",t}(),L=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(t,e){var n=Object(l.c)("mysql/lib/Connection.js")
|
|
103
|
+
n?Object(F.c)(n,"createQuery",(function(t){return function(n,i,a){var r,s,o=null===(s=null===(r=e().getScope())||void 0===r?void 0:r.getSpan())||void 0===s?void 0:s.startChild({description:"string"==typeof n?n:n.sql,op:"db"})
|
|
102
104
|
return"function"==typeof a?t.call(this,n,i,(function(t,e,n){var i
|
|
103
105
|
null===(i=o)||void 0===i||i.finish(),a(t,e,n)})):"function"==typeof i?t.call(this,n,(function(t,e,n){var a
|
|
104
106
|
null===(a=o)||void 0===a||a.finish(),i(t,e,n)})):t.call(this,n,i,a)}})):r.a.error("Mysql Integration was unable to require `mysql` package.")},t.id="Mysql",t}(),z=["aggregate","bulkWrite","countDocuments","createIndex","createIndexes","deleteMany","deleteOne","distinct","drop","dropIndex","dropIndexes","estimatedDocumentCount","find","findOne","findOneAndDelete","findOneAndReplace","findOneAndUpdate","indexes","indexExists","indexInformation","initializeOrderedBulkOp","insertMany","insertOne","isCapped","mapReduce","options","parallelCollectionScan","rename","replaceOne","stats","updateMany","updateOne"],B={bulkWrite:["operations"],countDocuments:["query"],createIndex:["fieldOrSpec"],createIndexes:["indexSpecs"],deleteMany:["filter"],deleteOne:["filter"],distinct:["key","query"],dropIndex:["indexName"],find:["query"],findOne:["query"],findOneAndDelete:["filter"],findOneAndReplace:["filter","replacement"],findOneAndUpdate:["filter","update"],indexExists:["indexes"],insertMany:["docs"],insertOne:["doc"],mapReduce:["map","reduce"],rename:["newName"],replaceOne:["filter","doc"],updateMany:["filter","update"],updateOne:["filter","update"]},U=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._operations=Array.isArray(e.operations)?e.operations:z,this._describeOperations=!("describeOperations"in e)||e.describeOperations,this._useMongoose=!!e.useMongoose}return t.prototype.setupOnce=function(t,e){var n=this._useMongoose?"mongoose":"mongodb",i=Object(l.c)(n)
|
|
105
107
|
i?this._instrumentOperations(i.Collection,this._operations,e):r.a.error("Mongo Integration was unable to require `"+n+"` package.")},t.prototype._instrumentOperations=function(t,e,n){var i=this
|
|
106
108
|
e.forEach((function(e){return i._patchOperation(t,e,n)}))},t.prototype._patchOperation=function(t,e,n){if(e in t.prototype){var i=this._getSpanContextFromOperationArguments.bind(this)
|
|
107
|
-
Object(
|
|
109
|
+
Object(F.c)(t.prototype,e,(function(t){return function(){for(var r,s,o,c,u=[],d=0;d<arguments.length;d++)u[d]=arguments[d]
|
|
108
110
|
var p=u[u.length-1],l=n().getScope(),m=null===(r=l)||void 0===r?void 0:r.getSpan()
|
|
109
111
|
if("function"!=typeof p||"mapReduce"===e&&2===u.length){var h=null===(s=m)||void 0===s?void 0:s.startChild(i(this,e,u)),f=t.call.apply(t,Object(a.e)([this],u))
|
|
110
112
|
return Object(k.m)(f)?f.then((function(t){var e
|
|
@@ -113,15 +115,15 @@ return t.call.apply(t,Object(a.e)([this],u.slice(0,-1),[function(t,e){var n
|
|
|
113
115
|
null===(n=v)||void 0===n||n.finish(),p(t,e)}]))}}))}},t.prototype._getSpanContextFromOperationArguments=function(t,e,n){var i={collectionName:t.collectionName,dbName:t.dbName,namespace:t.namespace},r={op:"db",description:e,data:i},s=B[e],o=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations
|
|
114
116
|
if(!s||!o)return r
|
|
115
117
|
try{if("mapReduce"===e){var c=Object(a.c)(n,2),u=c[0],d=c[1]
|
|
116
|
-
i[s[0]]="string"==typeof u?u:u.name||"<anonymous>",i[s[1]]="string"==typeof d?d:d.name||"<anonymous>"}else for(var p=0;p<s.length;p++)i[s[p]]=JSON.stringify(n[p])}catch(t){}return r},t.id="Mongo",t}(),Y=n(
|
|
117
|
-
Object(o.a)()},
|
|
118
|
+
i[s[0]]="string"==typeof u?u:u.name||"<anonymous>",i[s[1]]="string"==typeof d?d:d.name||"<anonymous>"}else for(var p=0;p<s.length;p++)i[s[p]]=JSON.stringify(n[p])}catch(t){}return r},t.id="Mongo",t}(),Y=n(445),W=n(446),J=Object(a.a)(Object(a.a)({},i),{BrowserTracing:N})
|
|
119
|
+
Object(o.a)()},441:function(t,e,n){"use strict"
|
|
118
120
|
n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return r})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return o})),n.d(e,"e",(function(){return c})),n.d(e,"f",(function(){return u}))
|
|
119
|
-
var i=n(
|
|
121
|
+
var i=n(440),a=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$")
|
|
120
122
|
function r(t){var e
|
|
121
123
|
return void 0===t&&(t=null===(e=Object(i.b)().getClient())||void 0===e?void 0:e.getOptions()),!!t&&("tracesSampleRate"in t||"tracesSampler"in t)}function s(t){var e=t.match(a)
|
|
122
124
|
if(e){var n=void 0
|
|
123
125
|
return"1"===e[3]?n=!0:"0"===e[3]&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}}function o(t){var e,n
|
|
124
|
-
return void 0===t&&(t=Object(i.b)()),null===(n=null===(e=t)||void 0===e?void 0:e.getScope())||void 0===n?void 0:n.getTransaction()}function c(t){return t/1e3}function u(t){return 1e3*t}},
|
|
126
|
+
return void 0===t&&(t=Object(i.b)()),null===(n=null===(e=t)||void 0===e?void 0:e.getScope())||void 0===n?void 0:n.getTransaction()}function c(t){return t/1e3}function u(t){return 1e3*t}},442:function(t,e,n){"use strict"
|
|
125
127
|
var i
|
|
126
128
|
n.d(e,"a",(function(){return i})),function(t){t.Ok="ok",t.DeadlineExceeded="deadline_exceeded",t.Unauthenticated="unauthenticated",t.PermissionDenied="permission_denied",t.NotFound="not_found",t.ResourceExhausted="resource_exhausted",t.InvalidArgument="invalid_argument",t.Unimplemented="unimplemented",t.Unavailable="unavailable",t.InternalError="internal_error",t.UnknownError="unknown_error",t.Cancelled="cancelled",t.AlreadyExists="already_exists",t.FailedPrecondition="failed_precondition",t.Aborted="aborted",t.OutOfRange="out_of_range",t.DataLoss="data_loss"}(i||(i={})),function(t){t.fromHttpCode=function(e){if(e<400)return t.Ok
|
|
127
129
|
if(e>=400&&e<500)switch(e){case 401:return t.Unauthenticated
|
|
@@ -133,8 +135,8 @@ case 429:return t.ResourceExhausted
|
|
|
133
135
|
default:return t.InvalidArgument}if(e>=500&&e<600)switch(e){case 501:return t.Unimplemented
|
|
134
136
|
case 503:return t.Unavailable
|
|
135
137
|
case 504:return t.DeadlineExceeded
|
|
136
|
-
default:return t.InternalError}return t.UnknownError}}(i||(i={}))},
|
|
137
|
-
var i=n(0),a=n(
|
|
138
|
+
default:return t.InternalError}return t.UnknownError}}(i||(i={}))},443:function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return v}))
|
|
139
|
+
var i=n(0),a=n(440),r=n(56),s=n(11),o=n(10),c=n(448),u=n(444),d=n(446),p=n(441)
|
|
138
140
|
function l(){var t=this.getScope()
|
|
139
141
|
if(t){var e=t.getSpan()
|
|
140
142
|
if(e)return{"sentry-trace":e.toTraceparent()}}return{}}function m(t,e,n){return Object(p.d)()?void 0!==t.sampled?(t.setMetadata({transactionSampling:{method:r.a.Explicit}}),t):("function"==typeof e.tracesSampler?(i=e.tracesSampler(n),t.setMetadata({transactionSampling:{method:r.a.Sampler,rate:Number(i)}})):void 0!==n.parentSampled?(i=n.parentSampled,t.setMetadata({transactionSampling:{method:r.a.Inheritance}})):(i=e.tracesSampleRate,t.setMetadata({transactionSampling:{method:r.a.Rate,rate:Number(i)}})),function(t){return isNaN(t)||"number"!=typeof t&&"boolean"!=typeof t?(s.a.warn("[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got "+JSON.stringify(t)+" of type "+JSON.stringify(typeof t)+"."),!1):!(t<0||t>1)||(s.a.warn("[Tracing] Given sample rate is invalid. Sample rate must be between 0 and 1. Got "+t+"."),!1)}(i)?i?(t.sampled=Math.random()<i,t.sampled?(s.a.log("[Tracing] starting "+t.op+" transaction - "+t.name),t):(s.a.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(i)+")"),t)):(s.a.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),t.sampled=!1,t):(s.a.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)):(t.sampled=!1,t)
|
|
@@ -142,9 +144,9 @@ var i}function h(t,e){var n,a,r=(null===(n=this.getClient())||void 0===n?void 0:
|
|
|
142
144
|
return(s=m(s,r,Object(i.a)({parentSampled:t.parentSampled,transactionContext:t},e))).sampled&&s.initSpanRecorder(null===(a=r._experiments)||void 0===a?void 0:a.maxSpans),s}function f(t,e,n,a,r){var s,o,c=(null===(s=t.getClient())||void 0===s?void 0:s.getOptions())||{},d=new u.b(e,t,n,a)
|
|
143
145
|
return(d=m(d,c,Object(i.a)({parentSampled:e.parentSampled,transactionContext:e},r))).sampled&&d.initSpanRecorder(null===(o=c._experiments)||void 0===o?void 0:o.maxSpans),d}function v(){var e;(e=Object(a.d)()).__SENTRY__&&(e.__SENTRY__.extensions=e.__SENTRY__.extensions||{},e.__SENTRY__.extensions.startTransaction||(e.__SENTRY__.extensions.startTransaction=h),e.__SENTRY__.extensions.traceHeaders||(e.__SENTRY__.extensions.traceHeaders=l)),Object(o.b)()&&function(){var e=Object(a.d)()
|
|
144
146
|
if(e.__SENTRY__){var n={mongodb:function(){return new(Object(o.a)(t,"./integrations/mongo").Mongo)},mongoose:function(){return new(Object(o.a)(t,"./integrations/mongo").Mongo)({mongoose:!0})},mysql:function(){return new(Object(o.a)(t,"./integrations/mysql").Mysql)},pg:function(){return new(Object(o.a)(t,"./integrations/postgres").Postgres)}},r=Object.keys(n).filter((function(t){return!!Object(o.c)(t)})).map((function(t){try{return n[t]()}catch(t){return}})).filter((function(t){return t}))
|
|
145
|
-
r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(
|
|
147
|
+
r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(31)(t))},444:function(t,e,n){"use strict"
|
|
146
148
|
n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return p}))
|
|
147
|
-
var i=n(0),a=n(
|
|
149
|
+
var i=n(0),a=n(50),r=n(11),s=n(445),o=n(442),c=n(446),u=1e3,d=function(t){function e(e,n,i,a){void 0===i&&(i="")
|
|
148
150
|
var r=t.call(this,a)||this
|
|
149
151
|
return r._pushActivity=e,r._popActivity=n,r.transactionSpanId=i,r}return Object(i.b)(e,t),e.prototype.add=function(e){var n=this
|
|
150
152
|
e.spanId!==this.transactionSpanId&&(e.finish=function(t){e.endTimestamp="number"==typeof t?t:Object(a.e)(),n._popActivity(e.spanId)},void 0===e.endTimestamp&&this._pushActivity(e.spanId)),t.prototype.add.call(this,e)},e}(s.b),p=function(t){function e(e,n,i,a){void 0===i&&(i=u),void 0===a&&(a=!1)
|
|
@@ -162,9 +164,9 @@ setTimeout((function(){e._finished||e.finish(i)}),n)}},e.prototype._beat=functio
|
|
|
162
164
|
e===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=e,this._heartbeatCounter>=3?(r.a.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(o.a.DeadlineExceeded),this.setTag("heartbeat","failed"),this.finish()):this._pingHeartbeat()}},e.prototype._pingHeartbeat=function(){var t=this
|
|
163
165
|
r.a.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),this._heartbeatTimer=setTimeout((function(){t._beat()}),5e3)},e}(c.a)
|
|
164
166
|
function l(t){if(t){var e=t.getScope()
|
|
165
|
-
e&&e.getTransaction()&&e.setSpan(void 0)}}},
|
|
167
|
+
e&&e.getTransaction()&&e.setSpan(void 0)}}},445:function(t,e,n){"use strict"
|
|
166
168
|
n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u}))
|
|
167
|
-
var i=n(0),a=n(5),r=n(
|
|
169
|
+
var i=n(0),a=n(5),r=n(50),s=n(6),o=n(442),c=function(){function t(t){void 0===t&&(t=1e3),this.spans=[],this._maxlen=t}return t.prototype.add=function(t){this.spans.length>this._maxlen?t.spanRecorder=void 0:this.spans.push(t)},t}(),u=function(){function t(t){if(this.traceId=Object(a.l)(),this.spanId=Object(a.l)().substring(16),this.startTimestamp=Object(r.e)(),this.tags={},this.data={},!t)return this
|
|
168
170
|
t.traceId&&(this.traceId=t.traceId),t.spanId&&(this.spanId=t.spanId),t.parentSpanId&&(this.parentSpanId=t.parentSpanId),"sampled"in t&&(this.sampled=t.sampled),t.op&&(this.op=t.op),t.description&&(this.description=t.description),t.data&&(this.data=t.data),t.tags&&(this.tags=t.tags),t.status&&(this.status=t.status),t.startTimestamp&&(this.startTimestamp=t.startTimestamp),t.endTimestamp&&(this.endTimestamp=t.endTimestamp)}return t.prototype.child=function(t){return this.startChild(t)},t.prototype.startChild=function(e){var n=new t(Object(i.a)(Object(i.a)({},e),{parentSpanId:this.spanId,sampled:this.sampled,traceId:this.traceId}))
|
|
169
171
|
return n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,n},t.prototype.setTag=function(t,e){var n
|
|
170
172
|
return this.tags=Object(i.a)(Object(i.a)({},this.tags),((n={})[t]=e,n)),this},t.prototype.setData=function(t,e){var n
|
|
@@ -172,19 +174,19 @@ return this.data=Object(i.a)(Object(i.a)({},this.data),((n={})[t]=e,n)),this},t.
|
|
|
172
174
|
var e=o.a.fromHttpCode(t)
|
|
173
175
|
return e!==o.a.UnknownError&&this.setStatus(e),this},t.prototype.isSuccess=function(){return this.status===o.a.Ok},t.prototype.finish=function(t){this.endTimestamp="number"==typeof t?t:Object(r.e)()},t.prototype.toTraceparent=function(){var t=""
|
|
174
176
|
return void 0!==this.sampled&&(t=this.sampled?"-1":"-0"),this.traceId+"-"+this.spanId+t},t.prototype.toContext=function(){return Object(s.a)({data:this.data,description:this.description,endTimestamp:this.endTimestamp,op:this.op,parentSpanId:this.parentSpanId,sampled:this.sampled,spanId:this.spanId,startTimestamp:this.startTimestamp,status:this.status,tags:this.tags,traceId:this.traceId})},t.prototype.updateWithContext=function(t){var e,n,i,a,r
|
|
175
|
-
return this.data=null!=(e=t.data)?e:{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=null!=(n=t.spanId)?n:this.spanId,this.startTimestamp=null!=(i=t.startTimestamp)?i:this.startTimestamp,this.status=t.status,this.tags=null!=(a=t.tags)?a:{},this.traceId=null!=(r=t.traceId)?r:this.traceId,this},t.prototype.getTraceContext=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},t.prototype.toJSON=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},t}()},
|
|
177
|
+
return this.data=null!=(e=t.data)?e:{},this.description=t.description,this.endTimestamp=t.endTimestamp,this.op=t.op,this.parentSpanId=t.parentSpanId,this.sampled=t.sampled,this.spanId=null!=(n=t.spanId)?n:this.spanId,this.startTimestamp=null!=(i=t.startTimestamp)?i:this.startTimestamp,this.status=t.status,this.tags=null!=(a=t.tags)?a:{},this.traceId=null!=(r=t.traceId)?r:this.traceId,this},t.prototype.getTraceContext=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,trace_id:this.traceId})},t.prototype.toJSON=function(){return Object(s.a)({data:Object.keys(this.data).length>0?this.data:void 0,description:this.description,op:this.op,parent_span_id:this.parentSpanId,span_id:this.spanId,start_timestamp:this.startTimestamp,status:this.status,tags:Object.keys(this.tags).length>0?this.tags:void 0,timestamp:this.endTimestamp,trace_id:this.traceId})},t}()},446:function(t,e,n){"use strict"
|
|
176
178
|
n.d(e,"a",(function(){return u}))
|
|
177
|
-
var i=n(0),a=n(
|
|
179
|
+
var i=n(0),a=n(440),r=n(4),s=n(11),o=n(6),c=n(445),u=function(t){function e(e,n){var i=t.call(this,e)||this
|
|
178
180
|
return i._measurements={},i._hub=Object(a.b)(),Object(r.g)(n,a.a)&&(i._hub=n),i.name=e.name||"",i.metadata=e.metadata||{},i._trimEnd=e.trimEnd,i.transaction=i,i}return Object(i.b)(e,t),e.prototype.setName=function(t){this.name=t},e.prototype.initSpanRecorder=function(t){void 0===t&&(t=1e3),this.spanRecorder||(this.spanRecorder=new c.b(t)),this.spanRecorder.add(this)},e.prototype.setMeasurements=function(t){this._measurements=Object(i.a)({},t)},e.prototype.setMetadata=function(t){this.metadata=Object(i.a)(Object(i.a)({},this.metadata),t)},e.prototype.finish=function(e){var n=this
|
|
179
181
|
if(void 0===this.endTimestamp){if(this.name||(s.a.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),t.prototype.finish.call(this,e),!0===this.sampled){var i=this.spanRecorder?this.spanRecorder.spans.filter((function(t){return t!==n&&t.endTimestamp})):[]
|
|
180
182
|
this._trimEnd&&i.length>0&&(this.endTimestamp=i.reduce((function(t,e){return t.endTimestamp&&e.endTimestamp?t.endTimestamp>e.endTimestamp?t:e:t})).endTimestamp)
|
|
181
183
|
var a={contexts:{trace:this.getTraceContext()},spans:i,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata}
|
|
182
184
|
return Object.keys(this._measurements).length>0&&(s.a.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),a.measurements=this._measurements),s.a.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(a)}s.a.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled.")}},e.prototype.toContext=function(){var e=t.prototype.toContext.call(this)
|
|
183
185
|
return Object(o.a)(Object(i.a)(Object(i.a)({},e),{name:this.name,trimEnd:this._trimEnd}))},e.prototype.updateWithContext=function(e){var n
|
|
184
|
-
return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(c.a)},
|
|
186
|
+
return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(c.a)},448:function(t,e,n){"use strict"
|
|
185
187
|
n.d(e,"a",(function(){return o}))
|
|
186
|
-
var i=n(
|
|
188
|
+
var i=n(55),a=n(11),r=n(442),s=n(441)
|
|
187
189
|
function o(){Object(i.a)({callback:c,type:"error"}),Object(i.a)({callback:c,type:"unhandledrejection"})}function c(){var t=Object(s.c)()
|
|
188
190
|
t&&(a.a.log("[Tracing] Transaction: "+r.a.InternalError+" -> Global error occured"),t.setStatus(r.a.InternalError))}}}])
|
|
189
191
|
|
|
190
|
-
//# sourceMappingURL=chunk.3.
|
|
192
|
+
//# sourceMappingURL=chunk.3.4b1d9e20e57164ac9c29.map
|