Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/tasks/init-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export default function initClient (opts) {
...defaultOpts,
...opts
}
return createClient(config)
return createClient(config, { type: 'legacy' })
}
100 changes: 51 additions & 49 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"bluebird": "^3.7.2",
"cli-table3": "^0.6.5",
"contentful-batch-libs": "^9.6.0",
"contentful-management": "^11.63.1",
"contentful-management": "12.0.0-new-beta.14",
"date-fns": "^2.30.0",
"eslint": "^8.57.1",
"eslint-config-standard": "^17.1.0",
Expand Down
15 changes: 8 additions & 7 deletions test/integration/import-lib.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const withAssetsSpaceFile = join(__dirname, 'exports/with-assets/space-with-down
const assetsDirectory = join(__dirname, 'exports/with-assets')

let space
let client

type Error = {
errors: {
Expand All @@ -24,13 +25,13 @@ type Error = {
jest.setTimeout(1.5 * 60 * 1000) // 1.5min timeout

beforeEach(async () => {
const client = createClient({ accessToken: managementToken })
space = await client.createSpace({ name: 'IMPORT [AUTO] TOOL TMP' }, orgId)
client = createClient({ accessToken: managementToken })
space = await client.space.create({ organizationId: orgId }, { name: 'IMPORT [AUTO] TOOL TMP' })
})

afterEach(async () => {
if (space) {
await space.delete()
await client.space.delete({ spaceId: space.sys.id })
}
})

Expand Down Expand Up @@ -69,7 +70,7 @@ test('It should import a space properly when used as a lib', async () => {
})
expect(failedPublishErrors).toHaveLength(0)

await space.delete()
await client.space.delete({ spaceId: space.sys.id })
// Ensures that there is no deletion attempt in the afterEach function if the
// deletion had been successful
space = undefined
Expand Down Expand Up @@ -112,7 +113,7 @@ test('It should import a space with assets properly when used as a lib', async (
return true
})
expect(failedPublishErrors).toHaveLength(0)
await space.delete()
await client.space.delete({ spaceId: space.sys.id })
// Ensures that there is no deletion attempt in the afterEach function if the
// deletion had been successful
space = undefined
Expand All @@ -132,7 +133,7 @@ test('It should import a space with custom editor interfaces properly when used

await wrappedFunc()

const localClient = createClient({ accessToken: managementToken }, { type: 'plain' })
const localClient = createClient({ accessToken: managementToken })
const editorInterfaces = await localClient.editorInterface.getMany({
spaceId: space.sys.id,
environmentId: 'master'
Expand All @@ -148,7 +149,7 @@ test('It should import a space with custom editor interfaces properly when used
widgetNamespace: 'app'
})

await space.delete()
await client.space.delete({ spaceId: space.sys.id })
// Ensures that there is no deletion attempt in the afterEach function if the
// deletion had been successful
space = undefined
Expand Down
2 changes: 1 addition & 1 deletion test/unit/transform/transform-space.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {

import transformSpace from '../../../lib/transform/transform-space'
import { Resources, TransformedSourceData } from '../../../lib/types'
import { TagSysProps } from 'contentful-management/dist/typings/entities/tag'
import { TagSysProps } from 'contentful-management'
import type { AssetProps, LocaleProps, WebhookProps } from 'contentful-management'

const tagMock = {
Expand Down
Loading