ghost 4.22.3 → 4.22.4
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/.c8rc.json +24 -0
- package/Gruntfile.js +0 -1
- package/content/public/README.md +3 -0
- package/core/boot.js +18 -13
- package/core/built/assets/{chunk.3.324fd0cc598c73650219.js → chunk.3.8f95b516d88ff4eec64c.js} +18 -18
- package/core/built/assets/{ghost-dark-39fb496d051565531062d7e047d1c0b1.css → ghost-dark-42cf6e0c730578940ec069bda45aea41.css} +1 -1
- package/core/built/assets/{ghost.min-7da921f6c6cac3fe10da1ba104575440.js → ghost.min-2e3e64eb258cf424c59c3e308b4bc6e6.js} +134 -101
- package/core/built/assets/{ghost.min-4207edfc1ae0a3f9f6505ca00d20b0c0.css → ghost.min-fcf6a0738421f86c47c55f20d00c5ba9.css} +1 -1
- package/core/built/assets/icons/powered-by-tenor.svg +35 -0
- package/core/built/assets/icons/tenor.svg +7 -0
- package/core/built/assets/{vendor.min-413f887176a041e6dbf88214ca9a7481.js → vendor.min-c9002845b6c30ac978abdadde9f33d7c.js} +2860 -2403
- package/core/frontend/apps/amp/lib/views/amp.hbs +104 -0
- package/core/frontend/apps/private-blogging/lib/router.js +1 -1
- package/core/frontend/services/card-assets/service.js +7 -7
- package/core/frontend/services/routing/CollectionRouter.js +4 -5
- package/core/frontend/services/routing/EmailRouter.js +1 -1
- package/core/frontend/services/routing/ParentRouter.js +0 -8
- package/core/frontend/services/routing/PreviewRouter.js +1 -1
- package/core/frontend/services/routing/StaticPagesRouter.js +1 -1
- package/core/frontend/services/routing/StaticRoutesRouter.js +4 -4
- package/core/frontend/services/routing/TaxonomyRouter.js +3 -3
- package/core/frontend/services/routing/{middlewares → middleware}/index.js +0 -0
- package/core/frontend/services/routing/{middlewares → middleware}/page-param.js +0 -0
- package/core/frontend/services/routing/router-manager.js +7 -2
- package/core/frontend/services/rss/generate-feed.js +2 -1
- package/core/frontend/src/cards/css/bookmark.css +66 -48
- package/core/frontend/src/cards/css/callout.css +41 -3
- package/core/frontend/src/cards/css/gallery.css +8 -13
- package/core/frontend/src/cards/css/nft.css +20 -11
- package/core/frontend/src/cards/css/toggle.css +47 -0
- package/core/frontend/src/cards/js/toggle.js +16 -0
- package/core/frontend/web/middleware/serve-public-file.js +14 -8
- package/core/frontend/web/site.js +12 -12
- package/core/server/api/canary/authentication.js +1 -1
- package/core/server/api/canary/utils/serializers/output/config.js +1 -1
- package/core/server/api/v2/authentication.js +1 -1
- package/core/server/api/v3/authentication.js +1 -1
- package/core/server/data/db/connection.js +7 -0
- package/core/server/data/importer/importers/data/data-importer.js +3 -3
- package/core/server/data/migrations/init/2-create-fixtures.js +3 -20
- package/core/server/data/migrations/versions/1.21/1-add-contributor-role.js +5 -5
- package/core/server/data/migrations/versions/2.15/2-insert-zapier-integration.js +3 -3
- package/core/server/data/migrations/versions/2.2/3-insert-admin-integration-role.js +5 -5
- package/core/server/data/migrations/versions/2.27/1-insert-ghost-db-backup-role.js +5 -6
- package/core/server/data/migrations/versions/2.27/2-insert-db-backup-integration.js +3 -4
- package/core/server/data/migrations/versions/2.28/3-insert-ghost-scheduler-role.js +7 -7
- package/core/server/data/migrations/versions/2.28/4-insert-scheduler-integration.js +3 -3
- package/core/server/data/schema/fixtures/fixture-manager.js +340 -0
- package/core/server/data/schema/fixtures/index.js +8 -2
- package/core/server/services/mega/post-email-serializer.js +5 -1
- package/core/server/services/mega/segment-parser.js +1 -2
- package/core/server/services/mega/template.js +48 -37
- package/core/server/services/nft-oembed.js +7 -21
- package/core/server/services/oembed.js +4 -0
- package/core/server/services/public-config/config.js +1 -1
- package/core/server/services/url/Resources.js +8 -2
- package/core/server/services/url/UrlGenerator.js +23 -20
- package/core/server/services/url/UrlService.js +89 -45
- package/core/server/services/url/index.js +3 -2
- package/core/server/web/admin/app.js +6 -6
- package/core/server/web/admin/views/default-prod.html +3 -3
- package/core/server/web/admin/views/default.html +3 -3
- package/core/server/web/api/app.js +1 -1
- package/core/server/web/api/canary/admin/app.js +4 -4
- package/core/server/web/api/canary/admin/middleware.js +6 -6
- package/core/server/web/api/canary/admin/routes.js +5 -5
- package/core/server/web/api/canary/content/app.js +4 -4
- package/core/server/web/api/canary/content/middleware.js +3 -3
- package/core/server/web/api/v2/admin/app.js +4 -4
- package/core/server/web/api/v2/admin/middleware.js +6 -6
- package/core/server/web/api/v2/admin/routes.js +5 -5
- package/core/server/web/api/v2/content/app.js +4 -4
- package/core/server/web/api/v2/content/middleware.js +3 -3
- package/core/server/web/api/v3/admin/app.js +4 -4
- package/core/server/web/api/v3/admin/middleware.js +6 -6
- package/core/server/web/api/v3/admin/routes.js +5 -5
- package/core/server/web/api/v3/content/app.js +4 -4
- package/core/server/web/api/v3/content/middleware.js +3 -3
- package/core/server/web/members/app.js +7 -7
- package/core/server/web/oauth/app.js +1 -1
- package/core/server/web/parent/app.js +2 -3
- package/core/server/web/parent/frontend.js +1 -1
- package/core/server/web/shared/index.js +2 -2
- package/core/server/web/shared/{middlewares → middleware}/api/index.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/api/spam-prevention.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/brute.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/cache-control.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/error-handler.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/index.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/maintenance.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/pretty-urls.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/uncapitalise.js +0 -0
- package/core/server/web/shared/{middlewares → middleware}/url-redirects.js +0 -0
- package/core/shared/config/defaults.json +7 -1
- package/core/shared/config/helpers.js +42 -0
- package/core/shared/config/loader.js +1 -1
- package/loggingrc.js +19 -20
- package/package.json +26 -26
- package/yarn.lock +600 -295
- package/core/server/data/schema/fixtures/utils.js +0 -321
- package/core/server/web/parent/vhost-utils.js +0 -39
package/.c8rc.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"all": true,
|
|
3
|
+
"include": [
|
|
4
|
+
"core/{*.js,frontend,server,shared}"
|
|
5
|
+
],
|
|
6
|
+
"exclude": [
|
|
7
|
+
"core/frontend/src/**",
|
|
8
|
+
"core/frontend/public/**",
|
|
9
|
+
"core/server/data/migrations/**",
|
|
10
|
+
"!core/server/data/migrations/utils.js",
|
|
11
|
+
"core/frontend/web/**",
|
|
12
|
+
"!core/frontend/web/middleware/**",
|
|
13
|
+
"core/server/web/api/**",
|
|
14
|
+
"!core/server/web/api/middleware/**",
|
|
15
|
+
"core/server/web/parent/**",
|
|
16
|
+
"!core/server/web/parent/middleware/**",
|
|
17
|
+
"core/server/web/shared/**",
|
|
18
|
+
"!core/server/web/shared/middleware/**",
|
|
19
|
+
"core/server/api/v2/**",
|
|
20
|
+
"core/server/api/v3/**",
|
|
21
|
+
"core/server/api/canary/**",
|
|
22
|
+
"!core/server/api/canary/utils"
|
|
23
|
+
]
|
|
24
|
+
}
|
package/Gruntfile.js
CHANGED
package/core/boot.js
CHANGED
|
@@ -68,8 +68,9 @@ async function initDatabase({config, logging}) {
|
|
|
68
68
|
* @param {object} options
|
|
69
69
|
* @param {object} options.ghostServer
|
|
70
70
|
* @param {object} options.config
|
|
71
|
+
* @param {object} options.bootLogger
|
|
71
72
|
*/
|
|
72
|
-
async function initCore({ghostServer, config}) {
|
|
73
|
+
async function initCore({ghostServer, config, bootLogger}) {
|
|
73
74
|
debug('Begin: initCore');
|
|
74
75
|
|
|
75
76
|
// URL Utils is a bit slow, put it here so the timing is visible separate from models
|
|
@@ -95,8 +96,12 @@ async function initCore({ghostServer, config}) {
|
|
|
95
96
|
const urlService = require('./server/services/url');
|
|
96
97
|
// Note: there is no await here, we do not wait for the url service to finish
|
|
97
98
|
// We can return, but the site will remain in (the shared, not global) maintenance mode until this finishes
|
|
98
|
-
// This is managed on request: https://github.com/TryGhost/Ghost/blob/main/core/server/web/shared/
|
|
99
|
-
urlService.init(
|
|
99
|
+
// This is managed on request: https://github.com/TryGhost/Ghost/blob/main/core/server/web/shared/middleware/maintenance.js#L13
|
|
100
|
+
urlService.init({
|
|
101
|
+
onFinished: () => {
|
|
102
|
+
bootLogger.log('URL Service Ready');
|
|
103
|
+
}
|
|
104
|
+
});
|
|
100
105
|
debug('End: Url Service');
|
|
101
106
|
|
|
102
107
|
// Job Service allows parts of Ghost to run in the background
|
|
@@ -106,7 +111,7 @@ async function initCore({ghostServer, config}) {
|
|
|
106
111
|
await jobService.shutdown();
|
|
107
112
|
});
|
|
108
113
|
ghostServer.registerCleanupTask(async () => {
|
|
109
|
-
await urlService.
|
|
114
|
+
await urlService.shutdown();
|
|
110
115
|
});
|
|
111
116
|
debug('End: Job Service');
|
|
112
117
|
|
|
@@ -307,12 +312,18 @@ async function bootGhost() {
|
|
|
307
312
|
// These require their own try-catch block and error format, because we can't log an error if logging isn't working
|
|
308
313
|
try {
|
|
309
314
|
// Step 0 - Load config and logging - fundamental required components
|
|
310
|
-
//
|
|
315
|
+
// Version is required by logging, sentry & Migration config & so is fundamental to booting
|
|
316
|
+
// However, it involves reading package.json so its slow & it's here for visibility on that slowness
|
|
317
|
+
debug('Begin: Load version info');
|
|
318
|
+
require('@tryghost/version');
|
|
319
|
+
debug('End: Load version info');
|
|
320
|
+
|
|
321
|
+
// Loading config must be the first thing we do, because it is required for absolutely everything
|
|
311
322
|
debug('Begin: Load config');
|
|
312
323
|
config = require('./shared/config');
|
|
313
324
|
debug('End: Load config');
|
|
314
325
|
|
|
315
|
-
// Logging is used absolutely everywhere
|
|
326
|
+
// Logging is also used absolutely everywhere
|
|
316
327
|
debug('Begin: Load logging');
|
|
317
328
|
logging = require('@tryghost/logging');
|
|
318
329
|
metrics = require('@tryghost/metrics');
|
|
@@ -327,12 +338,6 @@ async function bootGhost() {
|
|
|
327
338
|
|
|
328
339
|
try {
|
|
329
340
|
// Step 1 - require more fundamental components
|
|
330
|
-
// Version is required by sentry & Migration config & so is fundamental to booting
|
|
331
|
-
// However, it involves reading package.json so its slow & it's here for visibility on that slowness
|
|
332
|
-
debug('Begin: Load version info');
|
|
333
|
-
require('@tryghost/version');
|
|
334
|
-
debug('End: Load version info');
|
|
335
|
-
|
|
336
341
|
// Sentry must be initialized early, but requires config
|
|
337
342
|
debug('Begin: Load sentry');
|
|
338
343
|
require('./shared/sentry');
|
|
@@ -355,7 +360,7 @@ async function bootGhost() {
|
|
|
355
360
|
|
|
356
361
|
// Step 4 - Load Ghost with all its services
|
|
357
362
|
debug('Begin: Load Ghost Services & Apps');
|
|
358
|
-
await initCore({ghostServer, config});
|
|
363
|
+
await initCore({ghostServer, config, bootLogger});
|
|
359
364
|
await initServicesForFrontend();
|
|
360
365
|
await initFrontend();
|
|
361
366
|
const ghostApp = await initExpressApps();
|
package/core/built/assets/{chunk.3.324fd0cc598c73650219.js → chunk.3.8f95b516d88ff4eec64c.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],{610:function(t,e,n){"use strict"
|
|
2
2
|
n.r(e),n.d(e,"Integrations",(function(){return X})),n.d(e,"Span",(function(){return W.a})),n.d(e,"Transaction",(function(){return J.a})),n.d(e,"registerRequestInstrumentation",(function(){return A})),n.d(e,"defaultRequestInstrumentationOptions",(function(){return R})),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 G.i})),n.d(e,"TRACEPARENT_REGEXP",(function(){return d.a}))
|
|
3
3
|
var i={}
|
|
4
4
|
n.r(i),n.d(i,"Express",(function(){return q})),n.d(i,"Postgres",(function(){return L})),n.d(i,"Mysql",(function(){return z})),n.d(i,"Mongo",(function(){return Y}))
|
|
5
|
-
var a=n(0),r=n(
|
|
5
|
+
var a=n(0),r=n(19),s=n(5),o=n(614),c=n(615),u=n(613),d=n(612),p=Object(s.a)(),l=n(18),m=n(82),h=n(32),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){}},b=function(t,e){var n=function(i){"pagehide"!==i.type&&"hidden"!==Object(s.a)().document.visibilityState||(t(i),e&&(removeEventListener("visibilitychange",n,!0),removeEventListener("pagehide",n,!0)))}
|
|
@@ -46,7 +46,7 @@ if(n){var i=Object(d.e)(m.b),a=Object(d.e)(n.startTime)
|
|
|
46
46
|
r.b.log("[Measurements] Adding FID"),t._measurements.fid={value:e.value},t._measurements["mark.fid"]={value:i+a}}}))},t}()
|
|
47
47
|
function E(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&&x(e,{op:"browser",description:null!=s?s:i,startTimestamp:a+Object(d.e)(c),endTimestamp:a+Object(d.e)(o)})}function x(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 I(t){return"number"==typeof t&&isFinite(t)}var C=n(
|
|
49
|
+
return n&&t.startTimestamp>n&&(t.startTimestamp=n),t.startChild(Object(a.a)({startTimestamp:n},i))}function I(t){return"number"==typeof t&&isFinite(t)}var C=n(13),k=n(92),w=n(4),R={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]}
|
|
50
50
|
function A(t){var e=Object(a.a)(Object(a.a)({},R),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(C.b)(t,e)}))&&!Object(C.b)(t,"sentry_key"),o[t]},p=c
|
|
@@ -115,15 +115,15 @@ return t.call.apply(t,Object(a.e)([this],u.slice(0,-1),[function(t,e){var n
|
|
|
115
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=U[e],o=Array.isArray(this._describeOperations)?this._describeOperations.includes(e):this._describeOperations
|
|
116
116
|
if(!s||!o)return r
|
|
117
117
|
try{if("mapReduce"===e){var c=Object(a.c)(n,2),u=c[0],d=c[1]
|
|
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}(),W=n(
|
|
119
|
-
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}(),W=n(616),J=n(617),G=n(84),X=Object(a.a)(Object(a.a)({},i),{BrowserTracing:D})
|
|
119
|
+
Object(o.a)()},612:function(t,e,n){"use strict"
|
|
120
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}))
|
|
121
|
-
var i=n(
|
|
121
|
+
var i=n(611),a=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$")
|
|
122
122
|
function r(t){var e
|
|
123
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)
|
|
124
124
|
if(e){var n=void 0
|
|
125
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
|
|
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}},
|
|
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}},613:function(t,e,n){"use strict"
|
|
127
127
|
var i
|
|
128
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
|
|
129
129
|
if(e>=400&&e<500)switch(e){case 401:return t.Unauthenticated
|
|
@@ -135,8 +135,8 @@ case 429:return t.ResourceExhausted
|
|
|
135
135
|
default:return t.InvalidArgument}if(e>=500&&e<600)switch(e){case 501:return t.Unimplemented
|
|
136
136
|
case 503:return t.Unavailable
|
|
137
137
|
case 504:return t.DeadlineExceeded
|
|
138
|
-
default:return t.InternalError}return t.UnknownError}}(i||(i={}))},
|
|
139
|
-
var i=n(0),a=n(
|
|
138
|
+
default:return t.InternalError}return t.UnknownError}}(i||(i={}))},614: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(611),r=n(93),s=n(19),o=n(18),c=n(619),u=n(615),d=n(617),p=n(612)
|
|
140
140
|
function l(){var t=this.getScope()
|
|
141
141
|
if(t){var e=t.getSpan()
|
|
142
142
|
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)
|
|
@@ -144,9 +144,9 @@ var i}function h(t,e){var n,a,r=(null===(n=this.getClient())||void 0===n?void 0:
|
|
|
144
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)
|
|
145
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)()
|
|
146
146
|
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}))
|
|
147
|
-
r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(47)(t))},
|
|
147
|
+
r.length>0&&(e.__SENTRY__.integrations=Object(i.e)(e.__SENTRY__.integrations||[],r))}}(),Object(c.a)()}}).call(this,n(47)(t))},615:function(t,e,n){"use strict"
|
|
148
148
|
n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return p}))
|
|
149
|
-
var i=n(0),a=n(82),r=n(
|
|
149
|
+
var i=n(0),a=n(82),r=n(19),s=n(616),o=n(613),c=n(617),u=1e3,d=function(t){function e(e,n,i,a){void 0===i&&(i="")
|
|
150
150
|
var r=t.call(this,a)||this
|
|
151
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
|
|
152
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)
|
|
@@ -164,9 +164,9 @@ setTimeout((function(){e._finished||e.finish(i)}),n)}},e.prototype._beat=functio
|
|
|
164
164
|
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(o.a.DeadlineExceeded),this.setTag("heartbeat","failed"),this.finish()):this._pingHeartbeat()}},e.prototype._pingHeartbeat=function(){var t=this
|
|
165
165
|
r.b.log("pinging Heartbeat -> current counter: "+this._heartbeatCounter),setTimeout((function(){t._beat()}),5e3)},e}(c.a)
|
|
166
166
|
function l(t){if(t){var e=t.getScope()
|
|
167
|
-
e&&e.getTransaction()&&e.setSpan(void 0)}}},
|
|
167
|
+
e&&e.getTransaction()&&e.setSpan(void 0)}}},616:function(t,e,n){"use strict"
|
|
168
168
|
n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return u}))
|
|
169
|
-
var i=n(0),a=n(
|
|
169
|
+
var i=n(0),a=n(84),r=n(82),s=n(7),o=n(613),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
|
|
170
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}))
|
|
171
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
|
|
172
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
|
|
@@ -174,9 +174,9 @@ return this.data=Object(i.a)(Object(i.a)({},this.data),((n={})[t]=e,n)),this},t.
|
|
|
174
174
|
var e=o.a.fromHttpCode(t)
|
|
175
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=""
|
|
176
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
|
|
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}()},
|
|
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}()},617:function(t,e,n){"use strict"
|
|
178
178
|
n.d(e,"a",(function(){return d}))
|
|
179
|
-
var i=n(0),a=n(
|
|
179
|
+
var i=n(0),a=n(611),r=n(89),s=n(4),o=n(19),c=n(7),u=n(616),d=function(t){function e(e,n){var i=t.call(this,e)||this
|
|
180
180
|
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
|
|
181
181
|
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"))
|
|
182
182
|
var d=this.spanRecorder?this.spanRecorder.spans.filter((function(t){return t!==u&&t.endTimestamp})):[]
|
|
@@ -184,10 +184,10 @@ this._trimEnd&&d.length>0&&(this.endTimestamp=d.reduce((function(t,e){return t.e
|
|
|
184
184
|
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}
|
|
185
185
|
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)
|
|
186
186
|
return Object(c.a)(Object(i.a)(Object(i.a)({},e),{name:this.name,trimEnd:this._trimEnd}))},e.prototype.updateWithContext=function(e){var n
|
|
187
|
-
return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(u.a)},
|
|
187
|
+
return t.prototype.updateWithContext.call(this,e),this.name=null!=(n=e.name)?n:"",this._trimEnd=e.trimEnd,this},e}(u.a)},619:function(t,e,n){"use strict"
|
|
188
188
|
n.d(e,"a",(function(){return o}))
|
|
189
|
-
var i=n(
|
|
189
|
+
var i=n(92),a=n(19),r=n(613),s=n(612)
|
|
190
190
|
function o(){Object(i.a)({callback:c,type:"error"}),Object(i.a)({callback:c,type:"unhandledrejection"})}function c(){var t=Object(s.c)()
|
|
191
191
|
t&&(a.b.log("[Tracing] Transaction: "+r.a.InternalError+" -> Global error occured"),t.setStatus(r.a.InternalError))}}}])
|
|
192
192
|
|
|
193
|
-
//# sourceMappingURL=chunk.3.
|
|
193
|
+
//# sourceMappingURL=chunk.3.8f95b516d88ff4eec64c.map
|