ghost 5.5.0 → 5.6.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/PRIVACY.md +3 -2
- package/components/tryghost-adapter-manager-0.0.0.tgz +0 -0
- package/components/tryghost-api-version-compatibility-service-0.0.0.tgz +0 -0
- package/components/tryghost-bootstrap-socket-0.0.0.tgz +0 -0
- package/components/tryghost-constants-0.0.0.tgz +0 -0
- package/components/tryghost-email-analytics-provider-mailgun-0.0.0.tgz +0 -0
- package/components/tryghost-email-content-generator-0.0.0.tgz +0 -0
- package/components/tryghost-extract-api-key-0.0.0.tgz +0 -0
- package/components/tryghost-job-manager-0.0.0.tgz +0 -0
- package/components/tryghost-members-api-0.0.0.tgz +0 -0
- package/components/tryghost-members-events-service-0.0.0.tgz +0 -0
- package/components/tryghost-members-importer-0.0.0.tgz +0 -0
- package/components/tryghost-members-stripe-service-0.0.0.tgz +0 -0
- package/components/tryghost-minifier-0.0.0.tgz +0 -0
- package/components/tryghost-mw-api-version-mismatch-0.0.0.tgz +0 -0
- package/components/tryghost-mw-error-handler-0.0.0.tgz +0 -0
- package/components/tryghost-mw-session-from-token-0.0.0.tgz +0 -0
- package/components/tryghost-mw-update-user-last-seen-0.0.0.tgz +0 -0
- package/components/tryghost-mw-vhost-0.0.0.tgz +0 -0
- package/components/tryghost-package-json-0.0.0.tgz +0 -0
- package/components/tryghost-security-0.0.0.tgz +0 -0
- package/components/tryghost-session-service-0.0.0.tgz +0 -0
- package/components/tryghost-settings-path-manager-0.0.0.tgz +0 -0
- package/components/tryghost-update-check-service-0.0.0.tgz +0 -0
- package/components/tryghost-verification-trigger-0.0.0.tgz +0 -0
- package/components/tryghost-version-notifications-data-service-0.0.0.tgz +0 -0
- package/core/boot.js +1 -1
- package/core/built/assets/{chunk.3.550552fbc71864fb9738.js → chunk.3.33097bb5eb150719bdd2.js} +20 -20
- package/core/built/assets/{ghost-dark-5c2a961b35311d7298136e02289d98b2.css → ghost-dark-1bdd57aba1fa4a23388121740454dab2.css} +1 -1
- package/core/built/assets/{ghost.min-c75f224decd20f9538179d7564cd2ab4.js → ghost.min-31bd482d1bcfe706448bc6f401481a28.js} +111 -115
- package/core/built/assets/{ghost.min-a89d10b3b58c1a5ebaca68cef93a404c.css → ghost.min-b0576e0e36343533e70992f3e5bb02bb.css} +1 -1
- package/core/built/assets/{vendor.min-cf3af99dca0c71937669305afb3686a1.js → vendor.min-3dd40d3052381526f38fd290d13baa47.js} +3002 -4456
- package/core/frontend/helpers/comments.js +17 -4
- package/core/server/api/endpoints/{comments-comments.js → comments-members.js} +8 -45
- package/core/server/api/endpoints/index.js +2 -6
- package/core/server/api/endpoints/utils/serializers/output/mappers/posts.js +11 -0
- package/core/server/api/endpoints/utils/serializers/output/utils/clean.js +4 -0
- package/core/server/data/migrations/versions/5.3/2022-07-06-09-17-add-ghost-explore-integration.js +0 -1
- package/core/server/data/migrations/versions/5.3/2022-07-06-09-26-add-ghost-explore-integration-api-key.js +0 -1
- package/core/server/data/migrations/versions/5.6/2022-07-27-13-40-change-explore-type.js +24 -0
- package/core/server/data/schema/fixtures/fixtures.json +1 -1
- package/core/server/services/bulk-email/bulk-email-processor.js +6 -0
- package/core/server/services/comments/controller.js +82 -0
- package/core/server/services/comments/index.js +6 -1
- package/core/server/services/comments/service.js +101 -11
- package/core/server/services/mega/email-preview.js +5 -1
- package/core/server/services/mega/mega.js +2 -4
- package/core/server/services/mega/post-email-serializer.js +97 -2
- package/core/server/services/mega/segment-parser.js +10 -1
- package/core/server/services/members/service.js +9 -4
- 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/comments/routes.js +9 -9
- package/core/shared/config/defaults.json +1 -1
- package/core/shared/labs.js +3 -1
- package/package.json +43 -24
- package/yarn.lock +215 -372
package/PRIVACY.md
CHANGED
|
@@ -22,8 +22,9 @@ All of the information and code related to this service is available in the [upd
|
|
|
22
22
|
|
|
23
23
|
Ghost uses a number of third party services for specific functionality within Ghost.
|
|
24
24
|
|
|
25
|
-
###
|
|
26
|
-
|
|
25
|
+
### JSDELIVR
|
|
26
|
+
|
|
27
|
+
To easily load functionality for membership features & search, Ghost leverages [JSDELIVR](https://www.jsdelivr.com/) to provide a CDN for drop-in scripts.
|
|
27
28
|
|
|
28
29
|
### Gravatar
|
|
29
30
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/core/boot.js
CHANGED
|
@@ -208,7 +208,7 @@ async function initExpressApps({frontend, backend, config}) {
|
|
|
208
208
|
debug('Begin: initExpressApps');
|
|
209
209
|
|
|
210
210
|
const parentApp = require('./server/web/parent/app')();
|
|
211
|
-
const vhost = require('@tryghost/vhost
|
|
211
|
+
const vhost = require('@tryghost/mw-vhost');
|
|
212
212
|
|
|
213
213
|
// Mount the express apps on the parentApp
|
|
214
214
|
if (backend) {
|
package/core/built/assets/{chunk.3.550552fbc71864fb9738.js → chunk.3.33097bb5eb150719bdd2.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
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],{631:function(t,e,n){"use strict"
|
|
2
2
|
n.r(e),n.d(e,"Integrations",(function(){return i})),n.d(e,"BrowserTracing",(function(){return Y})),n.d(e,"Span",(function(){return W.a})),n.d(e,"Transaction",(function(){return J.a})),n.d(e,"registerRequestInstrumentation",(function(){return B})),n.d(e,"defaultRequestInstrumentationOptions",(function(){return L})),n.d(e,"SpanStatus",(function(){return y.a})),n.d(e,"IdleTransaction",(function(){return _.b})),n.d(e,"startIdleTransaction",(function(){return a.b})),n.d(e,"addExtensionMethods",(function(){return a.a})),n.d(e,"extractTraceparentData",(function(){return O.b})),n.d(e,"getActiveTransaction",(function(){return O.c})),n.d(e,"hasTracingEnabled",(function(){return O.d})),n.d(e,"stripUrlQueryAndFragment",(function(){return G.i})),n.d(e,"TRACEPARENT_REGEXP",(function(){return O.a}))
|
|
3
3
|
var i={}
|
|
4
4
|
n.r(i),n.d(i,"Express",(function(){return o})),n.d(i,"Postgres",(function(){return m})),n.d(i,"Mysql",(function(){return h})),n.d(i,"Mongo",(function(){return g})),n.d(i,"BrowserTracing",(function(){return Y}))
|
|
5
|
-
var a=n(
|
|
5
|
+
var a=n(635),r=n(0),s=n(19),o=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]
|
|
6
6
|
return t[e]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i]
|
|
7
7
|
return n.call.apply(n,Object(r.e)([this],u(t,e)))},t}(t,e)}))}(this._router,this._methods):s.b.error("ExpressIntegration is missing an Express instance")},t.id="Express",t}()
|
|
8
8
|
function c(t,e){var n=t.length
|
|
@@ -41,7 +41,7 @@ return t.call.apply(t,Object(r.e)([this],u.slice(0,-1),[function(t,e){var n
|
|
|
41
41
|
null===(n=g)||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},a={op:"db",description:e,data:i},s=v[e],o=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations
|
|
42
42
|
if(!s||!o)return a
|
|
43
43
|
try{if("mapReduce"===e){var c=Object(r.c)(n,2),u=c[0],d=c[1]
|
|
44
|
-
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 a},t.id="Mongo",t}(),b=n(5),_=n(
|
|
44
|
+
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 a},t.id="Mongo",t}(),b=n(5),_=n(636),y=n(634),O=n(633),T=n(640),j=Object(b.a)(),S=n(81),E=n(31),x=function(t,e,n){var i
|
|
45
45
|
return function(a){e.value>=0&&(a||n)&&(e.delta=e.value-(i||0),(e.delta||void 0===i)&&(i=e.value,t(e)))}},I=function(t,e){return{name:t,value:null!=e?e:-1,delta:0,entries:[],id:"v2-"+Date.now()+"-"+(Math.floor(8999999999999*Math.random())+1e12)}},C=function(t,e){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){if("first-input"===t&&!("PerformanceEventTiming"in self))return
|
|
46
46
|
var n=new PerformanceObserver((function(t){return t.getEntries().map(e)}))
|
|
47
47
|
return n.observe({type:t,buffered:!0}),n}}catch(t){}},k=function(t,e){var n=function(i){"pagehide"!==i.type&&"hidden"!==Object(b.a)().document.visibilityState||(t(i),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))}
|
|
@@ -85,7 +85,7 @@ if(n){var i=Object(O.e)(S.b),a=Object(O.e)(n.startTime)
|
|
|
85
85
|
s.b.log("[Measurements] Adding FID"),t._measurements.fid={value:e.value},t._measurements["mark.fid"]={value:i+a}}}))},t}()
|
|
86
86
|
function D(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"]
|
|
87
87
|
c&&o&&q(e,{op:"browser",description:null!=s?s:i,startTimestamp:a+Object(O.e)(c),endTimestamp:a+Object(O.e)(o)})}function q(t,e){var n=e.startTimestamp,i=Object(r.d)(e,["startTimestamp"])
|
|
88
|
-
return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild(Object(r.a)({startTimestamp:n},i))}function P(t){return"number"==typeof t&&isFinite(t)}var F=n(13),H=n(
|
|
88
|
+
return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild(Object(r.a)({startTimestamp:n},i))}function P(t){return"number"==typeof t&&isFinite(t)}var F=n(13),H=n(90),L={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]}
|
|
89
89
|
function B(t){var e=Object(r.a)(Object(r.a)({},L),t),n=e.traceFetch,i=e.traceXHR,a=e.tracingOrigins,s=e.shouldCreateSpanForRequest,o={},c=function(t){if(o[t])return o[t]
|
|
90
90
|
var e=a
|
|
91
91
|
return o[t]=e.some((function(e){return Object(F.b)(t,e)}))&&!Object(F.b)(t,"sentry_key"),o[t]},u=c
|
|
@@ -117,15 +117,15 @@ if(e)return Object(O.b)(e)}():void 0,d=Object(r.a)(Object(r.a)(Object(r.a)({},t)
|
|
|
117
117
|
!1===l.sampled&&s.b.log("[Tracing] Will not send "+l.op+" transaction because of beforeNavigate."),s.b.log("[Tracing] Starting "+l.op+" transaction on scope")
|
|
118
118
|
var m=this._getCurrentHub(),h=Object(b.a)().location,f=Object(a.b)(m,l,o,!0,{location:h})
|
|
119
119
|
return f.registerBeforeFinishCallback((function(t,n){e._metrics.addPerformanceEntries(t),function(t,e,n){var i=n-e.startTimestamp
|
|
120
|
-
n&&(i>t||i<0)&&(e.setStatus(y.a.DeadlineExceeded),e.setTag("maxTransactionDurationExceeded","true"))}(Object(O.f)(c),t,n)})),f.setTag("idleTimeout",this._configuredIdleTimeout),f}s.b.warn("[Tracing] Did not create "+t.op+" transaction because _getCurrentHub is invalid.")},t.id="BrowserTracing",t}(),W=n(
|
|
121
|
-
Object(a.a)()},
|
|
120
|
+
n&&(i>t||i<0)&&(e.setStatus(y.a.DeadlineExceeded),e.setTag("maxTransactionDurationExceeded","true"))}(Object(O.f)(c),t,n)})),f.setTag("idleTimeout",this._configuredIdleTimeout),f}s.b.warn("[Tracing] Did not create "+t.op+" transaction because _getCurrentHub is invalid.")},t.id="BrowserTracing",t}(),W=n(637),J=n(638),G=n(83)
|
|
121
|
+
Object(a.a)()},633:function(t,e,n){"use strict"
|
|
122
122
|
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}))
|
|
123
|
-
var i=n(
|
|
123
|
+
var i=n(632),a=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$")
|
|
124
124
|
function r(t){var e
|
|
125
125
|
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)
|
|
126
126
|
if(e){var n=void 0
|
|
127
127
|
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
|
|
128
|
-
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}},
|
|
128
|
+
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}},634:function(t,e,n){"use strict"
|
|
129
129
|
var i
|
|
130
130
|
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&&e>=100)return t.Ok
|
|
131
131
|
if(e>=400&&e<500)switch(e){case 401:return t.Unauthenticated
|
|
@@ -137,8 +137,8 @@ case 429:return t.ResourceExhausted
|
|
|
137
137
|
default:return t.InvalidArgument}if(e>=500&&e<600)switch(e){case 501:return t.Unimplemented
|
|
138
138
|
case 503:return t.Unavailable
|
|
139
139
|
case 504:return t.DeadlineExceeded
|
|
140
|
-
default:return t.InternalError}return t.UnknownError}}(i||(i={}))},
|
|
141
|
-
var i=n(0),a=n(
|
|
140
|
+
default:return t.InternalError}return t.UnknownError}}(i||(i={}))},635:function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return v}))
|
|
141
|
+
var i=n(0),a=n(632),r=n(91),s=n(19),o=n(18),c=n(641),u=n(636),d=n(638),p=n(633)
|
|
142
142
|
function l(){var t=this.getScope()
|
|
143
143
|
if(t){var e=t.getSpan()
|
|
144
144
|
if(e)return{"sentry-trace":e.toTraceparent()}}return{}}function m(t,e,n){return Object(p.d)(e)?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.b.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.b.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.b.log("[Tracing] starting "+t.op+" transaction - "+t.name),t):(s.b.log("[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = "+Number(i)+")"),t)):(s.b.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.b.warn("[Tracing] Discarding transaction because of invalid sample rate."),t.sampled=!1,t)):(t.sampled=!1,t)
|
|
@@ -146,9 +146,9 @@ var i}function h(t,e){var n,a,r=(null===(n=this.getClient())||void 0===n?void 0:
|
|
|
146
146
|
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)
|
|
147
147
|
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)()
|
|
148
148
|
if(e.__SENTRY__){var n={mongodb:function(){return new(Object(o.a)(t,"./integrations/node/mongo").Mongo)},mongoose:function(){return new(Object(o.a)(t,"./integrations/node/mongo").Mongo)({mongoose:!0})},mysql:function(){return new(Object(o.a)(t,"./integrations/node/mysql").Mysql)},pg:function(){return new(Object(o.a)(t,"./integrations/node/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}))
|
|
149
|
-
r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(46)(t))},
|
|
149
|
+
r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(46)(t))},636:function(t,e,n){"use strict"
|
|
150
150
|
n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return l}))
|
|
151
|
-
var i=n(0),a=n(81),r=n(19),s=n(
|
|
151
|
+
var i=n(0),a=n(81),r=n(19),s=n(640),o=n(637),c=n(634),u=n(638),d=1e3,p=function(t){function e(e,n,i,a){void 0===i&&(i="")
|
|
152
152
|
var r=t.call(this,a)||this
|
|
153
153
|
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
|
|
154
154
|
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}(o.b),l=function(t){function e(e,n,i,a){void 0===i&&(i=d),void 0===a&&(a=!1)
|
|
@@ -166,9 +166,9 @@ setTimeout((function(){e._finished||(e.setTag(s.a,s.b[1]),e.finish(i))}),n)}},e.
|
|
|
166
166
|
t===this._prevHeartbeatString?this._heartbeatCounter+=1:this._heartbeatCounter=1,this._prevHeartbeatString=t,this._heartbeatCounter>=3?(r.b.log("[Tracing] Transaction finished because of no change for 3 heart beats"),this.setStatus(c.a.DeadlineExceeded),this.setTag(s.a,s.b[0]),this.finish()):this._pingHeartbeat()}},e.prototype._pingHeartbeat=function(){var t=this
|
|
167
167
|
r.b.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),setTimeout((function(){t._beat()}),5e3)},e}(u.a)
|
|
168
168
|
function m(t){if(t){var e=t.getScope()
|
|
169
|
-
e&&e.getTransaction()&&e.setSpan(void 0)}}},
|
|
169
|
+
e&&e.getTransaction()&&e.setSpan(void 0)}}},637:function(t,e,n){"use strict"
|
|
170
170
|
n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u}))
|
|
171
|
-
var i=n(0),a=n(83),r=n(81),s=n(7),o=n(
|
|
171
|
+
var i=n(0),a=n(83),r=n(81),s=n(7),o=n(634),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.j)(),this.spanId=Object(a.j)().substring(16),this.startTimestamp=Object(r.e)(),this.tags={},this.data={},!t)return this
|
|
172
172
|
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}))
|
|
173
173
|
return n.spanRecorder=this.spanRecorder,n.spanRecorder&&n.spanRecorder.add(n),n.transaction=this.transaction,n},t.prototype.setTag=function(t,e){var n
|
|
174
174
|
return this.tags=Object(i.a)(Object(i.a)({},this.tags),((n={})[t]=e,n)),this},t.prototype.setData=function(t,e){var n
|
|
@@ -176,9 +176,9 @@ return this.data=Object(i.a)(Object(i.a)({},this.data),((n={})[t]=e,n)),this},t.
|
|
|
176
176
|
var e=o.a.fromHttpCode(t)
|
|
177
177
|
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=""
|
|
178
178
|
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
|
|
179
|
-
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}()},
|
|
179
|
+
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}()},638:function(t,e,n){"use strict"
|
|
180
180
|
n.d(e,"a",(function(){return d}))
|
|
181
|
-
var i=n(0),a=n(
|
|
181
|
+
var i=n(0),a=n(632),r=n(87),s=n(4),o=n(19),c=n(7),u=n(637),d=function(t){function e(e,n){var i=t.call(this,e)||this
|
|
182
182
|
return i._measurements={},i._hub=Object(a.b)(),Object(s.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 u.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,i,a,s,c,u=this
|
|
183
183
|
if(void 0===this.endTimestamp){if(this.name||(o.b.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this.name="<unlabeled transaction>"),t.prototype.finish.call(this,e),!0!==this.sampled)return o.b.log("[Tracing] Discarding transaction because its trace was not chosen to be sampled."),void(null===(c=null===(a=null===(n=this._hub.getClient())||void 0===n?void 0:(i=n).getTransport)||void 0===a?void 0:(s=a.call(i)).recordLostEvent)||void 0===c||c.call(s,r.a.SampleRate,"transaction"))
|
|
184
184
|
var d=this.spanRecorder?this.spanRecorder.spans.filter((function(t){return t!==u&&t.endTimestamp})):[]
|
|
@@ -186,12 +186,12 @@ this._trimEnd&&d.length>0&&(this.endTimestamp=d.reduce((function(t,e){return t.e
|
|
|
186
186
|
var p={contexts:{trace:this.getTraceContext()},spans:d,start_timestamp:this.startTimestamp,tags:this.tags,timestamp:this.endTimestamp,transaction:this.name,type:"transaction",debug_meta:this.metadata}
|
|
187
187
|
return Object.keys(this._measurements).length>0&&(o.b.log("[Measurements] Adding measurements to transaction",JSON.stringify(this._measurements,void 0,2)),p.measurements=this._measurements),o.b.log("[Tracing] Finishing "+this.op+" transaction: "+this.name+"."),this._hub.captureEvent(p)}},e.prototype.toContext=function(){var e=t.prototype.toContext.call(this)
|
|
188
188
|
return Object(c.a)(Object(i.a)(Object(i.a)({},e),{name:this.name,trimEnd:this._trimEnd}))},e.prototype.updateWithContext=function(e){var n
|
|
189
|
-
return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(u.a)},
|
|
189
|
+
return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(u.a)},640:function(t,e,n){"use strict"
|
|
190
190
|
n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return a}))
|
|
191
|
-
var i="finishReason",a=["heartbeatFailed","idleTimeout","documentHidden"]},
|
|
191
|
+
var i="finishReason",a=["heartbeatFailed","idleTimeout","documentHidden"]},641:function(t,e,n){"use strict"
|
|
192
192
|
n.d(e,"a",(function(){return o}))
|
|
193
|
-
var i=n(
|
|
193
|
+
var i=n(90),a=n(19),r=n(634),s=n(633)
|
|
194
194
|
function o(){Object(i.a)({callback:c,type:"error"}),Object(i.a)({callback:c,type:"unhandledrejection"})}function c(){var t=Object(s.c)()
|
|
195
195
|
t&&(a.b.log("[Tracing] Transaction: "+r.a.InternalError+" -> Global error occured"),t.setStatus(r.a.InternalError))}}}])
|
|
196
196
|
|
|
197
|
-
//# sourceMappingURL=chunk.3.
|
|
197
|
+
//# sourceMappingURL=chunk.3.33097bb5eb150719bdd2.map
|