ghost 5.117.0 → 5.118.1

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 (166) hide show
  1. package/bin/minify-assets.js +119 -0
  2. package/components/{tryghost-api-framework-5.117.0.tgz → tryghost-api-framework-5.118.1.tgz} +0 -0
  3. package/components/tryghost-constants-5.118.1.tgz +0 -0
  4. package/components/tryghost-custom-fonts-5.118.1.tgz +0 -0
  5. package/components/tryghost-custom-theme-settings-service-5.118.1.tgz +0 -0
  6. package/components/tryghost-domain-events-5.118.1.tgz +0 -0
  7. package/components/tryghost-donations-5.118.1.tgz +0 -0
  8. package/components/{tryghost-email-addresses-5.117.0.tgz → tryghost-email-addresses-5.118.1.tgz} +0 -0
  9. package/components/{tryghost-email-service-5.117.0.tgz → tryghost-email-service-5.118.1.tgz} +0 -0
  10. package/components/tryghost-email-suppression-list-5.118.1.tgz +0 -0
  11. package/components/tryghost-html-to-plaintext-5.118.1.tgz +0 -0
  12. package/components/tryghost-i18n-5.118.1.tgz +0 -0
  13. package/components/{tryghost-job-manager-5.117.0.tgz → tryghost-job-manager-5.118.1.tgz} +0 -0
  14. package/components/tryghost-link-replacer-5.118.1.tgz +0 -0
  15. package/components/tryghost-magic-link-5.118.1.tgz +0 -0
  16. package/components/{tryghost-member-attribution-5.117.0.tgz → tryghost-member-attribution-5.118.1.tgz} +0 -0
  17. package/components/tryghost-member-events-5.118.1.tgz +0 -0
  18. package/components/{tryghost-members-csv-5.117.0.tgz → tryghost-members-csv-5.118.1.tgz} +0 -0
  19. package/components/{tryghost-members-offers-5.117.0.tgz → tryghost-members-offers-5.118.1.tgz} +0 -0
  20. package/components/tryghost-mw-error-handler-5.118.1.tgz +0 -0
  21. package/components/tryghost-mw-vhost-5.118.1.tgz +0 -0
  22. package/components/tryghost-post-events-5.118.1.tgz +0 -0
  23. package/components/tryghost-post-revisions-5.118.1.tgz +0 -0
  24. package/components/tryghost-posts-service-5.118.1.tgz +0 -0
  25. package/components/tryghost-prometheus-metrics-5.118.1.tgz +0 -0
  26. package/components/tryghost-security-5.118.1.tgz +0 -0
  27. package/components/tryghost-tiers-5.118.1.tgz +0 -0
  28. package/components/tryghost-webmentions-5.118.1.tgz +0 -0
  29. package/content/themes/casper/LICENSE +1 -1
  30. package/content/themes/casper/README.md +1 -1
  31. package/content/themes/casper/assets/built/screen.css +1 -1
  32. package/content/themes/casper/assets/built/screen.css.map +1 -1
  33. package/content/themes/casper/assets/css/screen.css +1 -1
  34. package/content/themes/casper/author.hbs +23 -2
  35. package/content/themes/casper/package.json +2 -2
  36. package/content/themes/casper/partials/icons/bluesky.hbs +3 -0
  37. package/content/themes/casper/partials/icons/instagram.hbs +5 -0
  38. package/content/themes/casper/partials/icons/linkedin.hbs +3 -0
  39. package/content/themes/casper/partials/icons/mastodon.hbs +3 -0
  40. package/content/themes/casper/partials/icons/threads.hbs +3 -0
  41. package/content/themes/casper/partials/icons/tiktok.hbs +3 -0
  42. package/content/themes/casper/partials/icons/twitter.hbs +3 -1
  43. package/content/themes/casper/partials/icons/youtube.hbs +3 -0
  44. package/content/themes/source/LICENSE +1 -1
  45. package/content/themes/source/README.md +1 -1
  46. package/content/themes/source/assets/built/screen.css +1 -1
  47. package/content/themes/source/assets/built/screen.css.map +1 -1
  48. package/content/themes/source/assets/css/screen.css +7 -12
  49. package/content/themes/source/author.hbs +24 -3
  50. package/content/themes/source/package.json +2 -2
  51. package/content/themes/source/partials/feature-image.hbs +2 -2
  52. package/content/themes/source/partials/icons/bluesky.hbs +3 -0
  53. package/content/themes/source/partials/icons/instagram.hbs +5 -0
  54. package/content/themes/source/partials/icons/linkedin.hbs +3 -0
  55. package/content/themes/source/partials/icons/mastodon.hbs +3 -0
  56. package/content/themes/source/partials/icons/threads.hbs +3 -0
  57. package/content/themes/source/partials/icons/tiktok.hbs +3 -0
  58. package/content/themes/source/partials/icons/youtube.hbs +3 -0
  59. package/core/bridge.js +1 -11
  60. package/core/built/admin/assets/admin-x-activitypub/admin-x-activitypub.js +32344 -26674
  61. package/core/built/admin/assets/admin-x-settings/{CodeEditorView-3bc05d1b.mjs → CodeEditorView-9d2a0119.mjs} +2 -2
  62. package/core/built/admin/assets/admin-x-settings/admin-x-settings.js +2 -2
  63. package/core/built/admin/assets/admin-x-settings/{index-c5623145.mjs → index-48250e60.mjs} +2 -2
  64. package/core/built/admin/assets/admin-x-settings/{index-b2cdc747.mjs → index-fd83d7a5.mjs} +4778 -4726
  65. package/core/built/admin/assets/admin-x-settings/{modals-fd7bc70c.mjs → modals-8fdc40a2.mjs} +8963 -7991
  66. package/core/built/admin/assets/{chunk.524.f4d7526780f546c5fc0b.js → chunk.524.9c1e444ecff073f053f5.js} +6 -6
  67. package/core/built/admin/assets/chunk.582.9b35e36c109a3c2d486b.js +37 -0
  68. package/core/built/admin/assets/{chunk.713.48f120c377bcaffdfddf.js → chunk.709.0cb431c2ada3758f5368.js} +2728 -2726
  69. package/core/built/admin/assets/{chunk.713.48f120c377bcaffdfddf.js.LICENSE.txt → chunk.709.0cb431c2ada3758f5368.js.LICENSE.txt} +2 -2
  70. package/core/built/admin/assets/{ghost-45186e4f079c9fdd8f42dfbfb93d3344.js → ghost-941b0691f9ab77a31452151d2828caee.js} +1123 -1120
  71. package/core/built/admin/assets/{ghost-ba58e9822f7384461e926c7e23f04a75.css → ghost-c10c25cbf2256a65051bf20fdb32b1a9.css} +1 -1
  72. package/core/built/admin/assets/{ghost-dark-f1f29683b14ffa11615b3bba8b6ab92c.css → ghost-dark-6cbe9c3d45b8b605f846c4b417881e50.css} +1 -1
  73. package/core/built/admin/assets/posts/posts.js +80101 -29841
  74. package/core/built/admin/assets/stats/stats.js +37413 -31600
  75. package/core/built/admin/assets/{vendor-8e3ee8261528bb429cfe78ce79a4a82a.js → vendor-778197221846b9f24b630ecc57b8d8a9.js} +25 -25
  76. package/core/built/admin/index.html +13 -22
  77. package/core/frontend/apps/private-blogging/lib/views/private.hbs +4 -12
  78. package/core/frontend/helpers/ghost_head.js +2 -2
  79. package/core/frontend/helpers/social_url.js +31 -0
  80. package/core/frontend/public/admin-auth/admin-auth.min.js +1 -0
  81. package/core/frontend/public/comment-counts.min.js +1 -0
  82. package/core/frontend/public/ghost-stats.min.js +1 -0
  83. package/core/frontend/public/member-attribution.min.js +1 -0
  84. package/core/frontend/services/assets-minification/index.js +1 -11
  85. package/core/frontend/src/ghost-stats/ghost-stats.js +234 -0
  86. package/core/frontend/src/member-attribution/member-attribution.js +29 -29
  87. package/core/frontend/src/utils/privacy.js +70 -0
  88. package/core/frontend/src/utils/session-storage.js +68 -0
  89. package/core/frontend/src/utils/url-attribution.js +92 -0
  90. package/core/frontend/web/site.js +26 -6
  91. package/core/server/api/endpoints/users.js +7 -0
  92. package/core/server/api/endpoints/utils/serializers/output/config.js +2 -1
  93. package/core/server/services/activitypub/ActivityPubService.js +0 -5
  94. package/core/server/services/activitypub/ActivityPubService.ts +0 -5
  95. package/core/server/services/auth/session/index.js +5 -2
  96. package/core/server/services/auth/session/session-service.js +5 -4
  97. package/core/server/services/members/api.js +2 -2
  98. package/core/server/services/members/members-api/controllers/MemberController.js +214 -0
  99. package/core/server/services/members/members-api/controllers/RouterController.js +667 -0
  100. package/core/server/services/members/members-api/controllers/WellKnownController.js +46 -0
  101. package/core/server/services/members/members-api/members-api.js +404 -0
  102. package/core/server/services/members/members-api/repositories/EventRepository.js +984 -0
  103. package/core/server/services/members/members-api/repositories/MemberRepository.js +1739 -0
  104. package/core/server/services/members/members-api/repositories/ProductRepository.js +662 -0
  105. package/core/server/services/members/members-api/services/GeolocationService.js +23 -0
  106. package/core/server/services/members/members-api/services/MemberBREADService.js +444 -0
  107. package/core/server/services/members/members-api/services/PaymentsService.js +522 -0
  108. package/core/server/services/members/members-api/services/TokenService.js +54 -0
  109. package/core/server/services/milestones/BookshelfMilestoneRepository.js +8 -9
  110. package/core/server/services/milestones/InMemoryMilestoneRepository.js +119 -0
  111. package/core/server/services/milestones/Milestone.js +231 -0
  112. package/core/server/services/milestones/MilestoneCreatedEvent.js +22 -0
  113. package/core/server/services/milestones/MilestonesService.js +327 -0
  114. package/core/server/services/milestones/service.js +2 -2
  115. package/core/server/services/newsletters/index.js +1 -1
  116. package/core/server/services/public-config/config.js +2 -1
  117. package/core/server/services/settings/settings-service.js +1 -1
  118. package/core/server/services/slack-notifications/SlackNotifications.js +1 -1
  119. package/core/server/services/slack-notifications/SlackNotificationsService.js +2 -2
  120. package/core/server/services/staff/StaffService.js +1 -1
  121. package/core/server/views/error.hbs +4 -9
  122. package/core/server/web/admin/app.js +3 -5
  123. package/core/server/web/admin/middleware/serve-auth-frame-file.js +35 -0
  124. package/core/shared/config/defaults.json +3 -0
  125. package/core/shared/config/env/config.development.docker.json +8 -0
  126. package/core/shared/config/env/config.development.json +1 -1
  127. package/core/shared/config/env/config.testing-mysql.json +3 -0
  128. package/core/shared/config/env/config.testing.json +3 -0
  129. package/core/shared/config/helpers.js +1 -21
  130. package/core/shared/labs.js +3 -7
  131. package/package.json +82 -73
  132. package/tsconfig.tsbuildinfo +1 -1
  133. package/yarn.lock +456 -386
  134. package/components/tryghost-constants-5.117.0.tgz +0 -0
  135. package/components/tryghost-custom-fonts-5.117.0.tgz +0 -0
  136. package/components/tryghost-custom-theme-settings-service-5.117.0.tgz +0 -0
  137. package/components/tryghost-domain-events-5.117.0.tgz +0 -0
  138. package/components/tryghost-donations-5.117.0.tgz +0 -0
  139. package/components/tryghost-email-suppression-list-5.117.0.tgz +0 -0
  140. package/components/tryghost-html-to-plaintext-5.117.0.tgz +0 -0
  141. package/components/tryghost-i18n-5.117.0.tgz +0 -0
  142. package/components/tryghost-link-replacer-5.117.0.tgz +0 -0
  143. package/components/tryghost-magic-link-5.117.0.tgz +0 -0
  144. package/components/tryghost-member-events-5.117.0.tgz +0 -0
  145. package/components/tryghost-members-api-5.117.0.tgz +0 -0
  146. package/components/tryghost-milestones-5.117.0.tgz +0 -0
  147. package/components/tryghost-mw-error-handler-5.117.0.tgz +0 -0
  148. package/components/tryghost-mw-vhost-5.117.0.tgz +0 -0
  149. package/components/tryghost-post-events-5.117.0.tgz +0 -0
  150. package/components/tryghost-post-revisions-5.117.0.tgz +0 -0
  151. package/components/tryghost-posts-service-5.117.0.tgz +0 -0
  152. package/components/tryghost-prometheus-metrics-5.117.0.tgz +0 -0
  153. package/components/tryghost-security-5.117.0.tgz +0 -0
  154. package/components/tryghost-tiers-5.117.0.tgz +0 -0
  155. package/components/tryghost-webmentions-5.117.0.tgz +0 -0
  156. package/core/built/admin/assets/admin-x-demo/admin-x-demo.js +0 -6
  157. package/core/built/admin/assets/admin-x-demo/index-09325f38.mjs +0 -11427
  158. package/core/built/admin/assets/admin-x-demo/modals-1a9ae8b7.mjs +0 -397
  159. package/core/built/admin/assets/chunk.582.869c66dfbfa68412de07.js +0 -37
  160. package/core/frontend/public/ghost-stats.js +0 -297
  161. package/core/frontend/services/assets-minification/AdminAuthAssets.js +0 -69
  162. package/core/frontend/services/assets-minification/CommentCountsAssets.js +0 -33
  163. package/core/frontend/services/assets-minification/MemberAttributionAssets.js +0 -45
  164. package/core/frontend/src/admin-auth/index.html +0 -6
  165. package/core/frontend/src/member-attribution/.eslintrc +0 -10
  166. /package/core/frontend/src/comment-counts/{js/comment-counts.js → comment-counts.js} +0 -0
