{"_id":"@kontent-ai-consulting/migration-toolkit","_rev":"37-4093bc2d41faf826c203fe413aca2838","name":"@kontent-ai-consulting/migration-toolkit","dist-tags":{"latest":"0.1.8","next":"1.0.0-29"},"versions":{"0.1.1":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.1","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.1","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"86fa648dd63a2fa7226102784a9ae39540cadb7e","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.1.tgz","fileCount":173,"integrity":"sha512-p/rBcvn7iQTXg/x5mTKzYFQCSdFVYs6xXgPC6StuKCD+Hyck/PcktaqurmB8wu/xr5MmpaDRMGYU03LQNhwpeg==","signatures":[{"sig":"MEUCIF/dH7HLVfqrznGDFNQPhKZA93HmZVlIkWRPyhCDwnhhAiEA6qKqViUSf/JGCrF4v0Xg4l07icU0POQj1df6FOO9aYM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":436961},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"70a3011474bae2eedfc0e885d87200d74bdc32e0","private":false,"scripts":{"lint":"npx eslint lib","test":"echo \"no global test configured\"","build":"npm run clean && npm run build:es2022","clean":"node clean.js","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --help","test:export":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json ","test:import":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --config=import-config.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"ts-node --project tsconfig.script.json ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"9.8.1","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.6.0","@kontent-ai/management-sdk":"5.8.2","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.6.2","eslint":"8.57.0","ts-node":"10.9.2","typescript":"5.3.3","@types/mime":"3.0.4","@types/node":"20.11.21","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.1.0","@typescript-eslint/eslint-plugin":"7.1.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.1_1709125218442_0.5529157434042071","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"0.1.2":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.2","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.2","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"6a5eb2fcd3180caaa3a2328e223b0dfdf8384941","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.2.tgz","fileCount":173,"integrity":"sha512-IANEgXo4AD+eIfBB973OKoDT44AgB0EuuEIkka9FGCE+2892byQTIZMRz85DkdOs4TDRK9gz76Izz2ULUalRMA==","signatures":[{"sig":"MEUCIEHMnGPdqe2NNIJa0rzNHeCC65ioVF/E3e40ZAJTuBl2AiEAtBqW92cC0I2lq19HvoMcJ66YOQbAQvnGR8SQCSa7/fU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":437912},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"060cbcb44a6f874b06a5fbe5043f521949985349","private":false,"scripts":{"lint":"npx eslint lib","test":"echo \"no global test configured\"","build":"npm run clean && npm run build:es2022","clean":"node clean.js","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --help","test:export":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json ","test:import":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --config=import-config.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"ts-node --project tsconfig.script.json ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"9.8.1","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.6.0","@kontent-ai/management-sdk":"5.8.2","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.6.2","eslint":"8.57.0","ts-node":"10.9.2","typescript":"5.3.3","@types/mime":"3.0.4","@types/node":"20.11.21","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.1.0","@typescript-eslint/eslint-plugin":"7.1.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.2_1709149761474_0.19234943583850717","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"0.1.3":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.3","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.3","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"2287fe01f852a1be286daef74a5df5f7c117ed3e","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.3.tgz","fileCount":173,"integrity":"sha512-lkuwzimdoTq1vBhbC5KIHbK2obkHKVvZrofC7lWoBMFSxCyK9ZvVHuK8tg2BlpFKYbPopTeT1lrQLE+vRTQ6CQ==","signatures":[{"sig":"MEQCIHcLJaIZxafiuRWtm8iSFHzHnJV6XnvlMQmAkmOCFTWcAiBOIK1udJZ1FMsLiMVdJtkKE989iyvYTwAcDQ8R+UDlEw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":443339},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"a49335710b3a1181d72e40cfae5c557519133c24","private":false,"scripts":{"lint":"npx eslint lib","test":"echo \"no global test configured\"","build":"npm run clean && npm run build:es2022","clean":"node clean.js","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --help","test:export":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config-movie.json ","test:import":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --config=import-config-movie.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"ts-node --project tsconfig.script.json ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"9.8.1","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.7.0","@kontent-ai/management-sdk":"5.9.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.6.2","eslint":"8.57.0","ts-node":"10.9.2","typescript":"5.3.3","@types/mime":"3.0.4","@types/node":"20.11.22","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.1.0","@typescript-eslint/eslint-plugin":"7.1.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.3_1709207927724_0.36304239093294033","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"0.1.4":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.4","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.4","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"ccc13bfee8a506a8fff7a97dca81303543d999ae","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.4.tgz","fileCount":169,"integrity":"sha512-MGzI7DU4huIQJvY22d4bFB2/ESyibOwgOrwbakECm7Ma9Avp5/xqeVLDINne9fbh4vjBPM1WpwzE8iv6s52A6w==","signatures":[{"sig":"MEUCIQC1av5B37eT+WMm4ofR8xhsNd5g/Z1HIbxqEkmBRTCFUgIgCqTYMHJrtkFZmrPdzCtZCMk5MQ7W5rfXgYfxWt5GAik=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":459887},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"225b4a90aba41d00bf18725b1221458634bb6825","private":false,"scripts":{"lint":"npx eslint lib","test":"echo \"no global test configured\"","build":"npm run clean && npm run build:es2022","clean":"node clean.js","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --help","test:export":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config-movie.json ","test:import":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --config=import-config-movie.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"ts-node --project tsconfig.script.json ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"9.8.1","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.8.0","@kontent-ai/management-sdk":"5.9.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.6.2","eslint":"8.57.0","ts-node":"10.9.2","typescript":"5.3.3","@types/mime":"3.0.4","@types/node":"20.11.24","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.1.1","@typescript-eslint/eslint-plugin":"7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.4_1709797184255_0.8199213553123641","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"0.1.5":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.5","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.5","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"0cb60e73305fb6578214ff5eaa085ce570d050c0","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.5.tgz","fileCount":169,"integrity":"sha512-imFhRI1t1zMMFcKkPu/6XR6KjkvVaHqCAmouNU3ovz/kzdpf3uf2Fo1gj6lr5dFgNGd5I2Wq/pUM80jvVMdDpg==","signatures":[{"sig":"MEUCIFrxDBs8AYv9vY3mLq4G7X+3XO994A6QIN1Xa/3mpb5eAiEA0stZ8dDBdOMP6HnE/p3s4cX5yEBClUfrVaMvAKjllOE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463641},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"09f980bb533e422f1676e6180ffd2ddd3e8329fa","private":false,"scripts":{"lint":"npx eslint lib","test":"echo \"no global test configured\"","build":"npm run clean && npm run build:es2022","clean":"node clean.js","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --help","test:export":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config-movie.json ","test:import":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --config=import-config-movie.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"ts-node --project tsconfig.script.json ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"9.8.1","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.8.0","@kontent-ai/management-sdk":"5.9.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.6.2","eslint":"8.57.0","ts-node":"10.9.2","typescript":"5.3.3","@types/mime":"3.0.4","@types/node":"20.11.24","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.1.1","@typescript-eslint/eslint-plugin":"7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.5_1709800433362_0.6967493505635145","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"0.1.6":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.6","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.6","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"092a11631a2c4d07a772d3ebc76c5e58012778b6","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.6.tgz","fileCount":169,"integrity":"sha512-LpoMU1Q/pgP2taIJS5qa36ROm1+KZXVZ5l08G62EMFO+chIhG4kWuaRuktNoLGRSHYj8PuyYK9HzMFdoCukcyw==","signatures":[{"sig":"MEQCIFqG4vZZ31kkU73xPdS2L4xfuV8sj1xGBehz13rIYvefAiAF9zB0eRhmobK+jxMfPJZ6fXosTybRAy8nWBPjOiO+pA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":463746},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"2ceefa2041dbd71eaf6dcb9f8bfafe808313f875","private":false,"scripts":{"lint":"npx eslint lib","test":"echo \"no global test configured\"","build":"npm run clean && npm run build:es2022","clean":"node clean.js","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --help","test:export":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config-movie.json ","test:import":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --config=import-config-movie.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"ts-node --project tsconfig.script.json ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"9.8.1","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.8.0","@kontent-ai/management-sdk":"5.9.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.6.2","eslint":"8.57.0","ts-node":"10.9.2","typescript":"5.3.3","@types/mime":"3.0.4","@types/node":"20.11.24","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.1.1","@typescript-eslint/eslint-plugin":"7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.6_1709821837344_0.9645768643543491","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"0.1.7":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.7","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.7","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"f7974dc1588e14b769dc52e6197ef4ac9c91eeea","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.7.tgz","fileCount":169,"integrity":"sha512-+oU0gh9Z1cwYAhckSsdPDipTL93BEuQ28pkPYud972e99CQpKAIf2eAgXmH2dHaQqL+zjIBCMlhN1WkL4w8i4Q==","signatures":[{"sig":"MEYCIQD7Bh20t3rV4fcH0KHqFUv8NLCwhTihGkrazLrtr0NdeAIhAL+A7kS2OoBEatG3QXSQnDdX8s1ECPDZfvMEeFm9JGTZ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462388},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"c2d871a263e64afd0e42080cd3154287e3f63df7","private":false,"scripts":{"lint":"npx eslint lib","test":"echo \"no global test configured\"","build":"npm run clean && npm run build:es2022","clean":"node clean.js","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --help","test:export":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config-movie.json ","test:import":"npm run build && cd output && node --max-http-header-size 150000 ../dist/es2022/node/cli/app --config=import-config-movie.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"ts-node --project tsconfig.script.json ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"9.8.1","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"18.18.2","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.8.0","@kontent-ai/management-sdk":"5.9.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tslib":"2.6.2","eslint":"8.57.0","ts-node":"10.9.2","typescript":"5.3.3","@types/mime":"3.0.4","@types/node":"20.11.24","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.1.1","@typescript-eslint/eslint-plugin":"7.1.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.7_1710146551635_0.4063738201320557","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"0.1.8":{"name":"@kontent-ai-consulting/migration-toolkit","version":"0.1.8","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@0.1.8","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"22a3a26529f496a0c875b69184c01147784220f9","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-0.1.8.tgz","fileCount":169,"integrity":"sha512-bf4Yft7d8cUwAz88elFys1J418WmO12j9MjVyoSs39KHr165rnLZACk9mhzPVuOKhACpkgjqrPS+EQ7sH5/s8g==","signatures":[{"sig":"MEQCIHpkix/WjO8SCX4MDRAgz5Vv4AxE8zAP++rYWkijriFYAiASgunGo4iQ+lvmQ5cKXALy5idAMEIL4zGbbTtuk7N7Zg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":462078},"type":"module","types":"./dist/es2022/index.d.ts","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"6d2afa768f9d68cf9dd90aec243bd1cc2c5e244f","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd output && tsx ../lib/node/cli/app --config=export-config-movie.json ","test:import":"cd output && tsx ../lib/node/cli/app --config=import-config-movie.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build","update:version":"tsx ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json "},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.1","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/delivery-sdk":"14.8.0","@kontent-ai/management-sdk":"6.1.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"tsx":"4.7.1","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.3","@types/node":"20.12.3","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.5.0","@typescript-eslint/eslint-plugin":"7.5.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_0.1.8_1712128859454_0.9369650758210211","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-0":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-0","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-0","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"6d79678fe1609c64e48a7d06e69d484c8b35af84","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-0.tgz","fileCount":181,"integrity":"sha512-l4IWsEFQkbUkFdAemi9IEVRJbP3iznXn9Y5RzOG30uC9t2yMXB36NNcUtuhsKInyBUg/ZNHvOpLeoWRiF+jh/A==","signatures":[{"sig":"MEUCIEJI4Hv1tQyi04uY3QBVWtK3ED3jo0lBeOBpWDfrqGamAiEAqGis+2lyX5+Kl6zISHydqGTUvbwBowMo39C17Dq+IAU=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484716},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate migration to [Kontent.ai](https://kontent.ai) environment using a developer friendly abstraction layer where developers focus on data transformation from external systems rather then spending time on writing customized import scripts.\n\n> [!TIP]  \n> This library provides the tools for developers to prepare the data for migration in designated format (`json`, `csv`)\n> and `import` functionality (either in code or via CLI) to bring this over to your Kontent.ai environment.The tool\n> takes care of preparing content items, language variants, moving items through workflow, publishing, archiving,\n> uploading assets, retry policy and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n```\n\n# Migrating data from external / 3rd party systems\n\nIn order to import data into your Kontent.ai environment you first need to prepare the data you want to import and\nconvert them into appropriate format (see more at\nhttps://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit?tab=readme-ov-file#migration-models).\n\nYou have 2 options to prepare your data. Either you use `ExportToolkit` to fetch your data from external system and\nstore them on File system which you then use to import data. Or you can use `ImportToolkit` directly without storing\nanything on File system.\n\n### Option 1 - Use `ExportToolkit`\n\n1. Prepare the desired structure (content types, taxonomies...) in your Kontent.ai environment\n2. Write a custom `adapter` to download / fetch data from your system and convert it to appropriate formats defined by\n   this library & your content model\n3. Use `ExportToolkit` with your `adapter` which creates files on File system\n4. Import the generated export files into a target environment using `ImportToolkit.importFromFilesAsync` in code or via `CLI`\n\nAn example script can be found\n[here](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-with-files.ts)\n\n### Option 2 - Direct import\n\n1. Prepare the desired structure (content types, taxonomies...) in your Kontent.ai environment\n2. Write a code to download / fetch data from your system and convert it to appropriate formats defined by this library\n   & your content model\n3. Use `ImportToolkit.importAsync` function to directly import the data into your Kontent.ai environment\n\nAn example script can be found\n[here](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-directly.ts)\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly** (without proper testing). Instead you\n> should first create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that used `Content types`, `Taxonomies` and `Workflows` are consistent with the ones\n> defined in target environment. Any inconsistency in data such as referencing inexistent taxonomy term, incorrect\n> element type and other problems will cause import to fail.\n\n## How are content items & language variants imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated instead. The workflow of imported language variant will be\nset according to `workflow_step` and `workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times. Same goes for assets if you use `assetExternalId` when migrating assets over.\n\n## How are assets imported?\n\nIf asset exists in target project, the asset upload will be skipped and not uploaded at all. If asset doesn't exist, the\nasset from the zip folder will be uploaded. It is highly recommended that you set `assetExternalId` when migrating\nassets as that will prevent duplicate assets from being created if you run the migration multiple times.\n\n## Import Configuration\n\n| Config            | Value                                                                                                                                                   |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **action**        | Action. Available options: `import` & `export` **(required)**                                                                                           |\n| **environmentId** | Id of Kontent.ai project **(required)**                                                                                                                 |\n| **apiKey**        | Management API key **(required)**                                                                                                                       |\n| **format**        | Format used to export data. Available options: `csv`, `json` or custom implementation **(required)**                                                    |\n| **itemsFilename** | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename    | Name of the items file that will be used to parse assets (only zip supported)                                                                           |\n| baseUrl           | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems   | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force             | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI samples\n\n```bash\n# Import from zip:\nkontent-ai-migration-toolkit --action=import --apiKey=xxx --environmentId=xxx --format=json --itemsFilename=items.zip --assetsFilename=assets.zip\n\n# Import from json file:\nkontent-ai-migration-toolkit --action=import --apiKey=xxx --environmentId=xxx --format=json --itemsFilename=items.json\n\n# Import from csv file:\nkontent-ai-migration-toolkit --action=import --apiKey=xxx --environmentId=xxx --format=csv --itemsFilename=items.csv\n```\n\n## Importing in code\n\nExamples of importing in code can be found at:\n\n1. [Import from json](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-from-json.ts)\n1. [Import from csv](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-from-csv.ts)\n1. [Import from zip](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-from-zip-sample.ts)\n1. [Direct import without files](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-directly.ts)\n\n# Migration models\n\nThis tools uses simplified models to make migration simpler and more developer friendly. This is useful especially when\nmigrating from external systems because data structure is almost certainly very different to models used within\nKontent.ai APIs.\n\n### Model definitions\n\n> Models are defined at\n> https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/core/migration-models.ts\n\n```typescript\nexport type MigrationElementType =\n    | 'text'\n    | 'rich_text'\n    | 'number'\n    | 'multiple_choice'\n    | 'date_time'\n    | 'asset'\n    | 'modular_content'\n    | 'taxonomy'\n    | 'url_slug'\n    | 'guidelines'\n    | 'snippet'\n    | 'custom'\n    | 'subpages';\n\nexport interface IMigrationElement {\n    value: string | undefined | string[];\n    type: MigrationElementType;\n    codename: string;\n}\n\nexport interface IMigrationItem {\n    system: {\n        codename: string;\n        name: string;\n        language: string;\n        type: string;\n        collection: string;\n\n        // workflow_step & workflow is required for Content items, but optional for Component items\n        workflow_step?: string;\n        workflow?: string;\n    };\n    elements: IMigrationElement[];\n}\n\nexport interface IMigrationReference {\n    id?: string;\n    codename?: string;\n    external_id?: string;\n}\n\nexport interface IMigrationAsset {\n    _zipFilename: string;\n    binaryData: Buffer | Blob | undefined;\n    filename: string;\n    title: string;\n\n    assetId?: string;\n    assetExternalId?: string;\n    codename?: string;\n    collection?: IMigrationReference;\n    folder?: IMigrationReference;\n}\n```\n\n### Model examples\n\nA single record of `IMigrationItem` type in `json` format may look like this:\n\n```json\n{\n    \"system\": {\n        \"codename\": \"_the_dark_knight_rises\",\n        \"collection\": \"default\",\n        \"language\": \"en\",\n        \"name\": \" The Dark Knight Rises\",\n        \"type\": \"movie\",\n        \"workflow_step\": \"published\",\n        \"workflow\": \"default\"\n    },\n    \"elements\": {\n        \"title\": \"The Dark Knight Rises\",\n        \"plot\": \"<p>Eight years after the Joker's reign of anarchy, the Dark Knight, with the help of the enigmatic Selina, is forced from his imposed exile to save Gotham City, now on the edge of total annihilation, from the brutal guerrilla terrorist Bane.</p>\",\n        \"released\": \"2012-07-20T00:00:00Z\",\n        \"length\": 164,\n        \"poster\": [\n            \"https://assets-eu-01.kc-usercontent.com:443/cdbf5823-cbec-010d-f4c3-0411eee31c0e/787c8c83-16b4-40b4-878e-b90b6d42a4ef/the_dark_knight_rises.jpg\"\n        ],\n        \"category\": [\"sci_fi\", \"action\"],\n        \"stars\": [\"christian_bale\", \"anne_hathaway\", \"tom_hardy\"],\n        \"seoname\": \"the-dark-knight-rises\",\n        \"releasecategory\": []\n    }\n}\n```\n\n> You may find sample export (`.zip`) with both items & assets at\n> https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/tree/main/samples/export-data\n\n# Export items & assets from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Export from Kontent.ai Configuration\n\n| Config               | Value                                                                                                                                                                                                                 |\n| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **action**           | Action. Available options: `import` & `export` **(required)**                                                                                                                                                         |\n| **environmentId**    | Id of Kontent.ai environment **(required)**                                                                                                                                                                           |\n| **managementApiKey** | Management API key of Kontent.ai environment. Need to fetch assets. **(required)**                                                                                                                                    |\n| **adapter**          | Adapter used to export data into known format that can be used for importing data. Available options: `kontentAi` **(required)**                                                                                      |\n| **format**           | Format used to export data. Available options: `csv`, `json` **(required)**                                                                                                                                           |\n| secureApiKey         | API key for secure Access. `isSecure` also needs to be enabled                                                                                                                                                        |\n| previewApiKey        | API key for preview. `isPreview` also needs to be enabled                                                                                                                                                             |\n| isSecure             | When set to `true`, Secure API will be used to make data export. Defaults to `false`                                                                                                                                  |\n| isPreview            | When set to `true`, Preview API will be used to make data export. Defaults to `false`                                                                                                                                 |\n| exporTypes           | CSV of content type codenames of which content items will be exported. If none is provided, all types are exported                                                                                                    |\n| exporLanguages       | CSV of language codenames of which content items will be exported. If none is provided, all types are exported                                                                                                        |\n| replaceInvalidLinks  | RTE may contain links to invalid items. You won't be able to re-import such items due to validation error. By setting this to `true` the Migration Toolkit will automatically remove these links. Defaults to `false` |\n| itemsFilename        | Name of the items file that will be created in folder where script is run                                                                                                                                             |\n| assetsFilename       | Name of the assets file that will be created in folder where script is run. Only zip is supported.                                                                                                                    |\n| baseUrl              | Custom base URL for Kontent.ai API calls                                                                                                                                                                              |\n\n## Export CLI samples\n\n```bash\n# Export from Kontent.ai environment as json\nkontent-ai-migration-toolkit --action=export --adapter=kontentAi --environmentId=xxx --format=json\n\n# Export from Kontent.ai environment as csv\nkontent-ai-migration-toolkit --action=export --adapter=kontentAi --environmentId=xxx --format=csv\n```\n\n## Exporting in code\n\nYou may customize what items get exported by using the `customItemsExport` option when exporting in code. This option\nallows you to export exactly the items you need, however be aware that the exported items may reference other items that\nyou might not export and subsequent re-import may fail because of the fact that there are missing items.\n\nExamples:\n\n1. [Export from Kontent.ai environment](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-kontent-ai.ts)\n1. [Custom export with files](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-with-files.ts)\n1. [Custom export and direct import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-directly.ts)\n\n## CLI help\n\nTo see available commands use:\n\n```bash\nkontent-ai-migration-toolkit --help\n```\n\n## Use with config file\n\nCreate a `json` configuration file in the folder where you are attempting to run script. (e.g. `export-config.json`)\n\n```json\n{\n    \"environmentId\": \"x\",\n    \"secureApiKey\": \"y\",\n    \"adapter\": \"kontentAi\",\n    \"isSecure\": true,\n    \"isPreview\": false,\n    \"action\": \"export\",\n    \"baseUrl\": null,\n    \"format\": \"json\" // or 'csv'\n}\n```\n\nTo execute your action run:\n\n```bash\nkontent-ai-migration-toolkit --config=export-config.json\n```\n\n## Code samples for import & export\n\nSee https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/tree/main/samples for examples of how to run\nthis library in code rather then via command line.\n\n## Output / Input formats\n\nThis library provides `csv` and `json` formats out of the box. However, you can create your own format by implementing\n`IFormatService` and supplying that to import / export functions. This is useful if you need to extend the existing\nformat, change how it's processing or just support new formats such as `xliff`, `xlxs`, `xml` or other.\n\nFollowing is a list of `built-in` format services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `csv`  | `ItemCsvProcessorService `  | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-csv-processor.service.ts         |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## Limitations\n\n-   Language variants in `Scheduled` workflow step exported with built-in Kontent.ai export adapter are not imported\n    with this state as the information about scheduled time is missing in API response.\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"4ab0550515c232f4a15a2aa58579166a89a75f77","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd output && tsx ../lib/node/cli/app --config=export-config-bein.json ","test:import":"cd output && tsx ../lib/node/cli/app --config=import-config-bein.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json ","test:export-via-code":"cd output && tsx test-export.ts"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.2.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.9.1","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.8","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.8.0","@typescript-eslint/eslint-plugin":"7.8.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-0_1714900177102_0.3298056583646807","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-1":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-1","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-1","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"aa52d702aa1706589f0f1aca8ed2c80c40a21d45","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-1.tgz","fileCount":181,"integrity":"sha512-JiwJk5ChwgWvddwR1/2SEsuD5aDuJpl97a0FUJpnU/s5E42bOdPIsdBShdSaTDu0Z5MFOzpHW921VcF6kNJGVw==","signatures":[{"sig":"MEYCIQCzXDx1WoRERis4uoOk78MtUg3hx0SA/i05tWtrmvGNugIhAKG7gNQWBLL+YrbGfF5Wvz8XgUqHFUcXYxUQ8hoqLPXy","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":485612},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate migration to [Kontent.ai](https://kontent.ai) environment using a developer friendly abstraction layer where developers focus on data transformation from external systems rather then spending time on writing customized import scripts.\n\n> [!TIP]  \n> This library provides the tools for developers to prepare the data for migration in designated format (`json`, `csv`)\n> and `import` functionality (either in code or via CLI) to bring this over to your Kontent.ai environment.The tool\n> takes care of preparing content items, language variants, moving items through workflow, publishing, archiving,\n> uploading assets, retry policy and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n```\n\n# Migrating data from external / 3rd party systems\n\nIn order to import data into your Kontent.ai environment you first need to prepare the data you want to import and\nconvert them into appropriate format (see more at\nhttps://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit?tab=readme-ov-file#migration-models).\n\nYou have 2 options to prepare your data. Either you use `ExportToolkit` to fetch your data from external system and\nstore them on File system which you then use to import data. Or you can use `ImportToolkit` directly without storing\nanything on File system.\n\n### Option 1 - Use `ExportToolkit`\n\n1. Prepare the desired structure (content types, taxonomies...) in your Kontent.ai environment\n2. Write a custom `adapter` to download / fetch data from your system and convert it to appropriate formats defined by\n   this library & your content model\n3. Use `ExportToolkit` with your `adapter` which creates files on File system\n4. Import the generated export files into a target environment using `ImportToolkit.importFromFilesAsync` in code or via `CLI`\n\nAn example script can be found\n[here](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-with-files.ts)\n\n### Option 2 - Direct import\n\n1. Prepare the desired structure (content types, taxonomies...) in your Kontent.ai environment\n2. Write a code to download / fetch data from your system and convert it to appropriate formats defined by this library\n   & your content model\n3. Use `ImportToolkit.importAsync` function to directly import the data into your Kontent.ai environment\n\nAn example script can be found\n[here](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-directly.ts)\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly** (without proper testing). Instead you\n> should first create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that used `Content types`, `Taxonomies` and `Workflows` are consistent with the ones\n> defined in target environment. Any inconsistency in data such as referencing inexistent taxonomy term, incorrect\n> element type and other problems will cause import to fail.\n\n## How are content items & language variants imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated instead. The workflow of imported language variant will be\nset according to `workflow_step` and `workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times. Same goes for assets if you use `assetExternalId` when migrating assets over.\n\n## How are assets imported?\n\nIf asset exists in target project, the asset upload will be skipped and not uploaded at all. If asset doesn't exist, the\nasset from the zip folder will be uploaded. It is highly recommended that you set `assetExternalId` when migrating\nassets as that will prevent duplicate assets from being created if you run the migration multiple times.\n\n## Import Configuration\n\n| Config            | Value                                                                                                                                                   |\n| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **action**        | Action. Available options: `import` & `export` **(required)**                                                                                           |\n| **environmentId** | Id of Kontent.ai project **(required)**                                                                                                                 |\n| **apiKey**        | Management API key **(required)**                                                                                                                       |\n| **format**        | Format used to export data. Available options: `csv`, `json` or custom implementation **(required)**                                                    |\n| **itemsFilename** | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename    | Name of the items file that will be used to parse assets (only zip supported)                                                                           |\n| baseUrl           | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems   | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force             | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI samples\n\n```bash\n# Import from zip:\nkontent-ai-migration-toolkit --action=import --apiKey=xxx --environmentId=xxx --format=json --itemsFilename=items.zip --assetsFilename=assets.zip\n\n# Import from json file:\nkontent-ai-migration-toolkit --action=import --apiKey=xxx --environmentId=xxx --format=json --itemsFilename=items.json\n\n# Import from csv file:\nkontent-ai-migration-toolkit --action=import --apiKey=xxx --environmentId=xxx --format=csv --itemsFilename=items.csv\n```\n\n## Importing in code\n\nExamples of importing in code can be found at:\n\n1. [Import from json](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-from-json.ts)\n1. [Import from csv](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-from-csv.ts)\n1. [Import from zip](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-from-zip-sample.ts)\n1. [Direct import without files](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-directly.ts)\n\n# Migration models\n\nThis tools uses simplified models to make migration simpler and more developer friendly. This is useful especially when\nmigrating from external systems because data structure is almost certainly very different to models used within\nKontent.ai APIs.\n\n### Model definitions\n\n> Models are defined at\n> https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/core/migration-models.ts\n\n```typescript\nexport type MigrationElementType =\n    | 'text'\n    | 'rich_text'\n    | 'number'\n    | 'multiple_choice'\n    | 'date_time'\n    | 'asset'\n    | 'modular_content'\n    | 'taxonomy'\n    | 'url_slug'\n    | 'guidelines'\n    | 'snippet'\n    | 'custom'\n    | 'subpages';\n\nexport interface IMigrationElement {\n    value: string | undefined | string[];\n    type: MigrationElementType;\n    codename: string;\n}\n\nexport interface IMigrationItem {\n    system: {\n        codename: string;\n        name: string;\n        language: string;\n        type: string;\n        collection: string;\n\n        // workflow_step & workflow is required for Content items, but optional for Component items\n        workflow_step?: string;\n        workflow?: string;\n    };\n    elements: IMigrationElement[];\n}\n\nexport interface IMigrationReference {\n    id?: string;\n    codename?: string;\n    external_id?: string;\n}\n\nexport interface IMigrationAsset {\n    _zipFilename: string;\n    binaryData: Buffer | Blob | undefined;\n    filename: string;\n    title: string;\n\n    assetId?: string;\n    assetExternalId?: string;\n    codename?: string;\n    collection?: IMigrationReference;\n    folder?: IMigrationReference;\n}\n```\n\n### Model examples\n\nA single record of `IMigrationItem` type in `json` format may look like this:\n\n```json\n{\n    \"system\": {\n        \"codename\": \"_the_dark_knight_rises\",\n        \"collection\": \"default\",\n        \"language\": \"en\",\n        \"name\": \" The Dark Knight Rises\",\n        \"type\": \"movie\",\n        \"workflow_step\": \"published\",\n        \"workflow\": \"default\"\n    },\n    \"elements\": {\n        \"title\": \"The Dark Knight Rises\",\n        \"plot\": \"<p>Eight years after the Joker's reign of anarchy, the Dark Knight, with the help of the enigmatic Selina, is forced from his imposed exile to save Gotham City, now on the edge of total annihilation, from the brutal guerrilla terrorist Bane.</p>\",\n        \"released\": \"2012-07-20T00:00:00Z\",\n        \"length\": 164,\n        \"poster\": [\n            \"https://assets-eu-01.kc-usercontent.com:443/cdbf5823-cbec-010d-f4c3-0411eee31c0e/787c8c83-16b4-40b4-878e-b90b6d42a4ef/the_dark_knight_rises.jpg\"\n        ],\n        \"category\": [\"sci_fi\", \"action\"],\n        \"stars\": [\"christian_bale\", \"anne_hathaway\", \"tom_hardy\"],\n        \"seoname\": \"the-dark-knight-rises\",\n        \"releasecategory\": []\n    }\n}\n```\n\n> You may find sample export (`.zip`) with both items & assets at\n> https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/tree/main/samples/export-data\n\n# Export items & assets from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Export from Kontent.ai Configuration\n\n| Config               | Value                                                                                                                                                                                                                 |\n| -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **action**           | Action. Available options: `import` & `export` **(required)**                                                                                                                                                         |\n| **environmentId**    | Id of Kontent.ai environment **(required)**                                                                                                                                                                           |\n| **managementApiKey** | Management API key of Kontent.ai environment. Need to fetch assets. **(required)**                                                                                                                                    |\n| **adapter**          | Adapter used to export data into known format that can be used for importing data. Available options: `kontentAi` **(required)**                                                                                      |\n| **format**           | Format used to export data. Available options: `csv`, `json` **(required)**                                                                                                                                           |\n| secureApiKey         | API key for secure Access. `isSecure` also needs to be enabled                                                                                                                                                        |\n| previewApiKey        | API key for preview. `isPreview` also needs to be enabled                                                                                                                                                             |\n| isSecure             | When set to `true`, Secure API will be used to make data export. Defaults to `false`                                                                                                                                  |\n| isPreview            | When set to `true`, Preview API will be used to make data export. Defaults to `false`                                                                                                                                 |\n| exporTypes           | CSV of content type codenames of which content items will be exported. If none is provided, all types are exported                                                                                                    |\n| exporLanguages       | CSV of language codenames of which content items will be exported. If none is provided, all types are exported                                                                                                        |\n| replaceInvalidLinks  | RTE may contain links to invalid items. You won't be able to re-import such items due to validation error. By setting this to `true` the Migration Toolkit will automatically remove these links. Defaults to `false` |\n| itemsFilename        | Name of the items file that will be created in folder where script is run                                                                                                                                             |\n| assetsFilename       | Name of the assets file that will be created in folder where script is run. Only zip is supported.                                                                                                                    |\n| baseUrl              | Custom base URL for Kontent.ai API calls                                                                                                                                                                              |\n\n## Export CLI samples\n\n```bash\n# Export from Kontent.ai environment as json\nkontent-ai-migration-toolkit --action=export --adapter=kontentAi --environmentId=xxx --format=json\n\n# Export from Kontent.ai environment as csv\nkontent-ai-migration-toolkit --action=export --adapter=kontentAi --environmentId=xxx --format=csv\n```\n\n## Exporting in code\n\nYou may customize what items get exported by using the `customItemsExport` option when exporting in code. This option\nallows you to export exactly the items you need, however be aware that the exported items may reference other items that\nyou might not export and subsequent re-import may fail because of the fact that there are missing items.\n\nExamples:\n\n1. [Export from Kontent.ai environment](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-kontent-ai.ts)\n1. [Custom export with files](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-with-files.ts)\n1. [Custom export and direct import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-directly.ts)\n\n## CLI help\n\nTo see available commands use:\n\n```bash\nkontent-ai-migration-toolkit --help\n```\n\n## Use with config file\n\nCreate a `json` configuration file in the folder where you are attempting to run script. (e.g. `export-config.json`)\n\n```json\n{\n    \"environmentId\": \"x\",\n    \"secureApiKey\": \"y\",\n    \"adapter\": \"kontentAi\",\n    \"isSecure\": true,\n    \"isPreview\": false,\n    \"action\": \"export\",\n    \"baseUrl\": null,\n    \"format\": \"json\" // or 'csv'\n}\n```\n\nTo execute your action run:\n\n```bash\nkontent-ai-migration-toolkit --config=export-config.json\n```\n\n## Code samples for import & export\n\nSee https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/tree/main/samples for examples of how to run\nthis library in code rather then via command line.\n\n## Output / Input formats\n\nThis library provides `csv` and `json` formats out of the box. However, you can create your own format by implementing\n`IFormatService` and supplying that to import / export functions. This is useful if you need to extend the existing\nformat, change how it's processing or just support new formats such as `xliff`, `xlxs`, `xml` or other.\n\nFollowing is a list of `built-in` format services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `csv`  | `ItemCsvProcessorService `  | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-csv-processor.service.ts         |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## Limitations\n\n-   Language variants in `Scheduled` workflow step exported with built-in Kontent.ai export adapter are not imported\n    with this state as the information about scheduled time is missing in API response.\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"89ba71aafe14f88d7a8e6bb339ebbe7951cd4ae2","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd output && tsx ../lib/node/cli/app --config=export-config-bein.json ","test:import":"cd output && tsx ../lib/node/cli/app --config=import-config-bein.json","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version","prepareSampleExport":"npm run build && cd samples/export-data && node --max-http-header-size 150000 ../../dist/es2022/node/cli/app --max-http-header-size=80000000 --config=export-config.json ","test:export-via-code":"cd output && tsx test-export.ts"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","prompts":"2.4.2","json2csv":"5.0.7","csv-parse":"5.5.5","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.2.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.9.1","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.8","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","@types/json2csv":"5.0.7","standard-version":"9.5.0","@typescript-eslint/parser":"7.8.0","@typescript-eslint/eslint-plugin":"7.8.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-1_1714993446800_0.7283488648113852","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-2":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-2","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-2","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"cf1c6f715bde920f54f32aed46b64d661b1f3734","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-2.tgz","fileCount":220,"integrity":"sha512-C7eeDgfbilUDyzspKNGRK827daXGiPniLYe7fTcCFvG6k5v7pJVEy+7XxWSxvvyDldJ7RvbzKV5KT40K3cjkTw==","signatures":[{"sig":"MEUCIEXgbMorpVJeBmapTZVwicmGVggMEkZqmZQjbdGiWc2VAiEAz64Q069YnYRnvsO6rff0NY3kodkZfo07//yqG38S62k=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470765},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction\n> layer which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not\n   provide an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"2f7e4712e65e75df399c06e9cf5e438e2709f3ee","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.10.4","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.9.0","@typescript-eslint/eslint-plugin":"7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-2_1716465351599_0.2962557554886913","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-3":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-3","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-3","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"d0ae5ff0ea0a8272f7f7dbd807839b16db522bc2","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-3.tgz","fileCount":220,"integrity":"sha512-HluDunffFcANcCKg1KXDDn62n4+8FDXkqoGqAqEEhXnlQNJm0GE/ggkos4+wzxgd5vd774P9LYTse2i257KE2A==","signatures":[{"sig":"MEQCIFLTc5E7E4FvOIAThcb5iEyQ6K4Vmv7EvJ/fGwBnyyfJAiAo0Zw7Q+d1cB/G7vMBJSllz823OLN7lmX8YRIjyKTbSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470763},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction\n> layer which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not\n   provide an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"9f65f5d1c7d9746a78e031c4a72f757788f57a39","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.10.4","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.9.0","@typescript-eslint/eslint-plugin":"7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-3_1716469811333_0.3022877903666965","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-4":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-4","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-4","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"b2e6e3e4c999edf08bb06797f9d72e1244bd1935","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-4.tgz","fileCount":220,"integrity":"sha512-+jzXw7hdfITcHZm57R3Jshn76oeqUpjCpJqrZ1DjakxqqnFGopuwg6p8LZLlvQvFtYkrGhNiEnDd7hRMY8eZRQ==","signatures":[{"sig":"MEUCIHv6zQxkSXfXUuQkB97y7PC+b6iQN0A4EKdQV47SLmlqAiEAogOvB8ErAdi9XiPMXUhtZChkqdxWTcRvBlpRuAroRyY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470504},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction\n> layer which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not\n   provide an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"4335db7e97a20f80e7965cca2d712384b3b82e0d","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","jszip":"3.10.1","yargs":"17.7.2","colors":"1.4.0","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.10.4","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.9.0","@typescript-eslint/eslint-plugin":"7.9.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-4_1716802875612_0.4511965604789616","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-5":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-5","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-5","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"2e9f2d5bf8cf6bc732ef52fba214bb936d9fe161","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-5.tgz","fileCount":232,"integrity":"sha512-nqh7zoxKsI1+rr0ZsJnT5xX0kZvHH2rCdRomi4fdobK+XljVBuCIm9wPRnujIcwn/uYqcOkHu455TSKpnJwiVg==","signatures":[{"sig":"MEYCIQDTnpBmpYPZOhocl70AHVp3DxQ+GOToHfKsuV3PV6V36wIhAKUhiA29SfKu08N/esnDs3HxADAhHQw54A3sIKONr7uR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":470655},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction\n> layer which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not\n   provide an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"7293e07caa1a3764ed0f0f1f31d5ac397e99dca7","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-5_1717336957919_0.17171582702349264","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-7":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-7","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-7","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"add869baa38532cf16d632996dfaffb516e6bb60","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-7.tgz","fileCount":228,"integrity":"sha512-7RJqHSOGkvyzV4NhHXQCG5ayT6vYJLHKztYLjITKer8z317xQVtcpPmqtVyNX5ZGB9LralkqQM4LXd23kgxlfA==","signatures":[{"sig":"MEQCIDy27+LoO+pVteUy5z8ZQU2wY8o0gwFad4xi4xuWYwJ5AiB1DszFYrn/IK50ckiA8pjc4A6HBzW6kJc+c4dc21aBbw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468027},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction\n> layer which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not\n   provide an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"0be3c8e535cecbcdd566192a0683ec974c8aae17","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-7_1717337306895_0.147634688525909","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-8":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-8","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-8","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"6fd33de58ec42f15f7e3f862337f6742a4430ddb","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-8.tgz","fileCount":228,"integrity":"sha512-3JTvDPVL1MTo0quFqGaFpeQVBCyNoMLOl06X+CevJENbGhKJOQJNTPcZ9dlz8Bk9HAKdkKpOJd1wv0AlOGUSrg==","signatures":[{"sig":"MEQCICnLASmd1/QL9bsbuzxkqmSmAujLSUssq50/nMwR5rv/AiAwCQXTqw5Rwh1ttqL8AiRb1OmQGAb4D+jZeE2cGuEHNA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":468714},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction\n> layer which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not\n   provide an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"448a15dc5d67e5b652ed3c743b4b65a765154e52","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-8_1717398302922_0.48067142749077685","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-9":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-9","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-9","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"0c4296ff766b3e282f6764e85b3de425f9fcb37e","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-9.tgz","fileCount":228,"integrity":"sha512-ErR67gCIevguma9ux6a5P9UNeohNRoO9z5YOoWz18rG+n+ygDXNYHrBIiYeos6aYPDefYnFY56jDlCux1b2xug==","signatures":[{"sig":"MEYCIQDT8nPIB6VsJ8nKBO0VFFgkKCrBucCsG3hzOqqr31n5GQIhAMEznwJvb1zY82wwHbsXVHkRNzYHWb2RRVehzsmXZbdY","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469107},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction\n> layer which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used in `node.js`. Use in Browsers is not supported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not\n   provide an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"4f046301a77a2e357a09707d34733346c4e6696a","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-9_1717398661106_0.919103038847668","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-10":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-10","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-10","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"8512f1b3623bfd2cd2cc955999d966188c9cfb5e","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-10.tgz","fileCount":228,"integrity":"sha512-VP6xKox4AtVJhIa6bDwPO59AlpmNC6wdUF4hosXZfyqfj8aneFUhipDSpM39kptafrZQvuJPcTqwmmqCyadSkw==","signatures":[{"sig":"MEYCIQCeTnhAvaCQLu3sGIZGupisJR9JvVfNUyS9iVFUxzhpBQIhAKQx/apXnvrG8gjeHJSvsMK0nDf6eUDORdHyDOu7i9gm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469455},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"7315a142723d7367fad60dc349f9ca45839186f4","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-10_1717406169965_0.18618847968593766","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-11":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-11","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-11","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"b365652c984e7917d7fe7dbf1e3a7df877d174ce","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-11.tgz","fileCount":228,"integrity":"sha512-Rn4GIXmx1+OAK/zzxbqYebPN+UNf6qfFuLmByS1x1kXJmSulZWRzuZSOgtGJT6Uyg49jXi3vBMxBTPKEXYmwng==","signatures":[{"sig":"MEQCIG+5thHtKIlNvKQULKeKWE9eeQRDppgV+W1Krd8mGzQkAiB+fenS4SVmuwOO8wUj6aK53+mOWoRAK5fapSoSrfZ3wA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":469973},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                              |\n| ----------------------- | -------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                        |\n| **language**            | Codename of language that items will be exported in **(required)**                                 |\n| **items**               | Comma separated list of items that will be exported **(required)**                                 |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                          |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported. |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"2624ece88daaa4f06b2aabd1b88f8d53c62d8701","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-11_1717406381104_0.4803274543130067","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-12":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-12","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-12","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"c7e82d14b27518f4b8d74937f4c765e5d9bec25c","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-12.tgz","fileCount":228,"integrity":"sha512-8jYAb3DhU36nSNes7FHgD/xnjlsd3WpxKXTibBYHq3BekoGTGH93GglEPpFDjgwZyg/cG8JAEN8MUCWiBLeEbA==","signatures":[{"sig":"MEYCIQCY/zoY/W2GdcUJkmH1dZirmXmaad4lmQ8ucc/BewdlVwIhAJfigg6dr3Krrlh7KwmY57ZG9VZVWwm+FL8p1F4tbAmO","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":472638},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"ddaa178f15b87845820c75d150c8ab672199f105","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-12_1717417883506_0.32360414129941595","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-13":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-13","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-13","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"0f0187e51f984a090cd22b95ff8312aedd6f81f9","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-13.tgz","fileCount":228,"integrity":"sha512-tjZn0hhjd/ysKlTOBOoccc+C3W/7tX63Wh72hzFhCdn/j815mKr6DO1Ak3kxvuTjUEcq92thYivxYKLYkJGGtA==","signatures":[{"sig":"MEUCIQDLn8bs3w09fxLebAzSWmA8AakkuOoK1gn8fs3FBBjsbAIgCJKSJuk8RAfOfbO3odAVZ5pZSW6sCn282yx/8fVb8K0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":472905},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"57b4b6ec06bcf3aaf97fec3ca057da301535052e","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-13_1717418101863_0.7299837380621326","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-14":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-14","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-14","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"0355216f822a0c510fa19036cd763d1281823472","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-14.tgz","fileCount":228,"integrity":"sha512-fx8Q/T2zygdlMD8rMdGuIq3Aq43LCOVc4FoovyrrKXjUXnfVxB/6Lt7sHvDiAglVt82Gs6kSdKMdELlw8uzsog==","signatures":[{"sig":"MEUCIBjjcSXv1kOBsbCOlOfpNRR+E7zZ3fPqbChzJkHNgYDrAiEAhyGkOYtLaOJlCnzxoKz8Kgo0AXoS21kasLPMAH86MgQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":474655},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"3861b07d3cc5dfa26eaf4cc891eec60b4d566d20","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-14_1717491227349_0.24102900880193867","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-15":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-15","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-15","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"eb53c0dc693bc8a1b99aadd9b3175651ac4aa6e0","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-15.tgz","fileCount":232,"integrity":"sha512-pKKTDNfXkBYX7eIsykIS5ig5gC0Vc7t+kS+VeAE5xnobhTH3jm6zWx4MaV1fWeuUkvGmDeqvEs90fWPC/4U5jg==","signatures":[{"sig":"MEUCIQCgbZXlR6mVxob7ofKIT+AHMb+P8OuWR70Pw9cfTIxStQIgXCjrUtspDrXYWiKnCruCjuu5vFfhuE0TMkZEcElfdmM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":484105},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"ec96ad945d074688983a92d756fbd3ecbbe30400","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-15_1717493443285_0.6424749335117068","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-16":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-16","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-16","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"5cf5e3d8131c02fc0df3f1d3c9627bc043d647bf","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-16.tgz","fileCount":236,"integrity":"sha512-F36ZF5US+R8qsWsT2Zo9noWOQBwB0W4Z7rcpG9Vw8M/tnzwYdu3i+qLsIBhVzf5JjRmERaIZ0HtR8xlYzqNUXg==","signatures":[{"sig":"MEUCIQDsfLcsAAQwbKuESIIFaDzW95rXxqcPigbIgOowaUdTkAIgY5ecM0LGtIXxaxSyQliO2ag+NKvd0FbHQY67onDFLlM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":501555},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"b42f4f596925c4d3908cd63a3599853d453b4680","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-16_1717503025426_0.9443018901841524","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-17":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-17","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-17","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"2e3e6d44c18aa9d040ea09d8322e79e9e53e4ca6","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-17.tgz","fileCount":236,"integrity":"sha512-T105vHkM6F1WgZn/QyNz7bgcaMtSHXen506PYbzDE75QlDqBRh7DQboK8oyOBAP+ZMgxBvSQiDUIA7aDcZHHZA==","signatures":[{"sig":"MEYCIQCXV83tEgc0D8YcqpNSa6jtwVtkUhNaUcaqo2vOP206NQIhAM/9Y8g3siRiTXn2BWgaHPVUoIu0QpEy6ZLsJvXd/+Jm","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":501092},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility. Use in Browsers is not\nsupported.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated. The workflow will be set according to `workflow_step` and\n`workflow` fields.\n\nYou can run `kontent-ai-migration-toolkit` many times over without being worried that identical content items will be\ncreated multiple times.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"21f931607be1b0f87458594fcb05debe7fd8bb46","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","uuid":"9.0.1","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","uuid-by-string":"4.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.11.0","tslib":"2.6.2","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.12.12","@types/uuid":"9.0.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","tsconfig-paths":"^4.2.0","standard-version":"9.5.0","@typescript-eslint/parser":"7.11.0","@typescript-eslint/eslint-plugin":"7.11.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-17_1717506184009_0.3331222448536306","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-18":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-18","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-18","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"32e215b616c8ce6bd9971a441994f6d963c24763","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-18.tgz","fileCount":248,"integrity":"sha512-beQ0mBWd2HSBwWVECfhEJk90Tgg7Y8XqvPX8Z76O8WCiaYeJa6h5HGKtOzpBr3eGOmzgMHR1dMn5FPvUHEBJGQ==","signatures":[{"sig":"MEQCIAMti+7awe4hB4eQ68k/6RYI0CQwTG9eI7lLJbdxBf3CAiAso+FxpSK+hob8iqkGDVUET0pNCWp+0m70Z5sglRKQjg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":516150},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available. Because of this you need to ensure that `external_ids` of\nnewly created items match those that reference them.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"0cfaae64b99bfe125d6232454130f6af3c932f60","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.13.2","tslib":"2.6.3","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@typescript-eslint/parser":"7.12.0","@typescript-eslint/eslint-plugin":"7.12.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-18_1717770753339_0.5058901008333649","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-19":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-19","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-19","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"8889dda508e3975e6a60597886f7dc17ff6f7af2","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-19.tgz","fileCount":248,"integrity":"sha512-oHaW4tSDGxj9rDFWW+mWCfgRzfK2yt2sJRR33Md58SFYQQ08dZcKvioFW6Odd1KicdEKsYGw05q2Z1/hhzbICw==","signatures":[{"sig":"MEQCIDOKEATWeD/NpOF9iGwkBwtkSRrgDZBrHpM4AU0BDA3/AiALpjGV60hG5zsfwaFTu9wLI86IBP7m8Z8Xii2mMjSw8w==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":516154},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available. Because of this you need to ensure that `external_ids` of\nnewly created items match those that reference them.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"88e29df482a5be68b89700df62c2be1bcb47e38b","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"cd output && tsx ../lib/node/cli/app --help","test:export":"cd test && tsx test-export.ts","test:import":"cd test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"cd output && tsx ../lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.13.2","tslib":"2.6.3","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@typescript-eslint/parser":"7.12.0","@typescript-eslint/eslint-plugin":"7.12.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-19_1717771267804_0.2450409080447875","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-20":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-20","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-20","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"f8c819da59d126f3aede2fff508cab8141a307e9","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-20.tgz","fileCount":248,"integrity":"sha512-nvAmxM5hTBPOzE1fu2N+0S4wp8qqqrVSMLyMKQB9Rumm0rIabA+0GpDrJv3u9r0bV03LeF0K1JHMZ9gkkPn1Cg==","signatures":[{"sig":"MEYCIQDB2MhOMjHMaXvMvw02AJwEKlBx+2i/e5iuA0OeuHc8OgIhAPB9BmnFFCl7V3gZ37nBaMN6fBjwjVoi0SmH01w8DrYd","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":519480},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available. Because of this you need to ensure that `external_ids` of\nnewly created items match those that reference them.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"6e1888b4e99cce7d9288514bbdf5c1d15eae7aac","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.13.3","tslib":"2.6.3","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.12.0","@typescript-eslint/eslint-plugin":"7.12.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-20_1718019326478_0.4923870410550717","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-21":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-21","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-21","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"1588ca4ab4d03347df3995711aae06f6ac9a0f3d","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-21.tgz","fileCount":240,"integrity":"sha512-3xgwjgAy0Rn0RGoiusdHlk/aDyOLW1mZew1iCNRQFLGksEtcGC5IONWpLEgROJcyapl7zPhTdAXcPE5fg+xaWQ==","signatures":[{"sig":"MEQCIA3BbHzv/PkCByyQM0xHCDHgVvC4+nSYCxfLZlwxg59PAiBYzsCiZ6BgSFd9CZsmO4Dr6tPlioiMQqfS653cce9olQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":519015},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available. Because of this you need to ensure that `external_ids` of\nnewly created items match those that reference them.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"3bcf87eec0f45a741896a1e5243e591eae8cd97b","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.13.3","tslib":"2.6.3","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.12.0","@typescript-eslint/eslint-plugin":"7.12.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-21_1718021685564_0.008815423297657388","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-22":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-22","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-22","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"983df34bb29d84db703f8f9c8f419639c2137d77","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-22.tgz","fileCount":244,"integrity":"sha512-n29Rhtq2hK2MlFkvB1LSWWY6Zfcw05fHVy8D0o0EmPgEmE6QEI7/i/42GKJ5YQYOktG+STYPyhThD+rZVfG3aA==","signatures":[{"sig":"MEUCIB2/JCfzO+bc1NU6m9/W64Cftoz1Dd/H3JePP066lqNPAiEAolp6b1ufnDrFf63j6VPHYB+1BZtFTgwWdnkyPQY6T2I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":499165},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Export from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Export from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available. Because of this you need to ensure that `external_ids` of\nnewly created items match those that reference them.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"65caba0002e9a9a06ce71b476275f79c68047822","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.2","tslib":"2.6.3","eslint":"8.57.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.13.0","@typescript-eslint/eslint-plugin":"7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-22_1718123768601_0.5621113825630164","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-23":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-23","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-23","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"5de19c3ddec487b8cac984427b983ed79342167c","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-23.tgz","fileCount":240,"integrity":"sha512-abQewzm7tUAdNbfciqcEU3nToBu3W0NkvTyA3RuqEKBd474HBYYwIt3pnLZO6XGzNCj1DSbvpyqZlUHMgsA1Yw==","signatures":[{"sig":"MEQCIFbvYq+3ogOOO9wCzsSjASVhNsrP2UbIeJSTZHaqayjCAiBdMdSqfiiC12RhmFMyBllx8vcbflfdHzpgTXx4jO08Sw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":515878},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Migrate from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Migrate from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migrate from external systems\n\nYou can use this library when exporting from 3rd party systems (i.e. legacy CMS) as it will abstract your from using\nKontent.ai Management API directly.\n\nThe main focus is therefore on transforming the data you need to migrate into a format this library supports. The main\nmigration models are `MigrationItem` and `MigrationAsset`. For creating element values `elementsBuilder`.\n\nSee below example of using a strongly typed model and migrating a single item with an asset.\n\n```typescript\n/**\n * Optionally (but strongly recommended) you may define a migration model\n * representing the content type you are trying to migrate into\n */\ninterface ArticleElements extends MigrationElements {\n    title: MigrationElementModels.TextElement;\n    rating: MigrationElementModels.NumberElement;\n    related_pages: MigrationElementModels.LinkedItemsElement;\n    teaser_image: MigrationElementModels.AssetElement;\n}\n\nconst migrationItem: MigrationItem<ArticleElements> = {\n    system: {\n        name: 'My article',\n        // codename is primary identifier - also used for validating whether asset exists in target env\n        codename: 'myArticle',\n        collection: {\n            // collection codename must match the collection in your target K.ai environment\n            codename: 'default'\n        },\n        language: {\n            // language codename must match the language in your target K.ai environment\n            codename: 'en_uk'\n        },\n        type: {\n            // type codename must match the content type codename in your target K.ai environment\n            codename: 'article'\n        }\n    },\n    elements: {\n        title: elementsBuilder().textElement({ value: 'Title of the article' }),\n        rating: elementsBuilder().numberElement({ value: 5 }),\n        related_pages: elementsBuilder().linkedItemsElement({\n            value: [\n                {\n                    codename: 'pageA'\n                },\n                {\n                    codename: 'pageB'\n                }\n            ]\n        }),\n        // assets are referenced by their codename\n        teaser_image: elementsBuilder().assetElement({ value: [{ codename: 'article_teaser' }] })\n    }\n};\n\nconst migrationAsset: MigrationAsset = {\n    // _zipFilename is a name of the file within the export .zip package. It is used only for identifying the file within export\n    _zipFilename: 'article_teaser.jpg',\n    // codename of the asset - Used for validating whether asset exists in target env\n    codename: 'article_teaser',\n    // filename will be used in K.ai asset as a filename\n    filename: 'article_teaser.jpg',\n    // title will be used in K.ai asset as a title\n    title: 'Article teaser',\n    // binary data of the asset you want to upload\n    binaryData: <BinaryData>,\n    // collection assignment\n    collection: {\n        codename: 'teasers'\n    },\n    // description of asset in project languages\n    descriptions: [\n        {\n            description: 'Teaser of the article',\n            language: {\n                codename: 'en_uk'\n            }\n        }\n    ]\n};\n```\n\nOnce you are happy with the data, you can import them to Kontent.ai using the `importAsync` function.\n\n```typescript\nawait importAsync({\n    data: {\n        assets: [migrationAsset],\n        items: [migrationItem]\n    },\n    adapterConfig: {\n        environmentId: environmentId,\n        apiKey: apiKey,\n        skipFailedItems: false\n    }\n});\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"e438fc613268b720e09e920ada380ce35cbbc325","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","lint:fix":"npx eslint lib --fix","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.4","tslib":"2.6.3","eslint":"8.57.0","@eslint/js":"^9.4.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/eslint__js":"^8.42.3","typescript-eslint":"7.13.0","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.13.0","@typescript-eslint/eslint-plugin":"7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-23_1718360338076_0.39472720984158216","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-24":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-24","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-24","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"0d206fdaaecf5a41720e0ddffdf2d0d596a7bbf9","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-24.tgz","fileCount":240,"integrity":"sha512-kYqM/ItWiq4MT8OpcL4X5NunRgmdTVkmTLWRgTzmQ52lzMRVvRCqR6F28rFrRpI86WxjODDfN0ViOau4gQPGJA==","signatures":[{"sig":"MEUCIEcV4Ba1VvyDzDkjPfGM3ZvMOYfK2WwZxJK5s4zqvqoLAiEAyNCp+dVBAiMW5o+EUPZyOIIwXx6sgNaCtL6Ckw/Xmdw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":518531},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n> [!CAUTION]  \n> **This readme uses pre-release version of this library using `next` tag on NPM**. To install it you need to specify\n> version explicitely such as running `npm i @kontent-ai-consulting/migration-toolkit@1.0.0-24 -g`.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Migrate from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Migrate from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migrate from external systems\n\nYou can use this library when exporting from 3rd party systems (i.e. legacy CMS) as it will abstract your from using\nKontent.ai Management API directly.\n\nThe main focus is therefore on transforming the data you need to migrate into a format this library supports. The main\nmigration models are `MigrationItem` and `MigrationAsset`. For creating element values `elementsBuilder`.\n\nSee below example of using a strongly typed model and migrating a single item with an asset.\n\n```typescript\n/**\n * Optionally (but strongly recommended) you may define a migration model\n * representing the content type you are trying to migrate into\n */\ninterface ArticleElements extends MigrationElements {\n    title: MigrationElementModels.TextElement;\n    rating: MigrationElementModels.NumberElement;\n    related_pages: MigrationElementModels.LinkedItemsElement;\n    teaser_image: MigrationElementModels.AssetElement;\n}\n\nconst migrationItem: MigrationItem<ArticleElements> = {\n    system: {\n        name: 'My article',\n        // codename is primary identifier - also used for validating whether asset exists in target env\n        codename: 'myArticle',\n        collection: {\n            // collection codename must match the collection in your target K.ai environment\n            codename: 'default'\n        },\n        language: {\n            // language codename must match the language in your target K.ai environment\n            codename: 'en_uk'\n        },\n        type: {\n            // type codename must match the content type codename in your target K.ai environment\n            codename: 'article'\n        }\n    },\n    elements: {\n        title: elementsBuilder().textElement({ value: 'Title of the article' }),\n        rating: elementsBuilder().numberElement({ value: 5 }),\n        related_pages: elementsBuilder().linkedItemsElement({\n            value: [\n                {\n                    codename: 'pageA'\n                },\n                {\n                    codename: 'pageB'\n                }\n            ]\n        }),\n        // assets are referenced by their codename\n        teaser_image: elementsBuilder().assetElement({ value: [{ codename: 'article_teaser' }] })\n    }\n};\n\nconst migrationAsset: MigrationAsset = {\n    // _zipFilename is a name of the file within the export .zip package. It is used only for identifying the file within export\n    _zipFilename: 'article_teaser.jpg',\n    // codename of the asset - Used for validating whether asset exists in target env\n    codename: 'article_teaser',\n    // filename will be used in K.ai asset as a filename\n    filename: 'article_teaser.jpg',\n    // title will be used in K.ai asset as a title\n    title: 'Article teaser',\n    // binary data of the asset you want to upload\n    binaryData: <BinaryData>,\n    // collection assignment\n    collection: {\n        codename: 'teasers'\n    },\n    // description of asset in project languages\n    descriptions: [\n        {\n            description: 'Teaser of the article',\n            language: {\n                codename: 'en_uk'\n            }\n        }\n    ]\n};\n```\n\nOnce you are happy with the data, you can import them to Kontent.ai using the `importAsync` function.\n\n```typescript\nawait importAsync({\n    data: {\n        assets: [migrationAsset],\n        items: [migrationItem]\n    },\n    adapterConfig: {\n        environmentId: environmentId,\n        apiKey: apiKey,\n        skipFailedItems: false\n    }\n});\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Components embedded within Rich text elements are not exported\n4. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"e664ecd6ce0bc50d5ce8277e0343f75301fd884a","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","lint:fix":"npx eslint lib --fix","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.4","tslib":"2.6.3","eslint":"8.57.0","@eslint/js":"^9.4.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/eslint__js":"^8.42.3","typescript-eslint":"7.13.0","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.13.0","@typescript-eslint/eslint-plugin":"7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-24_1718611018225_0.9019590150786068","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-25":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-25","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-25","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"59272932c1cf698b1de2d042e951e89d44d55cf8","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-25.tgz","fileCount":240,"integrity":"sha512-wr1JAlTXZrFXuFvLOb3A0RNqv20vzwf2xm98Pe/rKz6rqf6oHgGKwSDx79CKKsyg9zRfByTH7c+R2UDK+xI4VA==","signatures":[{"sig":"MEUCIAj2DvnYYvoNir0XwVRKXK2aXVtCDAg+R1TRT7q9pmhaAiEAwY3LjN5NACOrYpeUDeGY2Q+rc2YEyaH7uOscruG44zg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":540690},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n> [!CAUTION]  \n> **This readme uses pre-release version of this library using `next` tag on NPM**. To install it you need to specify\n> version explicitely such as running `npm i @kontent-ai-consulting/migration-toolkit@1.0.0-24 -g`.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Migrate from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **itemsFilename**       | Name of the items file that will be used to parse items **(required)**                                                                                  |\n| assetsFilename          | Name of the items file that will be used to parse assets                                                                                                |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --itemsFilename=items.zip --assetsFilename=assets.zip\n```\n\n# Migrate from Kontent.ai\n\nThere is a built-in `kontentAi` adapter that can be used to export content items & assets from Kontent.ai environments.\nHowever, when migration from 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| itemsFilename           | Name of the items file that will be created in folder where script is run                                  |\n| assetsFilename          | Name of the assets file that will be created in folder where script is run. Only zip is supported.         |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migrate from external systems\n\nYou can use this library when exporting from 3rd party systems (i.e. legacy CMS) as it will abstract your from using\nKontent.ai Management API directly.\n\nThe main focus is therefore on transforming the data you need to migrate into a format this library supports. The main\nmigration models are `MigrationItem` and `MigrationAsset`. For creating element values `elementsBuilder`.\n\nSee below example of using a strongly typed model and migrating a single item with an asset.\n\n```typescript\n/**\n * Optionally (but strongly recommended) you may define a migration model\n * representing the content type you are trying to migrate into\n */\ninterface ArticleElements extends MigrationElements {\n    title: MigrationElementModels.TextElement;\n    rating: MigrationElementModels.NumberElement;\n    related_pages: MigrationElementModels.LinkedItemsElement;\n    teaser_image: MigrationElementModels.AssetElement;\n}\n\nconst migrationItem: MigrationItem<ArticleElements> = {\n    system: {\n        name: 'My article',\n        // codename is primary identifier - also used for validating whether asset exists in target env\n        codename: 'myArticle',\n        collection: {\n            // collection codename must match the collection in your target K.ai environment\n            codename: 'default'\n        },\n        language: {\n            // language codename must match the language in your target K.ai environment\n            codename: 'en_uk'\n        },\n        type: {\n            // type codename must match the content type codename in your target K.ai environment\n            codename: 'article'\n        }\n    },\n    elements: {\n        title: elementsBuilder().textElement({ value: 'Title of the article' }),\n        rating: elementsBuilder().numberElement({ value: 5 }),\n        related_pages: elementsBuilder().linkedItemsElement({\n            value: [\n                {\n                    codename: 'pageA'\n                },\n                {\n                    codename: 'pageB'\n                }\n            ]\n        }),\n        // assets are referenced by their codename\n        teaser_image: elementsBuilder().assetElement({ value: [{ codename: 'article_teaser' }] })\n    }\n};\n\nconst migrationAsset: MigrationAsset = {\n    // _zipFilename is a name of the file within the export .zip package. It is used only for identifying the file within export\n    _zipFilename: 'article_teaser.jpg',\n    // codename of the asset - Used for validating whether asset exists in target env\n    codename: 'article_teaser',\n    // filename will be used in K.ai asset as a filename\n    filename: 'article_teaser.jpg',\n    // title will be used in K.ai asset as a title\n    title: 'Article teaser',\n    // binary data of the asset you want to upload\n    binaryData: <BinaryData>,\n    // collection assignment\n    collection: {\n        codename: 'teasers'\n    },\n    // description of asset in project languages\n    descriptions: [\n        {\n            description: 'Teaser of the article',\n            language: {\n                codename: 'en_uk'\n            }\n        }\n    ]\n};\n```\n\nOnce you are happy with the data, you can import them to Kontent.ai using the `importAsync` function.\n\n```typescript\nawait importAsync({\n    data: {\n        assets: [migrationAsset],\n        items: [migrationItem]\n    },\n    adapterConfig: {\n        environmentId: environmentId,\n        apiKey: apiKey,\n        skipFailedItems: false\n    }\n});\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## Output / Input formats\n\nThis library provides `json` format out of the box. However, you can create your own format by implementing\n`IFormatService`. This is useful if you need to support additional formats such as `xliff`, `xlxs`, `xml`, `csv` or\nothers.\n\nDefault formatting services:\n\n| Type   | Service                     | Link                                                                                                                                                  |\n| ------ | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json` | `ItemJsonProcessorService ` | https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/lib/file-processor/item-formats/item-json-joined-processor.service.ts |\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"7f7328a1b45a03d4ee6d9e4b959e32343a81a5e5","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","lint:fix":"npx eslint lib --fix","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"cd output && tsx ../lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.4","tslib":"2.6.3","eslint":"8.57.0","@eslint/js":"^9.4.0","typescript":"5.4.5","@types/node":"20.14.2","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/eslint__js":"^8.42.3","typescript-eslint":"7.13.0","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.13.0","@typescript-eslint/eslint-plugin":"7.13.0"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-25_1718635314750_0.24907172674723732","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-26":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-26","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-26","homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"8ac5cd3fd8fc9fbb581f25a300153daee8aa91b0","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-26.tgz","fileCount":224,"integrity":"sha512-54kMfOQd+9xLebDMrPjH363fUFWfqsP+hcitcvaras3fH01lPBHqcoOYY4uDWGnd3GdEAyuT6UOqy2Snrwhlmw==","signatures":[{"sig":"MEUCIQCW/+TcxX6HOkXCgJukmWexlr74F/Lyff4ewy6W/JzMegIgRy4S5UMfgF1iOx1QlCPTTBodGl3GcCDXP4EzAbhYQU4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":493851},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n> [!CAUTION]  \n> **This readme uses pre-release version of this library using `next` tag on NPM**. To install it you need to specify\n> version explicitely such as running `npm i @kontent-ai-consulting/migration-toolkit@1.0.0-24 -g`.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Migrate from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **filename**            | Name of the zip file **(required)**                                                                                                                     |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --filename=data.zip\n```\n\n# Migrate from Kontent.ai\n\nThis library can also be used to export content items & assets from Kontent.ai environments. However, when migration\nfrom 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                                                                      |\n| ----------------------- | ---------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**                                                |\n| **language**            | Codename of language that items will be exported in **(required)**                                         |\n| **items**               | Comma separated list of items that will be exported **(required)**                                         |\n| filename                | Name of the zip file                                                                                       |\n| skipFailedItems         | Indicates export skips items that fail to export. Available options: `true` & `false`. Detaults to `false` |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                   |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migrate from external systems\n\nYou can use this library when exporting from 3rd party systems (i.e. legacy CMS) as it will abstract your from using\nKontent.ai Management API directly.\n\nThe main focus is therefore on transforming the data you need to migrate into a format this library supports. The main\nmigration models are `MigrationItem` and `MigrationAsset`. For creating element values `elementsBuilder`.\n\nSee below example of using a strongly typed model and migrating a single item with an asset.\n\n```typescript\n/**\n * Optionally (but strongly recommended) you may define a migration model\n * representing the content type you are trying to migrate into\n */\ninterface ArticleElements extends MigrationElements {\n    title: MigrationElementModels.TextElement;\n    rating: MigrationElementModels.NumberElement;\n    related_pages: MigrationElementModels.LinkedItemsElement;\n    teaser_image: MigrationElementModels.AssetElement;\n}\n\nconst migrationItem: MigrationItem<ArticleElements> = {\n    system: {\n        name: 'My article',\n        // codename is primary identifier - also used for validating whether asset exists in target env\n        codename: 'myArticle',\n        collection: {\n            // collection codename must match the collection in your target K.ai environment\n            codename: 'default'\n        },\n        language: {\n            // language codename must match the language in your target K.ai environment\n            codename: 'en_uk'\n        },\n        type: {\n            // type codename must match the content type codename in your target K.ai environment\n            codename: 'article'\n        }\n    },\n    elements: {\n        title: elementsBuilder().textElement({ value: 'Title of the article' }),\n        rating: elementsBuilder().numberElement({ value: 5 }),\n        related_pages: elementsBuilder().linkedItemsElement({\n            value: [\n                {\n                    codename: 'pageA'\n                },\n                {\n                    codename: 'pageB'\n                }\n            ]\n        }),\n        // assets are referenced by their codename\n        teaser_image: elementsBuilder().assetElement({ value: [{ codename: 'article_teaser' }] })\n    }\n};\n\nconst migrationAsset: MigrationAsset = {\n    // _zipFilename is a name of the file within the export .zip package. It is used only for identifying the file within export\n    _zipFilename: 'article_teaser.jpg',\n    // codename of the asset - Used for validating whether asset exists in target env\n    codename: 'article_teaser',\n    // filename will be used in K.ai asset as a filename\n    filename: 'article_teaser.jpg',\n    // title will be used in K.ai asset as a title\n    title: 'Article teaser',\n    // binary data of the asset you want to upload\n    binaryData: <BinaryData>,\n    // collection assignment\n    collection: {\n        codename: 'teasers'\n    },\n    // description of asset in project languages\n    descriptions: [\n        {\n            description: 'Teaser of the article',\n            language: {\n                codename: 'en_uk'\n            }\n        }\n    ]\n};\n```\n\nOnce you are happy with the data, you can import them to Kontent.ai using the `importAsync` function.\n\n```typescript\nawait importAsync({\n    environmentId: environmentId,\n    apiKey: apiKey,\n    skipFailedItems: false,\n    data: {\n        assets: [migrationAsset],\n        items: [migrationItem]\n    }\n});\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"c258e1002932611b29827d989517cfe4e1314b73","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","lint:fix":"npx eslint lib --fix","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"tsx lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","p-limit":"5.0.0","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.6","tslib":"2.6.3","eslint":"8.57.0","@eslint/js":"9.5.0","typescript":"5.4.5","@types/node":"20.14.4","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/eslint__js":"8.42.3","typescript-eslint":"7.13.0","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.13.1","@typescript-eslint/eslint-plugin":"7.13.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-26_1718894278374_0.1089315817465748","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-27":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-27","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-27","homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"f9880d77e4da9c332661980d3840871b91c91c5f","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-27.tgz","fileCount":224,"integrity":"sha512-UpuwTtgYqz35DFL0oC1RS+68A3Hd9reZykewj3yKeV2E26hXmbpQ1EX+2eIiYItU/8R+CaJrae/d7gKe5rwHbg==","signatures":[{"sig":"MEQCIH1f9nLNiwW4+0ahsj+euw/14GWRI3lyt6TvO4Cu2rI9AiAgcduD8CS5Whx5UmLA9Up9SwCH+uAIybo+EyaRKkaYtw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495811},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n> [!CAUTION]  \n> **This readme uses pre-release version of this library using `next` tag on NPM**. To install it you need to specify\n> version explicitely such as running `npm i @kontent-ai-consulting/migration-toolkit@1.0.0-24 -g`.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Migrate from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **filename**            | Name of the zip file **(required)**                                                                                                                     |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --filename=data.zip\n```\n\n# Migrate from Kontent.ai\n\nThis library can also be used to export content items & assets from Kontent.ai environments. However, when migration\nfrom 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                              |\n| ----------------------- | ------------------------------------------------------------------ |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**        |\n| **language**            | Codename of language that items will be exported in **(required)** |\n| **items**               | Comma separated list of items that will be exported **(required)** |\n| filename                | Name of the zip file                                               |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migrate from external systems\n\nYou can use this library when exporting from 3rd party systems (i.e. legacy CMS) as it will abstract your from using\nKontent.ai Management API directly.\n\nThe main focus is therefore on transforming the data you need to migrate into a format this library supports. The main\nmigration models are `MigrationItem` and `MigrationAsset`. For creating element values `elementsBuilder`.\n\nSee below example of using a strongly typed model and migrating a single item with an asset.\n\n```typescript\n/**\n * Optionally (but strongly recommended) you may define a migration model\n * representing the content type you are trying to migrate into\n */\ninterface ArticleElements extends MigrationElements {\n    title: MigrationElementModels.TextElement;\n    rating: MigrationElementModels.NumberElement;\n    related_pages: MigrationElementModels.LinkedItemsElement;\n    teaser_image: MigrationElementModels.AssetElement;\n}\n\nconst migrationItem: MigrationItem<ArticleElements> = {\n    system: {\n        name: 'My article',\n        // codename is primary identifier - also used for validating whether asset exists in target env\n        codename: 'myArticle',\n        collection: {\n            // collection codename must match the collection in your target K.ai environment\n            codename: 'default'\n        },\n        language: {\n            // language codename must match the language in your target K.ai environment\n            codename: 'en_uk'\n        },\n        type: {\n            // type codename must match the content type codename in your target K.ai environment\n            codename: 'article'\n        }\n    },\n    elements: {\n        title: elementsBuilder().textElement({ value: 'Title of the article' }),\n        rating: elementsBuilder().numberElement({ value: 5 }),\n        related_pages: elementsBuilder().linkedItemsElement({\n            value: [\n                {\n                    codename: 'pageA'\n                },\n                {\n                    codename: 'pageB'\n                }\n            ]\n        }),\n        // assets are referenced by their codename\n        teaser_image: elementsBuilder().assetElement({ value: [{ codename: 'article_teaser' }] })\n    }\n};\n\nconst migrationAsset: MigrationAsset = {\n    // _zipFilename is a name of the file within the export .zip package. It is used only for identifying the file within export\n    _zipFilename: 'article_teaser.jpg',\n    // codename of the asset - Used for validating whether asset exists in target env\n    codename: 'article_teaser',\n    // filename will be used in K.ai asset as a filename\n    filename: 'article_teaser.jpg',\n    // title will be used in K.ai asset as a title\n    title: 'Article teaser',\n    // binary data of the asset you want to upload\n    binaryData: <BinaryData>,\n    // collection assignment\n    collection: {\n        codename: 'teasers'\n    },\n    // description of asset in project languages\n    descriptions: [\n        {\n            description: 'Teaser of the article',\n            language: {\n                codename: 'en_uk'\n            }\n        }\n    ]\n};\n```\n\nOnce you are happy with the data, you can import them to Kontent.ai using the `importAsync` function.\n\n```typescript\nawait importAsync({\n    environmentId: environmentId,\n    apiKey: apiKey,\n    skipFailedItems: false,\n    data: {\n        assets: [migrationAsset],\n        items: [migrationItem]\n    }\n});\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"5c29613f5c2ceb0dbd0a41e86a047d40aedf3ab0","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","lint:fix":"npx eslint lib --fix","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"tsx lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","p-limit":"5.0.0","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.7","tslib":"2.6.3","eslint":"8.57.0","@eslint/js":"9.5.0","typescript":"5.5.2","@types/node":"20.14.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/eslint__js":"8.42.3","typescript-eslint":"7.13.1","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.13.1","@typescript-eslint/eslint-plugin":"7.13.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-27_1719224370280_0.24833107853909042","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-28":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-28","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-28","homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"1e1b1113d9a3a80fe1366cdb60e2075f047a70c3","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-28.tgz","fileCount":224,"integrity":"sha512-LgVBl6mByKSULyXYUXjF6xXjE1cM4H3UL0ao5Tadtzy93TswYOi//Gfn3pxwkfv9SWbJpNwW78TG0r9iDfYj+w==","signatures":[{"sig":"MEUCIQC3ymgMdgr0IIVZJvYIe/dj5dH73wHM+UyEbZYlknEasQIgUVAReQkiH97NZonzDq0vKjfOTlYc7RnpCOiDihknz6I=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":496265},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n> [!CAUTION]  \n> **This readme uses pre-release version of this library using `next` tag on NPM**. To install it you need to specify\n> version explicitely such as running `npm i @kontent-ai-consulting/migration-toolkit@1.0.0-24 -g`.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Migrate from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **filename**            | Name of the zip file **(required)**                                                                                                                     |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --filename=data.zip\n```\n\n# Migrate from Kontent.ai\n\nThis library can also be used to export content items & assets from Kontent.ai environments. However, when migration\nfrom 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                              |\n| ----------------------- | ------------------------------------------------------------------ |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**        |\n| **language**            | Codename of language that items will be exported in **(required)** |\n| **items**               | Comma separated list of items that will be exported **(required)** |\n| filename                | Name of the zip file                                               |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migrate from external systems\n\nYou can use this library when exporting from 3rd party systems (i.e. legacy CMS) as it will abstract your from using\nKontent.ai Management API directly.\n\nThe main focus is therefore on transforming the data you need to migrate into a format this library supports. The main\nmigration models are `MigrationItem` and `MigrationAsset`. For creating element values `elementsBuilder`.\n\nSee below example of using a strongly typed model and migrating a single item with an asset.\n\n```typescript\n/**\n * Optionally (but strongly recommended) you may define a migration model\n * representing the content type you are trying to migrate into\n */\ninterface ArticleElements extends MigrationElements {\n    title: MigrationElementModels.TextElement;\n    rating: MigrationElementModels.NumberElement;\n    related_pages: MigrationElementModels.LinkedItemsElement;\n    teaser_image: MigrationElementModels.AssetElement;\n}\n\nconst migrationItem: MigrationItem<ArticleElements> = {\n    system: {\n        name: 'My article',\n        // codename is primary identifier - also used for validating whether asset exists in target env\n        codename: 'myArticle',\n        collection: {\n            // collection codename must match the collection in your target K.ai environment\n            codename: 'default'\n        },\n        language: {\n            // language codename must match the language in your target K.ai environment\n            codename: 'en_uk'\n        },\n        type: {\n            // type codename must match the content type codename in your target K.ai environment\n            codename: 'article'\n        }\n    },\n    elements: {\n        title: elementsBuilder().textElement({ value: 'Title of the article' }),\n        rating: elementsBuilder().numberElement({ value: 5 }),\n        related_pages: elementsBuilder().linkedItemsElement({\n            value: [\n                {\n                    codename: 'pageA'\n                },\n                {\n                    codename: 'pageB'\n                }\n            ]\n        }),\n        // assets are referenced by their codename\n        teaser_image: elementsBuilder().assetElement({ value: [{ codename: 'article_teaser' }] })\n    }\n};\n\nconst migrationAsset: MigrationAsset = {\n    // codename of the asset - Used for validating whether asset exists in target env\n    codename: 'article_teaser',\n    // filename will be used in K.ai asset as a filename\n    filename: 'article_teaser.jpg',\n    // title will be used in K.ai asset as a title\n    title: 'Article teaser',\n    // binary data of the asset you want to upload\n    binaryData: <BinaryData>,\n    // collection assignment\n    collection: {\n        codename: 'teasers'\n    },\n    // description of asset in project languages\n    descriptions: [\n        {\n            description: 'Teaser of the article',\n            language: {\n                codename: 'en_uk'\n            }\n        }\n    ]\n};\n```\n\nOnce you are happy with the data, you can import them to Kontent.ai using the `importAsync` function.\n\n```typescript\nawait importAsync({\n    environmentId: environmentId,\n    apiKey: apiKey,\n    skipFailedItems: false,\n    data: {\n        assets: [migrationAsset],\n        items: [migrationItem]\n    }\n});\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"73cf9df5060a5d11bec471052681069049c97962","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","lint:fix":"npx eslint lib --fix","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"tsx lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","p-limit":"5.0.0","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.0","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.7","tslib":"2.6.3","eslint":"8.57.0","@eslint/js":"9.5.0","typescript":"5.5.2","@types/node":"20.14.8","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/eslint__js":"8.42.3","typescript-eslint":"7.13.1","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.13.1","@typescript-eslint/eslint-plugin":"7.13.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-28_1719299369101_0.5790464394147901","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"},"1.0.0-29":{"name":"@kontent-ai-consulting/migration-toolkit","version":"1.0.0-29","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai migrations","Kontent.ai data migrations"],"author":{"name":"Richard Sustek"},"license":"MIT","_id":"@kontent-ai-consulting/migration-toolkit@1.0.0-29","homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"bin":{"kontent-ai-migration-toolkit":"dist/es2022/node/cli/app.js"},"dist":{"shasum":"de3abf0d4317433a9189a7175a132cfec650553b","tarball":"https://registry.npmjs.org/@kontent-ai-consulting/migration-toolkit/-/migration-toolkit-1.0.0-29.tgz","fileCount":224,"integrity":"sha512-AypjWgl6xKhNsVpnRhjLq3JFL6X/QLTQJhib/7bAnofq82xRvEVUmedHYLHHoKtbK+kqttupBpK4AIAHdwTPfg==","signatures":[{"sig":"MEUCIAD7bF7plgTNLOaqNN1pJrFI6YwgzQuGQTCIfybg2KAaAiEAx3q9/G/XYaDJubCSB5DrHS8x/ANPVn6JpVP6y1rDAfQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":495080},"type":"module","types":"./dist/es2022/index.d.ts","readme":"# Kontent.ai Migration Toolkit\n\nThe purpose of this tool is to facilitate _content migration_ to & from [Kontent.ai](https://kontent.ai) environments.\nIt can be used to simplify migration from external systems and also provides a built-in migration between kontent.ai\nenvironments.\n\n> [!TIP]  \n> This library aims to streamline the migration to / from Kontent.ai environments by providing an abstraction layer\n> which handles creation / updates of content items, language variants, moving items through workflow, publishing,\n> archiving, downloading binary data, uploading assets, `id` to `codename` translation and more.\n\nThis library can only be used as a library both in `node.js` & `browser` or as a `CLI` utility.\n\n> [!CAUTION]  \n> **This readme uses pre-release version of this library using `next` tag on NPM**. To install it you need to specify\n> version explicitely such as running `npm i @kontent-ai-consulting/migration-toolkit@1.0.0-24 -g`.\n\n# Getting started\n\nUse `--help` anytime to get information about available commands and their options.\n\n```bash\nnpx @kontent-ai-consulting/migration-toolkit --help\n\n# you can also install the package globally, or locally\nnpm i @kontent-ai-consulting/migration-toolkit -g\n\n# with the package installed, you can call the tool as follows\nkontent-ai-migration-toolkit --help\n\n# or check details of particular command\nkontent-ai-migration-toolkit migrate --help\n```\n\n## Code examples\n\n1. [Import](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/import-sample.ts)\n2. [Export](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/export-sample.ts)\n3. [Migrate from external system](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-from-external-system.ts)\n4. [Migrate content between Kontent.ai environments](https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/blob/main/samples/migrate-between-kontent-ai-environments.ts)\n\n> [!NOTE]  \n> You can run `kontent-ai-migration-toolkit` many times over without being worried that duplicate content items / assets\n> are created.\n\n# Migrate between Kontent.ai environments\n\nYou may migrate content (items & asset) between Kontent.ai environments. For migrating _Data model / structure_ see\n[Data Ops](https://github.com/kontent-ai/data-ops) instead.\n\n> [!CAUTION]  \n> **We recommend migrating to test / dev environments first ** to ensure nothing unexpected happens..\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **sourceEnvironmentId** | Id of source environment **(required)**                                                                                                                 |\n| **sourceApiKey**        | Management API key of source environment **(required)**                                                                                                 |\n| **targetEnvironmentId** | Id of target environment **(required)**                                                                                                                 |\n| **targetApiKey**        | Management API key of target environment **(required)**                                                                                                 |\n| **language**            | Codename of language that items will be exported in **(required)**                                                                                      |\n| **items**               | Comma separated list of items that will be exported **(required)**                                                                                      |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Migrate CLI\n\n```bash\n# Migrate from Kontent.ai environment into another Kontent.ai environment\nkontent-ai-migration-toolkit migrate --targetEnvironmentId=x --targetApiKey=x --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Import\n\n> [!CAUTION]  \n> **We do not recommended importing into a production environment directly without testing**. Instead you should first\n> create a testing environment and run the script there to make sure everything works as you intended to.\n\n> [!NOTE]  \n> When importing it is essential that the target project structure (i.e. `Content types`, `Taxonomies`, `Collections`,\n> `Workflows`, `languages`...) are consistent with the ones defined in source environment. Any inconsistency in data\n> such as referencing inexistent taxonomy term, incorrect element type and other inconsistencies may cause import to\n> fail.\n\n## Configuration\n\n| Config                  | Value                                                                                                                                                   |\n| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **targetEnvironmentId** | Id of Kontent.ai environment **(required)**                                                                                                             |\n| **targetApiKey**        | Management API key **(required)**                                                                                                                       |\n| **filename**            | Name of the zip file **(required)**                                                                                                                     |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                                                                                                                |\n| skipFailedItems         | Indicates if failed content items & language variants should be skipped if their import fails. Available options: `true` & `false`. Detaults to `false` |\n| force                   | Can be used to disable confirmation prompts. Available options: `true` & `false`. Detaults to `false`                                                   |\n\n## Import CLI\n\n```bash\n# Import into target environment\nkontent-ai-migration-toolkit import --targetEnvironmentId=x --targetApiKey=x --filename=data.zip\n```\n\n# Migrate from Kontent.ai\n\nThis library can also be used to export content items & assets from Kontent.ai environments. However, when migration\nfrom 3rd party system you typically only use the `import` capabilities of this repository.\n\n## Configuration\n\n| Config                  | Value                                                              |\n| ----------------------- | ------------------------------------------------------------------ |\n| **sourceEnvironmentId** | Id of Kontent.ai environment **(required)**                        |\n| **sourceApiKey**        | Management API key of Kontent.ai environment **(required)**        |\n| **language**            | Codename of language that items will be exported in **(required)** |\n| **items**               | Comma separated list of items that will be exported **(required)** |\n| filename                | Name of the zip file                                               |\n| baseUrl                 | Custom base URL for Kontent.ai API calls                           |\n\n## Export CLI\n\n```bash\n# Export from Kontent.ai environment\nkontent-ai-migration-toolkit export --sourceEnvironmentId=x --sourceApiKey=x --language=default --items=itemA,itemB\n```\n\n# Migrate from external systems\n\nYou can use this library when exporting from 3rd party systems (i.e. legacy CMS) as it will abstract your from using\nKontent.ai Management API directly.\n\nThe main focus is therefore on transforming the data you need to migrate into a format this library supports. The main\nmigration models are `MigrationItem` and `MigrationAsset`. For creating element values `elementsBuilder`.\n\nSee below example of using a strongly typed model and migrating a single item with an asset.\n\n```typescript\n/**\n * Optionally (but strongly recommended) you may define a migration model\n * representing the content type you are trying to migrate into\n */\ninterface ArticleElements extends MigrationElements {\n    title: MigrationElementModels.TextElement;\n    rating: MigrationElementModels.NumberElement;\n    related_pages: MigrationElementModels.LinkedItemsElement;\n    teaser_image: MigrationElementModels.AssetElement;\n}\n\nconst migrationItem: MigrationItem<ArticleElements> = {\n    system: {\n        name: 'My article',\n        // codename is primary identifier - also used for validating whether asset exists in target env\n        codename: 'myArticle',\n        collection: {\n            // collection codename must match the collection in your target K.ai environment\n            codename: 'default'\n        },\n        language: {\n            // language codename must match the language in your target K.ai environment\n            codename: 'en_uk'\n        },\n        type: {\n            // type codename must match the content type codename in your target K.ai environment\n            codename: 'article'\n        }\n    },\n    elements: {\n        title: elementsBuilder.textElement({ value: 'Title of the article' }),\n        rating: elementsBuilder.numberElement({ value: 5 }),\n        related_pages: elementsBuilder.linkedItemsElement({\n            value: [\n                {\n                    codename: 'pageA'\n                },\n                {\n                    codename: 'pageB'\n                }\n            ]\n        }),\n        // assets are referenced by their codename\n        teaser_image: elementsBuilder.assetElement({ value: [{ codename: 'article_teaser' }] })\n    }\n};\n\nconst migrationAsset: MigrationAsset = {\n    // codename of the asset - Used for validating whether asset exists in target env\n    codename: 'article_teaser',\n    // filename will be used in K.ai asset as a filename\n    filename: 'article_teaser.jpg',\n    // title will be used in K.ai asset as a title\n    title: 'Article teaser',\n    // binary data of the asset you want to upload\n    binaryData: <BinaryData>,\n    // collection assignment\n    collection: {\n        codename: 'teasers'\n    },\n    // description of asset in project languages\n    descriptions: [\n        {\n            description: 'Teaser of the article',\n            language: {\n                codename: 'en_uk'\n            }\n        }\n    ]\n};\n```\n\nOnce you are happy with the data, you can import them to Kontent.ai using the `importAsync` function.\n\n```typescript\nawait importAsync({\n    environmentId: environmentId,\n    apiKey: apiKey,\n    skipFailedItems: false,\n    data: {\n        assets: [migrationAsset],\n        items: [migrationItem]\n    }\n});\n```\n\n# Migration / import processing\n\n### How are content items imported?\n\nThe Migration Toolkit creates content items that are not present in target project. If the content item exists in target\nproject (based on item's `codename`) the item will be updated, otherwise it will be created. No duplicate items will be\ncreated. The workflow of the item in target environment will be set to match the source environment.\n\n### How are assets imported?\n\nIf asset exists in target project (based on asset's `codename`), the asset upload will be skipped and not uploaded at\nall. Otherwise the asset will be created in target environment.\n\n### How are referenced content items & asset handled?\n\nIf you have a reference to a content item or asset (i.e. in linked items element, asset element, rich text element...)\nthe migration toolkit first checks whether the referenced object exists (based on item or asset `codename`) and if it\ndoes, successfuly sets the reference. If the object does not exist, it will be referenced by an `external_id` which\ncreates a placeholder for the item until it becomes available.\n\nSee the table below to learn how `external_id` is generated by default:\n\n| Object type      | Template           | Sample `codename` of the object | Generated `external_id` |\n| ---------------- | ------------------ | ------------------------------- | ----------------------- |\n| **Asset**        | `asset_{codename}` | my_file                         | `asset_my_file`         |\n| **Content item** | `item_{codename}`  | article                         | `item_article`          |\n\nIf you need to change the way `external_id` is created, you may supply a custom implemenration of `externalIdGenerator`\nwithin import / migrate functions.\n\n## Limitations\n\n1. Asset folder assignments are not preserved during migration because folders can be referenced only by id's and not\n   codenames.\n2. Assets element values are not preserved during migration because elements can be referenced only by id's and not\n   codenames.\n3. Language variants in `Scheduled` workflow step do not preserve their workflow status because the API does not provide\n   an information about scheduled times\n\n## FAQ\n\n### I'm getting `Header overflow` exception\n\nThe Node.js limits the maximum header size of HTTP requests. In some cases it may be required for you to increase this\nlimitation to be able to successfully fetch data from Kontent.ai. You can do so by using the `max-http-header-size`\noption (https://nodejs.org/api/cli.html#--max-http-header-sizesize)\n\nExample script call:\n\n```bash\nnode --max-http-header-size 150000 %USERPROFILE%\\AppData\\Roaming\\npm\\node_modules\\kontent-ai-migration-toolkit\\dist\\cjs\\lib\\node\\cli\\app --action=export --apiKey=<key> --environmentId=<environmentId>\n```\n","engines":{"node":">=18"},"exports":"./dist/es2022/index.js","gitHead":"561d11dda7d126eee9240011e4dd740f1fa46b18","private":false,"scripts":{"lint":"npx eslint lib","test":"npm run test:all","build":"npm run clean && npm run build:es2022","clean":"tsx scripts/clean.ts","release":"npm run lint && standard-version && npm run update:version","lint:fix":"npx eslint lib --fix","test:all":"npm run build","push:tags":"git push --tags","test:help":"tsx lib/node/cli/app --help","test:export":"cd scripts/test && tsx test-export.ts","test:import":"cd scripts/test && tsx test-import.ts","build:es2022":"tsc --p tsconfig.es2022.json","publish:beta":"npm publish --tag=next","release:beta":"standard-version --prerelease && npm run update:version","test:migrate":"cd scripts/test && tsx test-migrate.ts","release:major":"npm run lint && standard-version --release-as major  && npm run update:version","prepublishOnly":"npm run lint && npm run build && npm run push:tags","update:version":"tsx ./scripts/version/update-version.ts","test:export:cli":"tsx lib/node/cli/app export --language=x --items=x --sourceEnvironmentId=x --sourceApiKey=x","test:help:command":"tsx lib/node/cli/app migrate --help","release:major:beta":"npm run lint && standard-version --prerelease --release-as major  && npm run update:version"},"_npmUser":{"name":"enngage","email":"ennspassion@gmail.com"},"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"_npmVersion":"10.2.4","description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","directories":{},"_nodeVersion":"20.11.1","dependencies":{"ora":"8.0.1","mime":"4.0.3","bytes":"3.1.2","chalk":"5.3.0","jszip":"3.10.1","yargs":"17.7.2","dotenv":"16.4.5","p-limit":"5.0.0","prompts":"2.4.2","browser-or-node":"3.0.0","@kontent-ai/management-sdk":"6.3.1","@kontent-ai-consulting/tools-analytics":"0.0.6"},"preferGlobal":true,"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tsx":"4.15.7","tslib":"2.6.3","eslint":"8.57.0","@eslint/js":"9.5.0","typescript":"5.5.2","@types/node":"20.14.9","@types/bytes":"3.1.4","@types/jszip":"3.4.1","@types/yargs":"17.0.32","@types/prompts":"2.4.9","standard-version":"9.5.0","@types/eslint__js":"8.42.3","typescript-eslint":"7.14.1","@types/browser-or-node":"1.3.2","@typescript-eslint/parser":"7.14.1","@typescript-eslint/eslint-plugin":"7.14.1"},"_npmOperationalInternal":{"tmp":"tmp/migration-toolkit_1.0.0-29_1719485319486_0.949517910953857","host":"s3://npm-registry-packages"},"deprecated":"Package has been moved to @kontent-ai/migration-toolkit"}},"time":{"created":"2024-02-28T13:00:18.365Z","modified":"2024-07-10T10:37:37.615Z","0.1.1":"2024-02-28T13:00:18.620Z","0.1.2":"2024-02-28T19:49:21.711Z","0.1.3":"2024-02-29T11:58:47.907Z","0.1.4":"2024-03-07T07:39:44.462Z","0.1.5":"2024-03-07T08:33:53.601Z","0.1.6":"2024-03-07T14:30:37.649Z","0.1.7":"2024-03-11T08:42:31.824Z","0.1.8":"2024-04-03T07:20:59.698Z","1.0.0-0":"2024-05-05T09:09:37.304Z","1.0.0-1":"2024-05-06T11:04:06.973Z","1.0.0-2":"2024-05-23T11:55:51.837Z","1.0.0-3":"2024-05-23T13:10:11.592Z","1.0.0-4":"2024-05-27T09:41:15.774Z","1.0.0-5":"2024-06-02T14:02:38.063Z","1.0.0-7":"2024-06-02T14:08:27.113Z","1.0.0-8":"2024-06-03T07:05:03.147Z","1.0.0-9":"2024-06-03T07:11:01.287Z","1.0.0-10":"2024-06-03T09:16:10.176Z","1.0.0-11":"2024-06-03T09:19:41.236Z","1.0.0-12":"2024-06-03T12:31:23.692Z","1.0.0-13":"2024-06-03T12:35:02.151Z","1.0.0-14":"2024-06-04T08:53:47.504Z","1.0.0-15":"2024-06-04T09:30:43.482Z","1.0.0-16":"2024-06-04T12:10:25.593Z","1.0.0-17":"2024-06-04T13:03:04.211Z","1.0.0-18":"2024-06-07T14:32:33.596Z","1.0.0-19":"2024-06-07T14:41:08.062Z","1.0.0-20":"2024-06-10T11:35:26.711Z","1.0.0-21":"2024-06-10T12:14:45.848Z","1.0.0-22":"2024-06-11T16:36:08.771Z","1.0.0-23":"2024-06-14T10:18:58.311Z","1.0.0-24":"2024-06-17T07:56:58.373Z","1.0.0-25":"2024-06-17T14:41:54.927Z","1.0.0-26":"2024-06-20T14:37:58.650Z","1.0.0-27":"2024-06-24T10:19:30.513Z","1.0.0-28":"2024-06-25T07:09:29.248Z","1.0.0-29":"2024-06-27T10:48:39.662Z"},"bugs":{"url":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit/issues"},"author":{"name":"Richard Sustek"},"license":"MIT","homepage":"https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit#readme","keywords":["Kontent.ai","Kontent.ai import","Kontent.ai import toolkit","Kontent.ai migration tool","Kontent.ai CSV export & import","Kontent.ai JSON export & import"],"repository":{"url":"git+https://github.com/Kontent-ai-consulting/kontent-ai-migration-toolkit.git","type":"git"},"description":"This program can be used to import content related data into Kontent.ai from various formats. Additionally, it can also be used to export Kontent.ai data using Delivery API.","maintainers":[{"name":"enngage","email":"ennspassion@gmail.com"}],"readme":"","readmeFilename":""}