mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Update dependency @tryghost/url-utils to v3 (#14705)
- updated usage of url-utils.urlFor to work with v3 Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Hannah Wolfe <github.erisds@gmail.com>
This commit is contained in:
parent
dde9a5462a
commit
9aa8e3e7ff
6 changed files with 16 additions and 12 deletions
|
@ -288,7 +288,7 @@ async function initServices({config}) {
|
|||
appService.init(),
|
||||
apiVersionCompatibility.init(),
|
||||
scheduling.init({
|
||||
apiUrl: urlUtils.urlFor('api', {version: defaultApiVersion, versionType: 'admin'}, true)
|
||||
apiUrl: urlUtils.urlFor('api', {type: 'admin'}, true)
|
||||
})
|
||||
]);
|
||||
debug('End: Services');
|
||||
|
|
|
@ -52,7 +52,7 @@ function createSettingsInstance(config) {
|
|||
return updateEmailTemplate({url, email, siteTitle});
|
||||
},
|
||||
getSigninURL(token, type) {
|
||||
const signinURL = new URL(getApiUrl({version: 'v4', type: 'admin'}));
|
||||
const signinURL = new URL(urlUtils.urlFor('api', {type: 'admin'}, true));
|
||||
signinURL.pathname = path.join(signinURL.pathname, '/settings/members/email/');
|
||||
signinURL.searchParams.set('token', token);
|
||||
signinURL.searchParams.set('action', type);
|
||||
|
@ -60,10 +60,6 @@ function createSettingsInstance(config) {
|
|||
}
|
||||
};
|
||||
|
||||
const getApiUrl = ({version, type}) => {
|
||||
return urlUtils.urlFor('api', {version: version, versionType: type}, true);
|
||||
};
|
||||
|
||||
const magicLinkService = new MagicLink({
|
||||
transporter,
|
||||
tokenProvider: new SingleUseTokenProvider(models.SingleUseToken, MAGIC_LINK_TOKEN_VALIDITY),
|
||||
|
|
|
@ -7,8 +7,6 @@ const urlUtils = new UrlUtils({
|
|||
getSubdir: config.getSubdir,
|
||||
getSiteUrl: config.getSiteUrl,
|
||||
getAdminUrl: config.getAdminUrl,
|
||||
apiVersions: config.get('api:versions'),
|
||||
defaultApiVersion: config.get('api:versions:default'),
|
||||
slugs: config.get('slugs').protected,
|
||||
redirectCacheMaxAge: config.get('caching:301:maxAge'),
|
||||
baseApiPath: BASE_API_PATH
|
||||
|
|
|
@ -110,7 +110,7 @@
|
|||
"@tryghost/string": "0.1.23",
|
||||
"@tryghost/tpl": "0.1.16",
|
||||
"@tryghost/update-check-service": "0.3.2",
|
||||
"@tryghost/url-utils": "2.1.0",
|
||||
"@tryghost/url-utils": "3.0.0",
|
||||
"@tryghost/validator": "0.1.24",
|
||||
"@tryghost/verification-trigger": "0.2.3",
|
||||
"@tryghost/version": "0.1.14",
|
||||
|
|
|
@ -45,8 +45,6 @@ const stubUrlUtils = (options, sandbox) => {
|
|||
// Method for regressions tests must be used with restore method
|
||||
const stubUrlUtilsFromConfig = () => {
|
||||
const options = {
|
||||
apiVersions: config.get('api:versions'),
|
||||
defaultApiVersion: 'canary',
|
||||
slugs: config.get('slugs').protected,
|
||||
redirectCacheMaxAge: config.get('caching:301:maxAge'),
|
||||
baseApiPath: '/ghost/api'
|
||||
|
|
14
yarn.lock
14
yarn.lock
|
@ -2488,7 +2488,19 @@
|
|||
lodash "^4.17.21"
|
||||
moment "^2.24.0"
|
||||
|
||||
"@tryghost/url-utils@2.1.0", "@tryghost/url-utils@^2.0.0":
|
||||
"@tryghost/url-utils@3.0.0":
|
||||
version "3.0.0"
|
||||
resolved "https://registry.yarnpkg.com/@tryghost/url-utils/-/url-utils-3.0.0.tgz#b289e7011cd80e4b6078392841410ea22aac26dc"
|
||||
integrity sha512-+wo9/WMOZjUNM9rD1GWkFlTIzz8ia8kBI7kc9xDazw9V9xizqikQElnO8o+V/McbpK0xSUSLYwklJDGj1IKZkQ==
|
||||
dependencies:
|
||||
cheerio "^0.22.0"
|
||||
moment "^2.27.0"
|
||||
moment-timezone "^0.5.31"
|
||||
remark "^11.0.2"
|
||||
remark-footnotes "^1.0.0"
|
||||
unist-util-visit "^2.0.0"
|
||||
|
||||
"@tryghost/url-utils@^2.0.0":
|
||||
version "2.1.0"
|
||||
resolved "https://registry.yarnpkg.com/@tryghost/url-utils/-/url-utils-2.1.0.tgz#5b30921eeb27fdcb9c1fc1360879a0d99304ddf2"
|
||||
integrity sha512-3oID3Pzgew17eZF6YpJvG4Iy8F5CDealvcZ3zRwGFBT/oSUBGHY4nQfAUAH0Uo7dPAEDx9zOcMyNk/cJ/VN3nQ==
|
||||
|
|
Loading…
Add table
Reference in a new issue