@@ -1,297 +0,0 @@
1
- (function(){
2
- const timezones = {"Asia/Barnaul":"RU","Africa/Nouakchott":"MR","Africa/Lusaka":"ZM","Asia/Pyongyang":"KP","Europe/Bratislava":"SK","America/Belize":"BZ","America/Maceio":"BR","Pacific/Chuuk":"FM","Indian/Comoro":"KM","Pacific/Palau":"PW","Asia/Jakarta":"ID","Africa/Windhoek":"NA","America/Chihuahua":"MX","America/Nome":"US","Africa/Mbabane":"SZ","Africa/Porto-Novo":"BJ","Europe/San_Marino":"SM","Pacific/Fakaofo":"TK","America/Denver":"US","Europe/Belgrade":"RS","America/Indiana/Tell_City":"US","America/Fortaleza":"BR","America/Halifax":"CA","Europe/Bucharest":"RO","America/Indiana/Petersburg":"US","Europe/Kirov":"RU","Europe/Athens":"GR","America/Argentina/Ushuaia":"AR","Europe/Monaco":"MC","Europe/Vilnius":"LT","Europe/Copenhagen":"DK","Pacific/Kanton":"KI","America/Caracas":"VE","Asia/Almaty":"KZ","Europe/Paris":"FR","Africa/Blantyre":"MW","Asia/Muscat":"OM","America/North_Dakota/Beulah":"US","America/Matamoros":"MX","Asia/Irkutsk":"RU","America/Costa_Rica":"CR","America/Araguaina":"BR","Atlantic/Canary":"ES","America/Santo_Domingo":"DO","America/Vancouver":"CA","Africa/Addis_Ababa":"ET","Africa/Accra":"GH","Pacific/Kwajalein":"MH","Asia/Baghdad":"IQ","Australia/Adelaide":"AU","Australia/Hobart":"AU","America/Guayaquil":"EC","America/Argentina/Tucuman":"AR","Australia/Lindeman":"AU","America/New_York":"US","Pacific/Fiji":"FJ","America/Antigua":"AG","Africa/Casablanca":"MA","America/Paramaribo":"SR","Africa/Cairo":"EG","America/Cayenne":"GF","America/Detroit":"US","Antarctica/Syowa":"AQ","Africa/Douala":"CM","America/Argentina/La_Rioja":"AR","Africa/Lagos":"NG","America/St_Barthelemy":"BL","Asia/Nicosia":"CY","Asia/Macau":"MO","Europe/Riga":"LV","Asia/Ashgabat":"TM","Indian/Antananarivo":"MG","America/Argentina/San_Juan":"AR","Asia/Aden":"YE","Asia/Tomsk":"RU","America/Asuncion":"PY","Pacific/Bougainville":"PG","Asia/Vientiane":"LA","America/Mazatlan":"MX","Africa/Luanda":"AO","Europe/Oslo":"NO","Africa/Kinshasa":"CD","Europe/Warsaw":"PL","America/Grand_Turk":"TC","Asia/Seoul":"KR","Africa/Tripoli":"LY","America/St_Thomas":"VI","Asia/Kathmandu":"NP","Pacific/Pitcairn":"PN","Pacific/Nauru":"NR","America/Curacao":"CW","Asia/Kabul":"AF","Pacific/Tongatapu":"TO","Europe/Simferopol":"UA","Asia/Ust-Nera":"RU","Africa/Mogadishu":"SO","Indian/Mayotte":"YT","Pacific/Niue":"NU","America/Thunder_Bay":"CA","Atlantic/Azores":"PT","Pacific/Gambier":"PF","Europe/Stockholm":"SE","Africa/Libreville":"GA","America/Punta_Arenas":"CL","America/Guatemala":"GT","America/Noronha":"BR","Europe/Helsinki":"FI","Asia/Gaza":"PS","Pacific/Kosrae":"FM","America/Aruba":"AW","America/Nassau":"BS","Asia/Choibalsan":"MN","America/Winnipeg":"CA","America/Anguilla":"AI","Asia/Thimphu":"BT","Asia/Beirut":"LB","Atlantic/Faroe":"FO","Europe/Berlin":"DE","Europe/Amsterdam":"NL","Pacific/Honolulu":"US","America/Regina":"CA","America/Scoresbysund":"GL","Europe/Vienna":"AT","Europe/Tirane":"AL","Africa/El_Aaiun":"EH","America/Creston":"CA","Asia/Qostanay":"KZ","Asia/Ho_Chi_Minh":"VN","Europe/Samara":"RU","Europe/Rome":"IT","Australia/Eucla":"AU","America/El_Salvador":"SV","America/Chicago":"US","Africa/Abidjan":"CI","Asia/Kamchatka":"RU","Pacific/Tarawa":"KI","America/Santiago":"CL","America/Bahia":"BR","Indian/Christmas":"CX","Asia/Atyrau":"KZ","Asia/Dushanbe":"TJ","Europe/Ulyanovsk":"RU","America/Yellowknife":"CA","America/Recife":"BR","Australia/Sydney":"AU","America/Fort_Nelson":"CA","Pacific/Efate":"VU","Europe/Saratov":"RU","Africa/Banjul":"GM","Asia/Omsk":"RU","Europe/Ljubljana":"SI","Europe/Budapest":"HU","Europe/Astrakhan":"RU","America/Argentina/Buenos_Aires":"AR","Pacific/Chatham":"NZ","America/Argentina/Salta":"AR","Africa/Niamey":"NE","Asia/Pontianak":"ID","Indian/Reunion":"RE","Asia/Hong_Kong":"HK","Antarctica/McMurdo":"AQ","Africa/Malabo":"GQ","America/Los_Angeles":"US","America/Argentina/Cordoba":"AR","Pacific/Pohnpei":"FM","America/Tijuana":"MX","America/Campo_Grande":"BR","America/Dawson_Creek":"CA","Asia/Novosibirsk":"RU","Pacific/Pago_Pago":"AS","Asia/Jerusalem":"IL","Europe/Sarajevo":"BA","Africa/Freetown":"SL","Asia/Yekaterinburg":"RU","America/Juneau":"US","Africa/Ouagadougou":"BF","Africa/Monrovia":"LR","Europe/Kiev":"UA","America/Argentina/San_Luis":"AR","Asia/Tokyo":"JP","Asia/Qatar":"QA","America/La_Paz":"BO","America/Bogota":"CO","America/Thule":"GL","Asia/Manila":"PH","Asia/Hovd":"MN","Asia/Tehran":"IR","Atlantic/Madeira":"PT","America/Metlakatla":"US","Europe/Vatican":"VA","Asia/Bishkek":"KG","Asia/Dili":"TL","Antarctica/Palmer":"AQ","Atlantic/Cape_Verde":"CV","Indian/Chagos":"IO","America/Kentucky/Monticello":"US","Africa/Algiers":"DZ","Africa/Maseru":"LS","Asia/Kuala_Lumpur":"MY","Africa/Khartoum":"SD","America/Argentina/Rio_Gallegos":"AR","America/Blanc-Sablon":"CA","Africa/Maputo":"MZ","America/Tortola":"VG","Atlantic/Bermuda":"BM","America/Argentina/Catamarca":"AR","America/Cayman":"KY","America/Puerto_Rico":"PR","Pacific/Majuro":"MH","Europe/Busingen":"DE","Pacific/Midway":"UM","Indian/Cocos":"CC","Asia/Singapore":"SG","America/Boise":"US","America/Nuuk":"GL","America/Goose_Bay":"CA","Australia/Broken_Hill":"AU","Africa/Dar_es_Salaam":"TZ","Africa/Asmara":"ER","Asia/Samarkand":"UZ","Asia/Tbilisi":"GE","America/Argentina/Jujuy":"AR","America/Indiana/Winamac":"US","America/Porto_Velho":"BR","Asia/Magadan":"RU","Europe/Zaporozhye":"UA","Antarctica/Casey":"AQ","Asia/Shanghai":"CN","Pacific/Norfolk":"NF","Europe/Guernsey":"GG","Australia/Brisbane":"AU","Antarctica/DumontDUrville":"AQ","America/Havana":"CU","America/Atikokan":"CA","America/Mexico_City":"MX","America/Rankin_Inlet":"CA","America/Cuiaba":"BR","America/Resolute":"CA","Africa/Ceuta":"ES","Arctic/Longyearbyen":"SJ","Pacific/Guam":"GU","Asia/Damascus":"SY","Asia/Colombo":"LK","Asia/Yerevan":"AM","America/Montserrat":"MS","America/Belem":"BR","Europe/Kaliningrad":"RU","Atlantic/South_Georgia":"GS","Asia/Tashkent":"UZ","Asia/Kolkata":"IN","America/St_Johns":"CA","Asia/Srednekolymsk":"RU","Asia/Yakutsk":"RU","Europe/Prague":"CZ","Africa/Djibouti":"DJ","Asia/Dubai":"AE","Europe/Uzhgorod":"UA","America/Edmonton":"CA","Asia/Famagusta":"CY","America/Indiana/Knox":"US","Asia/Hebron":"PS","Asia/Taipei":"TW","Europe/London":"GB","Africa/Dakar":"SN","Australia/Darwin":"AU","America/Glace_Bay":"CA","Antarctica/Vostok":"AQ","America/Indiana/Vincennes":"US","America/Nipigon":"CA","Asia/Kuwait":"KW","Pacific/Guadalcanal":"SB","America/Toronto":"CA","Africa/Gaborone":"BW","Africa/Bujumbura":"BI","Africa/Lubumbashi":"CD","America/Merida":"MX","America/Marigot":"MF","Europe/Zagreb":"HR","Pacific/Easter":"CL","America/Santarem":"BR","Pacific/Noumea":"NC","America/Sitka":"US","Atlantic/Stanley":"FK","Pacific/Funafuti":"TV","America/Iqaluit":"CA","America/Rainy_River":"CA","America/Anchorage":"US","America/Lima":"PE","Asia/Baku":"AZ","America/Indiana/Vevay":"US","Asia/Ulaanbaatar":"MN","America/Managua":"NI","Asia/Krasnoyarsk":"RU","Asia/Qyzylorda":"KZ","America/Eirunepe":"BR","Europe/Podgorica":"ME","Europe/Chisinau":"MD","Europe/Mariehamn":"AX","Europe/Volgograd":"RU","Africa/Nairobi":"KE","Europe/Isle_of_Man":"IM","America/Menominee":"US","Africa/Harare":"ZW","Asia/Anadyr":"RU","America/Moncton":"CA","Indian/Maldives":"MV","America/Whitehorse":"CA","Antarctica/Mawson":"AQ","Europe/Madrid":"ES","America/Argentina/Mendoza":"AR","America/Manaus":"BR","Africa/Bangui":"CF","Indian/Mauritius":"MU","Africa/Tunis":"TN","Australia/Lord_Howe":"AU","America/Kentucky/Louisville":"US","America/North_Dakota/Center":"US","Asia/Novokuznetsk":"RU","Asia/Makassar":"ID","America/Port_of_Spain":"TT","America/Bahia_Banderas":"MX","Pacific/Auckland":"NZ","America/Sao_Paulo":"BR","Asia/Dhaka":"BD","America/Pangnirtung":"CA","Europe/Dublin":"IE","Asia/Brunei":"BN","Africa/Brazzaville":"CG","America/Montevideo":"UY","America/Jamaica":"JM","America/Indiana/Indianapolis":"US","America/Kralendijk":"BQ","Europe/Gibraltar":"GI","Pacific/Marquesas":"PF","Pacific/Apia":"WS","Europe/Jersey":"JE","America/Phoenix":"US","Africa/Ndjamena":"TD","Asia/Karachi":"PK","Africa/Kampala":"UG","Asia/Sakhalin":"RU","America/Martinique":"MQ","Europe/Moscow":"RU","Africa/Conakry":"GN","America/Barbados":"BB","Africa/Lome":"TG","America/Ojinaga":"MX","America/Tegucigalpa":"HN","Asia/Bangkok":"TH","Africa/Johannesburg":"ZA","Europe/Vaduz":"LI","Africa/Sao_Tome":"ST","America/Cambridge_Bay":"CA","America/Lower_Princes":"SX","America/Miquelon":"PM","America/St_Kitts":"KN","Australia/Melbourne":"AU","Europe/Minsk":"BY","Asia/Vladivostok":"RU","Europe/Sofia":"BG","Antarctica/Davis":"AQ","Pacific/Galapagos":"EC","America/North_Dakota/New_Salem":"US","Asia/Amman":"JO","Pacific/Wallis":"WF","America/Hermosillo":"MX","Pacific/Kiritimati":"KI","Antarctica/Macquarie":"AU","America/Guyana":"GY","Asia/Riyadh":"SA","Pacific/Tahiti":"PF","America/St_Vincent":"VC","America/Cancun":"MX","America/Grenada":"GD","Pacific/Wake":"UM","America/Dawson":"CA","Europe/Brussels":"BE","Indian/Kerguelen":"TF","America/Yakutat":"US","Indian/Mahe":"SC","Atlantic/Reykjavik":"IS","America/Panama":"PA","America/Guadeloupe":"GP","Europe/Malta":"MT","Antarctica/Troll":"AQ","Asia/Jayapura":"ID","Asia/Bahrain":"BH","Asia/Chita":"RU","Europe/Tallinn":"EE","Asia/Khandyga":"RU","America/Rio_Branco":"BR","Atlantic/St_Helena":"SH","Africa/Juba":"SS","America/Adak":"US","Pacific/Saipan":"MP","America/St_Lucia":"LC","America/Inuvik":"CA","Europe/Luxembourg":"LU","Africa/Bissau":"GW","Asia/Oral":"KZ","America/Boa_Vista":"BR","Europe/Skopje":"MK","America/Port-au-Prince":"HT","Pacific/Port_Moresby":"PG","Europe/Andorra":"AD","America/Indiana/Marengo":"US","Africa/Kigali":"RW","Africa/Bamako":"ML","America/Dominica":"DM","Asia/Aqtobe":"KZ","Europe/Istanbul":"TR","Pacific/Rarotonga":"CK","America/Danmarkshavn":"GL","Europe/Zurich":"CH","Asia/Yangon":"MM","America/Monterrey":"MX","Europe/Lisbon":"PT","Asia/Kuching":"MY","Antarctica/Rothera":"AQ","Australia/Perth":"AU","Asia/Phnom_Penh":"KH","America/Swift_Current":"CA","Asia/Aqtau":"KZ","Asia/Urumqi":"CN","Asia/Calcutta":"IN"};
3
- const STORAGE_KEY = 'session-id'
4
- let DATASOURCE = 'analytics_events'
5
- const storageMethods = {
6
- localStorage: 'localStorage',
7
- sessionStorage: 'sessionStorage',
8
- }
9
- let STORAGE_METHOD = storageMethods.localStorage
10
- let globalAttributes = {}
11
- let stringifyPayload = true
12
-
13
- let token, host, domain
14
- if (document.currentScript) {
15
- host = document.currentScript.getAttribute('data-host')
16
- token = document.currentScript.getAttribute('data-token')
17
- domain = document.currentScript.getAttribute('data-domain')
18
- DATASOURCE =
19
- document.currentScript.getAttribute('data-datasource') || DATASOURCE
20
- STORAGE_METHOD =
21
- document.currentScript.getAttribute('data-storage') || STORAGE_METHOD
22
- stringifyPayload = document.currentScript.getAttribute('data-stringify-payload') !== 'false'
23
- for (const attr of document.currentScript.attributes) {
24
- if (attr.name.startsWith('tb_')) {
25
- globalAttributes[attr.name.slice(3)] = attr.value
26
- }
27
- }
28
- }
29
-
30
- /**
31
- * Generate uuid to identify the session. Random, not data-derived
32
- */
33
- function _uuidv4() {
34
- return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
35
- (
36
- c ^
37
- (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))
38
- ).toString(16)
39
- )
40
- }
41
-
42
- function _getSessionId() {
43
- const storage =
44
- STORAGE_METHOD === storageMethods.localStorage
45
- ? localStorage
46
- : sessionStorage
47
- const serializedItem = storage.getItem(STORAGE_KEY)
48
-
49
- if (!serializedItem) {
50
- return null
51
- }
52
-
53
- let item = null;
54
-
55
- try {
56
- item = JSON.parse(serializedItem)
57
- } catch (error) {
58
- return null
59
- }
60
-
61
- if(typeof item !== 'object' || item === null) {
62
- return null
63
- }
64
-
65
- const now = new Date()
66
-
67
- if (now.getTime() > item.expiry) {
68
- storage.removeItem(STORAGE_KEY)
69
- return null
70
- }
71
-
72
- return item.value
73
- }
74
-
75
- function _setSessionId() {
76
- /**
77
- * Try to keep same session id if it exists, generate a new one otherwise.
78
- * - First request in a session will generate a new session id
79
- * - The next request will keep the same session id and extend the TTL for 30 more minutes
80
- */
81
-
82
- const sessionId = _getSessionId() || _uuidv4()
83
- const now = new Date()
84
- const item = {
85
- value: sessionId,
86
- expiry: now.getTime() + 14400 * 1000, // 4 hours
87
- }
88
- const value = JSON.stringify(item)
89
- const storage =
90
- STORAGE_METHOD === storageMethods.localStorage
91
- ? localStorage
92
- : sessionStorage
93
- storage.setItem(STORAGE_KEY, value)
94
- }
95
-
96
- /**
97
- * Try to mask PPI and potential sensible attributes
98
- *
99
- * @param { object } payload Event payload
100
- * @return { object } Sanitized payload
101
- */
102
- const _maskSuspiciousAttributes = payload => {
103
- const attributesToMask = [
104
- 'username',
105
- 'user',
106
- 'user_id',
107
- 'userid',
108
- 'password',
109
- 'pass',
110
- 'pin',
111
- 'passcode',
112
- 'token',
113
- 'api_token',
114
- 'email',
115
- 'address',
116
- 'phone',
117
- 'sex',
118
- 'gender',
119
- 'order',
120
- 'order_id',
121
- 'orderid',
122
- 'payment',
123
- 'credit_card',
124
- ]
125
-
126
- // Deep copy
127
- let _payload = JSON.stringify(payload)
128
- attributesToMask.forEach(attr => {
129
- _payload = _payload.replaceAll(
130
- new RegExp(`("${attr}"):(".+?"|\\d+)`, 'mgi'),
131
- '$1:"********"'
132
- )
133
- })
134
-
135
- return _payload
136
- }
137
-
138
- /**
139
- * Send event to endpoint
140
- *
141
- * @param { string } name Event name
142
- * @param { object } payload Event payload
143
- * @return { Promise<any> } request response
144
- */
145
- async function _sendEvent(name, payload) {
146
- _setSessionId()
147
- const url = `${host}?name=${DATASOURCE}&token=${token}`
148
-
149
- let processedPayload
150
- if (stringifyPayload) {
151
- processedPayload = _maskSuspiciousAttributes(payload)
152
- processedPayload = Object.assign({}, JSON.parse(processedPayload), globalAttributes)
153
- processedPayload = JSON.stringify(processedPayload)
154
- } else {
155
- processedPayload = Object.assign({}, payload, globalAttributes)
156
- const maskedStr = _maskSuspiciousAttributes(processedPayload)
157
- processedPayload = JSON.parse(maskedStr)
158
- }
159
-
160
- const session_id = _getSessionId() || _uuidv4()
161
-
162
- const request = new XMLHttpRequest()
163
- request.open('POST', url, true)
164
- request.setRequestHeader('Content-Type', 'application/json')
165
- request.send(
166
- JSON.stringify({
167
- timestamp: new Date().toISOString(),
168
- action: name,
169
- version: '1',
170
- session_id,
171
- payload: processedPayload,
172
- })
173
- )
174
- }
175
-
176
- /**
177
- * Track page hit
178
- */
179
- function _trackPageHit() {
180
- // If local development environment
181
- // if (/^localhost$|^127(\.[0-9]+){0,2}\.[0-9]+$|^\[::1?\]$/.test(location.hostname) || location.protocol === 'file:') return;
182
- // If test environment
183
- if (window.__nightmare || window.navigator.webdriver || window.Cypress)
184
- return
185
-
186
- let country, locale
187
- try {
188
- const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
189
- country = timezones[timezone]
190
- locale =
191
- navigator.languages && navigator.languages.length
192
- ? navigator.languages[0]
193
- : navigator.userLanguage ||
194
- navigator.language ||
195
- navigator.browserLanguage ||
196
- 'en'
197
- } catch (error) {
198
- // ignore error
199
- }
200
-
201
- // Wait a bit for SPA routers
202
- setTimeout(() => {
203
- _sendEvent('page_hit', {
204
- 'user-agent': window.navigator.userAgent,
205
- locale,
206
- location: country,
207
- referrer: _getReferrer(),
208
- pathname: window.location.pathname,
209
- href: window.location.href,
210
- })
211
- }, 300)
212
- }
213
-
214
- function _getReferrer() {
215
- // Fetch referrer data from query params - priority is the following order: ref, source, utm_source, utm_medium, referrer
216
- let refParam;
217
- let sourceParam;
218
- let utmSourceParam;
219
- let utmMediumParam;
220
- let referrerSource;
221
-
222
- // Fetch source/medium from query param
223
- const url = new URL(window.location.href);
224
- refParam = url.searchParams.get('ref');
225
- sourceParam = url.searchParams.get('source');
226
- utmSourceParam = url.searchParams.get('utm_source');
227
- utmMediumParam = url.searchParams.get('utm_medium');
228
-
229
- referrerSource = refParam || sourceParam || utmSourceParam || null;
230
-
231
- // if referrerSource is not set, check to see if the url contains a hash like ghost.org/#/portal/signup?ref=ghost and pull the ref from the hash
232
- if (!referrerSource && url.hash && url.hash.includes('#/portal')) {
233
- const hashUrl = new URL(window.location.href.replace('/#/portal', ''));
234
- refParam = hashUrl.searchParams.get('ref');
235
- sourceParam = hashUrl.searchParams.get('source');
236
- utmSourceParam = hashUrl.searchParams.get('utm_source');
237
- utmMediumParam = hashUrl.searchParams.get('utm_medium');
238
-
239
- referrerSource = refParam || sourceParam || utmSourceParam || null;
240
- }
241
-
242
- // Get referrer medium and url
243
- const referrerMedium = utmMediumParam || null;
244
- const referrerUrl = window.document.referrer || null;
245
-
246
- // Get the final referrer value based on priority
247
- const finalReferrer = referrerSource || referrerMedium || referrerUrl || null;
248
-
249
- if (finalReferrer) {
250
- try {
251
- const referrerHost = new URL(finalReferrer).hostname;
252
- const currentHost = window.location.hostname;
253
- // If the final referrer matches the current site's domain, return null
254
- if (referrerHost === currentHost) {
255
- return null;
256
- }
257
- } catch (e) {
258
- // If URL parsing fails (e.g. for non-URL refs like "ghost-newsletter"),
259
- // just return the original referrer value
260
- return finalReferrer;
261
- }
262
- }
263
-
264
- return finalReferrer;
265
- }
266
-
267
- // Client
268
- window.Tinybird = {
269
- trackEvent: _sendEvent,
270
- _trackPageHit: _trackPageHit
271
- }
272
-
273
- // Event listener
274
- window.addEventListener('hashchange', _trackPageHit)
275
- const his = window.history
276
- if (his.pushState) {
277
- const originalPushState = his['pushState']
278
- his.pushState = function () {
279
- originalPushState.apply(this, arguments)
280
- _trackPageHit()
281
- }
282
- window.addEventListener('popstate', _trackPageHit)
283
- }
284
-
285
- let lastPage
286
- function handleVisibilityChange() {
287
- if (!lastPage && document.visibilityState === 'visible') {
288
- _trackPageHit()
289
- }
290
- }
291
-
292
- if (document.visibilityState === 'prerender') {
293
- document.addEventListener('visibilitychange', handleVisibilityChange)
294
- } else {
295
- _trackPageHit()
296
- }
297
- })()
@@ -1,69 +0,0 @@
1
- // const debug = require('@tryghost/debug')('comments-counts-assets');
2
- const path = require('path');
3
- const fs = require('fs');
4
- const logging = require('@tryghost/logging');
5
- const config = require('../../../shared/config');
6
- const urlUtils = require('../../../shared/url-utils');
7
-
8
- const Minifier = require('./Minifier');
9
- const AssetsMinificationBase = require('./AssetsMinificationBase');
10
-
11
- module.exports = class AdminAuthAssets extends AssetsMinificationBase {
12
- constructor(options = {}) {
13
- super(options);
14
-
15
- this.src = options.src || path.join(config.get('paths').assetSrc, 'admin-auth');
16
- /** @private */
17
- this.dest = options.dest || path.join(config.getContentPath('public'), 'admin-auth');
18
-
19
- this.minifier = new Minifier({src: this.src, dest: this.dest});
20
-
21
- try {
22
- // TODO: don't do this synchronously
23
- fs.mkdirSync(this.dest, {recursive: true});
24
- fs.copyFileSync(path.join(this.src, 'index.html'), path.join(this.dest, 'index.html'));
25
- } catch (error) {
26
- if (error.code === 'EACCES') {
27
- logging.error('Ghost was not able to write admin-auth asset files due to permissions.');
28
- return;
29
- }
30
-
31
- throw error;
32
- }
33
- }
34
-
35
- /**
36
- * @override
37
- */
38
- generateGlobs() {
39
- return {
40
- 'admin-auth.min.js': '*.js'
41
- };
42
- }
43
-
44
- /**
45
- * @private
46
- */
47
- generateReplacements() {
48
- // Clean the URL, only keep schema, host and port (without trailing slashes or subdirectory)
49
- const url = new URL(urlUtils.getSiteUrl());
50
- const origin = url.origin;
51
-
52
- return {
53
- // Properly encode the origin
54
- '\'{{SITE_ORIGIN}}\'': JSON.stringify(origin)
55
- };
56
- }
57
-
58
- /**
59
- * Minify, move into the destination directory, and clear existing asset files.
60
- *
61
- * @override
62
- * @returns {Promise<void>}
63
- */
64
- async load() {
65
- const globs = this.generateGlobs();
66
- const replacements = this.generateReplacements();
67
- await this.minify(globs, {replacements});
68
- }
69
- };
@@ -1,33 +0,0 @@
1
- const path = require('path');
2
- const config = require('../../../shared/config');
3
- const Minifier = require('./Minifier');
4
- const AssetsMinificationBase = require('./AssetsMinificationBase');
5
-
6
- module.exports = class CommentCountsAssets extends AssetsMinificationBase {
7
- constructor(options = {}) {
8
- super(options);
9
-
10
- this.src = options.src || path.join(config.get('paths').assetSrc, 'comment-counts');
11
- this.dest = options.dest || config.getContentPath('public');
12
- this.minifier = new Minifier({src: this.src, dest: this.dest});
13
-
14
- this.files = [];
15
- }
16
-
17
- /**
18
- * @override
19
- */
20
- generateGlobs() {
21
- return {
22
- 'comment-counts.min.js': 'js/*.js'
23
- };
24
- }
25
-
26
- /**
27
- * @override
28
- */
29
- async load() {
30
- const globs = this.generateGlobs();
31
- this.files = await this.minify(globs);
32
- }
33
- };
@@ -1,45 +0,0 @@
1
- const path = require('path');
2
- const config = require('../../../shared/config');
3
- const Minifier = require('./Minifier');
4
- const AssetsMinificationBase = require('./AssetsMinificationBase');
5
-
6
- module.exports = class MemberAttributionAssets extends AssetsMinificationBase {
7
- constructor(options = {}) {
8
- super(options);
9
-
10
- /** @private */
11
- this.src = options.src || path.join(config.get('paths').assetSrc, 'member-attribution');
12
- /** @private */
13
- this.dest = options.dest || config.getContentPath('public');
14
-
15
- this.minifier = new Minifier({src: this.src, dest: this.dest});
16
- }
17
-
18
- /**
19
- * @override
20
- */
21
- generateGlobs() {
22
- return {
23
- 'member-attribution.min.js': '*.js'
24
- };
25
- }
26
-
27
- /**
28
- * @private
29
- */
30
- generateReplacements() {
31
- return {};
32
- }
33
-
34
- /**
35
- * Minify, move into the destination directory, and clear existing asset files.
36
- *
37
- * @override
38
- * @returns {Promise<void>}
39
- */
40
- async load() {
41
- const globs = this.generateGlobs();
42
- const replacements = this.generateReplacements();
43
- await this.minify(globs, {replacements});
44
- }
45
- };
@@ -1,6 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <script src="admin-auth.min.js"></script>
5
- </head>
6
- </html>
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../../../.eslintrc.js",
3
- "env": {
4
- "browser": true,
5
- "node": false
6
- },
7
- "rules": {
8
- "no-console": "off"
9
- }
10
- }