ghost 4.22.1 → 4.23.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.
Files changed (128) hide show
  1. package/.c8rc.json +24 -0
  2. package/.eslintrc.js +6 -0
  3. package/Gruntfile.js +1 -1
  4. package/content/public/README.md +3 -0
  5. package/core/boot.js +20 -12
  6. package/core/built/assets/{chunk.3.1148677ff3b78e5aeaee.js → chunk.3.8f95b516d88ff4eec64c.js} +18 -18
  7. package/core/built/assets/{ghost-dark-684ad238e1a858c7cb5be6988de7c6f5.css → ghost-dark-42cf6e0c730578940ec069bda45aea41.css} +1 -1
  8. package/core/built/assets/{ghost.min-f7037eca328f4d4eb99f0309c19c9bae.js → ghost.min-cccc107e881b74c7aaf1a73e1e5e0dee.js} +189 -143
  9. package/core/built/assets/{ghost.min-66e08535f8bb797a8c40e0a2b31f1e9e.css → ghost.min-fcf6a0738421f86c47c55f20d00c5ba9.css} +1 -1
  10. package/core/built/assets/icons/powered-by-tenor.svg +35 -0
  11. package/core/built/assets/icons/tenor.svg +7 -0
  12. package/core/built/assets/{vendor.min-7c8fdd90f7ecd2e94328a07ea3b64608.js → vendor.min-c9002845b6c30ac978abdadde9f33d7c.js} +8189 -7601
  13. package/core/frontend/apps/amp/lib/views/amp.hbs +104 -0
  14. package/core/frontend/apps/private-blogging/lib/router.js +1 -1
  15. package/core/frontend/services/card-assets/service.js +21 -13
  16. package/core/frontend/services/routing/CollectionRouter.js +4 -5
  17. package/core/frontend/services/routing/EmailRouter.js +1 -1
  18. package/core/frontend/services/routing/ParentRouter.js +0 -8
  19. package/core/frontend/services/routing/PreviewRouter.js +1 -1
  20. package/core/frontend/services/routing/StaticPagesRouter.js +1 -1
  21. package/core/frontend/services/routing/StaticRoutesRouter.js +4 -4
  22. package/core/frontend/services/routing/TaxonomyRouter.js +3 -3
  23. package/core/frontend/services/routing/{middlewares → middleware}/index.js +0 -0
  24. package/core/frontend/services/routing/{middlewares → middleware}/page-param.js +0 -0
  25. package/core/frontend/services/routing/router-manager.js +7 -2
  26. package/core/frontend/services/rss/generate-feed.js +2 -1
  27. package/core/frontend/src/cards/css/bookmark.css +66 -48
  28. package/core/frontend/src/cards/css/button.css +30 -0
  29. package/core/frontend/src/cards/css/callout.css +50 -0
  30. package/core/frontend/src/cards/css/gallery.css +8 -13
  31. package/core/frontend/src/cards/css/nft.css +94 -0
  32. package/core/frontend/src/cards/css/toggle.css +47 -0
  33. package/core/frontend/src/cards/js/toggle.js +16 -0
  34. package/core/frontend/web/middleware/serve-public-file.js +14 -8
  35. package/core/frontend/web/routes.js +0 -1
  36. package/core/frontend/web/site.js +15 -12
  37. package/core/server/adapters/storage/LocalFilesStorage.js +17 -0
  38. package/core/server/adapters/storage/LocalImagesStorage.js +1 -0
  39. package/core/server/adapters/storage/LocalMediaStorage.js +2 -1
  40. package/core/server/adapters/storage/LocalStorageBase.js +30 -5
  41. package/core/server/api/canary/authentication.js +1 -1
  42. package/core/server/api/canary/files.js +19 -0
  43. package/core/server/api/canary/index.js +4 -0
  44. package/core/server/api/canary/media.js +25 -5
  45. package/core/server/api/canary/oembed.js +3 -0
  46. package/core/server/api/canary/utils/serializers/input/index.js +4 -0
  47. package/core/server/api/canary/utils/serializers/input/media.js +8 -0
  48. package/core/server/api/canary/utils/serializers/output/config.js +21 -14
  49. package/core/server/api/canary/utils/serializers/output/files.js +27 -0
  50. package/core/server/api/canary/utils/serializers/output/index.js +4 -0
  51. package/core/server/api/canary/utils/serializers/output/media.js +9 -0
  52. package/core/server/api/canary/utils/validators/input/files.js +7 -0
  53. package/core/server/api/canary/utils/validators/input/index.js +4 -0
  54. package/core/server/api/canary/utils/validators/input/media.js +4 -0
  55. package/core/server/api/v2/authentication.js +1 -1
  56. package/core/server/api/v3/authentication.js +1 -1
  57. package/core/server/data/db/connection.js +7 -0
  58. package/core/server/data/importer/importers/data/data-importer.js +3 -3
  59. package/core/server/data/migrations/init/2-create-fixtures.js +3 -20
  60. package/core/server/data/migrations/versions/1.21/1-add-contributor-role.js +5 -5
  61. package/core/server/data/migrations/versions/2.15/2-insert-zapier-integration.js +3 -3
  62. package/core/server/data/migrations/versions/2.2/3-insert-admin-integration-role.js +5 -5
  63. package/core/server/data/migrations/versions/2.27/1-insert-ghost-db-backup-role.js +5 -6
  64. package/core/server/data/migrations/versions/2.27/2-insert-db-backup-integration.js +3 -4
  65. package/core/server/data/migrations/versions/2.28/3-insert-ghost-scheduler-role.js +7 -7
  66. package/core/server/data/migrations/versions/2.28/4-insert-scheduler-integration.js +3 -3
  67. package/core/server/data/migrations/versions/4.23/01-truncate-offer-names.js +58 -0
  68. package/core/server/data/schema/fixtures/fixture-manager.js +340 -0
  69. package/core/server/data/schema/fixtures/index.js +8 -2
  70. package/core/server/services/mega/post-email-serializer.js +5 -1
  71. package/core/server/services/mega/segment-parser.js +1 -2
  72. package/core/server/services/mega/template.js +69 -1
  73. package/core/server/services/nft-oembed.js +57 -0
  74. package/core/server/services/oembed.js +161 -126
  75. package/core/server/services/public-config/config.js +2 -1
  76. package/core/server/services/stripe/index.js +4 -2
  77. package/core/server/services/url/Resource.js +1 -1
  78. package/core/server/services/url/Resources.js +36 -23
  79. package/core/server/services/url/UrlGenerator.js +23 -20
  80. package/core/server/services/url/UrlService.js +123 -21
  81. package/core/server/services/url/Urls.js +7 -2
  82. package/core/server/services/url/index.js +9 -1
  83. package/core/server/web/admin/app.js +6 -6
  84. package/core/server/web/admin/views/default-prod.html +4 -4
  85. package/core/server/web/admin/views/default.html +4 -4
  86. package/core/server/web/api/app.js +1 -1
  87. package/core/server/web/api/canary/admin/app.js +4 -4
  88. package/core/server/web/api/canary/admin/middleware.js +6 -6
  89. package/core/server/web/api/canary/admin/routes.js +20 -5
  90. package/core/server/web/api/canary/content/app.js +4 -4
  91. package/core/server/web/api/canary/content/middleware.js +3 -3
  92. package/core/server/web/api/middleware/cors.js +7 -7
  93. package/core/server/web/api/v2/admin/app.js +4 -4
  94. package/core/server/web/api/v2/admin/middleware.js +6 -6
  95. package/core/server/web/api/v2/admin/routes.js +5 -5
  96. package/core/server/web/api/v2/content/app.js +4 -4
  97. package/core/server/web/api/v2/content/middleware.js +3 -3
  98. package/core/server/web/api/v3/admin/app.js +4 -4
  99. package/core/server/web/api/v3/admin/middleware.js +6 -6
  100. package/core/server/web/api/v3/admin/routes.js +5 -5
  101. package/core/server/web/api/v3/content/app.js +4 -4
  102. package/core/server/web/api/v3/content/middleware.js +3 -3
  103. package/core/server/web/members/app.js +7 -7
  104. package/core/server/web/oauth/app.js +1 -1
  105. package/core/server/web/parent/app.js +2 -3
  106. package/core/server/web/parent/frontend.js +1 -1
  107. package/core/server/web/shared/index.js +2 -2
  108. package/core/server/web/shared/{middlewares → middleware}/api/index.js +0 -0
  109. package/core/server/web/shared/{middlewares → middleware}/api/spam-prevention.js +0 -0
  110. package/core/server/web/shared/{middlewares → middleware}/brute.js +0 -0
  111. package/core/server/web/shared/{middlewares → middleware}/cache-control.js +0 -0
  112. package/core/server/web/shared/{middlewares → middleware}/error-handler.js +0 -0
  113. package/core/server/web/shared/{middlewares → middleware}/index.js +0 -0
  114. package/core/server/web/shared/{middlewares → middleware}/maintenance.js +0 -0
  115. package/core/server/web/shared/{middlewares → middleware}/pretty-urls.js +0 -0
  116. package/core/server/web/shared/{middlewares → middleware}/uncapitalise.js +0 -0
  117. package/core/server/web/shared/{middlewares → middleware}/url-redirects.js +0 -0
  118. package/core/shared/config/defaults.json +10 -2
  119. package/core/shared/config/helpers.js +44 -0
  120. package/core/shared/config/loader.js +1 -1
  121. package/core/shared/config/overrides.json +2 -2
  122. package/core/shared/labs.js +8 -1
  123. package/loggingrc.js +19 -20
  124. package/package.json +35 -35
  125. package/urls.json +597 -0
  126. package/yarn.lock +655 -339
  127. package/core/server/data/schema/fixtures/utils.js +0 -321
  128. 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/.eslintrc.js CHANGED
