ghost 4.38.1 → 4.40.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/.c8rc.json +1 -1
- package/Gruntfile.js +1 -1
- package/README.md +26 -18
- package/core/built/assets/{chunk.3.4906cf0b01d6d8e33374.js → chunk.3.6e2ed2d00856e12bd81a.js} +19 -19
- package/core/built/assets/ghost-dark-498ff8339a89bb68c3f78f59bee4146e.css +1 -0
- package/core/built/assets/ghost.min-77b93478f83b0def6ddc5a4f23ce963e.css +1 -0
- package/core/built/assets/{ghost.min-6386b02480494a69c3bfe66206754836.js → ghost.min-88c665c3ba304b4f220d08b8bcf9d246.js} +525 -538
- package/core/built/assets/icons/{event-changed-subscription.svg → event-subscriptions.svg} +0 -1
- package/core/built/assets/icons/member.svg +3 -0
- package/core/built/assets/{vendor.min-c814d3c4b3f543c4cd5ef3aacd0fc645.js → vendor.min-ed945ad80ea22f1d3ffeec6d5ae63aee.js} +2355 -1419
- package/core/frontend/apps/private-blogging/lib/middleware.js +1 -1
- package/core/frontend/apps/private-blogging/lib/views/private.hbs +9 -10
- package/core/frontend/public/ghost.css +205 -143
- package/core/frontend/public/ghost.min.css +1 -1
- package/core/frontend/services/theme-engine/middleware/update-local-template-options.js +3 -1
- package/core/frontend/views/unsubscribe.hbs +28 -33
- package/core/frontend/web/middleware/error-handler.js +2 -2
- package/core/server/api/canary/authentication.js +7 -0
- package/core/server/api/canary/identities.js +0 -1
- package/core/server/api/canary/members.js +7 -1
- package/core/server/api/canary/tiers.js +3 -1
- package/core/server/api/canary/utils/serializers/input/pages.js +1 -1
- package/core/server/api/canary/utils/serializers/input/posts.js +1 -1
- package/core/server/api/canary/utils/serializers/input/tiers.js +17 -0
- package/core/server/api/canary/utils/serializers/output/actions.js +2 -2
- package/core/server/api/canary/utils/serializers/output/authentication.js +3 -3
- package/core/server/api/canary/utils/serializers/output/authors.js +3 -3
- package/core/server/api/canary/utils/serializers/output/email-posts.js +2 -2
- package/core/server/api/canary/utils/serializers/output/emails.js +3 -3
- package/core/server/api/canary/utils/serializers/output/images.js +2 -2
- package/core/server/api/canary/utils/serializers/output/integrations.js +5 -6
- package/core/server/api/canary/utils/serializers/output/labels.js +3 -3
- package/core/server/api/canary/utils/serializers/output/mappers/actions.js +7 -0
- package/core/server/api/canary/utils/serializers/output/mappers/emails.js +17 -0
- package/core/server/api/canary/utils/serializers/output/mappers/images.js +5 -0
- package/core/server/api/canary/utils/serializers/output/mappers/index.js +12 -0
- package/core/server/api/canary/utils/serializers/output/mappers/integrations.js +13 -0
- package/core/server/api/canary/utils/serializers/output/mappers/labels.js +4 -0
- package/core/server/api/canary/utils/serializers/output/mappers/pages.js +11 -0
- package/core/server/api/canary/utils/serializers/output/mappers/posts.js +101 -0
- package/core/server/api/canary/utils/serializers/output/mappers/settings.js +37 -0
- package/core/server/api/canary/utils/serializers/output/mappers/tags.js +11 -0
- package/core/server/api/canary/utils/serializers/output/mappers/users.js +12 -0
- package/core/server/api/canary/utils/serializers/output/members.js +2 -7
- package/core/server/api/canary/utils/serializers/output/pages.js +3 -3
- package/core/server/api/canary/utils/serializers/output/posts.js +3 -3
- package/core/server/api/canary/utils/serializers/output/preview.js +2 -2
- package/core/server/api/canary/utils/serializers/output/settings.js +2 -2
- package/core/server/api/canary/utils/serializers/output/tags.js +3 -3
- package/core/server/api/canary/utils/serializers/output/users.js +3 -3
- package/core/server/api/shared/serializers/handle.js +2 -2
- package/core/server/api/v2/utils/serializers/input/pages.js +1 -1
- package/core/server/api/v2/utils/serializers/input/posts.js +1 -1
- package/core/server/api/v3/utils/serializers/input/pages.js +1 -1
- package/core/server/api/v3/utils/serializers/input/posts.js +1 -1
- package/core/server/data/exporter/table-lists.js +1 -0
- package/core/server/data/importer/import-manager.js +152 -113
- package/core/server/data/migrations/versions/4.33/2022-01-14-11-51-add-default-free-tier.js +3 -0
- package/core/server/data/migrations/versions/4.39/2022-03-07-10-57-update-free-products-visibility-column.js +66 -0
- package/core/server/data/migrations/versions/4.39/2022-03-07-10-57-update-products-visibility-column.js +36 -0
- package/core/server/data/migrations/versions/4.40/2022-03-07-14-37-add-members-cancel-events-table.js +8 -0
- package/core/server/data/migrations/versions/4.40/2022-03-15-06-40-add-offers-admin-integration-permission-roles.js +23 -0
- package/core/server/data/migrations/versions/4.40/2022-03-15-06-40-add-tiers-admin-integration-permission-roles.js +20 -0
- package/core/server/data/schema/default-settings/default-settings.json +2 -2
- package/core/server/data/schema/fixtures/fixtures.json +17 -160
- package/core/server/data/schema/schema.js +6 -0
- package/core/server/lib/image/image-size.js +12 -4
- package/core/server/models/base/plugins/generate-slug.js +13 -1
- package/core/server/models/base/plugins/raw-knex.js +1 -1
- package/core/server/models/member-cancel-event.js +28 -0
- package/core/server/models/post.js +16 -6
- package/core/server/models/user.js +1 -1
- package/core/server/services/auth/setup.js +29 -13
- package/core/server/services/mega/mega.js +4 -4
- package/core/server/services/mega/template.js +2 -1
- package/core/server/services/members/api.js +1 -0
- package/core/server/services/members/content-gating.js +1 -1
- package/core/server/services/members/middleware.js +1 -0
- package/core/server/services/posts/posts-service.js +1 -1
- package/core/server/services/themes/validate.js +3 -3
- package/core/server/services/url/UrlGenerator.js +1 -1
- package/core/server/services/webhooks/webhooks-service.js +2 -0
- package/core/server/views/maintenance.html +2 -2
- 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/api/app.js +0 -3
- package/core/server/web/api/canary/admin/middleware.js +2 -0
- package/core/server/web/parent/backend.js +2 -1
- package/core/server/web/shared/middleware/uncapitalise.js +2 -1
- package/core/shared/config/defaults.json +2 -2
- package/core/shared/config/overrides.json +7 -3
- package/core/shared/labs.js +8 -10
- package/core/shared/url-utils.js +4 -1
- package/package.json +37 -36
- package/yarn.lock +513 -329
- package/core/built/assets/ghost-dark-9f760f16230b8bc52e188d6ce28516b0.css +0 -1
- package/core/built/assets/ghost.min-f4c59dd57a2136df8b0a34f87c099034.css +0 -1
- package/core/built/assets/icons/event-started-subscription.svg +0 -6
- package/core/built/assets/icons/locked-email-back.svg +0 -1
- package/core/built/assets/icons/locked-email-front.svg +0 -1
- package/core/built/assets/icons/locked-email-lock.svg +0 -1
- package/core/built/assets/img/ghost-logo-de2acf283f53ba1fd1149928faeaaa74.png +0 -0
- package/core/server/api/canary/utils/serializers/output/utils/mapper.js +0 -213
- package/core/server/frontend/ghost.min.css +0 -1
package/.c8rc.json
CHANGED
package/Gruntfile.js
CHANGED
package/README.md
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
|
|
1
2
|
<p align="center">
|
|
2
|
-
<a href="https://ghost.org
|
|
3
|
-
<img src="https://user-images.githubusercontent.com/
|
|
3
|
+
<a href="https://ghost.org/#gh-light-mode-only" target="_blank">
|
|
4
|
+
<img src="https://user-images.githubusercontent.com/65487235/157884383-1b75feb1-45d8-4430-b636-3f7e06577347.png" alt="Ghost" width="200px">
|
|
5
|
+
</a>
|
|
6
|
+
<a href="https://ghost.org/#gh-dark-mode-only" target="_blank">
|
|
7
|
+
<img src="https://user-images.githubusercontent.com/65487235/157849205-aa24152c-4610-4d7d-b752-3a8c4f9319e6.png" alt="Ghost" width="200px">
|
|
4
8
|
</a>
|
|
5
9
|
</p>
|
|
10
|
+
|
|
11
|
+
|
|
6
12
|
<p align="center">
|
|
7
|
-
<a href="https://ghost.org/">Ghost.org</a>
|
|
8
|
-
<a href="https://ghost.org
|
|
9
|
-
<a href="https://ghost.org/
|
|
10
|
-
<a href="https://
|
|
11
|
-
<a href="https://ghost.org/docs/">Docs</a> |
|
|
12
|
-
<a href="https://github.com/TryGhost/Ghost/blob/master/.github/CONTRIBUTING.md">Contributing</a> |
|
|
13
|
+
<a href="https://ghost.org/">Ghost.org</a> •
|
|
14
|
+
<a href="https://forum.ghost.org">Forum</a> •
|
|
15
|
+
<a href="https://ghost.org/docs/">Docs</a> •
|
|
16
|
+
<a href="https://github.com/TryGhost/Ghost/blob/master/.github/CONTRIBUTING.md">Contributing</a> •
|
|
13
17
|
<a href="https://twitter.com/ghost">Twitter</a>
|
|
14
18
|
<br /><br />
|
|
15
19
|
<a href="https://ghost.org/">
|
|
@@ -25,13 +29,17 @@
|
|
|
25
29
|
<img src="https://img.shields.io/github/contributors/TryGhost/Ghost.svg" alt="Contributors" />
|
|
26
30
|
</a>
|
|
27
31
|
</p>
|
|
28
|
-
<p align="center">
|
|
32
|
+
<p align="center">
|
|
33
|
+
Love open source? <a href="https://careers.ghost.org/product-engineer-node-js/">We're hiring</a> Node.js engineers to work on Ghost full-time.
|
|
34
|
+
</p>
|
|
29
35
|
|
|
30
36
|
|
|
31
37
|
|
|
32
38
|
<a href="https://ghost.org/"><img src="https://user-images.githubusercontent.com/120485/66918181-f88fdc80-f048-11e9-8135-d9c0e7b35ebc.png" alt="Fiercely independent, professional publishing. Ghost is the most popular open source, headless Node.js CMS which already works with all the tools you know and love." /></a>
|
|
39
|
+
|
|
33
40
|
|
|
34
|
-
<a href="https://ghost.org/pricing
|
|
41
|
+
<a href="https://ghost.org/pricing/#gh-light-mode-only" target="_blank"><img src="https://user-images.githubusercontent.com/65487235/157849437-9b8fcc48-1920-4b26-a1e8-5806db0e6bb9.png" alt="Ghost(Pro)" width="165px" /></a>
|
|
42
|
+
<a href="https://ghost.org/pricing/#gh-dark-mode-only" target="_blank"><img src="https://user-images.githubusercontent.com/65487235/157849438-79889b04-b7b6-4ba7-8de6-4c1e4b4e16a5.png" alt="Ghost(Pro)" width="165px" /></a>
|
|
35
43
|
|
|
36
44
|
The easiest way to get a production instance deployed is with our official **[Ghost(Pro)](https://ghost.org/pricing/)** managed service. It takes about 2 minutes to launch a new site with worldwide CDN, backups, security and maintenance all done for you.
|
|
37
45
|
|
|
@@ -41,7 +49,7 @@ If you prefer to run on your own infrastructure, we also offer official 1-off in
|
|
|
41
49
|
|
|
42
50
|
|
|
43
51
|
|
|
44
|
-
# Quickstart
|
|
52
|
+
# Quickstart install
|
|
45
53
|
|
|
46
54
|
If you want to run your own instance of Ghost, in most cases the best way is to use our **CLI tool**
|
|
47
55
|
|
|
@@ -69,21 +77,21 @@ ghost install
|
|
|
69
77
|
|
|
70
78
|
Check out our [official documentation](https://ghost.org/docs/) for more information about our [recommended hosting stack](https://ghost.org/docs/hosting/) & properly [upgrading Ghost](https://ghost.org/docs/update/), plus everything you need to develop your own Ghost [themes](https://ghost.org/docs/themes/) or work with [our API](https://ghost.org/docs/content-api/).
|
|
71
79
|
|
|
72
|
-
### Contributors &
|
|
80
|
+
### Contributors & advanced developers
|
|
73
81
|
|
|
74
|
-
For anyone wishing to contribute to Ghost or to hack/customize core files we recommend following our full development setup guides: [Contributor
|
|
82
|
+
For anyone wishing to contribute to Ghost or to hack/customize core files we recommend following our full development setup guides: [Contributor guide](https://ghost.org/docs/contributing/) • [Developer setup](https://ghost.org/docs/install/source/) • [Admin Client dev guide](https://ghost.org/docs/install/source/#ghost-admin)
|
|
75
83
|
|
|
76
84
|
|
|
77
85
|
|
|
78
|
-
# Ghost
|
|
86
|
+
# Ghost sponsors
|
|
79
87
|
|
|
80
|
-
We'd like to extend big thanks to our sponsors and partners who make Ghost possible. If you're interested in sponsoring Ghost and supporting the project, please check out our profile on [GitHub
|
|
88
|
+
We'd like to extend big thanks to our sponsors and partners who make Ghost possible. If you're interested in sponsoring Ghost and supporting the project, please check out our profile on [GitHub sponsors](https://github.com/sponsors/TryGhost) :heart:
|
|
81
89
|
|
|
82
|
-
**[DigitalOcean](https://m.do.co/c/9ff29836d717)**
|
|
90
|
+
**[DigitalOcean](https://m.do.co/c/9ff29836d717)** • **[Fastly](https://www.fastly.com/)**
|
|
83
91
|
|
|
84
92
|
|
|
85
93
|
|
|
86
|
-
# Getting
|
|
94
|
+
# Getting help
|
|
87
95
|
|
|
88
96
|
You can find answers to a huge variety of questions, along with a large community of helpful developers over on the [Ghost forum](https://forum.ghost.org/) - replies are generally very quick. **Ghost(Pro)** customers also have access to 24/7 email support.
|
|
89
97
|
|
|
@@ -91,6 +99,6 @@ To stay up to date with all the latest news and product updates, make sure you [
|
|
|
91
99
|
|
|
92
100
|
|
|
93
101
|
|
|
94
|
-
# Copyright &
|
|
102
|
+
# Copyright & license
|
|
95
103
|
|
|
96
104
|
Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE). Ghost and the Ghost Logo are trademarks of Ghost Foundation Ltd. Please see our [trademark policy](https://ghost.org/trademark/) for info on acceptable usage.
|
package/core/built/assets/{chunk.3.4906cf0b01d6d8e33374.js → chunk.3.6e2ed2d00856e12bd81a.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],{603: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(607),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(608),y=n(606),O=n(605),T=n(612),j=Object(b.a)(),S=n(80),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)))}
|
|
@@ -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(609),J=n(610),G=n(82)
|
|
121
|
+
Object(a.a)()},605: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(604),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}},606: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={}))},607: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(604),r=n(90),s=n(19),o=n(18),c=n(613),u=n(608),d=n(610),p=n(605)
|
|
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))},608: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(80),r=n(19),s=n(
|
|
151
|
+
var i=n(0),a=n(80),r=n(19),s=n(612),o=n(609),c=n(606),u=n(610),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)}}},609: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(82),r=n(80),s=n(7),o=n(
|
|
171
|
+
var i=n(0),a=n(82),r=n(80),s=n(7),o=n(606),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}()},610: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(604),r=n(86),s=n(4),o=n(19),c=n(7),u=n(609),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)},612: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"]},613:function(t,e,n){"use strict"
|
|
192
192
|
n.d(e,"a",(function(){return o}))
|
|
193
|
-
var i=n(89),a=n(19),r=n(
|
|
193
|
+
var i=n(89),a=n(19),r=n(606),s=n(605)
|
|
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.6e2ed2d00856e12bd81a.map
|