Skip to content

Commit d440705

Browse files
chore: updates to allow usage of newer cda client [] (#1588)
* build(deps): bump contentful from 9.3.5 to 10.6.9 * chore: newer cda client uses a different way of disabling link resolution [] * chore: newer cda client uses a different way of requesting all locales [] Bumps [contentful](https://github.com/contentful/contentful.js) from 9.3.5 to 10.6.9. - [Release notes](https://github.com/contentful/contentful.js/releases) - [Commits](contentful/contentful.js@v9.3.5...v10.6.9) --- updated-dependencies: - dependency-name: contentful dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 7a6be02 commit d440705

File tree

5 files changed

+77
-137
lines changed

5 files changed

+77
-137
lines changed

lib/tasks/get-space-data.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,11 @@ export default function getFullSourceSpace ({
8888
{
8989
title: 'Fetching content entries data',
9090
task: wrapTask((ctx) => {
91-
const source = cdaClient || ctx.environment
91+
const source = cdaClient?.withAllLocales || ctx.environment
9292
if (cdaClient) {
9393
// let's not fetch children when using Content Delivery API
9494
queryEntries = queryEntries || {}
9595
queryEntries.include = 0
96-
queryEntries.locale = '*'
9796
}
9897
return pagedGet({ source, method: 'getEntries', query: queryEntries })
9998
.then(extractItems)
@@ -109,9 +108,8 @@ export default function getFullSourceSpace ({
109108
{
110109
title: 'Fetching assets data',
111110
task: wrapTask((ctx) => {
112-
const source = cdaClient || ctx.environment
111+
const source = cdaClient?.withAllLocales || ctx.environment
113112
queryAssets = queryAssets || {}
114-
queryAssets.locale = '*'
115113
return pagedGet({ source, method: 'getAssets', query: queryAssets })
116114
.then(extractItems)
117115
.then((items) => filterDrafts(items, includeDrafts, cdaClient))
@@ -191,7 +189,7 @@ function pagedGet ({ source, method, skip = 0, aggregatedResponse = null, query
191189
}
192190
const fullQuery = Object.assign({},
193191
{
194-
skip: skip,
192+
skip,
195193
order: 'sys.createdAt,sys.id'
196194
},
197195
query,

lib/tasks/init-client.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ export default function initClient (opts, useCda = false) {
1919
const cdaConfig = {
2020
space: config.spaceId,
2121
accessToken: config.deliveryToken,
22-
environment: config.environmentId,
23-
resolveLinks: false
22+
environment: config.environmentId
2423
}
25-
return createCdaClient(cdaConfig)
24+
return createCdaClient(cdaConfig).withoutLinkResolution
2625
}
2726
return createCmaClient(config)
2827
}

0 commit comments

Comments
 (0)