@@ -37,6 +37,12 @@ module.exports = {
37
37
  ]]
38
38
  }
39
39
  },
40
+ {
41
+ files: 'core/server/api/**/utils/validators/**/index.js',
42
+ rules: {
43
+ 'max-lines': ['off']
44
+ }
45
+ },
40
46
  /**
41
47
  * @TODO: enable these soon
42
48
  */
package/Gruntfile.js CHANGED
@@ -74,7 +74,7 @@ module.exports = function (grunt) {
74
74
  'core/server/**/*.js',
75
75
  'core/shared/**/*.js',
76
76
  'core/frontend/**/*.js',
77
- '!core/frontend/public/**',
77
+ 'core/frontend/src/**/*.css',
78
78
  'core/*.js',
79
79
  'index.js',
80
80
  'config.*.json',
@@ -0,0 +1,3 @@
1
+ # Content / Public
2
+
3
+ Ghost will store any built assets here. This goes hand in hand with core/frontend/public where static assets are stored.
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/middlewares/maintenance.js#L13
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
@@ -105,6 +110,9 @@ async function initCore({ghostServer, config}) {
105
110
  ghostServer.registerCleanupTask(async () => {
106
111
  await jobService.shutdown();
107
112
  });
113
+ ghostServer.registerCleanupTask(async () => {
114
+ await urlService.shutdown();
115
+ });
108
116
  debug('End: Job Service');
109
117
 
110
118
  debug('End: initCore');
@@ -304,12 +312,18 @@ async function bootGhost() {
304
312
  // These require their own try-catch block and error format, because we can't log an error if logging isn't working
305
313
  try {
306
314
  // Step 0 - Load config and logging - fundamental required components
307
- // Config must be the first thing we do, because it is required for absolutely everything
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
308
322
  debug('Begin: Load config');
309
323
  config = require('./shared/config');
310
324
  debug('End: Load config');
311
325
 
312
- // Logging is used absolutely everywhere
326
+ // Logging is also used absolutely everywhere
313
327
  debug('Begin: Load logging');
314
328
  logging = require('@tryghost/logging');
315
329
  metrics = require('@tryghost/metrics');
@@ -324,12 +338,6 @@ async function bootGhost() {
324
338
 
325
339
  try {
326
340
  // Step 1 - require more fundamental components
327
- // Version is required by sentry & Migration config & so is fundamental to booting
328
- // However, it involves reading package.json so its slow & it's here for visibility on that slowness
329
- debug('Begin: Load version info');
330
- require('@tryghost/version');
331
- debug('End: Load version info');
332
-
333
341
  // Sentry must be initialized early, but requires config
334
342
  debug('Begin: Load sentry');
335
343
  require('./shared/sentry');
@@ -352,7 +360,7 @@ async function bootGhost() {
352
360
 
353
361
  // Step 4 - Load Ghost with all its services
354
362
  debug('Begin: Load Ghost Services & Apps');
355
- await initCore({ghostServer, config});
363
+ await initCore({ghostServer, config, bootLogger});
356
364
  await initServicesForFrontend();
357
365
  await initFrontend();
358
366
  const ghostApp = await initExpressApps();
@@ -1,8 +1,8 @@
1
- (window.webpackJsonp_ember_auto_import_=window.webpackJsonp_ember_auto_import_||[]).push([[3],{606:function(t,e,n){"use strict"
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(18),s=n(5),o=n(610),c=n(611),u=n(609),d=n(608),p=Object(s.a)(),l=n(17),m=n(83),h=n(33),f=function(t,e,n){var i
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(12),k=n(92),w=n(4),R={traceFetch:!0,traceXHR:!0,tracingOrigins:["localhost",/^\//]}
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(612),J=n(613),G=n(84),X=Object(a.a)(Object(a.a)({},i),{BrowserTracing:D})
119
- Object(o.a)()},608:function(t,e,n){"use strict"
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(607),a=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$")
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}},609:function(t,e,n){"use strict"
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={}))},610: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(607),r=n(93),s=n(18),o=n(17),c=n(615),u=n(611),d=n(613),p=n(608)
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(48)(t))},611:function(t,e,n){"use strict"
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(83),r=n(18),s=n(612),o=n(609),c=n(613),u=1e3,d=function(t){function e(e,n,i,a){void 0===i&&(i="")
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)}}},612:function(t,e,n){"use strict"
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(84),r=n(83),s=n(7),o=n(609),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
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}()},613:function(t,e,n){"use strict"
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(607),r=n(89),s=n(4),o=n(18),c=n(7),u=n(612),d=function(t){function e(e,n){var i=t.call(this,e)||this
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)},615:function(t,e,n){"use strict"
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(92),a=n(18),r=n(609),s=n(608)
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.1148677ff3b78e5aeaee.map
193
+ //# sourceMappingURL=chunk.3.8f95b516d88ff4eec64c.map