972c25edc7
refs https://github.com/TryGhost/Team/issues/1899 - Added `addEmailAttributionToUrl` method to MemberAttributionService. This adds both the source attribution (`rel=newsletter`) and member attribution (`?attribution_id=123&attribution_type=post`) to a URL. - The URLHistory can now contain a new sort of items: `{type: 'post', id: 'post-id', time: 123}`. - Updated frontend script to read `?attribution_id=123&attribution_type=post` from the URL and add it to the URLHistory + clear it from the URL. - Wired up some external dependencies to LinkReplacementService and added some dummy code. - Increased test coverage of attribution service - Moved all logic that removes the subdirectory from a URL to the UrlTranslator instead of the AttributionBuilder - The UrlTranslator now parses a URLHistoryItem to an object that can be used to build an Attribution instance - Excluded sites with different domain from member id and attribution tracking
30 lines
826 B
JSON
30 lines
826 B
JSON
{
|
|
"name": "@tryghost/link-replacement",
|
|
"version": "0.0.0",
|
|
"repository": "https://github.com/TryGhost/Ghost/tree/main/packages/link-replacement",
|
|
"author": "Ghost Foundation",
|
|
"private": true,
|
|
"main": "index.js",
|
|
"scripts": {
|
|
"dev": "echo \"Implement me!\"",
|
|
"test:unit": "NODE_ENV=testing c8 --all --check-coverage --reporter text --reporter cobertura mocha './test/**/*.test.js'",
|
|
"test": "yarn test:unit",
|
|
"lint:code": "eslint *.js lib/ --ext .js --cache",
|
|
"lint": "yarn lint:code && yarn lint:test",
|
|
"lint:test": "eslint -c test/.eslintrc.js test/ --ext .js --cache"
|
|
},
|
|
"files": [
|
|
"index.js",
|
|
"lib"
|
|
],
|
|
"devDependencies": {
|
|
"c8": "7.12.0",
|
|
"mocha": "10.0.0",
|
|
"should": "13.2.3",
|
|
"sinon": "14.0.0"
|
|
},
|
|
"dependencies": {
|
|
"cheerio": "0.22.0"
|
|
}
|
|
}
|