From 84a936c1e8cafb2395e9f19839b84da4843afda2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 24 Feb 2023 17:23:52 +0100 Subject: [PATCH 001/359] #745: speed up retrieve-by-key for importFile --- lib/metadataTypes/ImportFile.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 3aca611bb..63a9c3f63 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -24,7 +24,14 @@ class ImportFile extends MetadataType { * @returns {Promise.} Promise */ static retrieve(retrieveDir, _, __, key) { - return super.retrieveREST(retrieveDir, '/automation/v1/imports/', null, null, key); + return super.retrieveREST( + retrieveDir, + '/automation/v1/imports/' + + (key ? `?$filter=customerKey%20eq%20${encodeURIComponent(key)}` : ''), + null, + null, + key + ); } /** From d340957e60c5e4372b0b22c89d2dec04ea1a542d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 20:58:15 +0000 Subject: [PATCH 002/359] Bump fast-xml-parser from 4.3.2 to 4.3.3 Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.3.2 to 4.3.3. - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.2...v4.3.3) --- updated-dependencies: - dependency-name: fast-xml-parser dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f615aa76..684f6ebda 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", - "fast-xml-parser": "4.3.2", + "fast-xml-parser": "4.3.3", "husky": "8.0.3", "jsdoc-to-markdown": "8.0.0", "lint-staged": "15.2.0", @@ -2956,9 +2956,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.2.tgz", - "integrity": "sha512-rmrXUXwbJedoXkStenj1kkljNF7ugn5ZjR9FJcwmCfcCbtOMDghPajbc+Tck6vE6F5XsDmx+Pr2le9fw8+pXBg==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.3.tgz", + "integrity": "sha512-coV/D1MhrShMvU6D0I+VAK3umz6hUaxxhL0yp/9RjfiYUfAv14rDhGQL+PLForhMdr0wq3PiV07WtkkNjJjNHg==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index a8321efb5..51b0d99e2 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", - "fast-xml-parser": "4.3.2", + "fast-xml-parser": "4.3.3", "husky": "8.0.3", "jsdoc-to-markdown": "8.0.0", "lint-staged": "15.2.0", From fc0bde5065ce8c59d3ea190bb179f0dd98cc6111 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:30:16 +0000 Subject: [PATCH 003/359] Bump update-notifier from 6.0.2 to 7.0.0 Bumps [update-notifier](https://github.com/yeoman/update-notifier) from 6.0.2 to 7.0.0. - [Release notes](https://github.com/yeoman/update-notifier/releases) - [Commits](https://github.com/yeoman/update-notifier/compare/v6.0.2...v7.0.0) --- updated-dependencies: - dependency-name: update-notifier dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 108 ++++++++++++++++------------------------------ package.json | 2 +- 2 files changed, 39 insertions(+), 71 deletions(-) diff --git a/package-lock.json b/package-lock.json index 684f6ebda..9679d9ff9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "sfmc-sdk": "2.0.1", "simple-git": "3.22.0", "toposort": "2.0.2", - "update-notifier": "6.0.2", + "update-notifier": "7.0.0", "winston": "3.11.0", "yargs": "17.7.2" }, @@ -1124,9 +1124,9 @@ "dev": true }, "node_modules/boxen": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.0.tgz", - "integrity": "sha512-ScG8CDo8dj7McqCZ5hz4dIBp20xj4unQ2lXIDa7ff6RcZElCpuNzutdwzKVvRikfNjm7CFAlR3HJHcoHkDOExQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", + "integrity": "sha512-2hCgjEmP8YLWQ130n2FerGv7rYpfBmnmp9Uy2Le1vge6X3gZIfSmEzP5QTDElFxcvVcXlEn8Aq6MU/PZygIOog==", "dependencies": { "ansi-align": "^3.0.1", "camelcase": "^7.0.1", @@ -1167,9 +1167,9 @@ } }, "node_modules/boxen/node_modules/chalk": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", - "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -1199,9 +1199,9 @@ } }, "node_modules/boxen/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dependencies": { "ansi-regex": "^6.0.1" }, @@ -3605,17 +3605,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/has-yarn": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-3.0.0.tgz", - "integrity": "sha512-IrsVwUHhEULx3R8f/aA8AHuEzAorplsab/v8HBzEiIukwq5i/EC+xmOW+HfP1OaDP+2JkgT1yILHN2O3UFIbcA==", - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/hasown": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", @@ -4118,6 +4107,20 @@ "node": ">=0.10.0" } }, + "node_modules/is-in-ci": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-in-ci/-/is-in-ci-0.1.0.tgz", + "integrity": "sha512-d9PXLEY0v1iJ64xLiQMJ51J128EYHAaOR4yZqQi8aHGfw6KgifM3/Viw1oZZ1GCVmb3gBuyhLyHj0HgR2DhSXQ==", + "bin": { + "is-in-ci": "cli.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", @@ -4375,14 +4378,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/is-yarn-global": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.4.1.tgz", - "integrity": "sha512-/kppl+R+LO5VmhYSEWARUFjodS25D68gvj8W7z0I7OWhUla5xWu8KL6CtB2V0R6yqhnRgbcaREMr4EEM6htLPQ==", - "engines": { - "node": ">=12" - } - }, "node_modules/isarray": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz", @@ -7804,36 +7799,34 @@ } }, "node_modules/update-notifier": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-6.0.2.tgz", - "integrity": "sha512-EDxhTEVPZZRLWYcJ4ZXjGFN0oP7qYvbXWzEgRm/Yql4dHX5wDbvh89YHP6PK1lzZJYrMtXUuZZz8XGK+U6U1og==", + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-7.0.0.tgz", + "integrity": "sha512-Hv25Bh+eAbOLlsjJreVPOs4vd51rrtCrmhyOJtbpAojro34jS4KQaEp4/EvlHJX7jSO42VvEFpkastVyXyIsdQ==", "dependencies": { - "boxen": "^7.0.0", - "chalk": "^5.0.1", + "boxen": "^7.1.1", + "chalk": "^5.3.0", "configstore": "^6.0.0", - "has-yarn": "^3.0.0", "import-lazy": "^4.0.0", - "is-ci": "^3.0.1", + "is-in-ci": "^0.1.0", "is-installed-globally": "^0.4.0", "is-npm": "^6.0.0", - "is-yarn-global": "^0.4.0", "latest-version": "^7.0.0", "pupa": "^3.1.0", - "semver": "^7.3.7", + "semver": "^7.5.4", "semver-diff": "^4.0.0", "xdg-basedir": "^5.1.0" }, "engines": { - "node": ">=14.16" + "node": ">=18" }, "funding": { "url": "https://github.com/yeoman/update-notifier?sponsor=1" } }, "node_modules/update-notifier/node_modules/chalk": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.2.0.tgz", - "integrity": "sha512-ree3Gqw/nazQAPuJJEy+avdl7QfZMcUvmHIKgEZkGL+xOBzRvup5Hxo6LHuMceSxOabuJLJm5Yp/92R9eMmMvA==", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", "engines": { "node": "^12.17.0 || ^14.13 || >=16.0.0" }, @@ -7841,31 +7834,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/update-notifier/node_modules/ci-info": { - "version": "3.8.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.8.0.tgz", - "integrity": "sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/sibiraj-s" - } - ], - "engines": { - "node": ">=8" - } - }, - "node_modules/update-notifier/node_modules/is-ci": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-3.0.1.tgz", - "integrity": "sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==", - "dependencies": { - "ci-info": "^3.2.0" - }, - "bin": { - "is-ci": "bin.js" - } - }, "node_modules/update-notifier/node_modules/semver-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-4.0.0.tgz", @@ -8074,9 +8042,9 @@ } }, "node_modules/widest-line/node_modules/strip-ansi": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", - "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", "dependencies": { "ansi-regex": "^6.0.1" }, diff --git a/package.json b/package.json index 51b0d99e2..89168260e 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "sfmc-sdk": "2.0.1", "simple-git": "3.22.0", "toposort": "2.0.2", - "update-notifier": "6.0.2", + "update-notifier": "7.0.0", "winston": "3.11.0", "yargs": "17.7.2" }, From 74b3254b8cce8a4c9dea10ae4b4a03413b356ea9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:32:25 +0000 Subject: [PATCH 004/359] Bump fs-extra from 11.1.1 to 11.2.0 Bumps [fs-extra](https://github.com/jprichardson/node-fs-extra) from 11.1.1 to 11.2.0. - [Changelog](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md) - [Commits](https://github.com/jprichardson/node-fs-extra/compare/11.1.1...11.2.0) --- updated-dependencies: - dependency-name: fs-extra dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9679d9ff9..8a7011878 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "conf": "12.0.0", "console.table": "0.10.0", "deep-equal": "2.2.3", - "fs-extra": "11.1.1", + "fs-extra": "11.2.0", "inquirer": "9.2.6", "json-to-table": "4.2.1", "mustache": "4.2.0", @@ -3241,9 +3241,9 @@ } }, "node_modules/fs-extra": { - "version": "11.1.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.1.1.tgz", - "integrity": "sha512-MGIE4HOvQCeUCzmlHs0vXpih4ysz4wg9qiSAu6cd42lVwPbTM1TjV7RusoyQqMmk/95gdQZX72u+YW+c3eEpFQ==", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", diff --git a/package.json b/package.json index 89168260e..c3b1105fc 100644 --- a/package.json +++ b/package.json @@ -69,7 +69,7 @@ "conf": "12.0.0", "console.table": "0.10.0", "deep-equal": "2.2.3", - "fs-extra": "11.1.1", + "fs-extra": "11.2.0", "inquirer": "9.2.6", "json-to-table": "4.2.1", "mustache": "4.2.0", From bb28b7192f744543a212caa0d48c71e4420e1d04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:35:40 +0000 Subject: [PATCH 005/359] Bump prettier-eslint from 16.2.0 to 16.3.0 Bumps [prettier-eslint](https://github.com/prettier/prettier-eslint) from 16.2.0 to 16.3.0. - [Release notes](https://github.com/prettier/prettier-eslint/releases) - [Changelog](https://github.com/prettier/prettier-eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier-eslint/compare/v16.2.0...v16.3.0) --- updated-dependencies: - dependency-name: prettier-eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 20 ++++++++++++++++---- package.json | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8a7011878..ed8a6c866 100644 --- a/package-lock.json +++ b/package-lock.json @@ -53,7 +53,7 @@ "mocha": "10.2.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", - "prettier-eslint": "16.2.0" + "prettier-eslint": "16.3.0" }, "engines": { "node": ">=18.16.0" @@ -6340,9 +6340,9 @@ } }, "node_modules/prettier-eslint": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-16.2.0.tgz", - "integrity": "sha512-GDTSKc62VaLceiaI/qMaKo2oco2CIWtbj4Zr6ckhbTgcBL/uR0d9jkMzh9OtBIT/Z7iBoCB4OHj/aJ5YuNgAuA==", + "version": "16.3.0", + "resolved": "https://registry.npmjs.org/prettier-eslint/-/prettier-eslint-16.3.0.tgz", + "integrity": "sha512-Lh102TIFCr11PJKUMQ2kwNmxGhTsv/KzUg9QYF2Gkw259g/kPgndZDWavk7/ycbRvj2oz4BPZ1gCU8bhfZH/Xg==", "dev": true, "dependencies": { "@typescript-eslint/parser": "^6.7.5", @@ -6360,6 +6360,18 @@ }, "engines": { "node": ">=16.10.0" + }, + "peerDependencies": { + "prettier-plugin-svelte": "^3.0.0", + "svelte-eslint-parser": "*" + }, + "peerDependenciesMeta": { + "prettier-plugin-svelte": { + "optional": true + }, + "svelte-eslint-parser": { + "optional": true + } } }, "node_modules/prettier-linter-helpers": { diff --git a/package.json b/package.json index c3b1105fc..27186b483 100644 --- a/package.json +++ b/package.json @@ -104,7 +104,7 @@ "mocha": "10.2.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", - "prettier-eslint": "16.2.0" + "prettier-eslint": "16.3.0" }, "optionalDependencies": { "fsevents": "*" From efeb1cc9c04aa2c07136bb67b8a6c11d620940aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jan 2024 10:38:51 +0000 Subject: [PATCH 006/359] Bump prettier-plugin-sql from 0.15.1 to 0.18.0 Bumps [prettier-plugin-sql](https://github.com/un-ts/prettier) from 0.15.1 to 0.18.0. - [Release notes](https://github.com/un-ts/prettier/releases) - [Changelog](https://github.com/un-ts/prettier/blob/master/CHANGELOG.md) - [Commits](https://github.com/un-ts/prettier/compare/prettier-plugin-sql@0.15.1...prettier-plugin-sql@0.18.0) --- updated-dependencies: - dependency-name: prettier-plugin-sql dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 43 ++++++++++++++++++++++++++----------------- package.json | 2 +- 2 files changed, 27 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index ed8a6c866..f074a7912 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "mustache": "4.2.0", "p-limit": "4.0.0", "prettier": "3.2.4", - "prettier-plugin-sql": "0.15.1", + "prettier-plugin-sql": "0.18.0", "semver": "7.5.4", "sfmc-sdk": "2.0.1", "simple-git": "3.22.0", @@ -1091,9 +1091,9 @@ } }, "node_modules/big-integer": { - "version": "1.6.51", - "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", - "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", + "version": "1.6.52", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz", + "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==", "engines": { "node": ">=0.6" } @@ -4605,6 +4605,14 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsox": { + "version": "1.2.119", + "resolved": "https://registry.npmjs.org/jsox/-/jsox-1.2.119.tgz", + "integrity": "sha512-f37obwxWKKuylcaOzNlUlzfDvURSCpqTXs8yEivhvsp86D/DTIySxP4v5Qdlg24qCuzDSZ0mJr3krc/f7TZ/5A==", + "bin": { + "jsox": "lib/cli.js" + } + }, "node_modules/klaw": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", @@ -5748,9 +5756,9 @@ "dev": true }, "node_modules/node-sql-parser": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/node-sql-parser/-/node-sql-parser-4.10.0.tgz", - "integrity": "sha512-P4LZNX8drf+0X5zPtcE5o1SV7Wn4VpTGSYOnN8uY+TswtHrg3ymb193tYpF8EMp2LhGqqDUqTAnCr8hqjN3uQw==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/node-sql-parser/-/node-sql-parser-4.17.0.tgz", + "integrity": "sha512-3IhovpmUBpcETnoKK/KBdkz2mz53kVG5E1dnqz1QuYvtzdxYZW5xaGGEvW9u6Yyy2ivwR3eUZrn9inmEVef02w==", "dependencies": { "big-integer": "^1.6.48" }, @@ -6387,13 +6395,14 @@ } }, "node_modules/prettier-plugin-sql": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/prettier-plugin-sql/-/prettier-plugin-sql-0.15.1.tgz", - "integrity": "sha512-CWYgo4dXDhjA6ofvC6yUjsEOSzb5qdLmaloK8V+mPiSjkvMbatWsSTKjkV2g4k17shtqYmnU+WWOaYpFNbNL1A==", + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-sql/-/prettier-plugin-sql-0.18.0.tgz", + "integrity": "sha512-E7WXooLNtWyv79sYYHtQbfvXZ5B/OOR0ySBsB2evfrfvD4wJos1OKLBvVLC/a7+7YpG30bSUTgc2DEwz8ctPmQ==", "dependencies": { - "node-sql-parser": "^4.7.0", - "sql-formatter": "^12.2.3", - "tslib": "^2.6.0" + "jsox": "^1.2.118", + "node-sql-parser": "^4.12.0", + "sql-formatter": "^15.0.2", + "tslib": "^2.6.2" }, "engines": { "node": "^14.18.0 || >=16.0.0" @@ -6402,7 +6411,7 @@ "url": "https://opencollective.com/unts" }, "peerDependencies": { - "prettier": "^3.0.0" + "prettier": "^3.0.3" } }, "node_modules/pretty-format": { @@ -7245,9 +7254,9 @@ "dev": true }, "node_modules/sql-formatter": { - "version": "12.2.4", - "resolved": "https://registry.npmjs.org/sql-formatter/-/sql-formatter-12.2.4.tgz", - "integrity": "sha512-Qj45LEHSfgrdYDOrAtIkR8SdS10SWcqCIM2WZwQwMKF2v9sM0K2dlThWPS7eYCUrhttZIrU1WwuIwHk7MjsWOw==", + "version": "15.1.2", + "resolved": "https://registry.npmjs.org/sql-formatter/-/sql-formatter-15.1.2.tgz", + "integrity": "sha512-zBrLBclCNurCsQaO6yMvkXzHvv7eJPjiF8LIEQ5HdBV/x6UuWIZwqss3mlZ/6HLj+VYhFKeHpQnyLuZWG2agKQ==", "dependencies": { "argparse": "^2.0.1", "get-stdin": "=8.0.0", diff --git a/package.json b/package.json index 27186b483..fd2370e76 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "mustache": "4.2.0", "p-limit": "4.0.0", "prettier": "3.2.4", - "prettier-plugin-sql": "0.15.1", + "prettier-plugin-sql": "0.18.0", "semver": "7.5.4", "sfmc-sdk": "2.0.1", "simple-git": "3.22.0", From 3d0c62bfbbd9b784a4911c674b798dded6d9b180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Jan 2024 12:06:31 +0100 Subject: [PATCH 007/359] #0: fix tests & prettier config for new sql-formatter version --- boilerplate/files/.prettierrc | 3 +++ boilerplate/forcedUpdates.json | 4 ++++ .../549f0568-607c-4940-afef-437965094dat/get-response.json | 2 +- .../9999999/automation/v1/queries/get-response.json | 6 +++--- test/resources/9999999/query/build-expected.sql | 3 ++- test/resources/9999999/query/get-expected.sql | 3 ++- test/resources/9999999/query/template-expected.sql | 3 ++- test/utils.js | 1 + 8 files changed, 18 insertions(+), 7 deletions(-) diff --git a/boilerplate/files/.prettierrc b/boilerplate/files/.prettierrc index dc978ca52..f69dee35c 100644 --- a/boilerplate/files/.prettierrc +++ b/boilerplate/files/.prettierrc @@ -17,6 +17,9 @@ "options": { "formatter": "sql-formatter", "language": "tsql", + "identifierCase": "preserve", + "dataTypeCase": "preserve", + "functionCase": "upper", "keywordCase": "upper" } } diff --git a/boilerplate/forcedUpdates.json b/boilerplate/forcedUpdates.json index 66485e68d..b67b5c030 100644 --- a/boilerplate/forcedUpdates.json +++ b/boilerplate/forcedUpdates.json @@ -1,4 +1,8 @@ [ + { + "version": "6.0.3", + "files": [".prettierrc"] + }, { "version": "5.0.0", "files": [".vscode/settings.json", ".prettierrc"] diff --git a/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json b/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json index 9144d0e0b..32aa90a8c 100644 --- a/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json +++ b/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat/get-response.json @@ -3,7 +3,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "bla bla", - "queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n", + "queryText": "Select\n SubscriberKey as testField, Trim(last_name) AS name\nFrom\n _Subscribers\nwhere\n country in ('test')\n", "targetName": "testExisting_dataExtension", "targetKey": "testExisting_dataExtension", "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", diff --git a/test/resources/9999999/automation/v1/queries/get-response.json b/test/resources/9999999/automation/v1/queries/get-response.json index 834827ed3..d07088bac 100644 --- a/test/resources/9999999/automation/v1/queries/get-response.json +++ b/test/resources/9999999/automation/v1/queries/get-response.json @@ -8,7 +8,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "bla bla", - "queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n", + "queryText": "Select\n SubscriberKey as testField, Trim(last_name) AS name\nFrom\n _Subscribers\nwhere\n country in ('test')\n", "targetName": "testExisting_dataExtension", "targetKey": "testExisting_dataExtension", "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", @@ -25,7 +25,7 @@ "name": "testExisting_query2", "key": "testExisting_query2", "description": "bla bla", - "queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n", + "queryText": "Select\n SubscriberKey as testField, Trim(last_name) AS name\nfrom\n _Subscribers\nwhere\n country in ('test')\n", "targetName": "testExisting_dataExtension", "targetKey": "testExisting_dataExtension-WRONG", "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", @@ -42,7 +42,7 @@ "name": "testExisting_query_fixedKeys", "key": "testExisting_query_fixKeys", "description": "bla bla", - "queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n", + "queryText": "Select\n SubscriberKey as testField, Trim(last_name) AS name\nfrom\n _Subscribers\nwhere\n country in ('test')\n", "targetName": "testExisting_dataExtension", "targetKey": "testExisting_dataExtension", "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", diff --git a/test/resources/9999999/query/build-expected.sql b/test/resources/9999999/query/build-expected.sql index 4385e76e8..d1cba0e90 100644 --- a/test/resources/9999999/query/build-expected.sql +++ b/test/resources/9999999/query/build-expected.sql @@ -1,5 +1,6 @@ SELECT - SubscriberKey AS testField + SubscriberKey AS testField, + TRIM(last_name) AS name FROM _Subscribers WHERE diff --git a/test/resources/9999999/query/get-expected.sql b/test/resources/9999999/query/get-expected.sql index 2a32f5fad..c6da62468 100644 --- a/test/resources/9999999/query/get-expected.sql +++ b/test/resources/9999999/query/get-expected.sql @@ -1,5 +1,6 @@ SELECT - SubscriberKey AS testField + SubscriberKey AS testField, + TRIM(last_name) AS name FROM _Subscribers WHERE diff --git a/test/resources/9999999/query/template-expected.sql b/test/resources/9999999/query/template-expected.sql index 06aae9b31..a1210ae9f 100644 --- a/test/resources/9999999/query/template-expected.sql +++ b/test/resources/9999999/query/template-expected.sql @@ -1,5 +1,6 @@ SELECT - SubscriberKey AS testField + SubscriberKey AS testField, + TRIM(last_name) AS name FROM _Subscribers WHERE diff --git a/test/utils.js b/test/utils.js index 98021ae80..0e4b881c4 100644 --- a/test/utils.js +++ b/test/utils.js @@ -168,6 +168,7 @@ export function mockSetup(isDeploy) { 'node_modules/sql-formatter': fsmock.load( path.resolve(__dirname, '../node_modules/sql-formatter') ), + 'node_modules/jsox': fsmock.load(path.resolve(__dirname, '../node_modules/jsox')), 'node_modules/nearley': fsmock.load(path.resolve(__dirname, '../node_modules/nearley')), }; if (isDeploy) { From cc32d3362b8a2ba196d064ac6773bd20f71ac077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 25 Jan 2024 22:50:59 +0100 Subject: [PATCH 008/359] #1189: retrieve & deploy blankFileProcessingType --- docs/dist/documentation.md | 13 ++++++++ lib/metadataTypes/ImportFile.js | 13 ++++++++ .../definitions/ImportFile.definition.js | 32 ++++++++++++++++++- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index c46eccb64..0cdea8418 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -3035,6 +3035,7 @@ ImportFile MetadataType * [.update(importFile)](#ImportFile.update) ⇒ Promise * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise * [.parseMetadata(metadata)](#ImportFile.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ boolean @@ -3134,6 +3135,18 @@ parses retrieved Metadata before saving | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single import definition | + + +### ImportFile.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: boolean - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + ## Journey ⇐ [MetadataType](#MetadataType) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 5348a4909..f5281f3be 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -163,6 +163,11 @@ class ImportFile extends MetadataType { } not fully supported. Deploy might fail.` ); } + if (metadata.c__blankFileProcessing) { + // omit this if not set + metadata.blankFileProcessingType = + this.definition.blankFileProcessingTypeMapping[metadata.c__blankFileProcessing]; + } // When the destinationObjectTypeId is 584 it refers to Mobile Connect which is not supported as an Import Type metadata.destinationObjectTypeId = this.definition.destinationObjectTypeMapping[metadata.c__destinationType]; @@ -216,6 +221,14 @@ class ImportFile extends MetadataType { Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`); } } + if (metadata.blankFileProcessingType) { + // omit this if not set + metadata.c__blankFileProcessing = Util.inverseGet( + this.definition.blankFileProcessingTypeMapping, + metadata.blankFileProcessingType + ); + delete metadata.blankFileProcessingType; + } metadata.c__subscriberImportType = Util.inverseGet( this.definition.subscriberImportTypeMapping, diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js index dc4263c2e..e233d0f26 100644 --- a/lib/metadataTypes/definitions/ImportFile.definition.js +++ b/lib/metadataTypes/definitions/ImportFile.definition.js @@ -8,7 +8,7 @@ export default { SMS: 584, Push: 613, }, - hasExtended: false, + hasExtended: true, idField: 'importDefinitionId', keyIsFixed: false, keyField: 'customerKey', @@ -33,6 +33,11 @@ export default { Overwrite: 4, Update: 2, }, + blankFileProcessingTypeMapping: { + Fail: 0, + Process: 1, + Skip: 2, + }, fields: { allowErrors: { isCreateable: true, @@ -40,6 +45,13 @@ export default { retrieving: true, template: true, }, + blankFileProcessingType: { + // only visible if retrieved with ID + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, createdDate: { isCreateable: false, isUpdateable: false, @@ -76,6 +88,12 @@ export default { retrieving: false, template: false, }, + destinationName: { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, destinationObjectId: { isCreateable: true, isUpdateable: true, @@ -115,6 +133,12 @@ export default { retrieving: true, template: true, }, + fileTransferLocationName: { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, fileTransferLocationTypeId: { isCreateable: true, isUpdateable: true, @@ -258,5 +282,11 @@ export default { retrieving: true, template: true, }, + c__blankFileProcessing: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, }, }; From 60348c8bdcdc21180efdbbb897f577168637f66d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 25 Jan 2024 23:00:12 +0100 Subject: [PATCH 009/359] #1189: improve performance for key-based retrieves --- lib/metadataTypes/ImportFile.js | 42 +++++++++++++++++-- lib/metadataTypes/MetadataType.js | 8 +++- .../definitions/ImportFile.definition.js | 2 + 3 files changed, 47 insertions(+), 5 deletions(-) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index f5281f3be..466ac84ff 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -23,8 +23,26 @@ class ImportFile extends MetadataType { * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ - static retrieve(retrieveDir, _, __, key) { - return super.retrieveREST(retrieveDir, '/automation/v1/imports/', null, key); + static async retrieve(retrieveDir, _, __, key) { + let objectId = null; + if (key) { + // using '?$filter=customerKey%20eq%20' + encodeURIComponent(key) would also work but that just retrieves more data for no reason + objectId = await this._getObjectIdForSingleRetrieve(key); + if (!objectId) { + // avoid running the rest request below by returning early + Util.logger.info( + `Downloaded: ${this.definition.type} (0)${Util.getKeysString(key)}` + ); + return { metadata: {}, type: this.definition.type }; + } + } + + return super.retrieveREST( + retrieveDir, + '/automation/v1/imports/' + (objectId || ''), + null, + key + ); } /** @@ -82,6 +100,23 @@ class ImportFile extends MetadataType { ); } } + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + static async _getObjectIdForSingleRetrieve(key) { + const response = await this.client.soap.retrieve('ImportDefinition', ['ObjectID'], { + filter: { + leftOperand: 'CustomerKey', + operator: 'equals', + rightOperand: key, + }, + }); + return response?.Results?.length ? response.Results[0].ObjectID : null; + } /** * manages post retrieve steps @@ -90,8 +125,7 @@ class ImportFile extends MetadataType { * @returns {TYPE.MetadataTypeItem} metadata */ static postRetrieveTasks(importDef) { - const val = this.parseMetadata(importDef); - return val; + return this.parseMetadata(importDef); } /** diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 2ea9cb9c2..81582b7dd 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1063,7 +1063,13 @@ class MetadataType { if (this.definition.hasExtended) { Util.logger.debug(' - retrieving extended metadata'); const extended = await this.client.rest.getCollection( - Object.keys(results).map((key) => uri + results[key][this.definition.idField]) + Object.keys(results) + .map((key) => + uri.endsWith(results[key][this.definition.idField]) + ? null + : uri + results[key][this.definition.idField] + ) + .filter(Boolean) ); for (const ext of extended) { const key = ext[this.definition.keyField]; diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js index e233d0f26..32fc1269b 100644 --- a/lib/metadataTypes/definitions/ImportFile.definition.js +++ b/lib/metadataTypes/definitions/ImportFile.definition.js @@ -89,6 +89,7 @@ export default { template: false, }, destinationName: { + // only visible if retrieved with ID isCreateable: false, isUpdateable: false, retrieving: false, @@ -134,6 +135,7 @@ export default { template: true, }, fileTransferLocationName: { + // only visible if retrieved with ID isCreateable: false, isUpdateable: false, retrieving: false, From ff3208790d35943f9e90714f0648b77afac9aad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 11:49:23 +0100 Subject: [PATCH 010/359] #1189: retrieveForCache harmonization --- docs/dist/documentation.md | 50 ++++++++++++++--------- lib/metadataTypes/Asset.js | 2 +- lib/metadataTypes/Folder.js | 2 +- lib/metadataTypes/ImportFile.js | 7 +++- lib/metadataTypes/MetadataType.js | 5 ++- lib/metadataTypes/MobileKeyword.js | 4 +- lib/metadataTypes/MobileMessage.js | 4 +- lib/metadataTypes/TransactionalEmail.js | 2 +- lib/metadataTypes/TransactionalMessage.js | 4 +- 9 files changed, 48 insertions(+), 32 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 0cdea8418..1f3eeaf3f 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -866,7 +866,7 @@ FileTransfer MetadataType * [Asset](#Asset) ⇐ [MetadataType](#MetadataType) * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache(_, [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> * [.create(metadata)](#Asset.create) ⇒ Promise * [.update(metadata)](#Asset.update) ⇒ Promise @@ -909,7 +909,7 @@ Retrieves Metadata of Asset -### Asset.retrieveForCache(_, [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> Retrieves asset metadata for caching **Kind**: static method of [Asset](#Asset) @@ -917,7 +917,7 @@ Retrieves asset metadata for caching | Param | Type | Description | | --- | --- | --- | -| _ | void | unused | +| [_] | void | parameter not used | | [subTypeArr] | Array.<string> | optionally limit to a single subtype | @@ -2877,7 +2877,7 @@ Folder MetadataType * [Folder](#Folder) ⇐ [MetadataType](#MetadataType) * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise - * [.retrieveForCache(_, [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise + * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> * [.create(metadataEntry)](#Folder.create) ⇒ Promise * [.update(metadataEntry)](#Folder.update) ⇒ Promise @@ -2904,7 +2904,7 @@ Retrieves metadata of metadata type into local filesystem. executes callback wit -### Folder.retrieveForCache(_, [subTypeArr]) ⇒ Promise +### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise Retrieves folder metadata for caching **Kind**: static method of [Folder](#Folder) @@ -2912,7 +2912,7 @@ Retrieves folder metadata for caching | Param | Type | Description | | --- | --- | --- | -| _ | void | unused | +| [_] | void | parameter not used | | [subTypeArr] | Array.<string> | content type of folder | @@ -3028,7 +3028,7 @@ ImportFile MetadataType * [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> * [.postRetrieveTasks(importDef)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.create(importFile)](#ImportFile.create) ⇒ Promise @@ -3056,11 +3056,18 @@ Currently it is not needed to loop over Imports with endpoint /automation/v1/imp -### ImportFile.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> Retrieves import definition metadata for caching **Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | + ### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> @@ -3403,7 +3410,7 @@ Provides default functionality that can be overwritten by child metadata type cl * [.setFolderId(metadata)](#MetadataType.setFolderId) * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> @@ -3629,7 +3636,7 @@ Gets metadata from Marketing Cloud -### MetadataType.retrieveForCache([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> Gets metadata cache with limited fields and does not store value to disk **Kind**: static method of [MetadataType](#MetadataType) @@ -3639,6 +3646,7 @@ Gets metadata cache with limited fields and does not store value to disk | --- | --- | --- | | [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | | [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | @@ -4354,7 +4362,7 @@ MobileKeyword MetadataType * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.retrieveForCache(_, __, [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> * [.create(metadata)](#MobileKeyword.create) ⇒ Promise * [.update(metadata)](#MobileKeyword.update) ⇒ Promise @@ -4418,7 +4426,7 @@ helper for [upsert](#MetadataType.upsert) -### MobileKeyword.retrieveForCache(_, __, [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> Retrieves event definition metadata for caching **Kind**: static method of [MobileKeyword](#MobileKeyword) @@ -4426,8 +4434,8 @@ Retrieves event definition metadata for caching | Param | Type | Description | | --- | --- | --- | -| _ | void | parameter not used | -| __ | void | parameter not used | +| [_] | void | parameter not used | +| [__] | void | parameter not used | | [key] | string | customer key of single item to retrieve | @@ -4645,7 +4653,7 @@ MobileMessage MetadataType * [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.retrieveForCache(_, __, [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.update(metadata)](#MobileMessage.update) ⇒ Promise * [.create(metadata)](#MobileMessage.create) ⇒ Promise * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> @@ -4677,7 +4685,7 @@ Retrieves Metadata of Mobile Keywords -### MobileMessage.retrieveForCache(_, __, [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> Retrieves event definition metadata for caching **Kind**: static method of [MobileMessage](#MobileMessage) @@ -4685,8 +4693,8 @@ Retrieves event definition metadata for caching | Param | Type | Description | | --- | --- | --- | -| _ | void | parameter not used | -| __ | void | parameter not used | +| [_] | void | parameter not used | +| [__] | void | parameter not used | | [key] | string | customer key of single item to retrieve | @@ -5529,7 +5537,7 @@ TransactionalMessage MetadataType * [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> @@ -5551,7 +5559,7 @@ Retrieves Metadata -### TransactionalMessage.retrieveForCache([key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> Retrieves event definition metadata for caching **Kind**: static method of [TransactionalMessage](#TransactionalMessage) @@ -5559,6 +5567,8 @@ Retrieves event definition metadata for caching | Param | Type | Description | | --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | | [key] | string | customer key of single item to cache | diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 3abad802d..61f5517c7 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -49,7 +49,7 @@ class Asset extends MetadataType { /** * Retrieves asset metadata for caching * - * @param {void} _ unused + * @param {void} [_] parameter not used * @param {string[]} [subTypeArr] optionally limit to a single subtype * @returns {Promise.<{metadata: TYPE.AssetMap, type: string}>} Promise */ diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index b4b2b6ae7..bdc026544 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -150,7 +150,7 @@ class Folder extends MetadataType { /** * Retrieves folder metadata for caching * - * @param {void} _ unused + * @param {void} [_] parameter not used * @param {string[]} [subTypeArr] content type of folder * @returns {Promise} Promise */ diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 466ac84ff..ee341403a 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -48,10 +48,13 @@ class ImportFile extends MetadataType { /** * Retrieves import definition metadata for caching * + * @param {void} [_] parameter not used + * @param {void} [__] parameter not used + * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ - static async retrieveForCache() { - return super.retrieveREST(null, '/automation/v1/imports/'); + static retrieveForCache(_, __, key) { + return this.retrieve(null, null, null, key); } /** diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 81582b7dd..7d30ab4d2 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -266,10 +266,11 @@ class MetadataType { * * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} metadata */ - static async retrieveForCache(additionalFields, subTypeArr) { - return this.retrieve(null, additionalFields, subTypeArr); + static async retrieveForCache(additionalFields, subTypeArr, key) { + return this.retrieve(null, additionalFields, subTypeArr, key); } /** * Gets metadata cache with limited fields and does not store value to disk diff --git a/lib/metadataTypes/MobileKeyword.js b/lib/metadataTypes/MobileKeyword.js index 23f753cbb..547151f96 100644 --- a/lib/metadataTypes/MobileKeyword.js +++ b/lib/metadataTypes/MobileKeyword.js @@ -151,8 +151,8 @@ class MobileKeyword extends MetadataType { /** * Retrieves event definition metadata for caching * - * @param {void} _ parameter not used - * @param {void} __ parameter not used + * @param {void} [_] parameter not used + * @param {void} [__] parameter not used * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/MobileMessage.js b/lib/metadataTypes/MobileMessage.js index 756d8175b..492be105c 100644 --- a/lib/metadataTypes/MobileMessage.js +++ b/lib/metadataTypes/MobileMessage.js @@ -50,8 +50,8 @@ class MobileMessage extends MetadataType { /** * Retrieves event definition metadata for caching * - * @param {void} _ parameter not used - * @param {void} __ parameter not used + * @param {void} [_] parameter not used + * @param {void} [__] parameter not used * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/TransactionalEmail.js b/lib/metadataTypes/TransactionalEmail.js index 35ad0cf13..079ccdc58 100644 --- a/lib/metadataTypes/TransactionalEmail.js +++ b/lib/metadataTypes/TransactionalEmail.js @@ -212,7 +212,7 @@ class TransactionalEmail extends TransactionalMessage { * @returns {Promise.} deletion success status */ static async deleteByKey(key) { - const metadataMapObj = await this.retrieveForCache(key); + const metadataMapObj = await this.retrieveForCache(null, null, key); const journeyKey = metadataMapObj?.metadata?.[key]?.journey?.interactionKey; const isDeleted = await super.deleteByKeyREST( diff --git a/lib/metadataTypes/TransactionalMessage.js b/lib/metadataTypes/TransactionalMessage.js index 523c6ac27..38ec53694 100644 --- a/lib/metadataTypes/TransactionalMessage.js +++ b/lib/metadataTypes/TransactionalMessage.js @@ -67,10 +67,12 @@ class TransactionalMessage extends MetadataType { /** * Retrieves event definition metadata for caching * + * @param {void} [_] parameter not used + * @param {void} [__] parameter not used * @param {string} [key] customer key of single item to cache * @returns {Promise.} Promise of metadata */ - static retrieveForCache(key) { + static retrieveForCache(_, __, key) { // the call to /messaging/v1/email/definitions/ does not return definitionId // definitionId is required for resolving dependencies on interactions. // we should therefore use the already defined retrieve method From d1005768353b3bf7203d56a99572bc9c180e5397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 11:58:13 +0100 Subject: [PATCH 011/359] #1189: fixing test cases to deal with additional api request --- ...stExisting_importFile.importFile-meta.json | 8 ++-- .../get-response.json | 35 +++++++++++++++++ .../patch-response.json | 24 +++++++----- ...erKey=testExisting_importFile-response.xml | 30 +++++++++++++++ ...-Name=testExisting_importFile-response.xml | 30 +++++++++++++++ .../9999999/importFile/build-expected.json | 4 +- .../9999999/importFile/get-expected.json | 16 ++++---- .../9999999/importFile/patch-expected.json | 6 ++- .../9999999/importFile/template-expected.json | 2 + test/type.automation.test.js | 26 ++++++------- test/type.importFile.test.js | 38 ++++++++++++++++--- test/type.query.test.js | 4 +- 12 files changed, 180 insertions(+), 43 deletions(-) create mode 100644 test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json create mode 100644 test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml create mode 100644 test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml diff --git a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json index 70fdc604f..16c631818 100644 --- a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json @@ -5,6 +5,7 @@ "dateFormatLocale": "en-US", "deleteFile": false, "description": "updated on deploy", + "encodingName": "utf-8", "fieldMappingType": "InferFromColumnHeadings", "fieldMappings": [], "fileNamingPattern": "blabla", @@ -21,9 +22,10 @@ "name": "testExisting_importFile", "sendEmailNotification": false, "standardQuotedStrings": true, - "r__fileLocation_name": "ExactTarget Enhanced FTP", + "c__blankFileProcessing": "Process", + "c__dataAction": "AddUpdate", "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", "c__subscriberImportType": "DataExtension", - "c__dataAction": "AddUpdate" + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__fileLocation_name": "ExactTarget Enhanced FTP" } diff --git a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json new file mode 100644 index 000000000..9e443db63 --- /dev/null +++ b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/get-response.json @@ -0,0 +1,35 @@ +{ + "allowErrors": true, + "customerKey": "testExisting_importFile", + "createdDate": "2022-11-09T05:32:30.533", + "modifiedDate": "2022-11-17T07:13:03.95", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "17.11.2022", + "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "destinationId": 0, + "destinationObjectTypeId": 310, + "destinationName": "testExisting_dataExtension", + "encodingName": "utf-8", + "fieldMappings": [], + "fieldMappingType": "InferFromColumnHeadings", + "fileNamingPattern": "blabla", + "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", + "fileTransferLocationName": "ExactTarget Enhanced FTP", + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b", + "isOrderedImport": true, + "isSequential": true, + "maxFileAgeHours": 0, + "maxImportFrequencyHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "name": "testExisting_importFile", + "sendEmailNotification": false, + "standardQuotedStrings": true, + "subscriberImportTypeId": 255, + "updateTypeId": 0, + "fileTransferLocationTypeId": 0, + "blankFileProcessingType": 2 +} diff --git a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json index 09b433e8d..be6e10946 100644 --- a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json +++ b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json @@ -1,31 +1,35 @@ { "allowErrors": true, "customerKey": "testExisting_importFile", + "createdDate": "2022-11-09T05:32:30.533", + "modifiedDate": "2023-07-18T09:11:26.19", "dateFormatLocale": "en-US", "deleteFile": false, "description": "updated on deploy", - "fieldMappingType": "InferFromColumnHeadings", + "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "destinationId": 0, + "destinationObjectTypeId": 310, + "destinationName": "testExisting_dataExtension", + "encodingName": "utf-8", "fieldMappings": [], + "fieldMappingType": "InferFromColumnHeadings", "fileNamingPattern": "blabla", - "fileTransferLocationTypeId": 0, + "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", + "fileTransferLocationName": "ExactTarget Enhanced FTP", "fileType": "CSV", "filter": "", "hasColumnHeader": true, + "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b", "isOrderedImport": true, "isSequential": true, "maxFileAgeHours": 0, - "maxFileAgeScheduleOffsetHours": 0, "maxImportFrequencyHours": 0, + "maxFileAgeScheduleOffsetHours": 0, "name": "testExisting_importFile", "sendEmailNotification": false, "standardQuotedStrings": true, - "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", - "destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", - "destinationObjectTypeId": 310, "subscriberImportTypeId": 255, "updateTypeId": 0, - "importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b", - "createdDate": "2022-11-09T05:53:03.243", - "destinationId": 0, - "modifiedDate": "2023-07-18T09:11:26.19" + "fileTransferLocationTypeId": 0, + "blankFileProcessingType": 1 } diff --git a/test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml b/test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml new file mode 100644 index 000000000..0af2d2588 --- /dev/null +++ b/test/resources/9999999/importDefinition/retrieve-CustomerKey=testExisting_importFile-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:58a4181c-9ea7-4d26-835b-f1eb50877b0b + urn:uuid:dab39bb4-2262-453a-9cb1-c591db9222d9 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-01-25T21:59:01Z + 2024-01-25T22:04:01Z + + + + + + OK + fdc476c9-46dc-43f5-b8a6-57f2299c65ac + + + 9d16f42c-2260-ed11-b849-48df37d1de8b + + + + diff --git a/test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml b/test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml new file mode 100644 index 000000000..0af2d2588 --- /dev/null +++ b/test/resources/9999999/importDefinition/retrieve-Name=testExisting_importFile-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:58a4181c-9ea7-4d26-835b-f1eb50877b0b + urn:uuid:dab39bb4-2262-453a-9cb1-c591db9222d9 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-01-25T21:59:01Z + 2024-01-25T22:04:01Z + + + + + + OK + fdc476c9-46dc-43f5-b8a6-57f2299c65ac + + + 9d16f42c-2260-ed11-b849-48df37d1de8b + + + + diff --git a/test/resources/9999999/importFile/build-expected.json b/test/resources/9999999/importFile/build-expected.json index a1e8feed7..11e81a297 100644 --- a/test/resources/9999999/importFile/build-expected.json +++ b/test/resources/9999999/importFile/build-expected.json @@ -1,5 +1,6 @@ { "allowErrors": true, + "c__blankFileProcessing": "Skip", "c__dataAction": "AddUpdate", "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", @@ -7,8 +8,9 @@ "dateFormatLocale": "en-US", "deleteFile": false, "description": "17.11.2022", - "fieldMappingType": "InferFromColumnHeadings", + "encodingName": "utf-8", "fieldMappings": [], + "fieldMappingType": "InferFromColumnHeadings", "fileNamingPattern": "blabla", "fileTransferLocationTypeId": 0, "fileType": "CSV", diff --git a/test/resources/9999999/importFile/get-expected.json b/test/resources/9999999/importFile/get-expected.json index 4175265c2..a704e2286 100644 --- a/test/resources/9999999/importFile/get-expected.json +++ b/test/resources/9999999/importFile/get-expected.json @@ -1,12 +1,17 @@ { "allowErrors": true, + "c__blankFileProcessing": "Skip", + "c__dataAction": "AddUpdate", + "c__destinationType": "DataExtension", + "c__subscriberImportType": "DataExtension", "createdDate": "2022-11-09T05:32:30.533", "customerKey": "testExisting_importFile", "dateFormatLocale": "en-US", "deleteFile": false, "description": "17.11.2022", - "fieldMappingType": "InferFromColumnHeadings", + "encodingName": "utf-8", "fieldMappings": [], + "fieldMappingType": "InferFromColumnHeadings", "fileNamingPattern": "blabla", "fileTransferLocationTypeId": 0, "fileType": "CSV", @@ -19,11 +24,8 @@ "maxImportFrequencyHours": 0, "modifiedDate": "2022-11-17T07:13:03.95", "name": "testExisting_importFile", - "sendEmailNotification": false, - "standardQuotedStrings": true, - "c__dataAction": "AddUpdate", - "c__destinationType": "DataExtension", - "c__subscriberImportType": "DataExtension", "r__dataExtension_CustomerKey": "testExisting_dataExtension", - "r__fileLocation_name": "ExactTarget Enhanced FTP" + "r__fileLocation_name": "ExactTarget Enhanced FTP", + "sendEmailNotification": false, + "standardQuotedStrings": true } diff --git a/test/resources/9999999/importFile/patch-expected.json b/test/resources/9999999/importFile/patch-expected.json index 844d9dd59..0d7618393 100644 --- a/test/resources/9999999/importFile/patch-expected.json +++ b/test/resources/9999999/importFile/patch-expected.json @@ -1,15 +1,17 @@ { "allowErrors": true, + "c__blankFileProcessing": "Process", "c__dataAction": "AddUpdate", "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", - "createdDate": "2022-11-09T05:53:03.243", + "createdDate": "2022-11-09T05:32:30.533", "customerKey": "testExisting_importFile", "dateFormatLocale": "en-US", "deleteFile": false, "description": "updated on deploy", - "fieldMappingType": "InferFromColumnHeadings", + "encodingName": "utf-8", "fieldMappings": [], + "fieldMappingType": "InferFromColumnHeadings", "fileNamingPattern": "blabla", "fileTransferLocationTypeId": 0, "fileType": "CSV", diff --git a/test/resources/9999999/importFile/template-expected.json b/test/resources/9999999/importFile/template-expected.json index 6be382e91..ff26a685b 100644 --- a/test/resources/9999999/importFile/template-expected.json +++ b/test/resources/9999999/importFile/template-expected.json @@ -1,5 +1,6 @@ { "allowErrors": true, + "c__blankFileProcessing": "Skip", "c__dataAction": "AddUpdate", "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", @@ -7,6 +8,7 @@ "dateFormatLocale": "en-US", "deleteFile": false, "description": "17.11.2022", + "encodingName": "utf-8", "fieldMappingType": "InferFromColumnHeadings", "fieldMappings": [], "fileNamingPattern": "blabla", diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 140c3eed6..543859e62 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -45,7 +45,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 18, + 19, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -119,7 +119,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 25, + 26, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -188,7 +188,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 33, + 34, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -256,7 +256,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 29, + 30, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -291,7 +291,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 18, + 19, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -335,7 +335,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 40, + 42, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -379,7 +379,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 42, + 44, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -423,7 +423,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 43, + 45, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -463,7 +463,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 35, + 37, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -504,7 +504,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 41, + 43, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -545,7 +545,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 43, + 45, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -596,7 +596,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 20, + 21, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -643,7 +643,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 18, + 19, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 06ca6c009..7e90a8de3 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -33,7 +33,35 @@ describe('type: importFile', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 10, + 11, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should retrieve a importFile by key', async () => { + // WHEN + await handler.retrieve( + 'testInstance/testBU', + ['importFile'], + ['testExisting_importFile'] + ); + // THEN + assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.importFile ? Object.keys(result.importFile).length : 0, + 1, + 'only one importFile expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_importFile', 'importFile'), + await testUtils.getExpectedJson('9999999', 'importFile', 'get'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 11, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -71,7 +99,7 @@ describe('type: importFile', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 12, + 13, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -116,7 +144,7 @@ describe('type: importFile', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 10, + 11, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -161,7 +189,7 @@ describe('type: importFile', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 10, + 11, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -173,7 +201,7 @@ describe('type: importFile', () => { const isDeleted = await handler.deleteByKey( 'testInstance/testBU', 'importFile', - 'testExisting_fileTranfer' + 'testExisting_importFile' ); // THEN assert.equal( diff --git a/test/type.query.test.js b/test/type.query.test.js index 57c16d8f3..dc2b183cd 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -455,7 +455,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 34, + 35, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -495,7 +495,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 36, + 37, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; From 790bf7fbd4e2720eae9980f40b564b57448da229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 12:00:59 +0100 Subject: [PATCH 012/359] #1189: enhance retrieveAsTemplate for importFile --- lib/metadataTypes/ImportFile.js | 30 +++++++++++-------- .../definitions/ImportFile.definition.js | 1 + 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index ee341403a..26efb0f3c 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -66,12 +66,12 @@ class ImportFile extends MetadataType { * @returns {Promise.} Promise */ static async retrieveAsTemplate(templateDir, name, templateVariables) { - const res = await this.client.rest.get( - '/automation/v1/imports/?$filter=name%20eq%20' + encodeURIComponent(name) - ); - if (Array.isArray(res?.items) && res?.items.length) { + // using '?$filter=name%20eq%20' + encodeURIComponent(name) would also work but that just retrieves more data for no reason + const cache = await this.retrieveForCache(null, null, 'name:' + name); + const metadataArr = Object.values(cache?.metadata); + if (Array.isArray(metadataArr) && metadataArr.length) { // eq-operator returns a similar, not exact match and hence might return more than 1 entry - const metadata = res.items.find((item) => item.name === name); + const metadata = metadataArr.find((item) => item.name === name); if (!metadata) { Util.logger.error(`No ${this.definition.typeName} found with name "${name}"`); return; @@ -93,13 +93,13 @@ class ImportFile extends MetadataType { ); Util.logger.info(`- templated ${this.definition.type}: ${name}`); return { metadata: val, type: this.definition.type }; - } else if (res?.items) { + } else if (metadataArr) { Util.logger.error(`No ${this.definition.typeName} found with name "${name}"`); } else { throw new Error( `Encountered unknown error when retrieveing ${ this.definition.typeName - } "${name}": ${JSON.stringify(res)}` + } "${name}": ${JSON.stringify(metadataArr)}` ); } } @@ -112,11 +112,17 @@ class ImportFile extends MetadataType { */ static async _getObjectIdForSingleRetrieve(key) { const response = await this.client.soap.retrieve('ImportDefinition', ['ObjectID'], { - filter: { - leftOperand: 'CustomerKey', - operator: 'equals', - rightOperand: key, - }, + filter: key.startsWith('name:') + ? { + leftOperand: 'Name', + operator: 'equals', + rightOperand: key.slice(5), + } + : { + leftOperand: 'CustomerKey', + operator: 'equals', + rightOperand: key, + }, }); return response?.Results?.length ? response.Results[0].ObjectID : null; } diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js index 32fc1269b..0b3aa28a3 100644 --- a/lib/metadataTypes/definitions/ImportFile.definition.js +++ b/lib/metadataTypes/definitions/ImportFile.definition.js @@ -108,6 +108,7 @@ export default { template: true, }, encodingName: { + // only visible if retrieved with ID isCreateable: true, isUpdateable: true, retrieving: true, From cb89209a108ffc793fc48ccfa0daa20b1981d1a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 14:01:36 +0100 Subject: [PATCH 013/359] #164: support delete importFile --- lib/metadataTypes/ImportFile.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 26efb0f3c..1b385f798 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -285,6 +285,21 @@ class ImportFile extends MetadataType { delete metadata.updateTypeId; return metadata; } + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {boolean} deletion success status + */ + static async deleteByKey(customerKey) { + // delete only works with the query's object id + const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; + if (!objectId) { + Util.logger.error(` - import not found`); + return false; + } + return super.deleteByKeyREST('/automation/v1/imports/' + objectId, customerKey); + } } // Assign definition to static attributes From f7595442f945b6281c04b256bdcbc1d822e8db97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 18:23:45 +0100 Subject: [PATCH 014/359] #164: support delete for fileTransfer --- docs/dist/documentation.md | 13 ++++++++ lib/metadataTypes/FileTransfer.js | 31 +++++++++++++++++++ .../delete-response.json | 1 + test/type.fileTransfer.test.js | 14 ++------- 4 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/delete-response.json diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 1f3eeaf3f..98b504327 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -2744,6 +2744,7 @@ FileTransfer MetadataType * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise * [.parseMetadata(metadata)](#FileTransfer.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ boolean @@ -2842,6 +2843,18 @@ parses retrieved Metadata before saving | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | + + +### FileTransfer.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit + +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: boolean - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + ## Filter ⇐ [MetadataType](#MetadataType) diff --git a/lib/metadataTypes/FileTransfer.js b/lib/metadataTypes/FileTransfer.js index 35067f816..817ee6d4c 100644 --- a/lib/metadataTypes/FileTransfer.js +++ b/lib/metadataTypes/FileTransfer.js @@ -162,6 +162,37 @@ class FileTransfer extends MetadataType { return metadata; } + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + static async _getObjectIdForSingleRetrieve(key) { + const name = key.startsWith('name:') ? key.slice(5) : null; + const filter = name ? '?$filter=name%20eq%20' + encodeURIComponent(name) : ''; + const results = await this.client.rest.get('/automation/v1/filetransfers/' + filter); + const items = results?.items || []; + const found = items.find((item) => (name ? item.name === name : item.customerKey === key)); + return found?.id || null; + } + + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {boolean} deletion success status + */ + static async deleteByKey(customerKey) { + // delete only works with the query's object id + const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; + if (!objectId) { + Util.logger.error(` - fileTransfer not found`); + return false; + } + return super.deleteByKeyREST('/automation/v1/filetransfers/' + objectId, customerKey); + } } // Assign definition to static attributes diff --git a/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/delete-response.json b/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/delete-response.json new file mode 100644 index 000000000..0967ef424 --- /dev/null +++ b/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/delete-response.json @@ -0,0 +1 @@ +{} diff --git a/test/type.fileTransfer.test.js b/test/type.fileTransfer.test.js index 1bb0f10e0..188a09658 100644 --- a/test/type.fileTransfer.test.js +++ b/test/type.fileTransfer.test.js @@ -172,19 +172,11 @@ describe('type: fileTransfer', () => { const isDeleted = await handler.deleteByKey( 'testInstance/testBU', 'fileTransfer', - 'testExisting_fileTranfer' + 'testExisting_fileTransfer' ); // THEN - assert.equal( - process.exitCode, - 1, - 'deleteByKey should have thrown an error due to lack of support' - ); - assert.equal( - isDeleted, - false, - 'deleteByKey should have returned false due to lack of support' - ); + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); return; }); }); From 7319c33c7081ba18498f54c6e153ab949f23115e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 18:28:16 +0100 Subject: [PATCH 015/359] #164: support delete for importFile - test case --- .../delete-response.txt | 0 test/type.importFile.test.js | 12 ++---------- 2 files changed, 2 insertions(+), 10 deletions(-) create mode 100644 test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/delete-response.txt diff --git a/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/delete-response.txt b/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/delete-response.txt new file mode 100644 index 000000000..e69de29bb diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 7e90a8de3..21ad11d73 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -204,16 +204,8 @@ describe('type: importFile', () => { 'testExisting_importFile' ); // THEN - assert.equal( - process.exitCode, - 1, - 'deleteByKey should have thrown an error due to lack of support' - ); - assert.equal( - isDeleted, - false, - 'deleteByKey should have returned false due to lack of support' - ); + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); return; }); }); From e8a285d5bcd2e6580e40167854fe814e89e53250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 18:57:18 +0100 Subject: [PATCH 016/359] #164: support delete for fileTransfer --- docs/dist/documentation.md | 13 +++++++++++++ lib/metadataTypes/FileTransfer.js | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 98b504327..b204520cf 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -2232,6 +2232,7 @@ DataExtract MetadataType * [.update(dataExtract)](#DataExtract.update) ⇒ Promise * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem * [.parseMetadata(metadata)](#DataExtract.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ boolean @@ -2330,6 +2331,18 @@ parses retrieved Metadata before saving | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | + + +### DataExtract.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit + +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: boolean - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + ## DataExtractType ⇐ [MetadataType](#MetadataType) diff --git a/lib/metadataTypes/FileTransfer.js b/lib/metadataTypes/FileTransfer.js index 817ee6d4c..62fa606f8 100644 --- a/lib/metadataTypes/FileTransfer.js +++ b/lib/metadataTypes/FileTransfer.js @@ -174,7 +174,9 @@ class FileTransfer extends MetadataType { const filter = name ? '?$filter=name%20eq%20' + encodeURIComponent(name) : ''; const results = await this.client.rest.get('/automation/v1/filetransfers/' + filter); const items = results?.items || []; - const found = items.find((item) => (name ? item.name === name : item.customerKey === key)); + const found = items.find((item) => + name ? item[this.definition.nameField] === name : item[this.definition.keyField] === key + ); return found?.id || null; } From ffdaa8c4464c97f8eeb45a4c73055d99720d6c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 18:59:41 +0100 Subject: [PATCH 017/359] #164: support delete for dataExtract --- lib/metadataTypes/DataExtract.js | 33 +++++++++++++++++++ .../delete-response.txt | 1 + test/type.dataExtract.test.js | 14 ++------ 3 files changed, 37 insertions(+), 11 deletions(-) create mode 100644 test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/delete-response.txt diff --git a/lib/metadataTypes/DataExtract.js b/lib/metadataTypes/DataExtract.js index c6cdf0168..ae6bf299c 100644 --- a/lib/metadataTypes/DataExtract.js +++ b/lib/metadataTypes/DataExtract.js @@ -157,6 +157,39 @@ class DataExtract extends MetadataType { } return JSON.parse(JSON.stringify(metadata)); } + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + static async _getObjectIdForSingleRetrieve(key) { + const name = key.startsWith('name:') ? key.slice(5) : null; + const filter = name ? '?$filter=name%20eq%20' + encodeURIComponent(name) : ''; + const results = await this.client.rest.get('/automation/v1/dataextracts/' + filter); + const items = results?.items || []; + const found = items.find((item) => + name ? item[this.definition.nameField] === name : item[this.definition.keyField] === key + ); + return found?.dataExtractDefinitionId || null; + } + + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {boolean} deletion success status + */ + static async deleteByKey(customerKey) { + // delete only works with the query's object id + const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; + if (!objectId) { + Util.logger.error(` - dataExtract not found`); + return false; + } + return super.deleteByKeyREST('/automation/v1/dataextracts/' + objectId, customerKey); + } } // Assign definition to static attributes diff --git a/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/delete-response.txt b/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/delete-response.txt new file mode 100644 index 000000000..d86bac9de --- /dev/null +++ b/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/delete-response.txt @@ -0,0 +1 @@ +OK diff --git a/test/type.dataExtract.test.js b/test/type.dataExtract.test.js index 12cde0fb5..bf5aafe07 100644 --- a/test/type.dataExtract.test.js +++ b/test/type.dataExtract.test.js @@ -174,19 +174,11 @@ describe('type: dataExtract', () => { const isDeleted = await handler.deleteByKey( 'testInstance/testBU', 'dataExtract', - 'testExisting_fileTranfer' + 'testExisting_dataExtract' ); // THEN - assert.equal( - process.exitCode, - 1, - 'deleteByKey should have thrown an error due to lack of support' - ); - assert.equal( - isDeleted, - false, - 'deleteByKey should have returned false due to lack of support' - ); + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); return; }); }); From a6bc86c8341d071161baf77707ef4e96db678b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 19:19:57 +0100 Subject: [PATCH 018/359] #164: support delete for script --- docs/dist/documentation.md | 25 ++++++++++ lib/metadataTypes/Script.js | 50 +++++++++++++++++++ .../delete-response.txt | 1 + test/type.script.test.js | 15 +++++- 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/delete-response.txt diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index b204520cf..944797e37 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -5254,6 +5254,8 @@ Script MetadataType * [.parseMetadata(metadata)](#Script.parseMetadata) ⇒ TYPE.CodeExtractItem * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void @@ -5449,6 +5451,29 @@ additionally, the documentation for dataExtension and automation should be retur | --- | --- | --- | | keyArr | Array.<string> | customerkey of the metadata | + + +### Script.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit + +**Kind**: static method of [Script](#Script) +**Returns**: boolean - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### Script.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item + +**Kind**: static method of [Script](#Script) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + ## SendClassification ⇐ [MetadataType](#MetadataType) diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index e84ea214d..2c56bd6ad 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -324,6 +324,56 @@ class Script extends MetadataType { ]); return fileList; } + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + static async _getObjectIdForSingleRetrieve(key) { + const name = key.startsWith('name:') ? key.slice(5) : null; + const filter = name + ? '?$filter=name%20eq%20' + encodeURIComponent(name) + : '?$filter=key%20eq%20' + encodeURIComponent(key); + const results = await this.client.rest.get('/automation/v1/scripts/' + filter); + const items = results?.items || []; + const found = items.find((item) => + name ? item[this.definition.nameField] === name : item[this.definition.keyField] === key + ); + return found?.ssjsActivityId || null; + } + + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {boolean} deletion success status + */ + static async deleteByKey(customerKey) { + // delete only works with the query's object id + const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; + if (!objectId) { + Util.logger.error(` - ${this.definition.type} not found`); + return false; + } + return super.deleteByKeyREST('/automation/v1/scripts/' + objectId, customerKey); + } + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {void} + */ + static async postDeleteTasks(customerKey) { + // delete local copy: retrieve/cred/bu/.../...-meta.json + // delete local copy: retrieve/cred/bu/.../...-meta.ssjs + // delete local copy: retrieve/cred/bu/.../...-meta.html + await super.postDeleteTasks(customerKey, [ + `${this.definition.type}-meta.ssjs`, + `${this.definition.type}-meta.html`, + ]); + } } // Assign definition & cache to static attributes diff --git a/test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/delete-response.txt b/test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/delete-response.txt new file mode 100644 index 000000000..d86bac9de --- /dev/null +++ b/test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/delete-response.txt @@ -0,0 +1 @@ +OK diff --git a/test/type.script.test.js b/test/type.script.test.js index 215136ab5..330553518 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -372,7 +372,20 @@ describe('type: script', () => { return; }); }); - describe('Delete ================', () => {}); + describe('Delete ================', () => { + it('Should delete the item', async () => { + // WHEN + const isDeleted = await handler.deleteByKey( + 'testInstance/testBU', + 'script', + 'testExisting_script' + ); + // THEN + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); + return; + }); + }); describe('CI/CD ================', () => { it('Should return a list of files based on their type and key', async () => { // WHEN From 1dc5597228a3f58a491d55c9a89ae264b99f425a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 26 Jan 2024 19:21:19 +0100 Subject: [PATCH 019/359] #164: cleanup --- test/type.dataExtract.test.js | 2 +- test/type.fileTransfer.test.js | 2 +- test/type.importFile.test.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/type.dataExtract.test.js b/test/type.dataExtract.test.js index bf5aafe07..a2beb9ffe 100644 --- a/test/type.dataExtract.test.js +++ b/test/type.dataExtract.test.js @@ -169,7 +169,7 @@ describe('type: dataExtract', () => { }); }); describe('Delete ================', () => { - it('Should NOT delete the item', async () => { + it('Should delete the item', async () => { // WHEN const isDeleted = await handler.deleteByKey( 'testInstance/testBU', diff --git a/test/type.fileTransfer.test.js b/test/type.fileTransfer.test.js index 188a09658..b4c18386b 100644 --- a/test/type.fileTransfer.test.js +++ b/test/type.fileTransfer.test.js @@ -167,7 +167,7 @@ describe('type: fileTransfer', () => { }); }); describe('Delete ================', () => { - it('Should NOT delete the item', async () => { + it('Should delete the item', async () => { // WHEN const isDeleted = await handler.deleteByKey( 'testInstance/testBU', diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 21ad11d73..42e12a286 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -196,7 +196,7 @@ describe('type: importFile', () => { }); }); describe('Delete ================', () => { - it('Should NOT delete the item', async () => { + it('Should delete the item', async () => { // WHEN const isDeleted = await handler.deleteByKey( 'testInstance/testBU', From 50edae3ae059d30f0c9b064b8406a9526e7008a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 29 Jan 2024 14:17:03 +0100 Subject: [PATCH 020/359] #164: refactoring --- docs/dist/documentation.md | 128 +++++------------------- lib/metadataTypes/ContentArea.js | 11 +- lib/metadataTypes/DataExtensionField.js | 12 --- lib/metadataTypes/DataExtract.js | 20 +--- lib/metadataTypes/Email.js | 9 -- lib/metadataTypes/FileTransfer.js | 19 +--- lib/metadataTypes/ImportFile.js | 21 ++-- lib/metadataTypes/MetadataType.js | 2 +- lib/metadataTypes/Script.js | 23 ++--- 9 files changed, 50 insertions(+), 195 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 944797e37..b441b4e3f 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -1767,9 +1767,8 @@ ContentArea MetadataType * [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.setFolderPath(metadata)](#ContentArea.setFolderPath) - * [.parseMetadata(metadata)](#ContentArea.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem @@ -1786,18 +1785,6 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: TYPE.MetadataTypeItem - parsed item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - ### ContentArea.setFolderPath(metadata) @@ -1809,9 +1796,9 @@ generic script that retrieves the folder path from cache and updates the given m | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### ContentArea.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem +### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem parses retrieved Metadata before saving **Kind**: static method of [ContentArea](#ContentArea) @@ -2227,11 +2214,10 @@ DataExtract MetadataType * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.postRetrieveTasks(fileTransfer)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.create(dataExtract)](#DataExtract.create) ⇒ Promise * [.update(dataExtract)](#DataExtract.update) ⇒ Promise * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata)](#DataExtract.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ boolean @@ -2271,18 +2257,6 @@ Retrieve a specific dataExtract Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - -### DataExtract.postRetrieveTasks(fileTransfer) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single fileTransfer | - ### DataExtract.create(dataExtract) ⇒ Promise @@ -2319,17 +2293,17 @@ prepares a dataExtract for deployment | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | - + -### DataExtract.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps **Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | +| metadata | TYPE.MetadataTypeItem | a single item | @@ -2414,7 +2388,6 @@ Email MetadataType * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata)](#Email.parseMetadata) ⇒ TYPE.MetadataTypeItem @@ -2458,18 +2431,6 @@ manages post retrieve steps | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single query | - - -### Email.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving - -**Kind**: static method of [Email](#Email) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query activity definition | - ## EmailSend ⇐ [MetadataType](#MetadataType) @@ -2752,11 +2713,10 @@ FileTransfer MetadataType * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ Array.<object> * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise - * [.parseMetadata(metadata)](#FileTransfer.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ boolean @@ -2796,18 +2756,6 @@ Retrieve a specific File Transfer Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - -### FileTransfer.postRetrieveTasks(metadata) ⇒ Array.<object> -manages post retrieve steps - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Array.<object> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - ### FileTransfer.create(fileTransfer) ⇒ Promise @@ -2844,10 +2792,10 @@ prepares a fileTransfer for deployment | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - + -### FileTransfer.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps **Kind**: static method of [FileTransfer](#FileTransfer) **Returns**: TYPE.MetadataTypeItem - parsed metadata @@ -3056,11 +3004,10 @@ ImportFile MetadataType * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.postRetrieveTasks(importDef)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.create(importFile)](#ImportFile.create) ⇒ Promise * [.update(importFile)](#ImportFile.update) ⇒ Promise * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.parseMetadata(metadata)](#ImportFile.parseMetadata) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ boolean @@ -3108,18 +3055,6 @@ Retrieve a specific Import Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - -### ImportFile.postRetrieveTasks(importDef) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| importDef | TYPE.MetadataTypeItem | a single importDef | - ### ImportFile.create(importFile) ⇒ Promise @@ -3156,17 +3091,17 @@ prepares a import definition for deployment | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single importDef | - + -### ImportFile.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps **Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata definition +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single import definition | +| metadata | TYPE.MetadataTypeItem | a single item | @@ -5243,7 +5178,6 @@ Script MetadataType * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> - * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem * [.update(script)](#Script.update) ⇒ Promise * [.create(script)](#Script.create) ⇒ Promise * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> @@ -5251,7 +5185,7 @@ Script MetadataType * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.parseMetadata(metadata)](#Script.parseMetadata) ⇒ TYPE.CodeExtractItem + * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ boolean @@ -5294,18 +5228,6 @@ Retrieve a specific Script by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - -### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one ssjs string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.ScriptItem | a single script | - ### Script.update(script) ⇒ Promise @@ -5413,22 +5335,22 @@ handles extracted code if any are found for complex types | templateName | string | name of the template to be built | | mode | 'definition' \| 'template' | defines what we use this helper for | - + -### Script.parseMetadata(metadata) ⇒ TYPE.CodeExtractItem -Splits the script metadata into two parts and parses in a standard manner +### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps **Kind**: static method of [Script](#Script) **Returns**: TYPE.CodeExtractItem - a single item with code parts extracted | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.ScriptItem | a single script activity definition | +| metadata | TYPE.ScriptItem | a single item | ### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object -helper for [parseMetadata](#Script.parseMetadata) and [_buildForNested](#Script._buildForNested) +helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) **Kind**: static method of [Script](#Script) **Returns**: Object - returns found extension and file content diff --git a/lib/metadataTypes/ContentArea.js b/lib/metadataTypes/ContentArea.js index a67049c92..f9d18edb7 100644 --- a/lib/metadataTypes/ContentArea.js +++ b/lib/metadataTypes/ContentArea.js @@ -38,15 +38,6 @@ class ContentArea extends MetadataType { // !dont activate `await File.initPrettier('html');` as we only want to retrieve for migration and formatting might mess with the outcome return super.retrieveSOAP(retrieveDir, requestParams, key); } - /** - * manages post retrieve steps - * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} parsed item - */ - static postRetrieveTasks(metadata) { - return this.parseMetadata(metadata); - } /** * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve * @@ -79,7 +70,7 @@ class ContentArea extends MetadataType { * @param {TYPE.MetadataTypeItem} metadata a single item * @returns {TYPE.MetadataTypeItem} parsed item */ - static parseMetadata(metadata) { + static postRetrieveTasks(metadata) { // folder this.setFolderPath(metadata); diff --git a/lib/metadataTypes/DataExtensionField.js b/lib/metadataTypes/DataExtensionField.js index ec0eeb329..c1f93fae7 100644 --- a/lib/metadataTypes/DataExtensionField.js +++ b/lib/metadataTypes/DataExtensionField.js @@ -63,18 +63,6 @@ class DataExtensionField extends MetadataType { * @returns {TYPE.DataExtensionFieldItem} metadata */ static postRetrieveTasks(metadata, forDataExtension) { - return this._parseMetadata(metadata, forDataExtension); - } - - /** - * parses retrieved Metadata before saving - * - * @private - * @param {TYPE.DataExtensionFieldItem} metadata a single record - * @param {boolean} forDataExtension when used by DataExtension class we remove more fields - * @returns {TYPE.DataExtensionFieldItem} parsed metadata definition - */ - static _parseMetadata(metadata, forDataExtension) { if (forDataExtension) { // remove fields according to definition this.keepRetrieveFields(metadata); diff --git a/lib/metadataTypes/DataExtract.js b/lib/metadataTypes/DataExtract.js index ae6bf299c..01dc2e8e4 100644 --- a/lib/metadataTypes/DataExtract.js +++ b/lib/metadataTypes/DataExtract.js @@ -61,7 +61,7 @@ class DataExtract extends MetadataType { const originalKey = extended[this.definition.keyField]; const val = JSON.parse( Util.replaceByObject( - JSON.stringify(this.parseMetadata(extended)), + JSON.stringify(this.postRetrieveTasks(extended)), templateVariables ) ); @@ -86,16 +86,6 @@ class DataExtract extends MetadataType { } } - /** - * manages post retrieve steps - * - * @param {TYPE.MetadataTypeItem} fileTransfer a single fileTransfer - * @returns {TYPE.MetadataTypeItem} metadata - */ - static postRetrieveTasks(fileTransfer) { - return this.parseMetadata(fileTransfer); - } - /** * Creates a single Data Extract * @@ -136,12 +126,12 @@ class DataExtract extends MetadataType { return metadata; } /** - * parses retrieved Metadata before saving + * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single dataExtract activity definition - * @returns {TYPE.MetadataTypeItem} Array with one metadata object and one sql string + * @param {TYPE.MetadataTypeItem} metadata a single item + * @returns {TYPE.MetadataTypeItem} metadata */ - static parseMetadata(metadata) { + static postRetrieveTasks(metadata) { try { metadata.r__dataExtractType_name = cache.searchForField( 'dataExtractType', diff --git a/lib/metadataTypes/Email.js b/lib/metadataTypes/Email.js index f4b3c0d4c..7c17111c6 100644 --- a/lib/metadataTypes/Email.js +++ b/lib/metadataTypes/Email.js @@ -59,15 +59,6 @@ class Email extends MetadataType { * @returns {TYPE.MetadataTypeItem} Array with one metadata object and one query string */ static postRetrieveTasks(metadata) { - return this.parseMetadata(metadata); - } - /** - * parses retrieved Metadata before saving - * - * @param {TYPE.MetadataTypeItem} metadata a single query activity definition - * @returns {TYPE.MetadataTypeItem} Array with one metadata object and one sql string - */ - static parseMetadata(metadata) { // folder super.setFolderPath(metadata); diff --git a/lib/metadataTypes/FileTransfer.js b/lib/metadataTypes/FileTransfer.js index 62fa606f8..6fc6310d5 100644 --- a/lib/metadataTypes/FileTransfer.js +++ b/lib/metadataTypes/FileTransfer.js @@ -61,7 +61,7 @@ class FileTransfer extends MetadataType { const originalKey = extended[this.definition.keyField]; const val = JSON.parse( Util.replaceByObject( - JSON.stringify(this.parseMetadata(extended)), + JSON.stringify(this.postRetrieveTasks(extended)), templateVariables ) ); @@ -86,17 +86,6 @@ class FileTransfer extends MetadataType { } } - /** - * manages post retrieve steps - * - * @param {TYPE.MetadataTypeItem} metadata a single fileTransfer activity definition - * @returns {object[]} metadata - */ - static postRetrieveTasks(metadata) { - const values = this.parseMetadata(metadata); - return values; - } - /** * Creates a single File Transfer * @@ -139,13 +128,14 @@ class FileTransfer extends MetadataType { } return metadata; } + /** - * parses retrieved Metadata before saving + * manages post retrieve steps * * @param {TYPE.MetadataTypeItem} metadata a single fileTransfer activity definition * @returns {TYPE.MetadataTypeItem} parsed metadata */ - static parseMetadata(metadata) { + static postRetrieveTasks(metadata) { try { metadata.r__fileLocation_name = cache.searchForField( 'fileLocation', @@ -162,6 +152,7 @@ class FileTransfer extends MetadataType { return metadata; } + /** * helper to allow us to select single metadata entries via REST * diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 1b385f798..4199931b2 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -79,7 +79,7 @@ class ImportFile extends MetadataType { const originalKey = metadata[this.definition.keyField]; const val = JSON.parse( Util.replaceByObject( - JSON.stringify(this.parseMetadata(metadata)), + JSON.stringify(this.postRetrieveTasks(metadata)), templateVariables ) ); @@ -127,16 +127,6 @@ class ImportFile extends MetadataType { return response?.Results?.length ? response.Results[0].ObjectID : null; } - /** - * manages post retrieve steps - * - * @param {TYPE.MetadataTypeItem} importDef a single importDef - * @returns {TYPE.MetadataTypeItem} metadata - */ - static postRetrieveTasks(importDef) { - return this.parseMetadata(importDef); - } - /** * Creates a single Import File * @@ -221,12 +211,12 @@ class ImportFile extends MetadataType { } /** - * parses retrieved Metadata before saving + * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single import definition - * @returns {TYPE.MetadataTypeItem} parsed metadata definition + * @param {TYPE.MetadataTypeItem} metadata a single item + * @returns {TYPE.MetadataTypeItem} parsed metadata */ - static parseMetadata(metadata) { + static postRetrieveTasks(metadata) { metadata.r__fileLocation_name = cache.searchForField( 'fileLocation', metadata.fileTransferLocationId, @@ -285,6 +275,7 @@ class ImportFile extends MetadataType { delete metadata.updateTypeId; return metadata; } + /** * Delete a metadata item from the specified business unit * diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 7d30ab4d2..874515599 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1558,7 +1558,7 @@ class MetadataType { * @returns {?boolean} true: filter value found; false: filter value not found; null: no filter defined */ static _filterOther(myFilter, metadataEntry) { - // not possible to check r__folder_Path before parseMetadata was run; handled in `isFilteredFolder()` + // not possible to check r__folder_Path before postRetrieveTasks was run; handled in `isFilteredFolder()` if ( !myFilter || !Object.keys(myFilter).filter((item) => item !== 'r__folder_Path').length diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index 2c56bd6ad..63f1979c6 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -51,16 +51,6 @@ class Script extends MetadataType { ); } - /** - * manages post retrieve steps - * - * @param {TYPE.ScriptItem} metadata a single script - * @returns {TYPE.CodeExtractItem} Array with one metadata object and one ssjs string - */ - static postRetrieveTasks(metadata) { - return this.parseMetadata(metadata); - } - /** * Updates a single Script * @@ -211,7 +201,7 @@ class Script extends MetadataType { // get SSJS from filesystem let code = await this._mergeCode(metadata, templateDir, templateName); // try to remove script tags and decide on file extension (html/ssjs) - const file = Script.prepExtractedCode(code, metadata.name); + const file = this.prepExtractedCode(code, metadata.name); const fileExt = file.fileExt; code = fileExt === 'ssjs' ? file.code.replace(/^\n/, '') : file.code; // apply templating @@ -255,19 +245,19 @@ class Script extends MetadataType { } /** - * Splits the script metadata into two parts and parses in a standard manner + * manages post retrieve steps * - * @param {TYPE.ScriptItem} metadata a single script activity definition + * @param {TYPE.ScriptItem} metadata a single item * @returns {TYPE.CodeExtractItem} a single item with code parts extracted */ - static parseMetadata(metadata) { + static postRetrieveTasks(metadata) { // folder super.setFolderPath(metadata); // extract SSJS const codeArr = []; // keep between tags - const { fileExt, code } = Script.prepExtractedCode(metadata.script, metadata.name); + const { fileExt, code } = this.prepExtractedCode(metadata.script, metadata.name); delete metadata.script; codeArr.push({ subFolder: null, @@ -278,8 +268,9 @@ class Script extends MetadataType { return { json: metadata, codeArr: codeArr, subFolder: null }; } + /** - * helper for {@link Script.parseMetadata} and {@link Script._buildForNested} + * helper for {@link Script.postRetrieveTasks} and {@link Script._buildForNested} * * @param {string} metadataScript the code of the file * @param {string} metadataName the name of the metadata From 3c96236f9e7c6b1815a246969d6ac4729ecfad29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 29 Jan 2024 15:55:14 +0100 Subject: [PATCH 021/359] #164: support delete for asset --- docs/dist/documentation.md | 26 +++++ lib/metadataTypes/Asset.js | 60 ++++++++++ test/resourceFactory.js | 62 ++++++++++- .../content/assets/950143/delete-response.txt | 1 + ...sponse-customerKey=testExisting_asset.json | 105 ++++++++++++++++++ test/type.asset.test.js | 14 +++ 6 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 test/resources/9999999/asset/v1/content/assets/950143/delete-response.txt create mode 100644 test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index b441b4e3f..9cec6282b 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -891,6 +891,8 @@ FileTransfer MetadataType * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void @@ -1266,6 +1268,30 @@ additionally, the documentation for dataExtension and automation should be retur | --- | --- | --- | | keyArr | Array.<string> | customerkey of the metadata | + + +### Asset.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit + +**Kind**: static method of [Asset](#Asset) +**Returns**: boolean - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### Asset.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk + +**Kind**: static method of [Asset](#Asset) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + ## AttributeGroup ⇐ [MetadataType](#MetadataType) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 61f5517c7..61ea7b52a 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1629,6 +1629,66 @@ class Asset extends MetadataType { ).flat(); return fileList; } + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + static async _getObjectIdForSingleRetrieve(key) { + const name = key.startsWith('name:') ? key.slice(5) : null; + const filter = name + ? '?$filter=name%20eq%20' + encodeURIComponent(name) + : '?$filter=customerKey%20eq%20' + encodeURIComponent(key); + + const results = await this.client.rest.get('/asset/v1/content/assets/' + filter); + const items = results?.items || []; + const found = items.find((item) => + name ? item[this.definition.nameField] === name : item[this.definition.keyField] === key + ); + return found?.id || null; + } + + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {boolean} deletion success status + */ + static async deleteByKey(customerKey) { + // delete only works with the query's object id + const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; + if (!objectId) { + Util.logger.error(` - ${this.definition.type} not found`); + return false; + } + return super.deleteByKeyREST('/asset/v1/content/assets/' + objectId, customerKey); + } + + /** + * clean up after deleting a metadata item + * cannot use the generic method due to the complexity of how assets are saved to disk + * + * @param {string} customerKey Identifier of metadata item + * @returns {void} + */ + static async postDeleteTasks(customerKey) { + const fileArr = await this.getFilesToCommit([customerKey]); + + // check if asset sits in its own folder + const ownFolderIndex = + fileArr[0].indexOf(customerKey + '\\') > 0 + ? fileArr[0].indexOf(customerKey + '\\') + : fileArr[0].indexOf(customerKey + '/'); + if (ownFolderIndex > 0) { + fileArr.push(fileArr[0].slice(0, ownFolderIndex + customerKey.length)); + } + + for (const filePath of fileArr) { + await File.remove(filePath); + } + } } // Assign definition to static attributes diff --git a/test/resourceFactory.js b/test/resourceFactory.js index 30407d340..e9141d0a9 100644 --- a/test/resourceFactory.js +++ b/test/resourceFactory.js @@ -252,8 +252,52 @@ export const handleRESTRequest = async (config) => { config.method + '-response' ) .replace(':', '_'); // replace : with _ for Windows + const testPathFilter = filterName + ? testPath + + '-' + + urlObj.searchParams.get('$filter').replaceAll(' eq ', '=').replaceAll(' ', '') + : null; + if (testPathFilter && (await fs.pathExists(testPathFilter + '.json'))) { + // build filter logic to ensure templating works + if (filterName) { + const response = JSON.parse( + await fs.readFile(testPathFilter + '.json', { + encoding: 'utf8', + }) + ); + response.items = response.items.filter((def) => def.name == filterName); + response.count = response.items.length; + return [200, JSON.stringify(response)]; + } else { + return [ + 200, + await fs.readFile(testPathFilter + '.json', { + encoding: 'utf8', + }), + ]; + } + } else if (testPathFilter && (await fs.pathExists(testPathFilter + '.txt'))) { + return [ + 200, + await fs.readFile(testPathFilter + '.txt', { + encoding: 'utf8', + }), + ]; + } else if (await fs.pathExists(testPath + '.json')) { + if (testPathFilter) { + /* eslint-disable no-console */ + console.log( + `${color.bgYellow}${color.fgBlack}TEST-WARNING${ + color.reset + }: You are loading your reponse from ${ + testPath + '.json' + } instead of the more specific ${ + testPathFilter + '.json' + }. Make sure this is intended` + ); + /* eslint-enable no-console */ + } - if (await fs.pathExists(testPath + '.json')) { // build filter logic to ensure templating works if (filterName) { const response = JSON.parse( @@ -273,6 +317,20 @@ export const handleRESTRequest = async (config) => { ]; } } else if (await fs.pathExists(testPath + '.txt')) { + if (testPathFilter) { + /* eslint-disable no-console */ + console.log( + `${color.bgYellow}${color.fgBlack}TEST-WARNING${ + color.reset + }: You are loading your reponse from ${ + testPath + '.txt' + } instead of the more specific ${ + testPathFilter + '.txt' + }. Make sure this is intended` + ); + /* eslint-enable no-console */ + } + return [ 200, await fs.readFile(testPath + '.txt', { @@ -282,7 +340,7 @@ export const handleRESTRequest = async (config) => { } else { /* eslint-disable no-console */ console.log( - `${color.bgRed}${color.fgBlack}TEST-ERROR${color.reset}: Please create file ${testPath}.json/.txt` + `${color.bgRed}${color.fgBlack}TEST-ERROR${color.reset}: Please create file ${testPath}.json/.txt${filterName ? ` or ${testPathFilter}.json/.txt` : ''}` ); /* eslint-enable no-console */ process.exitCode = 404; diff --git a/test/resources/9999999/asset/v1/content/assets/950143/delete-response.txt b/test/resources/9999999/asset/v1/content/assets/950143/delete-response.txt new file mode 100644 index 000000000..d86bac9de --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/950143/delete-response.txt @@ -0,0 +1 @@ +OK diff --git a/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json b/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json new file mode 100644 index 000000000..0964cfb60 --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json @@ -0,0 +1,105 @@ +{ + "count": 1, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [ + { + "id": 950143, + "customerKey": "testExisting_asset", + "objectID": "198ad191-59ae-44d1-9981-ffa71b076ad9", + "contentType": "text/html", + "assetType": { + "id": 205, + "name": "webpage", + "displayName": "Web Page" + }, + "version": 1, + "name": "testExisting_asset", + "owner": { + "id": 717319337, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld", + "userId": "717319337" + }, + "createdDate": "2021-09-13T12:14:02.32-06:00", + "createdBy": { + "id": 717319337, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld", + "userId": "717319337" + }, + "modifiedDate": "2023-08-02T07:10:29.553-06:00", + "modifiedBy": { + "id": 700304523, + "name": "SFMC DEVOPS app user", + "userId": "700304523" + }, + "enterpriseId": 111111, + "memberId": 999999, + "status": { + "id": 1, + "name": "Draft" + }, + "thumbnail": { + "thumbnailUrl": "/v1/assets/950143/thumbnail" + }, + "category": { + "id": 667369 + }, + "meta": { + "globalStyles": { + "isLocked": false, + "body": { + "max-width": "1280px", + "color": "#000000", + "font-family": "Arial", + "font-size": "12px", + "margin": "0px auto" + }, + "template": { + "background-color": "#FFFFFF", + "border": "none", + "box-sizing": "border-box", + "padding": "0px", + "width": "100%" + } + } + }, + "views": { + "html": { + "thumbnail": {}, + "content": "\n\n \n \n \n \n \n \n
\n
\n
\n
\n
\n
\n
\n \n\n", + "slots": { + "col1": { + "content": "
", + "design": "

Drop blocks or content here

", + "blocks": { + "bgbqbbx4we9": { + "assetType": { + "id": 197, + "name": "htmlblock" + }, + "content": "
\n%%[FOR @I=1 TO 1000 DO\n SET @a = CONCAT(IIF(MOD(@i, 3)==0, \"Fizz\", \"\"), IIF(MOD(@i,5)==0,\"Buzz\",\"\"), IIF(MOD(@i, 7)==0, \"Boing\", \"\"), IIF(MOD(@i,11)==0,\"Bang\",\"\"))\nOUTPUT(CONCAT(@a, IIF(LENGTH(@a)>0, \"\", @i), \"
\"))NEXT @i\n]%%\n
", + "design": "
", + "meta": { + "wrapperStyles": { + "mobile": { + "visible": true + } + } + }, + "modelVersion": 2 + } + }, + "modelVersion": 2 + } + }, + "modelVersion": 2 + } + }, + "availableViews": ["html"], + "modelVersion": 2 + } + ] +} diff --git a/test/type.asset.test.js b/test/type.asset.test.js index df709ace5..959ce797e 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -81,4 +81,18 @@ describe('type: asset', () => { return; }); }); + describe('Delete ================', () => { + it('Should delete the item', async () => { + // WHEN + const isDeleted = await handler.deleteByKey( + 'testInstance/testBU', + 'asset', + 'testExisting_asset' + ); + // THEN + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); + return; + }); + }); }); From b60afe8d3218cf5853e8642075c7b8235ec37377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 29 Jan 2024 16:11:54 +0100 Subject: [PATCH 022/359] #164: jsdoc cleanup --- docs/dist/documentation.md | 48 +++++++++++++++---------------- lib/metadataTypes/Asset.js | 2 +- lib/metadataTypes/DataExtract.js | 2 +- lib/metadataTypes/FileTransfer.js | 2 +- lib/metadataTypes/ImportFile.js | 2 +- lib/metadataTypes/MetadataType.js | 4 +-- lib/metadataTypes/Query.js | 2 +- lib/metadataTypes/Script.js | 2 +- 8 files changed, 32 insertions(+), 32 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 9cec6282b..10baca458 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -891,7 +891,7 @@ FileTransfer MetadataType * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ boolean + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void @@ -1270,11 +1270,11 @@ additionally, the documentation for dataExtension and automation should be retur -### Asset.deleteByKey(customerKey) ⇒ boolean +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit **Kind**: static method of [Asset](#Asset) -**Returns**: boolean - deletion success status +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | @@ -2244,7 +2244,7 @@ DataExtract MetadataType * [.update(dataExtract)](#DataExtract.update) ⇒ Promise * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ boolean + * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> @@ -2333,11 +2333,11 @@ manages post retrieve steps -### DataExtract.deleteByKey(customerKey) ⇒ boolean +### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit **Kind**: static method of [DataExtract](#DataExtract) -**Returns**: boolean - deletion success status +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | @@ -2743,7 +2743,7 @@ FileTransfer MetadataType * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ boolean + * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> @@ -2832,11 +2832,11 @@ manages post retrieve steps -### FileTransfer.deleteByKey(customerKey) ⇒ boolean +### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit **Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: boolean - deletion success status +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | @@ -3034,7 +3034,7 @@ ImportFile MetadataType * [.update(importFile)](#ImportFile.update) ⇒ Promise * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ boolean + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> @@ -3131,11 +3131,11 @@ manages post retrieve steps -### ImportFile.deleteByKey(customerKey) ⇒ boolean +### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit **Kind**: static method of [ImportFile](#ImportFile) -**Returns**: boolean - deletion success status +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | @@ -3444,8 +3444,8 @@ Provides default functionality that can be overwritten by child metadata type cl * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ boolean - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ boolean + * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> + * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> @@ -4239,11 +4239,11 @@ clean up after deleting a metadata item -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ boolean +### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> Delete a data extension from the specified business unit **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success flag +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | @@ -4253,11 +4253,11 @@ Delete a data extension from the specified business unit -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ boolean +### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> Delete a data extension from the specified business unit **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success flag +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | @@ -4887,7 +4887,7 @@ Query MetadataType * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void - * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ boolean + * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) @@ -5067,11 +5067,11 @@ Standardizes a check for multiple messages but adds query specific filters to er -### Query.deleteByKey(customerKey) ⇒ boolean +### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit **Kind**: static method of [Query](#Query) -**Returns**: boolean - deletion success status +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | @@ -5214,7 +5214,7 @@ Script MetadataType * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ boolean + * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void @@ -5401,11 +5401,11 @@ additionally, the documentation for dataExtension and automation should be retur -### Script.deleteByKey(customerKey) ⇒ boolean +### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit **Kind**: static method of [Script](#Script) -**Returns**: boolean - deletion success status +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 61ea7b52a..badfeb065 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1654,7 +1654,7 @@ class Asset extends MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success flag */ static async deleteByKey(customerKey) { // delete only works with the query's object id diff --git a/lib/metadataTypes/DataExtract.js b/lib/metadataTypes/DataExtract.js index 01dc2e8e4..1d50cd458 100644 --- a/lib/metadataTypes/DataExtract.js +++ b/lib/metadataTypes/DataExtract.js @@ -169,7 +169,7 @@ class DataExtract extends MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success flag */ static async deleteByKey(customerKey) { // delete only works with the query's object id diff --git a/lib/metadataTypes/FileTransfer.js b/lib/metadataTypes/FileTransfer.js index 6fc6310d5..494f77fe9 100644 --- a/lib/metadataTypes/FileTransfer.js +++ b/lib/metadataTypes/FileTransfer.js @@ -175,7 +175,7 @@ class FileTransfer extends MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success flag */ static async deleteByKey(customerKey) { // delete only works with the query's object id diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 4199931b2..447e1c0e4 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -280,7 +280,7 @@ class ImportFile extends MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success flag */ static async deleteByKey(customerKey) { // delete only works with the query's object id diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 874515599..bea4107c7 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -2021,7 +2021,7 @@ class MetadataType { * @param {string} customerKey Identifier of metadata * @param {string} [overrideKeyField] optionally change the name of the key field if the api uses a different name * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method - * @returns {boolean} deletion success flag + * @returns {Promise.} deletion success flag */ static async deleteByKeySOAP(customerKey, overrideKeyField, handleOutside) { const metadata = {}; @@ -2056,7 +2056,7 @@ class MetadataType { * @param {string} url endpoint * @param {string} key Identifier of metadata * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method - * @returns {boolean} deletion success flag + * @returns {Promise.} deletion success flag */ static async deleteByKeyREST(url, key, handleOutside) { try { diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index a7cd501a7..1fffc67d2 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -435,7 +435,7 @@ class Query extends MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success flag */ static async deleteByKey(customerKey) { // delete only works with the query's object id diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index 63f1979c6..702cdfb33 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -339,7 +339,7 @@ class Script extends MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success flag */ static async deleteByKey(customerKey) { // delete only works with the query's object id From f067b063e7c424662add5db3a6e7e913e55f91bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 29 Jan 2024 16:14:51 +0100 Subject: [PATCH 023/359] #164: cleanup --- .../assets/get-response-customerKey=testExisting_asset.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json b/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json index 0964cfb60..6c91edf43 100644 --- a/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json +++ b/test/resources/9999999/asset/v1/content/assets/get-response-customerKey=testExisting_asset.json @@ -81,7 +81,7 @@ "name": "htmlblock" }, "content": "
\n%%[FOR @I=1 TO 1000 DO\n SET @a = CONCAT(IIF(MOD(@i, 3)==0, \"Fizz\", \"\"), IIF(MOD(@i,5)==0,\"Buzz\",\"\"), IIF(MOD(@i, 7)==0, \"Boing\", \"\"), IIF(MOD(@i,11)==0,\"Bang\",\"\"))\nOUTPUT(CONCAT(@a, IIF(LENGTH(@a)>0, \"\", @i), \"
\"))NEXT @i\n]%%\n
", - "design": "
", + "design": "
", "meta": { "wrapperStyles": { "mobile": { From 7e7ffa07a547c71011705ac03f80f9ca316cd16e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 20:17:15 +0000 Subject: [PATCH 024/359] Bump husky from 8.0.3 to 9.0.7 Bumps [husky](https://github.com/typicode/husky) from 8.0.3 to 9.0.7. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v8.0.3...v9.0.7) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index f074a7912..9cf73ec95 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", "fast-xml-parser": "4.3.3", - "husky": "8.0.3", + "husky": "9.0.7", "jsdoc-to-markdown": "8.0.0", "lint-staged": "15.2.0", "mocha": "10.2.0", @@ -3675,15 +3675,15 @@ } }, "node_modules/husky": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz", - "integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==", + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.7.tgz", + "integrity": "sha512-vWdusw+y12DUEeoZqW1kplOFqk3tedGV8qlga8/SF6a3lOiWLqGZZQvfWvY0fQYdfiRi/u1DFNpudTSV9l1aCg==", "dev": true, "bin": { - "husky": "lib/bin.js" + "husky": "bin.js" }, "engines": { - "node": ">=14" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/typicode" diff --git a/package.json b/package.json index fd2370e76..98145e1a2 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", "fast-xml-parser": "4.3.3", - "husky": "8.0.3", + "husky": "9.0.7", "jsdoc-to-markdown": "8.0.0", "lint-staged": "15.2.0", "mocha": "10.2.0", From 547f3fad114d90e5291407f3cf79f6bcb83241f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 30 Jan 2024 11:22:26 +0100 Subject: [PATCH 025/359] #0: migrate config to husky v9 --- .husky/pre-commit | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 287490035..eb06e57ff 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,5 @@ #!/bin/sh -. "$(dirname "$0")/_/husky.sh" +npm test npm run docs git update-index --add docs/dist/documentation.md diff --git a/package.json b/package.json index 98145e1a2..8dc0a3792 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "lint-lib": "eslint lib/**/*.js", "lint-type": "eslint types/*.js", "lint-test": "eslint test/**/*.js", - "manual-prepare": "husky install", + "prepare": "husky || true", "lint-and-test": "run-s lint test", "test": "mocha --reporter-option maxDiffSize=25000", "coverage": "c8 npm run test", From 7f282b811e60b9b2ca08b5c7272fea3d3e682c12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 30 Jan 2024 11:26:20 +0100 Subject: [PATCH 026/359] #0: ran npx husky init --- .husky/pre-commit | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index eb06e57ff..72c4429bc 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,6 +1 @@ -#!/bin/sh npm test - -npm run docs -git update-index --add docs/dist/documentation.md -npx --no lint-staged From 5d57e415671fa886d1ca8cfe4e9957d91712e853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 30 Jan 2024 11:28:59 +0100 Subject: [PATCH 027/359] #0: re-add docs and lint-staged --- .husky/pre-commit | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.husky/pre-commit b/.husky/pre-commit index 72c4429bc..6d7ff8b41 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,5 @@ npm test + +npm run docs +git update-index --add docs/dist/documentation.md +npx --no lint-staged From 65e6da9e551151d8369f67be233e489d7399a83b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Jan 2024 13:09:36 +0000 Subject: [PATCH 028/359] Bump p-limit from 4.0.0 to 5.0.0 Bumps [p-limit](https://github.com/sindresorhus/p-limit) from 4.0.0 to 5.0.0. - [Release notes](https://github.com/sindresorhus/p-limit/releases) - [Commits](https://github.com/sindresorhus/p-limit/compare/v4.0.0...v5.0.0) --- updated-dependencies: - dependency-name: p-limit dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 24 +++++++++++++++++++----- package.json | 2 +- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9cf73ec95..ee7019539 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "inquirer": "9.2.6", "json-to-table": "4.2.1", "mustache": "4.2.0", - "p-limit": "4.0.0", + "p-limit": "5.0.0", "prettier": "3.2.4", "prettier-plugin-sql": "0.18.0", "semver": "7.5.4", @@ -6148,14 +6148,14 @@ } }, "node_modules/p-limit": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", - "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-5.0.0.tgz", + "integrity": "sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==", "dependencies": { "yocto-queue": "^1.0.0" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + "node": ">=18" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" @@ -7072,6 +7072,20 @@ "fxparser": "src/cli/cli.js" } }, + "node_modules/sfmc-sdk/node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", diff --git a/package.json b/package.json index 8dc0a3792..12ecb3f9d 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,7 @@ "inquirer": "9.2.6", "json-to-table": "4.2.1", "mustache": "4.2.0", - "p-limit": "4.0.0", + "p-limit": "5.0.0", "prettier": "3.2.4", "prettier-plugin-sql": "0.18.0", "semver": "7.5.4", From 33ec4a6f050a7de0c2908228170c6e4f046b78b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 30 Jan 2024 14:29:23 +0100 Subject: [PATCH 029/359] #1201: disable color coding for tests run by GitFork and Sourcetree via commit hook --- lib/util/util.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/util/util.js b/lib/util/util.js index 78585f1b1..25dfe15c1 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -251,8 +251,10 @@ export const Util = { // silly: 6 // } if ( - process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' || - process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost' + process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' || // run via VSCode extension + process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost' || // run via VSCode extension + process.env.FORK_PROCESS_ID || // run via Git-Fork + process.env.PATH.toLowerCase().includes('sourcetree') // run via Atlassian SourceTree ) { Util.OPTIONS.noLogColors = true; } From 48e149c39a60cf3f56e1a6f5d5b1fbd0f65a2f8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 2 Feb 2024 10:27:35 +0100 Subject: [PATCH 030/359] #745: get mobileCode, mobileKeyword, source DataExtension for SMS imports --- docs/dist/documentation.md | 15 ++ lib/metadataTypes/ImportFile.js | 240 ++++++++++++++---- .../definitions/ImportFile.definition.js | 4 +- 3 files changed, 206 insertions(+), 53 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 10baca458..656712476 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -3032,6 +3032,7 @@ ImportFile MetadataType * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> * [.create(importFile)](#ImportFile.create) ⇒ Promise * [.update(importFile)](#ImportFile.update) ⇒ Promise + * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> @@ -3105,6 +3106,20 @@ Updates a single Import File | --- | --- | --- | | importFile | TYPE.MetadataTypeItem | a single Import File | + + +### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + ### ImportFile.preDeployTasks(metadata) ⇒ Promise diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 447e1c0e4..cc0cb9744 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -36,6 +36,33 @@ class ImportFile extends MetadataType { return { metadata: {}, type: this.definition.type }; } } + const smsImportResults = await this.client.rest.getBulk( + '/legacy/v1/beta/mobile/imports/', + 50 + ); + this.smsImports = {}; + if (smsImportResults.totalResults > 0 && smsImportResults.entry.length > 0) { + for (const item of smsImportResults.entry) { + // this api does not show the key but the name is assumed to be unique + this.smsImports[item.name] = item; + + try { + const sourceObject = await this.client.rest.get( + '/legacy/v1/beta/object/' + item.sourceObjectId + ); + item.sourceObjectKey = sourceObject.key; + } catch { + Util.logger.error( + `endpoint /legacy/v1/beta/object/${item.sourceObjectId} does not exist` + ); + } + } + } + try { + await this.client.rest.get('/legacy/v1/beta/audience/'); + } catch { + Util.logger.error(`endpoint /legacy/v1/beta/audience does not exist`); + } return super.retrieveREST( retrieveDir, @@ -149,6 +176,33 @@ class ImportFile extends MetadataType { '/automation/v1/imports/' + importFile.importDefinitionId ); } + /** + * Deploys metadata + * + * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @param {string} deployDir directory where deploy metadata are saved + * @param {string} retrieveDir directory where metadata after deploy should be saved + * @returns {Promise.} Promise of keyField => metadata map + */ + static async deploy(metadataMap, deployDir, retrieveDir) { + if ( + Object.values(metadataMap).filter((item) => item.c__destinationType === 'SMS').length > + 0 + ) { + const dataExtensionLegacyResult = await this.client.rest.getBulk( + '/legacy/v1/beta/object/', + 500 + ); + this.dataExtensionsLegacy = {}; + if (dataExtensionLegacyResult?.entry?.length) { + for (const item of dataExtensionLegacyResult.entry) { + this.dataExtensionsLegacy[item.key] = item; + } + } + } + + return super.deploy(metadataMap, deployDir, retrieveDir); + } /** * prepares a import definition for deployment @@ -157,44 +211,96 @@ class ImportFile extends MetadataType { * @returns {Promise} Promise */ static async preDeployTasks(metadata) { - metadata.fileTransferLocationId = cache.searchForField( - 'fileLocation', - metadata.r__fileLocation_name, - 'name', - 'id' - ); + const fileLocation = cache.getByKey('fileLocation', metadata.r__fileLocation_name); + if (!fileLocation) { + throw new Error(`fileLocation ${metadata.r__fileLocation_name} not found in cache`); + } + + metadata.fileTransferLocationId = fileLocation.id; + metadata.fileTransferLocationTypeId = fileLocation.locationTypeId; delete metadata.r__fileLocation_name; - if (metadata.c__destinationType === 'DataExtension') { - if (metadata.r__dataExtension_CustomerKey) { - metadata.destinationObjectId = cache.searchForField( - 'dataExtension', - metadata.r__dataExtension_CustomerKey, - 'CustomerKey', - 'ObjectID' + switch (metadata.c__destinationType) { + case 'DataExtension': { + if (metadata.r__dataExtension_CustomerKey) { + metadata.destinationObjectId = cache.searchForField( + 'dataExtension', + metadata.r__dataExtension_CustomerKey, + 'CustomerKey', + 'ObjectID' + ); + delete metadata.r__dataExtension_CustomerKey; + } else { + throw new Error('Import Destination DataExtension not defined'); + } + break; + } + case 'List': { + if (metadata.r__list_PathName) { + metadata.destinationObjectId = cache.getListObjectId( + metadata.r__list_PathName, + 'ObjectID' + ); + // destinationId is also needed for List types + metadata.destinationId = cache.getListObjectId(metadata.r__list_PathName, 'ID'); + delete metadata.r__list_PathName; + } else { + throw new Error('Import Destination List not defined'); + } + break; + } + case 'SMS': { + if (metadata.c__codeKeyword) { + // code + const codeObj = cache.getByKey( + 'mobileCode', + metadata.c__codeKeyword.split('.')[0] + ); + if (!codeObj) { + throw new Error(`mobileCode ${metadata.c__codeKeyword} not found in cache`); + } + metadata.code = codeObj; + + // keyword + const keywordObj = cache.getByKey('mobileKeyword', metadata.c__codeKeyword); + if (!keywordObj) { + throw new Error( + `mobileKeyword ${metadata.c__codeKeyword} not found in cache` + ); + } + metadata.keyword = keywordObj; + } else { + Util.logger.error( + ` - importFile ${metadata[this.definition.keyField]}: No code or keyword info found. Please re-download this from the source.` + ); + } + + // destination + metadata.destinationObjectId = '00000000-0000-0000-0000-000000000000'; + metadata.destinationObjectType = 'MobileSubscription'; + // source + if (this.dataExtensionsLegacy[metadata.c__sourceObjectKey]) { + metadata.sourceObjectId = + this.dataExtensionsLegacy[metadata.c__sourceObjectKey].id; + metadata.sourceObjectName = + this.dataExtensionsLegacy[metadata.c__sourceObjectKey].dataExtensionName; + delete metadata.c__sourceObjectKey; + } + + Util.logger.debug( + ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${ + metadata.c__destinationType + } not fully supported. Deploy might fail.` ); - delete metadata.r__dataExtension_CustomerKey; - } else { - throw new Error('Import Destination DataExtension not defined'); + break; } - } else if (metadata.c__destinationType === 'List') { - if (metadata.r__list_PathName) { - metadata.destinationObjectId = cache.getListObjectId( - metadata.r__list_PathName, - 'ObjectID' + default: { + Util.logger.debug( + ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${ + metadata.c__destinationType + } not fully supported. Deploy might fail.` ); - // destinationId is also needed for List types - metadata.destinationId = cache.getListObjectId(metadata.r__list_PathName, 'ID'); - delete metadata.r__list_PathName; - } else { - throw new Error('Import Destination List not defined'); } - } else { - Util.logger.debug( - ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${ - metadata.c__destinationType - } not fully supported. Deploy might fail.` - ); } if (metadata.c__blankFileProcessing) { // omit this if not set @@ -230,30 +336,62 @@ class ImportFile extends MetadataType { this.definition.destinationObjectTypeMapping, metadata.destinationObjectTypeId ); - delete metadata.destinationObjectTypeId; - if (metadata.c__destinationType === 'DataExtension') { - try { - metadata.r__dataExtension_CustomerKey = cache.searchForField( - 'dataExtension', - metadata.destinationObjectId, - 'ObjectID', - 'CustomerKey' - ); + switch (metadata.c__destinationType) { + case 'DataExtension': { + try { + metadata.r__dataExtension_CustomerKey = cache.searchForField( + 'dataExtension', + metadata.destinationObjectId, + 'ObjectID', + 'CustomerKey' + ); + delete metadata.destinationObjectId; + } catch (ex) { + Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`); + } + + break; + } + case 'List': { + try { + metadata.r__list_PathName = cache.getListPathName( + metadata.destinationObjectId, + 'ObjectID' + ); + delete metadata.destinationObjectId; + } catch (ex) { + Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`); + } + + break; + } + case 'SMS': { + if (this.smsImports[metadata.name]) { + const smsImport = this.smsImports[metadata.name]; + + metadata.c__codeKeyword = + smsImport.code?.code + '.' + smsImport.keyword?.keyword; + if (smsImport.sourceObjectKey) { + // source dataExtension + metadata.c__sourceObjectKey = smsImport.sourceObjectKey; + } + } else { + Util.logger.debug( + ` - ImportFile ${metadata.customerKey}: Could not find code and keyword for this SMS import activity.` + ); + } delete metadata.destinationObjectId; - } catch (ex) { - Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`); + + break; } - } else if (metadata.c__destinationType === 'List') { - try { - metadata.r__list_PathName = cache.getListPathName( - metadata.destinationObjectId, - 'ObjectID' + default: { + Util.logger.debug( + ` - ImportFile ${metadata.customerKey}: Destination Type ${metadata.destinationObjectTypeId} not fully supported. Deploy might fail.` ); - delete metadata.destinationObjectId; - } catch (ex) { - Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`); } } + delete metadata.destinationObjectTypeId; + if (metadata.blankFileProcessingType) { // omit this if not set metadata.c__blankFileProcessing = Util.inverseGet( diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js index 0b3aa28a3..cbefdc7b1 100644 --- a/lib/metadataTypes/definitions/ImportFile.definition.js +++ b/lib/metadataTypes/definitions/ImportFile.definition.js @@ -145,8 +145,8 @@ export default { fileTransferLocationTypeId: { isCreateable: true, isUpdateable: true, - retrieving: true, - template: true, + retrieving: false, + template: false, }, fileType: { isCreateable: true, From 207fb705524727a892b625f9f41d01175df9bc3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 2 Feb 2024 10:38:58 +0100 Subject: [PATCH 031/359] #0: husky v9 simplified hooks --- .husky/commit-msg | 2 -- .husky/post-checkout | 3 --- .husky/post-merge | 9 ++------- .husky/pre-commit | 2 -- 4 files changed, 2 insertions(+), 14 deletions(-) diff --git a/.husky/commit-msg b/.husky/commit-msg index cf7663854..c1672c9e1 100644 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,5 +1,3 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" INPUT_FILE=$1 START_LINE=`head -n1 $INPUT_FILE` PATTERN="^(#[[:digit:]]|Merge|Revert)" diff --git a/.husky/post-checkout b/.husky/post-checkout index 5bf2cfe67..a62f88563 100644 --- a/.husky/post-checkout +++ b/.husky/post-checkout @@ -1,6 +1,3 @@ -#!/bin/sh -. "$(dirname "$0")/_/husky.sh" - # ### git commit message template ### git config commit.template .git/templatemessage TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '^((feature|bug|bugfix|fix|hotfix|task|chore)\/)?\K\d{1,7}' || true` diff --git a/.husky/post-merge b/.husky/post-merge index a5b4e597b..ff616c114 100644 --- a/.husky/post-merge +++ b/.husky/post-merge @@ -1,12 +1,7 @@ -#!/bin/sh -# ### run npm install ### -. "$(dirname "$0")/_/husky.sh" - - echo "[POST-MERGE] 📦 Checking for changes to dependencies" IFS=$'\n' -# extract all paths to package-lock.json files +# extract all paths to package-lock.json files PACKAGE_LOCK_REGEX="(^package-lock\.json)" PACKAGES=$(git diff --name-only HEAD^1 HEAD | grep -E $PACKAGE_LOCK_REGEX || true) @@ -19,4 +14,4 @@ if [[ ${PACKAGES[@]} ]]; then npm run lint:fix else echo "📦 All packages up-to-date. No need to run npm install." -fi \ No newline at end of file +fi diff --git a/.husky/pre-commit b/.husky/pre-commit index 6d7ff8b41..8ff502612 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,3 @@ -npm test - npm run docs git update-index --add docs/dist/documentation.md npx --no lint-staged From 12dc420759ed9e10da2001e900370465d75e8345 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Feb 2024 21:00:30 +0000 Subject: [PATCH 032/359] Bump jsdoc-to-markdown from 8.0.0 to 8.0.1 Bumps [jsdoc-to-markdown](https://github.com/jsdoc2md/jsdoc-to-markdown) from 8.0.0 to 8.0.1. - [Release notes](https://github.com/jsdoc2md/jsdoc-to-markdown/releases) - [Commits](https://github.com/jsdoc2md/jsdoc-to-markdown/compare/v8.0.0...v8.0.1) --- updated-dependencies: - dependency-name: jsdoc-to-markdown dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 23 ++++++++--------------- package.json | 2 +- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee7019539..2e2bd0f5f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "eslint-plugin-unicorn": "50.0.1", "fast-xml-parser": "4.3.3", "husky": "9.0.7", - "jsdoc-to-markdown": "8.0.0", + "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.0", "mocha": "10.2.0", "mock-fs": "5.2.0", @@ -4502,14 +4502,13 @@ } }, "node_modules/jsdoc-parse": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.2.0.tgz", - "integrity": "sha512-Afu1fQBEb7QHt6QWX/6eUWvYHJofB90Fjx7FuJYF7mnG9z5BkAIpms1wsnvYLytfmqpEENHs/fax9p8gvMj7dw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.2.1.tgz", + "integrity": "sha512-9viGRUUtWOk/G4V0+nQ6rfLucz5plxh5I74WbNSNm9h9NWugCDVX4jbG8hZP9QqKGpdTPDE+qJXzaYNos3wqTA==", "dev": true, "dependencies": { "array-back": "^6.2.2", "lodash.omit": "^4.5.0", - "lodash.pick": "^4.4.0", "reduce-extract": "^1.0.0", "sort-array": "^4.1.5", "test-value": "^3.0.0" @@ -4519,9 +4518,9 @@ } }, "node_modules/jsdoc-to-markdown": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-8.0.0.tgz", - "integrity": "sha512-2FQvYkg491+FP6s15eFlgSSWs69CvQrpbABGYBtvAvGWy/lWo8IKKToarT283w59rQFrpcjHl3YdhHCa3l7gXg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-8.0.1.tgz", + "integrity": "sha512-qJfNJhkq2C26UYoOdj8L1yheTJlk1veCsxwRejRmj07XZKCn7oSkuPErx6+JoNi8afCaUKdIM5oUu0uF2/T8iw==", "dev": true, "dependencies": { "array-back": "^6.2.2", @@ -4529,7 +4528,7 @@ "config-master": "^3.1.0", "dmd": "^6.2.0", "jsdoc-api": "^8.0.0", - "jsdoc-parse": "^6.2.0", + "jsdoc-parse": "^6.2.1", "walk-back": "^5.1.0" }, "bin": { @@ -5072,12 +5071,6 @@ "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", "dev": true }, - "node_modules/lodash.pick": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.pick/-/lodash.pick-4.4.0.tgz", - "integrity": "sha512-hXt6Ul/5yWjfklSGvLQl8vM//l3FtyHZeuelpzK6mm99pNvN9yTDruNZPEJZD1oWrqo+izBmB7oUfWgcCX7s4Q==", - "dev": true - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", diff --git a/package.json b/package.json index 12ecb3f9d..d12da08f9 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "eslint-plugin-unicorn": "50.0.1", "fast-xml-parser": "4.3.3", "husky": "9.0.7", - "jsdoc-to-markdown": "8.0.0", + "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.0", "mocha": "10.2.0", "mock-fs": "5.2.0", From d0bc0782ee13204a4983ed898ad0bc4315db6d46 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:43:17 +0000 Subject: [PATCH 033/359] Bump fast-xml-parser from 4.3.3 to 4.3.4 Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.3.3 to 4.3.4. - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.3...v4.3.4) --- updated-dependencies: - dependency-name: fast-xml-parser dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e2bd0f5f..3af380564 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", - "fast-xml-parser": "4.3.3", + "fast-xml-parser": "4.3.4", "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.0", @@ -2956,9 +2956,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.3.tgz", - "integrity": "sha512-coV/D1MhrShMvU6D0I+VAK3umz6hUaxxhL0yp/9RjfiYUfAv14rDhGQL+PLForhMdr0wq3PiV07WtkkNjJjNHg==", + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.4.tgz", + "integrity": "sha512-utnwm92SyozgA3hhH2I8qldf2lBqm6qHOICawRNRFu1qMe3+oqr+GcXjGqTmXTMGE5T4eC03kr/rlh5C1IRdZA==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index d12da08f9..60784a763 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", - "fast-xml-parser": "4.3.3", + "fast-xml-parser": "4.3.4", "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.0", From b6a21ff00c84984f10916902263680a8d599ec63 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:47:33 +0000 Subject: [PATCH 034/359] Bump lint-staged from 15.2.0 to 15.2.2 Bumps [lint-staged](https://github.com/okonet/lint-staged) from 15.2.0 to 15.2.2. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md) - [Commits](https://github.com/okonet/lint-staged/compare/v15.2.0...v15.2.2) --- updated-dependencies: - dependency-name: lint-staged dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 40 ++++++++++++++++++++-------------------- package.json | 2 +- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3af380564..298ad03c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -49,7 +49,7 @@ "fast-xml-parser": "4.3.4", "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", - "lint-staged": "15.2.0", + "lint-staged": "15.2.2", "mocha": "10.2.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", @@ -1657,9 +1657,9 @@ "dev": true }, "node_modules/cli-truncate/node_modules/string-width": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.0.0.tgz", - "integrity": "sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dev": true, "dependencies": { "emoji-regex": "^10.3.0", @@ -4884,9 +4884,9 @@ } }, "node_modules/lint-staged": { - "version": "15.2.0", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.0.tgz", - "integrity": "sha512-TFZzUEV00f+2YLaVPWBWGAMq7So6yQx+GG8YRMDeOEIf95Zn5RyiLMsEiX4KTNl9vq/w+NqRJkLA1kPIo15ufQ==", + "version": "15.2.2", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", + "integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==", "dev": true, "dependencies": { "chalk": "5.3.0", @@ -4894,7 +4894,7 @@ "debug": "4.3.4", "execa": "8.0.1", "lilconfig": "3.0.0", - "listr2": "8.0.0", + "listr2": "8.0.1", "micromatch": "4.0.5", "pidtree": "0.6.0", "string-argv": "0.3.2", @@ -4923,9 +4923,9 @@ } }, "node_modules/listr2": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.0.tgz", - "integrity": "sha512-u8cusxAcyqAiQ2RhYvV7kRKNLgUvtObIbhOX2NCXqvp1UU32xIg5CT22ykS2TPKJXZWJwtK3IKLiqAGlGNE+Zg==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", + "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", "dev": true, "dependencies": { "cli-truncate": "^4.0.0", @@ -4958,9 +4958,9 @@ "dev": true }, "node_modules/listr2/node_modules/string-width": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.0.0.tgz", - "integrity": "sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dev": true, "dependencies": { "emoji-regex": "^10.3.0", @@ -5201,9 +5201,9 @@ } }, "node_modules/log-update/node_modules/string-width": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.0.0.tgz", - "integrity": "sha512-GPQHj7row82Hjo9hKZieKcHIhaAIKOJvFSIZXuCU9OASVZrMNUaZuz++SPVrBjnLsnk4k+z9f2EIypgxf2vNFw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", + "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", "dev": true, "dependencies": { "emoji-regex": "^10.3.0", @@ -6896,9 +6896,9 @@ } }, "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.1.tgz", + "integrity": "sha512-r5a3l5HzYlIC68TpmYKlxWjmOP6wiPJ1vWv2HeLhNsRZMrCkxeqxiHlQ21oXmQ4F3SiryXBHhAD7JZqvOJjFmg==", "dev": true }, "node_modules/rimraf": { diff --git a/package.json b/package.json index 60784a763..8f56b557a 100644 --- a/package.json +++ b/package.json @@ -100,7 +100,7 @@ "fast-xml-parser": "4.3.4", "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", - "lint-staged": "15.2.0", + "lint-staged": "15.2.2", "mocha": "10.2.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", From 828296ad8fd314222cb0471dafaadd9c6a2d35d5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:50:22 +0000 Subject: [PATCH 035/359] Bump eslint-plugin-jsdoc from 48.0.2 to 48.0.5 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.0.2 to 48.0.5. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.0.2...v48.0.5) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 298ad03c9..b71ead95a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.0.2", + "eslint-plugin-jsdoc": "48.0.5", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", @@ -2552,9 +2552,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.0.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.2.tgz", - "integrity": "sha512-CBFl5Jc7+jlV36RwDm+PQ8Uw5r28pn2/uW/OaB+Gw5bFwn4Py/1eYMZ3hGf9S4meUFZ/sRvS+hVif2mRAp6WqQ==", + "version": "48.0.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.5.tgz", + "integrity": "sha512-9ZYb3W6r6nZ3jc9vmJ2pZoINLhk9iI6rEFTfU7sTRAzFUWh00SRI9SRZ+IgDoiIPTp2tOUXs0vDOApdIlTnFKA==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.41.0", diff --git a/package.json b/package.json index 8f56b557a..41daa33df 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.0.2", + "eslint-plugin-jsdoc": "48.0.5", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "50.0.1", From 463cedba850b1fb0447612ccea1edd37f08d6212 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:52:32 +0000 Subject: [PATCH 036/359] Bump semver from 7.5.4 to 7.6.0 Bumps [semver](https://github.com/npm/node-semver) from 7.5.4 to 7.6.0. - [Release notes](https://github.com/npm/node-semver/releases) - [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md) - [Commits](https://github.com/npm/node-semver/compare/v7.5.4...v7.6.0) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index b71ead95a..f33001115 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,7 +22,7 @@ "p-limit": "5.0.0", "prettier": "3.2.4", "prettier-plugin-sql": "0.18.0", - "semver": "7.5.4", + "semver": "7.6.0", "sfmc-sdk": "2.0.1", "simple-git": "3.22.0", "toposort": "2.0.2", @@ -6980,9 +6980,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dependencies": { "lru-cache": "^6.0.0" }, diff --git a/package.json b/package.json index 41daa33df..b6881b6f4 100644 --- a/package.json +++ b/package.json @@ -76,7 +76,7 @@ "p-limit": "5.0.0", "prettier": "3.2.4", "prettier-plugin-sql": "0.18.0", - "semver": "7.5.4", + "semver": "7.6.0", "sfmc-sdk": "2.0.1", "simple-git": "3.22.0", "toposort": "2.0.2", From 192b65b3da794a0d63ded399a82fdb67095f1bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 6 Feb 2024 14:11:59 +0100 Subject: [PATCH 037/359] #745: cleanup --- lib/metadataTypes/ImportFile.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index cc0cb9744..3dec7f670 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -36,12 +36,15 @@ class ImportFile extends MetadataType { return { metadata: {}, type: this.definition.type }; } } + Util.logger.debug(' - retrieving extended metadata for SMS imports'); const smsImportResults = await this.client.rest.getBulk( '/legacy/v1/beta/mobile/imports/', 50 ); this.smsImports = {}; if (smsImportResults.totalResults > 0 && smsImportResults.entry.length > 0) { + Util.logger.info(`Caching dependent Metadata: dataExtension (source for SMS imports)`); + for (const item of smsImportResults.entry) { // this api does not show the key but the name is assumed to be unique this.smsImports[item.name] = item; @@ -52,17 +55,12 @@ class ImportFile extends MetadataType { ); item.sourceObjectKey = sourceObject.key; } catch { - Util.logger.error( + Util.logger.warn( `endpoint /legacy/v1/beta/object/${item.sourceObjectId} does not exist` ); } } } - try { - await this.client.rest.get('/legacy/v1/beta/audience/'); - } catch { - Util.logger.error(`endpoint /legacy/v1/beta/audience does not exist`); - } return super.retrieveREST( retrieveDir, @@ -189,6 +187,8 @@ class ImportFile extends MetadataType { Object.values(metadataMap).filter((item) => item.c__destinationType === 'SMS').length > 0 ) { + Util.logger.info(`Caching dependent Metadata: dataExtension (source for SMS imports)`); + const dataExtensionLegacyResult = await this.client.rest.getBulk( '/legacy/v1/beta/object/', 500 @@ -368,18 +368,19 @@ class ImportFile extends MetadataType { case 'SMS': { if (this.smsImports[metadata.name]) { const smsImport = this.smsImports[metadata.name]; - + // code + keyword metadata.c__codeKeyword = smsImport.code?.code + '.' + smsImport.keyword?.keyword; + // source dataExtension if (smsImport.sourceObjectKey) { - // source dataExtension metadata.c__sourceObjectKey = smsImport.sourceObjectKey; } } else { Util.logger.debug( - ` - ImportFile ${metadata.customerKey}: Could not find code and keyword for this SMS import activity.` + ` - ImportFile ${metadata.customerKey}: Could not find mobile code and keyword nor source for this SMS import activity.` ); } + // remove empty desitination delete metadata.destinationObjectId; break; From adea6dfaa6630e794ca5548b4c34fdc59aabea04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 21:00:19 +0000 Subject: [PATCH 038/359] Bump eslint-plugin-unicorn from 50.0.1 to 51.0.1 Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 50.0.1 to 51.0.1. - [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases) - [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v50.0.1...v51.0.1) --- updated-dependencies: - dependency-name: eslint-plugin-unicorn dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index f33001115..30b348a87 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "eslint-plugin-jsdoc": "48.0.5", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", - "eslint-plugin-unicorn": "50.0.1", + "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", @@ -2631,9 +2631,9 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "50.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-50.0.1.tgz", - "integrity": "sha512-KxenCZxqSYW0GWHH18okDlOQcpezcitm5aOSz6EnobyJ6BIByiPDviQRjJIUAjG/tMN11958MxaQ+qCoU6lfDA==", + "version": "51.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", + "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", diff --git a/package.json b/package.json index b6881b6f4..4a14ed57e 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "eslint-plugin-jsdoc": "48.0.5", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", - "eslint-plugin-unicorn": "50.0.1", + "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", From 3336b91498c9b8010853f83653fddca788c9d8dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:28:15 +0000 Subject: [PATCH 039/359] Bump eslint-plugin-jsdoc from 48.0.5 to 48.0.6 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.0.5 to 48.0.6. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.0.5...v48.0.6) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 30b348a87..5dd960dbe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.0.5", + "eslint-plugin-jsdoc": "48.0.6", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", @@ -290,9 +290,9 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.41.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.41.0.tgz", - "integrity": "sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==", + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.42.0.tgz", + "integrity": "sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==", "dev": true, "dependencies": { "comment-parser": "1.4.1", @@ -2552,19 +2552,19 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.0.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.5.tgz", - "integrity": "sha512-9ZYb3W6r6nZ3jc9vmJ2pZoINLhk9iI6rEFTfU7sTRAzFUWh00SRI9SRZ+IgDoiIPTp2tOUXs0vDOApdIlTnFKA==", + "version": "48.0.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.6.tgz", + "integrity": "sha512-LgwXOX6TWxxFYcbdVe+BJ94Kl/pgjSPYHLzqEdAMXTA1BH9WDx7iJ+9/iDajPF64LtzWX8C1mCfpbMZjJGhAOw==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.41.0", + "@es-joy/jsdoccomment": "~0.42.0", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "esquery": "^1.5.0", "is-builtin-module": "^3.2.1", - "semver": "^7.5.4", + "semver": "^7.6.0", "spdx-expression-parse": "^4.0.0" }, "engines": { diff --git a/package.json b/package.json index 4a14ed57e..8ac7f9e2c 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.0.5", + "eslint-plugin-jsdoc": "48.0.6", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", From d7277bda844ae8cbdf25a762c5297a269afe8a66 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:33:42 +0000 Subject: [PATCH 040/359] Bump mocha from 10.2.0 to 10.3.0 Bumps [mocha](https://github.com/mochajs/mocha) from 10.2.0 to 10.3.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v10.2.0...v10.3.0) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 46 ++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 25 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5dd960dbe..bf8d42581 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", - "mocha": "10.2.0", + "mocha": "10.3.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", "prettier-eslint": "16.3.0" @@ -5551,9 +5551,9 @@ "dev": true }, "node_modules/mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.2.0.tgz", - "integrity": "sha512-IDY7fl/BecMwFHzoqF2sg/SHHANeBoMMXFlS9r0OXKDssYE1M5O43wUY/9BVPeIvfH2zmEbBfseqN9gBQZzXkg==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", + "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", @@ -5563,13 +5563,12 @@ "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.2.0", + "glob": "8.1.0", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "5.0.1", "ms": "2.1.3", - "nanoid": "3.3.3", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", @@ -5584,10 +5583,6 @@ }, "engines": { "node": ">= 14.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" } }, "node_modules/mocha/node_modules/brace-expansion": { @@ -5599,6 +5594,25 @@ "balanced-match": "^1.0.0" } }, + "node_modules/mocha/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/mocha/node_modules/minimatch": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", @@ -5686,18 +5700,6 @@ "mustache": "bin/mustache" } }, - "node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, - "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" - } - }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", diff --git a/package.json b/package.json index 8ac7f9e2c..ac79363ec 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "husky": "9.0.7", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", - "mocha": "10.2.0", + "mocha": "10.3.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", "prettier-eslint": "16.3.0" From 20098c4e67135682164197d5e9748349749f0b8c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 10:45:55 +0000 Subject: [PATCH 041/359] Bump beauty-amp-core2 from 0.4.5 to 0.4.6 Bumps [beauty-amp-core2](https://github.com/FiB3/beautyAmpCore2) from 0.4.5 to 0.4.6. - [Changelog](https://github.com/FiB3/beautyAmpCore2/blob/master/CHANGELOG.md) - [Commits](https://github.com/FiB3/beautyAmpCore2/commits) --- updated-dependencies: - dependency-name: beauty-amp-core2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index bf8d42581..1f24a665d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "6.0.2", "license": "MIT", "dependencies": { - "beauty-amp-core2": "0.4.5", + "beauty-amp-core2": "0.4.6", "cli-progress": "3.12.0", "command-exists": "1.2.9", "conf": "12.0.0", @@ -1068,9 +1068,9 @@ ] }, "node_modules/beauty-amp-core2": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/beauty-amp-core2/-/beauty-amp-core2-0.4.5.tgz", - "integrity": "sha512-mhmHf8/6qf1yCdqkL66j9T3C5Z0Q+jP+XWK6ajnA+L/cG3bEjnN6ywRy97eSzij5JVSRNxs8w2857whB6+o5jw==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/beauty-amp-core2/-/beauty-amp-core2-0.4.6.tgz", + "integrity": "sha512-kEyX5uhmRU28Zy0uAcceHOoU7PZXXMuKUuuP0y7iMMSwluZrsRxhMcy23EEXJ+iASP9jQ/ffXavlfHc36yPvMg==", "dependencies": { "lodash": "^4.17.21", "prettier": "^2.8.8" diff --git a/package.json b/package.json index ac79363ec..6af2e9d6b 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "version:patch": "npm version --no-commit-hooks patch" }, "dependencies": { - "beauty-amp-core2": "0.4.5", + "beauty-amp-core2": "0.4.6", "cli-progress": "3.12.0", "command-exists": "1.2.9", "conf": "12.0.0", From 9b6ed154a3853238a55147b8525443c45d3be5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 13 Feb 2024 14:12:40 +0100 Subject: [PATCH 042/359] #0: fix variable capitalization for beauty-amp-core2 0.4.6 --- test/resources/9999999/transactionalSMS/build-expected.amp | 2 +- test/resources/9999999/transactionalSMS/get-expected.amp | 2 +- test/resources/9999999/transactionalSMS/patch-expected.amp | 2 +- test/resources/9999999/transactionalSMS/post-expected.amp | 2 +- test/resources/9999999/transactionalSMS/template-expected.amp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/resources/9999999/transactionalSMS/build-expected.amp b/test/resources/9999999/transactionalSMS/build-expected.amp index 90327ec0e..cdf0c6b39 100644 --- a/test/resources/9999999/transactionalSMS/build-expected.amp +++ b/test/resources/9999999/transactionalSMS/build-expected.amp @@ -24,7 +24,7 @@ line3 SET @rx = '^\+((?:9[679]\d8[035789]\d|6[789]\d|5[90]\d|42\d|3[578]\d|2[1-689]\d)|9[0-58]|8[1246]|6[0-6]|5[1-8]|4[013-9]|3[0-469]|2[70]|7|1)' SET @prefix = concat('+', RegExMatch(@num, @rx, 1)) IF @count>0 THEN - FOR @I = 1 TO @COUNT DO + FOR @i = 1 TO @count DO SET @sk = Field(Row(@rs, @i), 'Id') IF Field(Row(@rs, 1), 'et4ae5__HasOptedOutOfMobile__c') == 'false' THEN SET @result = UpdateSingleSalesforceObject('Contact', @sk, 'et4ae5__HasOptedOutOfMobile__c', 'true') diff --git a/test/resources/9999999/transactionalSMS/get-expected.amp b/test/resources/9999999/transactionalSMS/get-expected.amp index 550ecfdd8..47307e6c5 100644 --- a/test/resources/9999999/transactionalSMS/get-expected.amp +++ b/test/resources/9999999/transactionalSMS/get-expected.amp @@ -24,7 +24,7 @@ line3 SET @rx = '^\+((?:9[679]\d8[035789]\d|6[789]\d|5[90]\d|42\d|3[578]\d|2[1-689]\d)|9[0-58]|8[1246]|6[0-6]|5[1-8]|4[013-9]|3[0-469]|2[70]|7|1)' SET @prefix = concat('+', RegExMatch(@num, @rx, 1)) IF @count>0 THEN - FOR @I = 1 TO @COUNT DO + FOR @i = 1 TO @count DO SET @sk = Field(Row(@rs, @i), 'Id') IF Field(Row(@rs, 1), 'et4ae5__HasOptedOutOfMobile__c') == 'false' THEN SET @result = UpdateSingleSalesforceObject('Contact', @sk, 'et4ae5__HasOptedOutOfMobile__c', 'true') diff --git a/test/resources/9999999/transactionalSMS/patch-expected.amp b/test/resources/9999999/transactionalSMS/patch-expected.amp index e1ef91076..9c94b4199 100644 --- a/test/resources/9999999/transactionalSMS/patch-expected.amp +++ b/test/resources/9999999/transactionalSMS/patch-expected.amp @@ -18,7 +18,7 @@ SET @rx = '^\+((?:9[679]\d8[035789]\d|6[789]\d|5[90]\d|42\d|3[578]\d|2[1-689]\d)|9[0-58]|8[1246]|6[0-6]|5[1-8]|4[013-9]|3[0-469]|2[70]|7|1)' SET @prefix = concat('+', RegExMatch(@num, @rx, 1)) IF @count>0 THEN - FOR @I = 1 TO @COUNT DO + FOR @i = 1 TO @count DO SET @sk = Field(Row(@rs, @i), 'Id') IF Field(Row(@rs, 1), 'et4ae5__HasOptedOutOfMobile__c') == 'false' THEN SET @result = UpdateSingleSalesforceObject('Contact', @sk, 'et4ae5__HasOptedOutOfMobile__c', 'true') diff --git a/test/resources/9999999/transactionalSMS/post-expected.amp b/test/resources/9999999/transactionalSMS/post-expected.amp index b11a84731..a211011bd 100644 --- a/test/resources/9999999/transactionalSMS/post-expected.amp +++ b/test/resources/9999999/transactionalSMS/post-expected.amp @@ -18,7 +18,7 @@ SET @rx = '^\+((?:9[679]\d8[035789]\d|6[789]\d|5[90]\d|42\d|3[578]\d|2[1-689]\d)|9[0-58]|8[1246]|6[0-6]|5[1-8]|4[013-9]|3[0-469]|2[70]|7|1)' SET @prefix = concat('+', RegExMatch(@num, @rx, 1)) IF @count>0 THEN - FOR @I = 1 TO @COUNT DO + FOR @i = 1 TO @count DO SET @sk = Field(Row(@rs, @i), 'Id') IF Field(Row(@rs, 1), 'et4ae5__HasOptedOutOfMobile__c') == 'false' THEN SET @result = UpdateSingleSalesforceObject('Contact', @sk, 'et4ae5__HasOptedOutOfMobile__c', 'true') diff --git a/test/resources/9999999/transactionalSMS/template-expected.amp b/test/resources/9999999/transactionalSMS/template-expected.amp index 26bc6dc2f..d5aa49c01 100644 --- a/test/resources/9999999/transactionalSMS/template-expected.amp +++ b/test/resources/9999999/transactionalSMS/template-expected.amp @@ -24,7 +24,7 @@ line3 SET @rx = '^\+((?:9[679]\d8[035789]\d|6[789]\d|5[90]\d|42\d|3[578]\d|2[1-689]\d)|9[0-58]|8[1246]|6[0-6]|5[1-8]|4[013-9]|3[0-469]|2[70]|7|1)' SET @prefix = concat('+', RegExMatch(@num, @rx, 1)) IF @count>0 THEN - FOR @I = 1 TO @COUNT DO + FOR @i = 1 TO @count DO SET @sk = Field(Row(@rs, @i), 'Id') IF Field(Row(@rs, 1), 'et4ae5__HasOptedOutOfMobile__c') == 'false' THEN SET @result = UpdateSingleSalesforceObject('Contact', @sk, 'et4ae5__HasOptedOutOfMobile__c', 'true') From 0834a8af01989a0f441de7f5b6cba283bb0ce9ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 13 Feb 2024 14:53:15 +0100 Subject: [PATCH 043/359] #1217: moving jsdoc2md into lint-staged to speed up commits --- .husky/pre-commit | 4 ++-- package.json | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 8ff502612..11e9a358a 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1,3 @@ -npm run docs -git update-index --add docs/dist/documentation.md +#npm run docs +#git update-index --add docs/dist/documentation.md npx --no lint-staged diff --git a/package.json b/package.json index 6af2e9d6b..63a120f67 100644 --- a/package.json +++ b/package.json @@ -111,7 +111,9 @@ }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ - "eslint --fix" + "eslint --fix", + "npm run docs", + "git update-index --add docs/dist/documentation.md" ] }, "type": "module" From c84314ff7e3cb78facf1100235c4ead651ded946 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 13:57:43 +0000 Subject: [PATCH 044/359] Bump chai from 4.3.10 to 5.1.0 Bumps [chai](https://github.com/chaijs/chai) from 4.3.10 to 5.1.0. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](https://github.com/chaijs/chai/compare/v4.3.10...v5.1.0) --- updated-dependencies: - dependency-name: chai dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 76 +++++++++++++++++++++-------------------------- package.json | 2 +- 2 files changed, 35 insertions(+), 43 deletions(-) diff --git a/package-lock.json b/package-lock.json index 1f24a665d..bd834b745 100644 --- a/package-lock.json +++ b/package-lock.json @@ -37,7 +37,7 @@ "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", - "chai": "4.3.10", + "chai": "5.1.0", "chai-files": "1.4.0", "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", @@ -1457,21 +1457,19 @@ } }, "node_modules/chai": { - "version": "4.3.10", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.10.tgz", - "integrity": "sha512-0UXG04VuVbruMUYbJ6JctvH0YnC/4q3/AkT18q4NaITo91CUm0liMS9VqzT9vZhVQ/1eqPanMWjBM+Juhfb/9g==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.0.tgz", + "integrity": "sha512-kDZ7MZyM6Q1DhR9jy7dalKohXQ2yrlXkk59CR52aRKxJrobmlBNqnFQxX9xOX8w+4mz8SYlKJa/7D7ddltFXCw==", "dev": true, "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.0.8" + "assertion-error": "^2.0.1", + "check-error": "^2.0.0", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" }, "engines": { - "node": ">=4" + "node": ">=12" } }, "node_modules/chai-files": { @@ -1483,6 +1481,15 @@ "assertion-error": "^1.0.1" } }, + "node_modules/chai/node_modules/assertion-error": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", + "integrity": "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", @@ -1504,15 +1511,12 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.0.0.tgz", + "integrity": "sha512-tjLAOBHKVxtPoHe/SA7kNOMvhCRdCJ3vETdeY0RuAc9popf+hyaSV6ZEg9hr4cpWF7jmo/JSWEnLDrnijS9Tog==", "dev": true, - "dependencies": { - "get-func-name": "^2.0.2" - }, "engines": { - "node": "*" + "node": ">= 16" } }, "node_modules/chokidar": { @@ -2109,13 +2113,10 @@ } }, "node_modules/deep-eql": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.3.tgz", - "integrity": "sha512-WaEtAOpRA1MQ0eohqZjpGD8zdI0Ovsm8mmFhaDN8dvDZzyoUMcYDnf5Y6iu7HTXxf8JDS23qWa4a+hKCDyOPzw==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.1.tgz", + "integrity": "sha512-nwQCf6ne2gez3o1MxWifqkciwt0zhl0LO1/UwVu4uMBuPmflWM4oQ70XMqHqnBJA+nhzncaqL9HVL6KkHJ28lw==", "dev": true, - "dependencies": { - "type-detect": "^4.0.0" - }, "engines": { "node": ">=6" } @@ -5361,12 +5362,12 @@ } }, "node_modules/loupe": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.6.tgz", - "integrity": "sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.0.tgz", + "integrity": "sha512-qKl+FrLXUhFuHUoDJG7f8P8gEMHq9NFS0c6ghXG1J0rldmZFQZoNVv/vyirE9qwCIhWZDsvEFd1sbFu3GvRQFg==", "dev": true, "dependencies": { - "get-func-name": "^2.0.0" + "get-func-name": "^2.0.1" } }, "node_modules/lru-cache": { @@ -6272,12 +6273,12 @@ } }, "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.0.tgz", + "integrity": "sha512-vE7JKRyES09KiunauX7nd2Q9/L7lhok4smP9RZTDeD4MVs72Dp2qNFVz39Nz5a0FVEW0BJR6C0DYrq6unoziZA==", "dev": true, "engines": { - "node": "*" + "node": ">= 14.16" } }, "node_modules/picocolors": { @@ -7677,15 +7678,6 @@ "node": ">= 0.8.0" } }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", diff --git a/package.json b/package.json index 63a120f67..1d6de5f69 100644 --- a/package.json +++ b/package.json @@ -88,7 +88,7 @@ "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", - "chai": "4.3.10", + "chai": "5.1.0", "chai-files": "1.4.0", "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", From d49a10137f2490ea6f692f851edea418756e38c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 13 Feb 2024 15:18:26 +0100 Subject: [PATCH 045/359] #0: fix chai import for chai-files relates to chaijs/chai/issues/1569 --- docs/dist/documentation.md | 36 ++++++++++++++++++++++++++++ test/general.test.js | 5 +++- test/type.asset.test.js | 5 +++- test/type.attributeGroup.test.js | 4 +++- test/type.attributeSet.test.js | 4 +++- test/type.automation.test.js | 5 +++- test/type.dataExtension.test.js | 5 +++- test/type.dataExtract.test.js | 4 +++- test/type.fileTransfer.test.js | 4 +++- test/type.importFile.test.js | 4 +++- test/type.journey.test.js | 4 +++- test/type.mobileKeyword.test.js | 5 +++- test/type.mobileMessage.test.js | 5 +++- test/type.query.test.js | 5 +++- test/type.script.test.js | 5 +++- test/type.transactionalEmail.test.js | 4 +++- test/type.transactionalPush.test.js | 4 +++- test/type.transactionalSMS.test.js | 5 +++- test/type.triggeredSend.test.js | 4 +++- test/type.user.test.js | 5 +++- test/type.verification.test.js | 4 +++- 21 files changed, 106 insertions(+), 20 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 10baca458..f871d7316 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -242,6 +242,12 @@ helper for DataExtension.#fixShared_item
setupSDK(sessionKey, authObject)SDK

Returns an SDK instance to be used for API calls

+
getActualJson(customerKey, type, subtype, [buName])Promise.<string>
+

gets file from Retrieve folder

+
+
getActualFile(customerKey, type, subtype, ext)string
+

gets file from Retrieve folder

+
## Typedefs @@ -8461,6 +8467,36 @@ Returns an SDK instance to be used for API calls | sessionKey | string | key for specific BU | | authObject | TYPE.AuthObject | credentials for specific BU | + + +## getActualJson(customerKey, type, subtype, [buName]) ⇒ Promise.<string> +gets file from Retrieve folder + +**Kind**: global function +**Returns**: Promise.<string> - file in string form + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| customerKey | string | | of metadata | +| type | string | | of metadata | +| subtype | string | | of metadata | +| [buName] | string | "testBU" | used when we need to test on ParentBU | + + + +## getActualFile(customerKey, type, subtype, ext) ⇒ string +gets file from Retrieve folder + +**Kind**: global function +**Returns**: string - file path + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | of metadata | +| type | string | of metadata | +| subtype | string | of metadata | +| ext | string | file extension | + ## TypeKeyCombo : Object.<string, string> diff --git a/test/general.test.js b/test/general.test.js index 9497b7e22..cbea04e29 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 959ce797e..5e2312c1c 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -1,6 +1,9 @@ import File from '../lib/util/file.js'; -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.attributeGroup.test.js b/test/type.attributeGroup.test.js index da3698f8c..8805fe36f 100644 --- a/test/type.attributeGroup.test.js +++ b/test/type.attributeGroup.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.attributeSet.test.js b/test/type.attributeSet.test.js index a4e44e3aa..d1b06114d 100644 --- a/test/type.attributeSet.test.js +++ b/test/type.attributeSet.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 543859e62..265f98c24 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index 55a116c07..c82911cba 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.dataExtract.test.js b/test/type.dataExtract.test.js index a2beb9ffe..99842c358 100644 --- a/test/type.dataExtract.test.js +++ b/test/type.dataExtract.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.fileTransfer.test.js b/test/type.fileTransfer.test.js index b4c18386b..3c6e70bd8 100644 --- a/test/type.fileTransfer.test.js +++ b/test/type.fileTransfer.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 42e12a286..80f148304 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.journey.test.js b/test/type.journey.test.js index aaf43e923..3e83a731e 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.mobileKeyword.test.js b/test/type.mobileKeyword.test.js index 7ecb99b89..0bc57ec1b 100644 --- a/test/type.mobileKeyword.test.js +++ b/test/type.mobileKeyword.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.mobileMessage.test.js b/test/type.mobileMessage.test.js index 9e8cc1d16..d02cde0c3 100644 --- a/test/type.mobileMessage.test.js +++ b/test/type.mobileMessage.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.query.test.js b/test/type.query.test.js index dc2b183cd..2dbcd246a 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.script.test.js b/test/type.script.test.js index 330553518..2503b3a48 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.transactionalEmail.test.js b/test/type.transactionalEmail.test.js index 60dff65e8..87f15552b 100644 --- a/test/type.transactionalEmail.test.js +++ b/test/type.transactionalEmail.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.transactionalPush.test.js b/test/type.transactionalPush.test.js index dd6e6e9ec..ac6b4e0f1 100644 --- a/test/type.transactionalPush.test.js +++ b/test/type.transactionalPush.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.transactionalSMS.test.js b/test/type.transactionalSMS.test.js index 0917e7fae..137cc4404 100644 --- a/test/type.transactionalSMS.test.js +++ b/test/type.transactionalSMS.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index 8d4e3a666..7ad9029d2 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.user.test.js b/test/type.user.test.js index 7811b21f0..80b8740ef 100644 --- a/test/type.user.test.js +++ b/test/type.user.test.js @@ -1,4 +1,7 @@ -import chai, { assert, expect } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; +const expect = chai.expect; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; diff --git a/test/type.verification.test.js b/test/type.verification.test.js index c93a92f08..d0076e6dd 100644 --- a/test/type.verification.test.js +++ b/test/type.verification.test.js @@ -1,4 +1,6 @@ -import chai, { assert } from 'chai'; +import * as chai from 'chai'; +const assert = chai.assert; + import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; From b3069b46beec5bb7b0e42995b290b1950571775e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 20:35:01 +0000 Subject: [PATCH 046/359] Bump prettier from 3.2.4 to 3.2.5 Bumps [prettier](https://github.com/prettier/prettier) from 3.2.4 to 3.2.5. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.4...3.2.5) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index bd834b745..b069d4776 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "json-to-table": "4.2.1", "mustache": "4.2.0", "p-limit": "5.0.0", - "prettier": "3.2.4", + "prettier": "3.2.5", "prettier-plugin-sql": "0.18.0", "semver": "7.6.0", "sfmc-sdk": "2.0.1", @@ -6330,9 +6330,9 @@ } }, "node_modules/prettier": { - "version": "3.2.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz", - "integrity": "sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ==", + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", + "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index 1d6de5f69..bd209d11d 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "json-to-table": "4.2.1", "mustache": "4.2.0", "p-limit": "5.0.0", - "prettier": "3.2.4", + "prettier": "3.2.5", "prettier-plugin-sql": "0.18.0", "semver": "7.6.0", "sfmc-sdk": "2.0.1", From b40843dd380ff6c48eec5c528001ef7a3b89660b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:32:09 +0000 Subject: [PATCH 047/359] Bump eslint-plugin-jsdoc from 48.0.6 to 48.2.0 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.0.6 to 48.2.0. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.0.6...v48.2.0) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index b069d4776..efe2a43da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.0.6", + "eslint-plugin-jsdoc": "48.2.0", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", @@ -2553,9 +2553,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.0.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.0.6.tgz", - "integrity": "sha512-LgwXOX6TWxxFYcbdVe+BJ94Kl/pgjSPYHLzqEdAMXTA1BH9WDx7iJ+9/iDajPF64LtzWX8C1mCfpbMZjJGhAOw==", + "version": "48.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.0.tgz", + "integrity": "sha512-O2B1XLBJnUCRkggFzUQ+PBYJDit8iAgXdlu8ucolqGrbmOWPvttZQZX8d1sC0MbqDMSLs8SHSQxaNPRY1RQREg==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.42.0", diff --git a/package.json b/package.json index bd209d11d..e56650d7d 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "eslint": "8.56.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.0.6", + "eslint-plugin-jsdoc": "48.2.0", "eslint-plugin-mocha": "10.2.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", From 261bc27617670cfbfa53ee9e6ed698bcfe3507cb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:37:48 +0000 Subject: [PATCH 048/359] Bump husky from 9.0.7 to 9.0.11 Bumps [husky](https://github.com/typicode/husky) from 9.0.7 to 9.0.11. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](https://github.com/typicode/husky/compare/v9.0.7...v9.0.11) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 10 +++++----- package.json | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index efe2a43da..4af4f5d1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", - "husky": "9.0.7", + "husky": "9.0.11", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", "mocha": "10.3.0", @@ -3676,12 +3676,12 @@ } }, "node_modules/husky": { - "version": "9.0.7", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.7.tgz", - "integrity": "sha512-vWdusw+y12DUEeoZqW1kplOFqk3tedGV8qlga8/SF6a3lOiWLqGZZQvfWvY0fQYdfiRi/u1DFNpudTSV9l1aCg==", + "version": "9.0.11", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz", + "integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==", "dev": true, "bin": { - "husky": "bin.js" + "husky": "bin.mjs" }, "engines": { "node": ">=18" diff --git a/package.json b/package.json index e56650d7d..244edcc12 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", - "husky": "9.0.7", + "husky": "9.0.11", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", "mocha": "10.3.0", From eb13c9357173374360e13646ea2fc8c046b8263e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:44:57 +0000 Subject: [PATCH 049/359] Bump eslint-plugin-mocha from 10.2.0 to 10.3.0 Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 10.2.0 to 10.3.0. - [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases) - [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/CHANGELOG.md) - [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/10.2.0...10.3.0) --- updated-dependencies: - dependency-name: eslint-plugin-mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4af4f5d1e..234b17fe6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.0", - "eslint-plugin-mocha": "10.2.0", + "eslint-plugin-mocha": "10.3.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", @@ -2586,9 +2586,9 @@ } }, "node_modules/eslint-plugin-mocha": { - "version": "10.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.2.0.tgz", - "integrity": "sha512-ZhdxzSZnd1P9LqDPF0DBcFLpRIGdh1zkF2JHnQklKQOvrQtT73kdP5K9V2mzvbLR+cCAO9OI48NXK/Ax9/ciCQ==", + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.3.0.tgz", + "integrity": "sha512-IWzbg2K6B1Q7h37Ih4zMyW+nhmw1JvUlHlbCUUUu6PfOOAUGCB0gxmvv7/U+TQQ6e8yHUv+q7KMdIIum4bx+PA==", "dev": true, "dependencies": { "eslint-utils": "^3.0.0", diff --git a/package.json b/package.json index 244edcc12..1ffd52583 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.0", - "eslint-plugin-mocha": "10.2.0", + "eslint-plugin-mocha": "10.3.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", From f20f259f5e30f6c8f69c92c1c057aeb450b9ecc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 23 Feb 2024 15:52:49 +0100 Subject: [PATCH 050/359] #0: eslint --fix --- test/general.test.js | 9 +++++++++ test/type.asset.test.js | 3 +++ test/type.attributeGroup.test.js | 2 ++ test/type.attributeSet.test.js | 2 ++ test/type.automation.test.js | 30 ++++++++++++++++++++++++++++ test/type.dataExtension.test.js | 12 +++++++++++ test/type.dataExtract.test.js | 7 +++++++ test/type.fileTransfer.test.js | 6 ++++++ test/type.importFile.test.js | 7 +++++++ test/type.journey.test.js | 8 ++++++++ test/type.mobileKeyword.test.js | 8 ++++++++ test/type.mobileMessage.test.js | 7 +++++++ test/type.query.test.js | 23 +++++++++++++++++++++ test/type.script.test.js | 11 ++++++++++ test/type.transactionalEmail.test.js | 6 ++++++ test/type.transactionalPush.test.js | 6 ++++++ test/type.transactionalSMS.test.js | 7 +++++++ test/type.triggeredSend.test.js | 8 ++++++++ test/type.user.test.js | 7 +++++++ test/type.verification.test.js | 5 +++++ 20 files changed, 174 insertions(+) diff --git a/test/general.test.js b/test/general.test.js index cbea04e29..97d9bc58b 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -11,26 +11,33 @@ describe('GENERAL', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); describe('init ================', () => { it('should init a local project without downloading BUs'); + it('should init a local project and download all BUs'); }); + describe('join ================', () => { it('should clone a project from git'); }); + describe('upgrade ================', () => { it('should upgrade a project to the latest version'); }); + describe('reloadBUs ================', () => { it('should load all BUs from the server and refresh the config'); }); + describe('selectTypes ================', () => { it('should change which types are selected for default retrieval'); }); + describe('explainTypes ================', () => { it('without options', () => { handler.explainTypes(); @@ -38,6 +45,7 @@ describe('GENERAL', () => { return; }); + it('with --json set', () => { handler.setOptions({ json: true }); const typeArr = handler.explainTypes(); @@ -76,6 +84,7 @@ describe('GENERAL', () => { return; }); }); + describe('createDeltaPkg ================', () => { it('should show diff to master branch'); // mcdev createDeltaPkg master # resolves to master..HEAD diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 5e2312c1c..6d7b26f83 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -42,9 +42,11 @@ describe('type: asset', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); + describe('Retrieve ================', () => { it('Should retrieve a asset & ensure non-ssjs code is not removed', async () => { // WHEN @@ -84,6 +86,7 @@ describe('type: asset', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN diff --git a/test/type.attributeGroup.test.js b/test/type.attributeGroup.test.js index 8805fe36f..f371b31bd 100644 --- a/test/type.attributeGroup.test.js +++ b/test/type.attributeGroup.test.js @@ -11,9 +11,11 @@ describe('type: attributeGroup', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); + describe('Retrieve ================', () => { it('Should retrieve a attributeGroup', async () => { // WHEN diff --git a/test/type.attributeSet.test.js b/test/type.attributeSet.test.js index d1b06114d..141ad1c34 100644 --- a/test/type.attributeSet.test.js +++ b/test/type.attributeSet.test.js @@ -11,9 +11,11 @@ describe('type: attributeSet', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); + describe('Retrieve ================', () => { it('Should retrieve a attributeSet', async () => { // WHEN diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 265f98c24..3703d2513 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -13,9 +13,11 @@ describe('type: automation', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); + describe('Retrieve ================', () => { it('Should retrieve a automation', async () => { // WHEN @@ -54,10 +56,12 @@ describe('type: automation', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & update a automation', async () => { // WHEN const deployResult = await handler.deploy( @@ -127,6 +131,7 @@ describe('type: automation', () => { ); return; }); + it('Should update & schedule an automation with --schedule option', async () => { // WHEN handler.setOptions({ schedule: true }); @@ -196,6 +201,7 @@ describe('type: automation', () => { ); return; }); + it('Should update & runOnce an automation with --execute option', async () => { // WHEN handler.setOptions({ execute: true }); @@ -265,10 +271,12 @@ describe('type: automation', () => { return; }); }); + describe('FixKeys ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should run fixKeys but not find fixable keys and hence stop', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); @@ -299,6 +307,7 @@ describe('type: automation', () => { ); return; }); + it('Should fixKeys by key w/o re-retrieving, auto-schedule', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); @@ -343,6 +352,7 @@ describe('type: automation', () => { ); return; }); + it('Should fixKeys by key w/o re-retrieving, auto-schedule and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); @@ -387,6 +397,7 @@ describe('type: automation', () => { ); return; }); + it('Should fixKeys by key w/o re-retrieving, auto-schedule and then --schedule', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true }); @@ -431,6 +442,7 @@ describe('type: automation', () => { ); return; }); + it('Should fixKeys by key w/o re-retrieving, deploy paused', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); @@ -471,6 +483,7 @@ describe('type: automation', () => { ); return; }); + it('Should fixKeys by key w/o re-retrieving, deploy paused and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); @@ -512,6 +525,7 @@ describe('type: automation', () => { ); return; }); + it('Should fixKeys by key w/o re-retrieving, deploy paused and then --schedule', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true }); @@ -554,6 +568,7 @@ describe('type: automation', () => { return; }); }); + describe('Templating ================', () => { it('Should create a automation template via retrieveAsTemplate and build it', async () => { // GIVEN there is a template @@ -604,6 +619,7 @@ describe('type: automation', () => { ); return; }); + it('Should create a automation template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['automation']); @@ -652,6 +668,7 @@ describe('type: automation', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN @@ -667,6 +684,7 @@ describe('type: automation', () => { return; }); }); + describe('CI/CD ================', () => { it('Should return a list of files based on their type and key', async () => { // WHEN @@ -694,6 +712,7 @@ describe('type: automation', () => { return; }); }); + describe('Schedule ================', () => { it('Should schedule an automation by key', async () => { const executedKeys = await handler.schedule('testInstance/testBU', 'automation', [ @@ -712,6 +731,7 @@ describe('type: automation', () => { ); return; }); + it('Should schedule an automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%automation' } }); const executedKeys = await handler.schedule('testInstance/testBU', 'automation'); @@ -728,6 +748,7 @@ describe('type: automation', () => { ); return; }); + it('Should not schedule executing an automation because key and --like was specified', async () => { handler.setOptions({ like: { key: 'testExisting%' } }); const executedKeys = await handler.schedule('testInstance/testBU', 'automation', [ @@ -742,6 +763,7 @@ describe('type: automation', () => { return; }); }); + describe('Execute ================', () => { it('Should execute --schedule an automation by key', async () => { handler.setOptions({ schedule: true }); @@ -761,6 +783,7 @@ describe('type: automation', () => { ); return; }); + it('Should execute --schedule an automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%automation' }, schedule: true }); const executedKeys = await handler.execute('testInstance/testBU', 'automation'); @@ -777,6 +800,7 @@ describe('type: automation', () => { ); return; }); + it('Should not execute --schedule executing an automation because key and --like was specified', async () => { handler.setOptions({ like: { key: 'testExisting%' }, schedule: true }); const executedKeys = await handler.execute('testInstance/testBU', 'automation', [ @@ -790,6 +814,7 @@ describe('type: automation', () => { ); return; }); + it('Should runOnce an automation by key', async () => { const executedKeys = await handler.execute('testInstance/testBU', 'automation', [ 'testExisting_automation', @@ -807,6 +832,7 @@ describe('type: automation', () => { ); return; }); + it('Should runOnce an automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%automation' } }); const executedKeys = await handler.execute('testInstance/testBU', 'automation'); @@ -824,6 +850,7 @@ describe('type: automation', () => { return; }); + it('Should not runOnce executing an automation because key and --like was specified', async () => { handler.setOptions({ like: { key: 'testExisting%' } }); const executedKeys = await handler.execute('testInstance/testBU', 'automation', [ @@ -839,6 +866,7 @@ describe('type: automation', () => { return; }); }); + describe('Pause ================', () => { it('Should pause a automation by key', async () => { const pausedKeys = await handler.pause('testInstance/testBU', 'automation', [ @@ -857,6 +885,7 @@ describe('type: automation', () => { ); return; }); + it('Should pause a automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExisting_a%n_pause' } }); const pausedKeys = await handler.pause('testInstance/testBU', 'automation'); @@ -873,6 +902,7 @@ describe('type: automation', () => { ); return; }); + it('Should not pause automation because key and --like was specified', async () => { handler.setOptions({ like: { key: 'testExisting_a%n_pause' } }); const pausedKeys = await handler.pause('testInstance/testBU', 'automation', [ diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index c82911cba..708b86c3d 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -13,9 +13,11 @@ describe('type: dataExtension', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); + describe('Retrieve ================', () => { it('Should retrieve a dataExtension', async () => { // WHEN @@ -49,6 +51,7 @@ describe('type: dataExtension', () => { ); return; }); + it('Should retrieve a shared dataExtension', async () => { // WHEN await handler.retrieve('testInstance/_ParentBU_', ['dataExtension']); @@ -92,10 +95,12 @@ describe('type: dataExtension', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & update a dataExtension including a field rename', async () => { // WHEN const deployResult = await handler.deploy('testInstance/testBU', ['dataExtension']); @@ -136,6 +141,7 @@ describe('type: dataExtension', () => { ); return; }); + it('Should create & update a shared dataExtension', async () => { // WHEN const deployResult = await handler.deploy('testInstance/_ParentBU_', ['dataExtension']); @@ -184,6 +190,7 @@ describe('type: dataExtension', () => { ); return; }); + it('Should create & update a shared dataExtension with --fixShared & --skipInteraction', async () => { // WHEN handler.setOptions({ fixShared: 'testBU', skipInteraction: true, _runningTest: true }); @@ -235,6 +242,7 @@ describe('type: dataExtension', () => { return; }); }); + describe('Templating ================', () => { it('Should create a dataExtension template via retrieveAsTemplate and build it', async () => { // GIVEN there is a template @@ -288,6 +296,7 @@ describe('type: dataExtension', () => { ); return; }); + it('Should create a dataExtension template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['dataExtension']); @@ -339,6 +348,7 @@ describe('type: dataExtension', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the dataExtension', async () => { // WHEN @@ -353,6 +363,7 @@ describe('type: dataExtension', () => { assert.equal(isDeleted, true, 'should have deleted the item'); return; }); + it('Should delete the dataExtensionField', async () => { // WHEN const isDeleted = await handler.deleteByKey( @@ -367,6 +378,7 @@ describe('type: dataExtension', () => { return; }); }); + describe('CI/CD ================', () => { it('Should return a list of files based on their type and key', async () => { // WHEN diff --git a/test/type.dataExtract.test.js b/test/type.dataExtract.test.js index 99842c358..0fb197c28 100644 --- a/test/type.dataExtract.test.js +++ b/test/type.dataExtract.test.js @@ -11,6 +11,7 @@ describe('type: dataExtract', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -41,10 +42,12 @@ describe('type: dataExtract', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a dataExtract', async () => { // WHEN @@ -78,8 +81,10 @@ describe('type: dataExtract', () => { ); return; }); + it('Should change the key during update via --changeKeyValue '); }); + describe('Templating ================', () => { it('Should create a dataExtract template via retrieveAsTemplate and build it', async () => { // buildTemplate @@ -124,6 +129,7 @@ describe('type: dataExtract', () => { ); return; }); + it('Should create a dataExtract template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['dataExtract']); @@ -170,6 +176,7 @@ describe('type: dataExtract', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN diff --git a/test/type.fileTransfer.test.js b/test/type.fileTransfer.test.js index 3c6e70bd8..0dc820c58 100644 --- a/test/type.fileTransfer.test.js +++ b/test/type.fileTransfer.test.js @@ -11,6 +11,7 @@ describe('type: fileTransfer', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -41,10 +42,12 @@ describe('type: fileTransfer', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a fileTransfer', async () => { // WHEN await handler.deploy('testInstance/testBU', ['fileTransfer']); @@ -78,6 +81,7 @@ describe('type: fileTransfer', () => { return; }); }); + describe('Templating ================', () => { it('Should create a fileTransfer template via retrieveAsTemplate and build it', async () => { // buildTemplate @@ -122,6 +126,7 @@ describe('type: fileTransfer', () => { ); return; }); + it('Should create a fileTransfer template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['fileTransfer']); @@ -168,6 +173,7 @@ describe('type: fileTransfer', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 80f148304..8e2ce81c8 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -11,6 +11,7 @@ describe('type: importFile', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -40,6 +41,7 @@ describe('type: importFile', () => { ); return; }); + it('Should retrieve a importFile by key', async () => { // WHEN await handler.retrieve( @@ -69,10 +71,12 @@ describe('type: importFile', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a importFile', async () => { // WHEN @@ -107,6 +111,7 @@ describe('type: importFile', () => { return; }); }); + describe('Templating ================', () => { it('Should create a importFile template via retrieveAsTemplate and build it', async () => { // buildTemplate @@ -151,6 +156,7 @@ describe('type: importFile', () => { ); return; }); + it('Should create a importFile template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['importFile']); @@ -197,6 +203,7 @@ describe('type: importFile', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 3e83a731e..ad7dcd4ae 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -11,6 +11,7 @@ describe('type: journey', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -41,10 +42,12 @@ describe('type: journey', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a journey', async () => { // WHEN await handler.deploy('testInstance/testBU', ['journey']); @@ -79,6 +82,7 @@ describe('type: journey', () => { ); return; }); + it('Should NOT change the key during update with --changeKeyValue and instead fail due to missing support', async () => { // WHEN handler.setOptions({ changeKeyValue: 'updatedKey' }); @@ -92,6 +96,7 @@ describe('type: journey', () => { return; }); }); + describe('Templating ================', () => { it('Should create a journey template via buildTemplate and build it', async () => { // download first before we test buildTemplate @@ -141,6 +146,7 @@ describe('type: journey', () => { return; }); }); + describe('Delete ================', () => { it('Should NOT delete the item due to missing version', async () => { // WHEN @@ -155,6 +161,7 @@ describe('type: journey', () => { assert.equal(isDeleted, false, 'should not have deleted the item'); return; }); + it('Should NOT delete the item due to unknown version', async () => { // WHEN const isDeleted = await handler.deleteByKey( @@ -168,6 +175,7 @@ describe('type: journey', () => { assert.equal(isDeleted, false, 'should not have deleted the item'); return; }); + it('Should delete the item with version', async () => { // WHEN const isDeleted = await handler.deleteByKey( diff --git a/test/type.mobileKeyword.test.js b/test/type.mobileKeyword.test.js index 0bc57ec1b..51939ca25 100644 --- a/test/type.mobileKeyword.test.js +++ b/test/type.mobileKeyword.test.js @@ -13,6 +13,7 @@ describe('type: mobileKeyword', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -55,10 +56,12 @@ describe('type: mobileKeyword', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create (but not update) a mobileKeyword', async () => { // WHEN await handler.deploy( @@ -103,6 +106,7 @@ describe('type: mobileKeyword', () => { ); return; }); + it('Should not create a mobileKeyword with wrong type', async () => { // WHEN await handler.deploy( @@ -122,6 +126,7 @@ describe('type: mobileKeyword', () => { return; }); }); + describe('Templating ================', () => { it('Should create a mobileKeyword template via retrieveAsTemplate and build it', async () => { // GIVEN there is a template @@ -168,6 +173,7 @@ describe('type: mobileKeyword', () => { ); return; }); + it('Should create a mobileKeyword template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['mobileKeyword']); @@ -243,6 +249,7 @@ describe('type: mobileKeyword', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN @@ -258,6 +265,7 @@ describe('type: mobileKeyword', () => { return; }); }); + describe('CI/CD ================', () => { it('Should return a list of files based on their type and key', async () => { // WHEN diff --git a/test/type.mobileMessage.test.js b/test/type.mobileMessage.test.js index d02cde0c3..241a27658 100644 --- a/test/type.mobileMessage.test.js +++ b/test/type.mobileMessage.test.js @@ -13,6 +13,7 @@ describe('type: mobileMessage', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -46,10 +47,12 @@ describe('type: mobileMessage', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & update items', async () => { // WHEN await handler.deploy('testInstance/testBU', ['mobileMessage']); @@ -90,6 +93,7 @@ describe('type: mobileMessage', () => { ); return; }); + it('Should NOT change the key during update with --changeKeyValue and instead fail due to missing support', async () => { // WHEN handler.setOptions({ changeKeyValue: 'updatedKey' }); @@ -103,6 +107,7 @@ describe('type: mobileMessage', () => { return; }); }); + describe('Templating ================', () => { it('Should create a mobileMessage template via buildTemplate and build it', async () => { // download first before we test buildTemplate @@ -161,6 +166,7 @@ describe('type: mobileMessage', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN @@ -176,6 +182,7 @@ describe('type: mobileMessage', () => { return; }); }); + describe('CI/CD ================', () => { it('Should return a list of files based on their type and key', async () => { // WHEN diff --git a/test/type.query.test.js b/test/type.query.test.js index 2dbcd246a..4b3f21147 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -13,6 +13,7 @@ describe('type: query', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -53,6 +54,7 @@ describe('type: query', () => { ); return; }); + it('Should retrieve one specific query by key', async () => { // WHEN await handler.retrieve('testInstance/testBU', ['query'], ['testExisting_query']); @@ -80,6 +82,7 @@ describe('type: query', () => { ); return; }); + it('Should retrieve one specific query via --like', async () => { // WHEN handler.setOptions({ like: { key: '%Existing_query' } }); @@ -110,6 +113,7 @@ describe('type: query', () => { ); return; }); + it('Should not retrieve any query via --like and key due to a mismatching filter', async () => { // WHEN handler.setOptions({ like: { key: 'NotExisting_query' } }); @@ -136,10 +140,12 @@ describe('type: query', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a query', async () => { // WHEN const resultDeploy = await handler.deploy( @@ -189,6 +195,7 @@ describe('type: query', () => { ); return; }); + it('Should deploy and execute with --execute', async () => { handler.setOptions({ execute: true }); // WHEN @@ -221,10 +228,12 @@ describe('type: query', () => { return; }); }); + describe('FixKeys ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should change the key during update with --changeKeyValue', async () => { // WHEN await handler.retrieve( @@ -275,6 +284,7 @@ describe('type: query', () => { ); return; }); + it('Should change the key during update with --changeKeyField', async () => { // WHEN await handler.retrieve( @@ -321,6 +331,7 @@ describe('type: query', () => { ); return; }); + it('Should run fixKeys but not find fixable keys and hence stop', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); @@ -351,6 +362,7 @@ describe('type: query', () => { ); return; }); + it('Should fixKeys by key WITHOUT re-retrieving dependent types', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); @@ -387,6 +399,7 @@ describe('type: query', () => { ); return; }); + it('Should fixKeys by key WITHOUT re-retrieving dependent types and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); @@ -427,6 +440,7 @@ describe('type: query', () => { ); return; }); + it('Should fixKeys by key AND re-retrieve dependent types', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: true } }); @@ -463,6 +477,7 @@ describe('type: query', () => { ); return; }); + it('Should fixKeys by key AND re-retrieve dependent types and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: true }, execute: true }); @@ -503,6 +518,7 @@ describe('type: query', () => { ); return; }); + it('Should fixKeys via --like WITHOUT re-retrieving dependent types', async () => { // WHEN handler.setOptions({ @@ -540,6 +556,7 @@ describe('type: query', () => { return; }); }); + describe('Templating ================', () => { it('Should create a query template via retrieveAsTemplate and build it', async () => { // GIVEN there is a template @@ -597,6 +614,7 @@ describe('type: query', () => { ); return; }); + it('Should create a query template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['query']); @@ -653,6 +671,7 @@ describe('type: query', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN @@ -668,6 +687,7 @@ describe('type: query', () => { return; }); }); + describe('CI/CD ================', () => { it('Should return a list of files based on their type and key', async () => { // WHEN @@ -695,6 +715,7 @@ describe('type: query', () => { return; }); }); + describe('Execute ================', () => { it('Should start a query by key', async () => { const executedKeys = await handler.execute('testInstance/testBU', 'query', [ @@ -713,6 +734,7 @@ describe('type: query', () => { ); return; }); + it('Should start a query selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%query' } }); const executedKeys = await handler.execute('testInstance/testBU', 'query'); @@ -729,6 +751,7 @@ describe('type: query', () => { ); return; }); + it('Should not start executing a query because key and --like was specified', async () => { handler.setOptions({ like: { key: 'testExisting%' } }); const executedKeys = await handler.execute('testInstance/testBU', 'query', [ diff --git a/test/type.script.test.js b/test/type.script.test.js index 2503b3a48..592ef273e 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -13,6 +13,7 @@ describe('type: script', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -114,6 +115,7 @@ describe('type: script', () => { ); return; }); + it('Should retrieve one specific script by key', async () => { // WHEN await handler.retrieve('testInstance/testBU', ['script'], ['testExisting_script']); @@ -154,6 +156,7 @@ describe('type: script', () => { ); return; }); + it('Should retrieve one specific script via --like', async () => { // WHEN handler.setOptions({ like: { key: '%Existing_script' } }); @@ -195,6 +198,7 @@ describe('type: script', () => { ); return; }); + it('Should not retrieve any script via --like and key due to a mismatching filter', async () => { // WHEN handler.setOptions({ like: { key: 'NotExisting_script' } }); @@ -220,10 +224,12 @@ describe('type: script', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a script', async () => { // WHEN await handler.deploy('testInstance/testBU', ['script']); @@ -262,6 +268,7 @@ describe('type: script', () => { return; }); }); + describe('Templating ================', () => { it('Should create a script template via retrieveAsTemplate and build it', async () => { // GIVEN there is a template @@ -319,6 +326,7 @@ describe('type: script', () => { ); return; }); + it('Should create a script template via buildTemplate and build it', async () => { // download first before we test buildTemplate await handler.retrieve('testInstance/testBU', ['script']); @@ -375,6 +383,7 @@ describe('type: script', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN @@ -389,6 +398,7 @@ describe('type: script', () => { return; }); }); + describe('CI/CD ================', () => { it('Should return a list of files based on their type and key', async () => { // WHEN @@ -421,5 +431,6 @@ describe('type: script', () => { return; }); }); + describe('Execute ================', () => {}); }); diff --git a/test/type.transactionalEmail.test.js b/test/type.transactionalEmail.test.js index 87f15552b..e84c7e67d 100644 --- a/test/type.transactionalEmail.test.js +++ b/test/type.transactionalEmail.test.js @@ -11,6 +11,7 @@ describe('type: transactionalEmail', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -41,10 +42,12 @@ describe('type: transactionalEmail', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a transactionalEmail', async () => { // WHEN await handler.deploy('testInstance/testBU', ['transactionalEmail']); @@ -77,6 +80,7 @@ describe('type: transactionalEmail', () => { ); return; }); + it('Should NOT change the key during update with --changeKeyValue and instead fail due to missing support', async () => { // WHEN handler.setOptions({ changeKeyValue: 'updatedKey' }); @@ -94,6 +98,7 @@ describe('type: transactionalEmail', () => { return; }); }); + describe('Templating ================', () => { // it.skip('Should create a transactionalEmail template via retrieveAsTemplate and build it'); it('Should create a transactionalEmail template via buildTemplate and build it', async () => { @@ -142,6 +147,7 @@ describe('type: transactionalEmail', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN diff --git a/test/type.transactionalPush.test.js b/test/type.transactionalPush.test.js index ac6b4e0f1..80e299815 100644 --- a/test/type.transactionalPush.test.js +++ b/test/type.transactionalPush.test.js @@ -11,6 +11,7 @@ describe('type: transactionalPush', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -41,10 +42,12 @@ describe('type: transactionalPush', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a transactionalPush', async () => { // WHEN await handler.deploy('testInstance/testBU', ['transactionalPush']); @@ -77,6 +80,7 @@ describe('type: transactionalPush', () => { ); return; }); + it('Should NOT change the key during update with --changeKeyValue and instead fail due to missing support', async () => { // WHEN handler.setOptions({ changeKeyValue: 'updatedKey' }); @@ -94,6 +98,7 @@ describe('type: transactionalPush', () => { return; }); }); + describe('Templating ================', () => { // it.skip('Should create a transactionalPush template via retrieveAsTemplate and build it'); it('Should create a transactionalPush template via buildTemplate and build it', async () => { @@ -143,6 +148,7 @@ describe('type: transactionalPush', () => { return; }); }); + describe('Delete ================', () => { // TODO: add this test it('Should delete the item'); // , async () => { diff --git a/test/type.transactionalSMS.test.js b/test/type.transactionalSMS.test.js index 137cc4404..feb0e20f4 100644 --- a/test/type.transactionalSMS.test.js +++ b/test/type.transactionalSMS.test.js @@ -13,6 +13,7 @@ describe('type: transactionalSMS', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -48,10 +49,12 @@ describe('type: transactionalSMS', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a transactionalSMS', async () => { // WHEN await handler.deploy('testInstance/testBU', ['transactionalSMS']); @@ -94,6 +97,7 @@ describe('type: transactionalSMS', () => { ); return; }); + it('Should NOT change the key during update with --changeKeyValue and instead fail due to missing support', async () => { // WHEN handler.setOptions({ changeKeyValue: 'updatedKey' }); @@ -111,6 +115,7 @@ describe('type: transactionalSMS', () => { return; }); }); + describe('Templating ================', () => { // it.skip('Should create a transactionalSMS template via retrieveAsTemplate and build it'); it('Should create a transactionalSMS template via buildTemplate and build it', async () => { @@ -173,6 +178,7 @@ describe('type: transactionalSMS', () => { return; }); }); + describe('Delete ================', () => { // TODO: add this test it('Should delete the item'); // , async () => { @@ -185,6 +191,7 @@ describe('type: transactionalSMS', () => { // return; // }); }); + describe('CI/CD ================', () => { // TODO: add this test it('Should return a list of files based on their type and key'); // , async () => { diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index 7ad9029d2..f41e38376 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -11,6 +11,7 @@ describe('type: triggeredSend', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -41,10 +42,12 @@ describe('type: triggeredSend', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a triggeredSend', async () => { // WHEN await handler.deploy('testInstance/testBU', ['triggeredSend']); @@ -78,6 +81,7 @@ describe('type: triggeredSend', () => { return; }); }); + describe('Templating ================', () => { it('Should create a triggeredSend template via buildTemplate and build it', async () => { // download first before we test buildTemplate @@ -128,6 +132,7 @@ describe('type: triggeredSend', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN @@ -143,12 +148,15 @@ describe('type: triggeredSend', () => { return; }); }); + describe('Refresh ================', () => { it('Should refresh a triggeredSend by key'); }); + describe('Start (Execute) ================', () => { it('Should start a triggeredSend by key'); }); + describe('Pause ================', () => { it('Should pause a triggeredSend by key'); }); diff --git a/test/type.user.test.js b/test/type.user.test.js index 80b8740ef..5b72b444a 100644 --- a/test/type.user.test.js +++ b/test/type.user.test.js @@ -14,9 +14,11 @@ describe('type: user', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); + describe('Retrieve ================', () => { it('Should retrieve a user', async () => { // WHEN @@ -61,6 +63,7 @@ describe('type: user', () => { ); return; }); + it('Should retrieve a specific user but not run document', async () => { // WHEN await handler.retrieve('testInstance/_ParentBU_', ['user'], ['testExisting_user']); @@ -78,10 +81,12 @@ describe('type: user', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a user', async () => { // WHEN const expectedCache = [ @@ -130,6 +135,7 @@ describe('type: user', () => { ); return; }); + it('Should not deploy user with Marketing Cloud role', async () => { // WHEN const expectedCache = [ @@ -163,6 +169,7 @@ describe('type: user', () => { return; }); }); + describe('Templating ================', () => { // it('Should create a user template via retrieveAsTemplate and build it', async () => {}); it('Should create a user template via buildTemplate and build it', async () => { diff --git a/test/type.verification.test.js b/test/type.verification.test.js index d0076e6dd..42890286b 100644 --- a/test/type.verification.test.js +++ b/test/type.verification.test.js @@ -11,6 +11,7 @@ describe('type: verification', () => { beforeEach(() => { testUtils.mockSetup(); }); + afterEach(() => { testUtils.mockReset(); }); @@ -52,10 +53,12 @@ describe('type: verification', () => { return; }); }); + describe('Deploy ================', () => { beforeEach(() => { testUtils.mockSetup(true); }); + it('Should create & upsert a verification', async () => { // WHEN @@ -100,6 +103,7 @@ describe('type: verification', () => { return; }); }); + describe('Templating ================', () => { it('Should create a verification template via buildTemplate and build it', async () => { // download first before we test buildTemplate @@ -153,6 +157,7 @@ describe('type: verification', () => { return; }); }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN From 0296523ee06690d309b9c2e2b3f51eea581127e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 23 Feb 2024 17:29:02 +0100 Subject: [PATCH 051/359] #745: reduce amount of api calls --- docs/dist/documentation.md | 433 +++++++++++++++++++++++++++++--- lib/metadataTypes/ImportFile.js | 12 +- 2 files changed, 404 insertions(+), 41 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index bc04b6002..b49859190 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -132,6 +132,9 @@ Provides default functionality that can be overwritten by child metadata type cl
Retriever

Retrieves metadata from a business unit and saves it to the local filesystem.

+
ImportFileMetadataType
+

ImportFile MetadataType

+
## Constants @@ -242,12 +245,6 @@ helper for DataExtension.#fixShared_item
setupSDK(sessionKey, authObject)SDK

Returns an SDK instance to be used for API calls

-
getActualJson(customerKey, type, subtype, [buName])Promise.<string>
-

gets file from Retrieve folder

-
-
getActualFile(customerKey, type, subtype, ext)string
-

gets file from Retrieve folder

-
## Typedefs @@ -3042,6 +3039,134 @@ ImportFile MetadataType * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> + * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(importFile)](#ImportFile.create) ⇒ Promise + * [.update(importFile)](#ImportFile.update) ⇒ Promise + * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> + + + +### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Import File. +Endpoint /automation/v1/imports/ return all Import Files with all details. +Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | + + + +### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Import Definition by Name + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### ImportFile.create(importFile) ⇒ Promise +Creates a single Import File + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| importFile | TYPE.MetadataTypeItem | a single Import File | + + + +### ImportFile.update(importFile) ⇒ Promise +Updates a single Import File + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| importFile | TYPE.MetadataTypeItem | a single Import File | + + + +### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + + + +### ImportFile.preDeployTasks(metadata) ⇒ Promise +prepares a import definition for deployment + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single importDef | + + + +### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: TYPE.MetadataTypeItem - parsed metadata + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | @@ -6317,6 +6442,272 @@ helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of t | --- | --- | --- | | metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | + + +## ImportFile ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(importFile)](#ImportFile.create) ⇒ Promise + * [.update(importFile)](#ImportFile.update) ⇒ Promise + * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> + * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(importFile)](#ImportFile.create) ⇒ Promise + * [.update(importFile)](#ImportFile.update) ⇒ Promise + * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> + + + +### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Import File. +Endpoint /automation/v1/imports/ return all Import Files with all details. +Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | + + + +### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Import Definition by Name + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### ImportFile.create(importFile) ⇒ Promise +Creates a single Import File + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| importFile | TYPE.MetadataTypeItem | a single Import File | + + + +### ImportFile.update(importFile) ⇒ Promise +Updates a single Import File + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| importFile | TYPE.MetadataTypeItem | a single Import File | + + + +### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + + + +### ImportFile.preDeployTasks(metadata) ⇒ Promise +prepares a import definition for deployment + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single importDef | + + + +### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: TYPE.MetadataTypeItem - parsed metadata + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Import File. +Endpoint /automation/v1/imports/ return all Import Files with all details. +Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | + + + +### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Import Definition by Name + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### ImportFile.create(importFile) ⇒ Promise +Creates a single Import File + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| importFile | TYPE.MetadataTypeItem | a single Import File | + + + +### ImportFile.update(importFile) ⇒ Promise +Updates a single Import File + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| importFile | TYPE.MetadataTypeItem | a single Import File | + + + +### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + + + +### ImportFile.preDeployTasks(metadata) ⇒ Promise +prepares a import definition for deployment + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single importDef | + + + +### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: TYPE.MetadataTypeItem - parsed metadata + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + ## BusinessUnit @@ -8482,36 +8873,6 @@ Returns an SDK instance to be used for API calls | sessionKey | string | key for specific BU | | authObject | TYPE.AuthObject | credentials for specific BU | - - -## getActualJson(customerKey, type, subtype, [buName]) ⇒ Promise.<string> -gets file from Retrieve folder - -**Kind**: global function -**Returns**: Promise.<string> - file in string form - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| customerKey | string | | of metadata | -| type | string | | of metadata | -| subtype | string | | of metadata | -| [buName] | string | "testBU" | used when we need to test on ParentBU | - - - -## getActualFile(customerKey, type, subtype, ext) ⇒ string -gets file from Retrieve folder - -**Kind**: global function -**Returns**: string - file path - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | of metadata | -| type | string | of metadata | -| subtype | string | of metadata | -| ext | string | file extension | - ## TypeKeyCombo : Object.<string, string> diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 3dec7f670..22225a828 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -44,16 +44,18 @@ class ImportFile extends MetadataType { this.smsImports = {}; if (smsImportResults.totalResults > 0 && smsImportResults.entry.length > 0) { Util.logger.info(`Caching dependent Metadata: dataExtension (source for SMS imports)`); - + const sourceObject = {}; for (const item of smsImportResults.entry) { // this api does not show the key but the name is assumed to be unique this.smsImports[item.name] = item; try { - const sourceObject = await this.client.rest.get( - '/legacy/v1/beta/object/' + item.sourceObjectId - ); - item.sourceObjectKey = sourceObject.key; + if (!sourceObject[item.sourceObjectId]) { + sourceObject[item.sourceObjectId] = await this.client.rest.get( + '/legacy/v1/beta/object/' + item.sourceObjectId + ); + } + item.sourceObjectKey = sourceObject[item.sourceObjectId].key; } catch { Util.logger.warn( `endpoint /legacy/v1/beta/object/${item.sourceObjectId} does not exist` From 24db8cd475a25edd213539001fa2ec00ec40df6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 23 Feb 2024 17:30:35 +0100 Subject: [PATCH 052/359] #745: fix tests --- docs/dist/documentation.md | 397 ------------------ .../get-response.json | 78 ++++ .../automation/v1/imports/get-response.json | 79 +++- .../9999999/importFile/build-expected.json | 1 - .../9999999/importFile/get-expected.json | 1 - .../9999999/importFile/get-sms-expected.json | 73 ++++ .../9999999/importFile/patch-expected.json | 1 - .../9999999/importFile/post-expected.json | 1 - .../9999999/importFile/template-expected.json | 1 - .../v1/beta/mobile/imports/get-response.json | 112 +++++ .../get-response.json | 12 + test/type.automation.test.js | 26 +- test/type.importFile.test.js | 23 +- test/type.query.test.js | 4 +- 14 files changed, 382 insertions(+), 427 deletions(-) create mode 100644 test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json create mode 100644 test/resources/9999999/importFile/get-sms-expected.json create mode 100644 test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json create mode 100644 test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index b49859190..656712476 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -132,9 +132,6 @@ Provides default functionality that can be overwritten by child metadata type cl
Retriever

Retrieves metadata from a business unit and saves it to the local filesystem.

-
ImportFileMetadataType
-

ImportFile MetadataType

-
## Constants @@ -3039,134 +3036,6 @@ ImportFile MetadataType * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> - * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(importFile)](#ImportFile.create) ⇒ Promise - * [.update(importFile)](#ImportFile.update) ⇒ Promise - * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> - - - -### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Import File. -Endpoint /automation/v1/imports/ return all Import Files with all details. -Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Import Definition by Name - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### ImportFile.create(importFile) ⇒ Promise -Creates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.update(importFile) ⇒ Promise -Updates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### ImportFile.preDeployTasks(metadata) ⇒ Promise -prepares a import definition for deployment - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single importDef | - - - -### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | @@ -6442,272 +6311,6 @@ helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of t | --- | --- | --- | | metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | - - -## ImportFile ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(importFile)](#ImportFile.create) ⇒ Promise - * [.update(importFile)](#ImportFile.update) ⇒ Promise - * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> - * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(importFile)](#ImportFile.create) ⇒ Promise - * [.update(importFile)](#ImportFile.update) ⇒ Promise - * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> - - - -### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Import File. -Endpoint /automation/v1/imports/ return all Import Files with all details. -Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Import Definition by Name - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### ImportFile.create(importFile) ⇒ Promise -Creates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.update(importFile) ⇒ Promise -Updates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### ImportFile.preDeployTasks(metadata) ⇒ Promise -prepares a import definition for deployment - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single importDef | - - - -### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Import File. -Endpoint /automation/v1/imports/ return all Import Files with all details. -Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Import Definition by Name - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### ImportFile.create(importFile) ⇒ Promise -Creates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.update(importFile) ⇒ Promise -Updates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### ImportFile.preDeployTasks(metadata) ⇒ Promise -prepares a import definition for deployment - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single importDef | - - - -### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - ## BusinessUnit diff --git a/test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json b/test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json new file mode 100644 index 000000000..87a475ffb --- /dev/null +++ b/test/resources/9999999/automation/v1/imports/1ebf557b-372e-eb11-b81b-48df37d1dbd7/get-response.json @@ -0,0 +1,78 @@ +{ + "allowErrors": true, + "customerKey": "testExisting_importFileSMS", + "createdDate": "2022-11-24T03:29:01.05", + "modifiedDate": "2023-07-19T23:06:33.577", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "Unsub for Keyword", + "destinationObjectId": "00000000-0000-0000-0000-000000000000", + "destinationId": 0, + "destinationObjectTypeId": 584, + "fieldMappings": [ + { + "sourceFieldName": "Locale", + "destinationFieldName": "_CountryCode" + }, + { + "sourceFieldName": "FirstName", + "destinationFieldName": "_FirstName" + }, + { + "sourceFieldName": "IsHonorDST", + "destinationFieldName": "_IsHonorDST" + }, + { + "sourceFieldName": "LastName", + "destinationFieldName": "_LastName" + }, + { + "sourceFieldName": "MobileNumber", + "destinationFieldName": "_MobileNumber" + }, + { + "sourceFieldName": "Status", + "destinationFieldName": "_Status" + }, + { + "sourceFieldName": "ContactKey", + "destinationFieldName": "_SubscriberKey" + }, + { + "sourceFieldName": "UTCoffset", + "destinationFieldName": "_UTCOffset" + }, + { + "sourceFieldName": "Action", + "destinationFieldName": "Action" + }, + { + "sourceFieldName": "ModifiedDate", + "destinationFieldName": "SalesforceModified" + }, + { + "sourceFieldName": "SFContactID", + "destinationFieldName": "SFContactID" + } + ], + "fieldMappingType": "ManualMap", + "fileNamingPattern": "_CustomObject", + "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", + "fileTransferLocationName": "ExactTarget Enhanced FTP", + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "importDefinitionId": "1ebf557b-372e-eb11-b81b-48df37d1dbd7", + "isOrderedImport": false, + "isSequential": true, + "maxFileAgeHours": 0, + "maxImportFrequencyHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "name": "testExisting_importFileSMS", + "notificationEmailAddress": "joern.berkefeld@accenture.com", + "sendEmailNotification": true, + "standardQuotedStrings": false, + "subscriberImportTypeId": 255, + "updateTypeId": 0, + "fileTransferLocationTypeId": 0 +} diff --git a/test/resources/9999999/automation/v1/imports/get-response.json b/test/resources/9999999/automation/v1/imports/get-response.json index 000537e3b..6b60cf36b 100644 --- a/test/resources/9999999/automation/v1/imports/get-response.json +++ b/test/resources/9999999/automation/v1/imports/get-response.json @@ -1,7 +1,7 @@ { "page": 1, "pageSize": 500, - "count": 1, + "count": 2, "items": [ { "allowErrors": true, @@ -33,6 +33,83 @@ "subscriberImportTypeId": 255, "updateTypeId": 0, "fileTransferLocationTypeId": 0 + }, + { + "allowErrors": true, + "customerKey": "testExisting_importFileSMS", + "createdDate": "2022-11-24T03:29:01.05", + "modifiedDate": "2023-07-19T23:06:33.577", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "Unsub for Keyword", + "destinationObjectId": "00000000-0000-0000-0000-000000000000", + "destinationId": 0, + "destinationObjectTypeId": 584, + "fieldMappings": [ + { + "sourceFieldName": "Locale", + "destinationFieldName": "_CountryCode" + }, + { + "sourceFieldName": "FirstName", + "destinationFieldName": "_FirstName" + }, + { + "sourceFieldName": "IsHonorDST", + "destinationFieldName": "_IsHonorDST" + }, + { + "sourceFieldName": "LastName", + "destinationFieldName": "_LastName" + }, + { + "sourceFieldName": "MobileNumber", + "destinationFieldName": "_MobileNumber" + }, + { + "sourceFieldName": "Status", + "destinationFieldName": "_Status" + }, + { + "sourceFieldName": "ContactKey", + "destinationFieldName": "_SubscriberKey" + }, + { + "sourceFieldName": "UTCoffset", + "destinationFieldName": "_UTCOffset" + }, + { + "sourceFieldName": "Action", + "destinationFieldName": "Action" + }, + { + "sourceFieldName": "ModifiedDate", + "destinationFieldName": "SalesforceModified" + }, + { + "sourceFieldName": "SFContactID", + "destinationFieldName": "SFContactID" + } + ], + "fieldMappingType": "ManualMap", + "fileNamingPattern": "_CustomObject", + "fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "importDefinitionId": "1ebf557b-372e-eb11-b81b-48df37d1dbd7", + "isOrderedImport": false, + "isSequential": true, + "maxFileAgeHours": 0, + "maxImportFrequencyHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "name": "testExisting_importFileSMS", + "notificationEmailAddress": "joern.berkefeld@accenture.com", + "sendEmailNotification": true, + "standardQuotedStrings": false, + "subscriberImportTypeId": 255, + "updateTypeId": 0, + "fileTransferLocationTypeId": 0 } ] } diff --git a/test/resources/9999999/importFile/build-expected.json b/test/resources/9999999/importFile/build-expected.json index 11e81a297..33e915fff 100644 --- a/test/resources/9999999/importFile/build-expected.json +++ b/test/resources/9999999/importFile/build-expected.json @@ -12,7 +12,6 @@ "fieldMappings": [], "fieldMappingType": "InferFromColumnHeadings", "fileNamingPattern": "blabla", - "fileTransferLocationTypeId": 0, "fileType": "CSV", "filter": "", "hasColumnHeader": true, diff --git a/test/resources/9999999/importFile/get-expected.json b/test/resources/9999999/importFile/get-expected.json index a704e2286..c60924af2 100644 --- a/test/resources/9999999/importFile/get-expected.json +++ b/test/resources/9999999/importFile/get-expected.json @@ -13,7 +13,6 @@ "fieldMappings": [], "fieldMappingType": "InferFromColumnHeadings", "fileNamingPattern": "blabla", - "fileTransferLocationTypeId": 0, "fileType": "CSV", "filter": "", "hasColumnHeader": true, diff --git a/test/resources/9999999/importFile/get-sms-expected.json b/test/resources/9999999/importFile/get-sms-expected.json new file mode 100644 index 000000000..230885a1a --- /dev/null +++ b/test/resources/9999999/importFile/get-sms-expected.json @@ -0,0 +1,73 @@ +{ + "allowErrors": true, + "c__dataAction": "AddUpdate", + "c__destinationType": "SMS", + "c__subscriberImportType": "DataExtension", + "createdDate": "2022-11-24T03:29:01.05", + "customerKey": "testExisting_importFileSMS", + "dateFormatLocale": "en-US", + "deleteFile": false, + "description": "Unsub for Keyword", + "fieldMappingType": "ManualMap", + "fieldMappings": [ + { + "destinationFieldName": "_CountryCode", + "sourceFieldName": "Locale" + }, + { + "destinationFieldName": "_FirstName", + "sourceFieldName": "FirstName" + }, + { + "destinationFieldName": "_IsHonorDST", + "sourceFieldName": "IsHonorDST" + }, + { + "destinationFieldName": "_LastName", + "sourceFieldName": "LastName" + }, + { + "destinationFieldName": "_MobileNumber", + "sourceFieldName": "MobileNumber" + }, + { + "destinationFieldName": "_Status", + "sourceFieldName": "Status" + }, + { + "destinationFieldName": "_SubscriberKey", + "sourceFieldName": "ContactKey" + }, + { + "destinationFieldName": "_UTCOffset", + "sourceFieldName": "UTCoffset" + }, + { + "destinationFieldName": "Action", + "sourceFieldName": "Action" + }, + { + "destinationFieldName": "SalesforceModified", + "sourceFieldName": "ModifiedDate" + }, + { + "destinationFieldName": "SFContactID", + "sourceFieldName": "SFContactID" + } + ], + "fileNamingPattern": "_CustomObject", + "fileType": "CSV", + "filter": "", + "hasColumnHeader": true, + "isOrderedImport": false, + "isSequential": true, + "maxFileAgeHours": 0, + "maxFileAgeScheduleOffsetHours": 0, + "maxImportFrequencyHours": 0, + "modifiedDate": "2023-07-19T23:06:33.577", + "name": "testExisting_importFileSMS", + "notificationEmailAddress": "joern.berkefeld@accenture.com", + "r__fileLocation_name": "ExactTarget Enhanced FTP", + "sendEmailNotification": true, + "standardQuotedStrings": false +} diff --git a/test/resources/9999999/importFile/patch-expected.json b/test/resources/9999999/importFile/patch-expected.json index 0d7618393..c0c078629 100644 --- a/test/resources/9999999/importFile/patch-expected.json +++ b/test/resources/9999999/importFile/patch-expected.json @@ -13,7 +13,6 @@ "fieldMappings": [], "fieldMappingType": "InferFromColumnHeadings", "fileNamingPattern": "blabla", - "fileTransferLocationTypeId": 0, "fileType": "CSV", "filter": "", "hasColumnHeader": true, diff --git a/test/resources/9999999/importFile/post-expected.json b/test/resources/9999999/importFile/post-expected.json index 0a9440dba..4fb99f81b 100644 --- a/test/resources/9999999/importFile/post-expected.json +++ b/test/resources/9999999/importFile/post-expected.json @@ -11,7 +11,6 @@ "fieldMappingType": "InferFromColumnHeadings", "fieldMappings": [], "fileNamingPattern": "blabla", - "fileTransferLocationTypeId": 0, "fileType": "CSV", "filter": "", "hasColumnHeader": true, diff --git a/test/resources/9999999/importFile/template-expected.json b/test/resources/9999999/importFile/template-expected.json index ff26a685b..52508601f 100644 --- a/test/resources/9999999/importFile/template-expected.json +++ b/test/resources/9999999/importFile/template-expected.json @@ -12,7 +12,6 @@ "fieldMappingType": "InferFromColumnHeadings", "fieldMappings": [], "fileNamingPattern": "blabla", - "fileTransferLocationTypeId": 0, "fileType": "CSV", "filter": "", "hasColumnHeader": true, diff --git a/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json b/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json new file mode 100644 index 000000000..2a4ea6fcc --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json @@ -0,0 +1,112 @@ +{ + "startIndex": 0, + "itemsPerPage": 50, + "totalResults": 3, + "entry": [ + { + "id": "ZTFXX0hpNDNFZXU0RzBqZk45SGIxdzo0MTow", + "name": "Contact_SMS_DEV_2", + "sourceFile": "_CustomObject", + "audience": { + "id": "QUFBQUFBQUFBQUFBQUFBQUFBQUFBQTo2Mzow", + "name": "Contact_SMS_DEV_2", + "description": "" + }, + "code": { + "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow", + "code": "491771783703", + "codeType": "PRIVATE", + "isShortCode": false, + "isGsmCharacterSetOnly": false, + "isMms": false, + "isStackIndependant": false, + "dipSwitches": 0, + "moEngineVersion": 0, + "supportsConcatenation": false, + "isClientOwned": false, + "isOwner": false + }, + "keyword": { + "id": "Y0ZDXzVjVHdYVUNlQVJlT2U2dzVKZzo4Njow", + "keyword": "ONEDEVICE_DEV", + "restriction": "NONE", + "isInherited": false, + "isLinkShorteningEnabled": false, + "isSubscriberTrackingEnabled": false, + "shortenerType": "BitLy" + }, + "sourceObjectId": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow", + "sourceObjectName": "testExisting_dataExtension" + }, + { + "id": "MVZtWUtidEVFZWlpdnhRQzdKVHM4UTo0MTow", + "name": "ContactSMS_DEV", + "sourceFile": "_CustomObject", + "audience": { + "id": "QUFBQUFBQUFBQUFBQUFBQUFBQUFBQTo2Mzow", + "name": "ContactSMS_DEV", + "description": "" + }, + "code": { + "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow", + "code": "491771783703", + "codeType": "PRIVATE", + "isShortCode": false, + "isGsmCharacterSetOnly": false, + "isMms": false, + "isStackIndependant": false, + "dipSwitches": 0, + "moEngineVersion": 0, + "supportsConcatenation": false, + "isClientOwned": false, + "isOwner": false + }, + "keyword": { + "id": "X2RqemdvVHFja1dpTzlKcERRQ25MZzo4Njow", + "keyword": "COMMUNITYCLOUD_DEV", + "restriction": "NONE", + "isInherited": false, + "isLinkShorteningEnabled": false, + "isSubscriberTrackingEnabled": false, + "shortenerType": "BitLy" + }, + "sourceObjectId": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow", + "sourceObjectName": "testExisting_dataExtension" + }, + { + "id": "NHNwUFR5YTdFZTY0WVVqZk45SGNlUTo0MTow", + "name": "ContactSMS_DEV3", + "sourceFile": "_CustomObject", + "audience": { + "id": "QUFBQUFBQUFBQUFBQUFBQUFBQUFBQTo2Mzow", + "name": "ContactSMS_DEV3", + "description": "" + }, + "code": { + "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow", + "code": "491771783703", + "codeType": "PRIVATE", + "isShortCode": false, + "isGsmCharacterSetOnly": false, + "isMms": false, + "isStackIndependant": false, + "dipSwitches": 0, + "moEngineVersion": 0, + "supportsConcatenation": false, + "isClientOwned": false, + "isOwner": false + }, + "keyword": { + "id": "X2RqemdvVHFja1dpTzlKcERRQ25MZzo4Njow", + "keyword": "COMMUNITYCLOUD_DEV", + "restriction": "NONE", + "isInherited": false, + "isLinkShorteningEnabled": false, + "isSubscriberTrackingEnabled": false, + "shortenerType": "BitLy" + }, + "sourceObjectId": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow", + "sourceObjectName": "testExisting_dataExtension" + } + ] +} diff --git a/test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json b/test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json new file mode 100644 index 000000000..2af253c3f --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/object/NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow/get-response.json @@ -0,0 +1,12 @@ +{ + "id": "NWQwdnhEU3dFZWVBekJRQzdISWl0QTo0NTow", + "key": "testExisting_dataExtension", + "dataExtensionName": "testExisting_dataExtension", + "description": "", + "isSendable": true, + "sendableDataExtensionField": "ContactKey", + "sendableSubscriberField": "_SubscriberKey", + "isTestable": false, + "isPublic": false, + "isPlatformObject": false +} diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 3703d2513..a2a7c64d6 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -50,7 +50,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 19, + 22, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -126,7 +126,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 26, + 29, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -196,7 +196,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 34, + 37, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -265,7 +265,7 @@ describe('type: automation', () => { assert.equal( testUtils.getAPIHistoryLength(), - 30, + 33, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -302,7 +302,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 19, + 22, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -347,7 +347,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 42, + 48, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -392,7 +392,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 44, + 50, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -437,7 +437,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 45, + 51, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -478,7 +478,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 37, + 43, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -520,7 +520,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 43, + 49, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -562,7 +562,7 @@ describe('type: automation', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 45, + 51, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -614,7 +614,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 21, + 24, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -662,7 +662,7 @@ describe('type: automation', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 19, + 22, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 8e2ce81c8..7471426dd 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -26,17 +26,22 @@ describe('type: importFile', () => { const result = cache.getCache(); assert.equal( result.importFile ? Object.keys(result.importFile).length : 0, - 1, - 'only one importFile expected' + 2, + 'only 2 importFile expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_importFile', 'importFile'), await testUtils.getExpectedJson('9999999', 'importFile', 'get'), 'returned JSON was not equal expected' ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_importFileSMS', 'importFile'), + await testUtils.getExpectedJson('9999999', 'importFile', 'get-sms'), + 'returned JSON was not equal expected' + ); assert.equal( testUtils.getAPIHistoryLength(), - 11, + 14, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -65,7 +70,7 @@ describe('type: importFile', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 11, + 13, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -87,8 +92,8 @@ describe('type: importFile', () => { const result = cache.getCache(); assert.equal( result.importFile ? Object.keys(result.importFile).length : 0, - 2, - 'two importFiles expected' + 3, + '3 importFiles expected' ); // confirm created item assert.deepEqual( @@ -105,7 +110,7 @@ describe('type: importFile', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 13, + 16, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -151,7 +156,7 @@ describe('type: importFile', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 11, + 13, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -197,7 +202,7 @@ describe('type: importFile', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 11, + 14, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; diff --git a/test/type.query.test.js b/test/type.query.test.js index 4b3f21147..0734274bd 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -472,7 +472,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 35, + 38, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -513,7 +513,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 37, + 40, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; From dac11d284a72d86bc089d2df2570006bda206fdb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Feb 2024 20:52:34 +0000 Subject: [PATCH 053/359] Bump eslint from 8.56.0 to 8.57.0 Bumps [eslint](https://github.com/eslint/eslint) from 8.56.0 to 8.57.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.56.0...v8.57.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 34 +++++++++++++++++----------------- package.json | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 234b17fe6..0c13477e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "c8": "9.1.0", "chai": "5.1.0", "chai-files": "1.4.0", - "eslint": "8.56.0", + "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.0", @@ -373,22 +373,22 @@ "dev": true }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -409,9 +409,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@istanbuljs/schema": { @@ -2471,16 +2471,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", diff --git a/package.json b/package.json index 1ffd52583..90913f960 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "c8": "9.1.0", "chai": "5.1.0", "chai-files": "1.4.0", - "eslint": "8.56.0", + "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.0", From 125fe5de27082ec5edcb6f8f79a09c8eff471e5d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Mar 2024 20:51:40 +0000 Subject: [PATCH 054/359] Bump winston from 3.11.0 to 3.12.0 Bumps [winston](https://github.com/winstonjs/winston) from 3.11.0 to 3.12.0. - [Release notes](https://github.com/winstonjs/winston/releases) - [Changelog](https://github.com/winstonjs/winston/blob/master/CHANGELOG.md) - [Commits](https://github.com/winstonjs/winston/compare/v3.11.0...v3.12.0) --- updated-dependencies: - dependency-name: winston dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 64 +++++++++++++++++++++++++---------------------- package.json | 2 +- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0c13477e3..0858ba075 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "simple-git": "3.22.0", "toposort": "2.0.2", "update-notifier": "7.0.0", - "winston": "3.11.0", + "winston": "3.12.0", "yargs": "17.7.2" }, "bin": { @@ -272,9 +272,9 @@ "dev": true }, "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", + "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", "engines": { "node": ">=0.1.90" } @@ -637,6 +637,11 @@ "integrity": "sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==", "dev": true }, + "node_modules/@types/triple-beam": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/@types/triple-beam/-/triple-beam-1.3.5.tgz", + "integrity": "sha512-6WaYesThRMCl19iryMYP7/x2OVgCtbIVflDGFpWnb9irXI3UjYE4AzmYuiUKY1AJstGijoY+MgUszMgRxIYTYw==" + }, "node_modules/@typescript-eslint/parser": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.18.0.tgz", @@ -5263,15 +5268,19 @@ } }, "node_modules/logform": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/logform/-/logform-2.4.0.tgz", - "integrity": "sha512-CPSJw4ftjf517EhXZGGvTHHkYobo7ZCc0kvwUoOYcjfR2UVrI66RHj8MCrfAdEitdmFqbu2BYdYs8FHHZSb6iw==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/logform/-/logform-2.6.0.tgz", + "integrity": "sha512-1ulHeNPp6k/LD8H91o7VYFBng5i1BDE7HoKxVbZiGFidS1Rj65qcywLxX+pVfAPoQJEjRdvKcusKwOupHCVOVQ==", "dependencies": { - "@colors/colors": "1.5.0", + "@colors/colors": "1.6.0", + "@types/triple-beam": "^1.3.2", "fecha": "^4.2.0", "ms": "^2.1.1", "safe-stable-stringify": "^2.3.1", "triple-beam": "^1.3.0" + }, + "engines": { + "node": ">= 12.0.0" } }, "node_modules/loglevel": { @@ -6970,9 +6979,9 @@ ] }, "node_modules/safe-stable-stringify": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.3.1.tgz", - "integrity": "sha512-kYBSfT+troD9cDA85VDnHZ1rpHC50O0g1e6WlGHVCz/g+JS+9WKLj+XwFYyR8UbrZN8ll9HUpDAAddY58MGisg==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", + "integrity": "sha512-e2bDA2WJT0wxseVd4lsDP4+3ONX6HpMXQa1ZhFQ7SU+GjvORCmShbCMltrtIDfkYhVHrOcPtj+KhmDBdPdZD1g==", "engines": { "node": ">=10" } @@ -7645,9 +7654,12 @@ "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" }, "node_modules/triple-beam": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.3.0.tgz", - "integrity": "sha512-XrHUvV5HpdLmIj4uVMxHggLbFSZYIn7HEWsqePZcI50pco+MPqJ50wMGY794X7AOOhxOBAjbkqfAbEe/QMp2Lw==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/triple-beam/-/triple-beam-1.4.1.tgz", + "integrity": "sha512-aZbgViZrg1QNcG+LULa7nhZpJTZSLm/mXnHXnbAbjmN5aSa0y7V+wvv6+4WaBtpISJzThKy+PIPxc1Nq1EJ9mg==", + "engines": { + "node": ">= 14.0.0" + } }, "node_modules/ts-api-utils": { "version": "1.0.3", @@ -8078,9 +8090,9 @@ } }, "node_modules/winston": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.11.0.tgz", - "integrity": "sha512-L3yR6/MzZAOl0DsysUXHVjOwv8mKZ71TrA/41EIduGpOOV5LQVodqN+QdQ6BS6PJ/RdIshZhq84P/fStEZkk7g==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.12.0.tgz", + "integrity": "sha512-OwbxKaOlESDi01mC9rkM0dQqQt2I8DAUMRLZ/HpbwvDXm85IryEHgoogy5fziQy38PntgZsLlhAYHz//UPHZ5w==", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", @@ -8092,31 +8104,23 @@ "safe-stable-stringify": "^2.3.1", "stack-trace": "0.0.x", "triple-beam": "^1.3.0", - "winston-transport": "^4.5.0" + "winston-transport": "^4.7.0" }, "engines": { "node": ">= 12.0.0" } }, "node_modules/winston-transport": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.5.0.tgz", - "integrity": "sha512-YpZzcUzBedhlTAfJg6vJDlyEai/IFMIVcaEZZyl3UXIl4gmqRpU7AE89AHLkbzLUsv0NVmw7ts+iztqKxxPW1Q==", + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/winston-transport/-/winston-transport-4.7.0.tgz", + "integrity": "sha512-ajBj65K5I7denzer2IYW6+2bNIVqLGDHqDw3Ow8Ohh+vdW+rv4MZ6eiDvHoKhfJFZ2auyN8byXieDDJ96ViONg==", "dependencies": { "logform": "^2.3.2", "readable-stream": "^3.6.0", "triple-beam": "^1.3.0" }, "engines": { - "node": ">= 6.4.0" - } - }, - "node_modules/winston/node_modules/@colors/colors": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.6.0.tgz", - "integrity": "sha512-Ir+AOibqzrIsL6ajt3Rz3LskB7OiMVHqltZmspbW/TJuTVuyOMirVqAkjfY6JISiLHgyNqicAC8AyHHGzNd/dA==", - "engines": { - "node": ">=0.1.90" + "node": ">= 12.0.0" } }, "node_modules/wordwrap": { diff --git a/package.json b/package.json index 90913f960..9cf189a57 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "simple-git": "3.22.0", "toposort": "2.0.2", "update-notifier": "7.0.0", - "winston": "3.11.0", + "winston": "3.12.0", "yargs": "17.7.2" }, "devDependencies": { From 85fa2e8aeae709651cad491ee36354089d417553 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:23:10 +0000 Subject: [PATCH 055/359] Bump eslint-plugin-jsdoc from 48.2.0 to 48.2.1 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.2.0 to 48.2.1. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.2.0...v48.2.1) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0858ba075..3220b646e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -42,7 +42,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.0", + "eslint-plugin-jsdoc": "48.2.1", "eslint-plugin-mocha": "10.3.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", @@ -2558,9 +2558,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.0.tgz", - "integrity": "sha512-O2B1XLBJnUCRkggFzUQ+PBYJDit8iAgXdlu8ucolqGrbmOWPvttZQZX8d1sC0MbqDMSLs8SHSQxaNPRY1RQREg==", + "version": "48.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.1.tgz", + "integrity": "sha512-iUvbcyDZSO/9xSuRv2HQBw++8VkV/pt3UWtX9cpPH0l7GKPq78QC/6+PmyQHHvNZaTjAce6QVciEbnc6J/zH5g==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.42.0", diff --git a/package.json b/package.json index 9cf189a57..ea9df2f17 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.0", + "eslint-plugin-jsdoc": "48.2.1", "eslint-plugin-mocha": "10.3.0", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", From 39af2bc8325dc389641337dfa5c3f7378eef9592 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 09:59:05 +0000 Subject: [PATCH 056/359] Bump eslint-plugin-mocha from 10.3.0 to 10.4.1 Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 10.3.0 to 10.4.1. - [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases) - [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/10.4.1/CHANGELOG.md) - [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/10.3.0...10.4.1) --- updated-dependencies: - dependency-name: eslint-plugin-mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3220b646e..13f853a9b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.1", - "eslint-plugin-mocha": "10.3.0", + "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", @@ -2591,12 +2591,13 @@ } }, "node_modules/eslint-plugin-mocha": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.3.0.tgz", - "integrity": "sha512-IWzbg2K6B1Q7h37Ih4zMyW+nhmw1JvUlHlbCUUUu6PfOOAUGCB0gxmvv7/U+TQQ6e8yHUv+q7KMdIIum4bx+PA==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.1.tgz", + "integrity": "sha512-G85ALUgKaLzuEuHhoW3HVRgPTmia6njQC3qCG6CEvA8/Ja9PDZnRZOuzekMki+HaViEQXINuYsmhp5WR5/4MfA==", "dev": true, "dependencies": { "eslint-utils": "^3.0.0", + "globals": "^13.24.0", "rambda": "^7.4.0" }, "engines": { diff --git a/package.json b/package.json index ea9df2f17..640339162 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.1", - "eslint-plugin-mocha": "10.3.0", + "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.4", From 3be36ca61f5f058223d1241f8abf42cb770e616e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 20:38:50 +0000 Subject: [PATCH 057/359] Bump fast-xml-parser from 4.3.4 to 4.3.6 Bumps [fast-xml-parser](https://github.com/NaturalIntelligence/fast-xml-parser) from 4.3.4 to 4.3.6. - [Release notes](https://github.com/NaturalIntelligence/fast-xml-parser/releases) - [Changelog](https://github.com/NaturalIntelligence/fast-xml-parser/blob/master/CHANGELOG.md) - [Commits](https://github.com/NaturalIntelligence/fast-xml-parser/compare/v4.3.4...v4.3.6) --- updated-dependencies: - dependency-name: fast-xml-parser dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13f853a9b..ea22e1936 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,7 +46,7 @@ "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", - "fast-xml-parser": "4.3.4", + "fast-xml-parser": "4.3.6", "husky": "9.0.11", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", @@ -2963,9 +2963,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.4.tgz", - "integrity": "sha512-utnwm92SyozgA3hhH2I8qldf2lBqm6qHOICawRNRFu1qMe3+oqr+GcXjGqTmXTMGE5T4eC03kr/rlh5C1IRdZA==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.6.tgz", + "integrity": "sha512-M2SovcRxD4+vC493Uc2GZVcZaj66CCJhWurC4viynVSTvrpErCShNcDz1lAho6n9REQKvL/ll4A4/fw6Y9z8nw==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index 640339162..f1a3c0f0e 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", - "fast-xml-parser": "4.3.4", + "fast-xml-parser": "4.3.6", "husky": "9.0.11", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", From ca0f3f7017f680fb456beacce9670abd22f3eda0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 25 Mar 2024 11:13:27 +0100 Subject: [PATCH 058/359] #1238: find contentblock by id --- docs/dist/documentation.md | 11894 ++++++++++++++++++++-------- lib/cli.js | 32 +- lib/index.js | 43 + lib/metadataTypes/Asset.js | 54 + lib/metadataTypes/MetadataType.js | 11 + 5 files changed, 8755 insertions(+), 3279 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 656712476..7ca0015c9 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -132,6 +132,16 @@ Provides default functionality that can be overwritten by child metadata type cl
Retriever

Retrieves metadata from a business unit and saves it to the local filesystem.

+
Mcdev
+

main class

+
+
AssetMetadataType
+

FileTransfer MetadataType

+
+
MetadataType
+

MetadataType class that gets extended by their specific metadata type class. +Provides default functionality that can be overwritten by child metadata type classes

+
## Constants @@ -242,6 +252,21 @@ helper for DataExtension.#fixShared_item
setupSDK(sessionKey, authObject)SDK

Returns an SDK instance to be used for API calls

+
csvToArray(csv)Array.<string>
+

helper to convert CSVs into an array. if only one value was given, it's also returned as an array

+
+
Mcdev.(methodName, businessUnit, [selectedType], [keys])Promise.<Object.<string, Array.<string>>>
+

run a method across BUs

+
+
Mcdev.(methodName, cred, bu, [type], keyArr)Promise.<Array.<string>>
+

helper for Mcdev.#runMethod

+
+
Mcdev.(selectedType, buObject)Array.<string>
+

helper for Mcdev.#runOnBU

+
+
Mcdev.(cred, bu, type, [keyArr])Promise.<Array.<string>>
+

Updates the key to match the name field

+
## Typedefs @@ -533,6 +558,34 @@ main class * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> + * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> + * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> + * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Mcdev.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [.buildDefinition(businessUnit, selectedType, name, market)](#Mcdev.buildDefinition) ⇒ Promise.<void> + * [.buildDefinitionBulk(listName, type, name)](#Mcdev.buildDefinitionBulk) ⇒ Promise.<void> + * [.getFilesToCommit(businessUnit, selectedType, keyArr)](#Mcdev.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.schedule(businessUnit, [selectedType], [keys])](#Mcdev.schedule) ⇒ Promise.<Object.<string, Array.<string>>> + * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> + * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> + * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> + * [.version()](#Mcdev.version) ⇒ string + * [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ void + * [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ void + * [.setOptions(argv)](#Mcdev.setOptions) ⇒ void + * [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> + * [.selectTypes()](#Mcdev.selectTypes) ⇒ Promise + * [.explainTypes()](#Mcdev.explainTypes) ⇒ Array.<object> + * [.upgrade()](#Mcdev.upgrade) ⇒ Promise.<boolean> + * [.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly])](#Mcdev.retrieve) ⇒ Promise.<object> + * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Mcdev.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> + * [.initProject([credentialsName])](#Mcdev.initProject) ⇒ Promise.<void> + * [.joinProject()](#Mcdev.joinProject) ⇒ Promise.<void> + * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> + * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> + * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> + * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> @@ -703,6 +756,20 @@ deletes metadata from MC instance by key | type | string | supported metadata type | | customerKey | string | Identifier of metadata | + + +### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | supported metadata type | +| id | string | Identifier of metadata | + ### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> @@ -856,1630 +923,1681 @@ Updates the key to match the name field | selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | | [keys] | Array.<string> | customerkey of the metadata | - + -## Asset ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType +### Mcdev.version() ⇒ string +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: string - current version of mcdev + -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +### Mcdev.setSkipInteraction([skipInteraction]) ⇒ void +helper method to use unattended mode when including mcdev as a package -* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void +**Kind**: static method of [Mcdev](#Mcdev) - +| Param | Type | Description | +| --- | --- | --- | +| [skipInteraction] | boolean \| TYPE.skipInteraction | signals what to insert automatically for things usually asked via wizard | -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset + -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +### Mcdev.setLoggingLevel(argv) ⇒ void +configures what is displayed in the console + +**Kind**: static method of [Mcdev](#Mcdev) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | +| argv | object | list of command line parameters given by user | +| [argv.silent] | boolean | only errors printed to CLI | +| [argv.verbose] | boolean | chatty user CLI output | +| [argv.debug] | boolean | enables developer output & features | - + -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching +### Mcdev.setOptions(argv) ⇒ void +allows setting system wide / command related options -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: static method of [Mcdev](#Mcdev) | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| argv | object | list of command line parameters given by user | - + -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating +### Mcdev.createDeltaPkg(argv) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> +handler for 'mcdev createDeltaPkg -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - list of changed items | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | +| argv | object | yargs parameters | +| [argv.range] | string | git commit range into deploy directory | +| [argv.filter] | string | filter file paths that start with any | +| [argv.diffArr] | Array.<TYPE.DeltaPkgItem> | list of files to include in delta package (skips git diff when provided) | - + -### Asset.create(metadata) ⇒ Promise -Creates a single asset +### Mcdev.selectTypes() ⇒ Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise - . + -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +### Mcdev.explainTypes() ⇒ Array.<object> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Array.<object> - list of supported types with their apiNames + + +### Mcdev.upgrade() ⇒ Promise.<boolean> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<boolean> - success flag + + +### Mcdev.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly]) ⇒ Promise.<object> +Retrieve all metadata from the specified business unit into the local file system. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<object> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| businessUnit | string | references credentials from properties.json | +| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> \| TYPE.TypeKeyCombo | limit retrieval to given metadata type | +| [keys] | Array.<string> | limit retrieval to given metadata key | +| [changelogOnly] | boolean | skip saving, only create json in memory | - + -### Asset.update(metadata) ⇒ Promise -Updates a single asset +### Mcdev.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> +Deploys all metadata located in the 'deploy' directory to the specified business unit -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| businessUnit | string | references credentials from properties.json | +| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | +| [keyArr] | Array.<string> | limit deployment to given metadata keys | - + -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type +### Mcdev.initProject([credentialsName]) ⇒ Promise.<void> +Creates template file for properties.json -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | +| [credentialsName] | string | identifying name of the installed package / project | - + -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset +### Mcdev.joinProject() ⇒ Promise.<void> +Clones an existing project from git repository and installs it -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + + +### Mcdev.findBUs(credentialsName) ⇒ Promise.<void> +Refreshes BU names and ID's from MC instance + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| credentialsName | string | identifying name of the installed package / project | - + -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json +### Mcdev.document(businessUnit, type) ⇒ Promise.<void> +Creates docs for supported metadata types in Markdown and/or HTML format -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Mcdev](#Mcdev) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | - - +| businessUnit | string | references credentials from properties.json | +| type | string | metadata type | -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it + -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - - - -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### Mcdev.deleteByKey(businessUnit, type, customerKey) ⇒ Promise.<boolean> +deletes metadata from MC instance by key -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<boolean> - true if successful, false otherwise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| businessUnit | string | references credentials from properties.json | +| type | string | supported metadata type | +| customerKey | string | Identifier of metadata | - + -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| businessUnit | string | references credentials from properties.json | +| type | string | supported metadata type | +| id | string | Identifier of metadata | - + -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment +### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> +ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | +| businessUnit | string | references credentials from properties.json | +| type | string | references credentials from properties.json | +| [keyArr] | Array.<string> | metadata keys | - + -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType +### Mcdev.badKeys(businessUnit) ⇒ Promise.<void> +Converts metadata to legacy format. Output is saved in 'converted' directory -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | +| businessUnit | string | references credentials from properties.json | - + -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### Mcdev.retrieveAsTemplate(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Retrieve a specific metadata file and templatise. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| name | Array.<string> | name of the metadata | +| market | string | market which should be used to revert template | - + -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### Mcdev.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Build a template based on a list of metadata files in the retrieve folder. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| keyArr | Array.<string> | customerkey of the metadata | +| market | string | market localizations | -**Example** -```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating -``` - + -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### Mcdev.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<void> +Build a specific metadata file based on a template. -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Mcdev](#Mcdev) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| name | string | name of the metadata | +| market | string | market localizations | - + -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Mcdev.buildDefinitionBulk(listName, type, name) ⇒ Promise.<void> +Build a specific metadata file based on a template using a list of bu-market combos -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - +| listName | string | name of list of BU-market combos | +| type | string | supported metadata type | +| name | string | name of the metadata | -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy + -**Kind**: static method of [Asset](#Asset) +### Mcdev.getFilesToCommit(businessUnit, selectedType, keyArr) ⇒ Promise.<Array.<string>> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted +### Mcdev.schedule(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Schedule an item (shortcut for execute --schedule) -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of scheduled item keys | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | - + -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) +### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Start/execute an item + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of executed item keys | Param | Type | Description | | --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | - + -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending +### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +pause an item -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | - + -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes +### Mcdev.fixKeys(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Updates the key to match the name field -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| businessUnit | string | name of BU | +| selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | - + -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure +## Asset ⇐ [MetadataType](#MetadataType) +FileTransfer MetadataType -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | +* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - + -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves Metadata of Asset **Kind**: static method of [Asset](#Asset) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | - | +| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | +| [key] | string | customer key | - + -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves asset metadata for caching **Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### Asset.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk +### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> +Retrieves asset metadata for templating **Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - + -## AttributeGroup ⇐ [MetadataType](#MetadataType) -AttributeGroup MetadataType +### Asset.create(metadata) ⇒ Promise +Creates a single asset -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise -* [AttributeGroup](#AttributeGroup) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeGroup.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeGroup.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.postRetrieveTasks(metadata)](#AttributeGroup.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | - + -### AttributeGroup.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups. +### Asset.update(metadata) ⇒ Promise +Updates a single asset -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### AttributeGroup.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups for caching. +| metadata | TYPE.AssetItem | a single asset | -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### AttributeGroup.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise +Retrieves Metadata of a specific asset type -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| [retrieveDir] | string | target directory for saving assets | +| [templateName] | string | name of the metadata file | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| key | string | customer key to filter by | - + -## AttributeSet ⇐ [MetadataType](#MetadataType) -AttributeSet MetadataType +### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise +Retrieves extended metadata (files or extended content) of asset -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise -* [AttributeSet](#AttributeSet) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeSet.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeSet.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.fixShared_retrieve(sharedDataExtensionMap, fixShared_fields)](#AttributeSet.fixShared_retrieve) ⇒ Promise.<Array.<string>> - * [.parseResponseBody(body, [singleRetrieve])](#AttributeSet.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.postRetrieveTasks(metadata)](#AttributeSet.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [._getSystemValueDefinitions()](#AttributeSet._getSystemValueDefinitions) ⇒ Array.<object> +| Param | Type | Description | +| --- | --- | --- | +| items | Array | array of items to retrieve | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### AttributeSet.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set Definitions. +### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> +Some metadata types store their actual content as a separate file, e.g. images +This method retrieves these and saves them alongside the metadata json -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### AttributeSet.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set definitions for caching. +| metadata | TYPE.AssetItem | a single asset | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - + -### AttributeSet.fixShared\_retrieve(sharedDataExtensionMap, fixShared_fields) ⇒ Promise.<Array.<string>> -used to identify updated shared data extensions that are used in attributeSets. -helper for DataExtension.#fixShared_onBU +### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> +helper for [preDeployTasks](#Asset.preDeployTasks) +Some metadata types store their actual content as a separate file, e.g. images +This method reads these from the local FS stores them in the metadata object allowing to deploy it -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<Array.<string>> - Promise of list of shared dataExtension IDs +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<string> - if found will return the path of the binary file -| Param | Type | Description | -| --- | --- | --- | -| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | -| fixShared_fields | object | DataExtensionField.fixShared_fields | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset | +| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | +| deployDir | string | | directory of deploy files | +| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - + -### AttributeSet.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - metadata | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +| metadata | TYPE.AssetItem | a single asset | - + -### AttributeSet.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - - -### AttributeSet.\_getSystemValueDefinitions() ⇒ Array.<object> -helper for [postRetrieveTasks](#AttributeSet.postRetrieveTasks) - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Array.<object> - all system value definitions - + -## Automation ⇐ [MetadataType](#MetadataType) -Automation MetadataType +### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> +prepares an asset definition for deployment -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetItem> - Promise -* [Automation](#Automation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Automation.retrieve) ⇒ Promise.<TYPE.AutomationMapObj> - * [.handleRESTErrors(ex, id)](#Automation.handleRESTErrors) ⇒ null - * [.retrieveChangelog()](#Automation.retrieveChangelog) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj> - * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void - * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<Array.<string>> - * [.getErrorsREST(ex)](#Automation.getErrorsREST) ⇒ Array.<string> \| void - * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<Array.<string>> - * [.deploy(metadata, targetBU, retrieveDir)](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap> - * [.create(metadata)](#Automation.create) ⇒ Promise - * [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ Promise.<TYPE.AutomationItem> - * [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ boolean - * [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Automation.setFolderPath) - * [.setFolderId(metadata)](#Automation.setFolderId) - * [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap - * [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string - * [.document([metadata])](#Automation.document) ⇒ Promise.<void> - * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | +| deployDir | string | directory of deploy files | - + -### Automation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation +### Asset.\_getMainSubtype(extendedSubType) ⇒ string +find the subType matching the extendedSubType -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: string - subType: block, message, other, etc | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| extendedSubType | string | webpage, htmlblock, etc | - + -### Automation.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) +### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [Automation](#Automation) -**Returns**: null - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### Automation.retrieveChangelog() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation +### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - -### Automation.retrieveForCache() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves automation metadata for caching +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - +**Example** +```js +assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +``` + -### Automation.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.AutomationItemObj> -Retrieve a specific Automation Definition by Name +### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItemObj> - Promise of metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem \| void -manages post retrieve steps +### Asset.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationItem \| void - parsed item +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | a single automation | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### Automation.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API +### Asset.setFolderId(metadata) +Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Automation.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts +### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset definition | +| deployDir | string | | directory of deploy files | +| subType | TYPE.AssetSubType | | asset-subtype name | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - + -### Automation.pause(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API +### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were paused +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| prefix | string | | usually the customerkey | +| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| readDirArr | Array.<string> | | directory of deploy files | +| subtypeExtension | string | | asset-subtype name ending on -meta | +| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | +| fileList | Array.<object> | | directory of files w/o leading deploy dir | +| customerKey | string | | external key of template (could have been changed if used during templating) | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - + -### Automation.deploy(metadata, targetBU, retrieveDir) ⇒ Promise.<TYPE.AutomationMap> -Deploys automation - the saved file is the original one due to large differences required for deployment +### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem +helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it +to allow saving that separately and formatted -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMap> - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationMap | metadata mapped by their keyField | -| targetBU | string | name/shorthand of target businessUnit for mapping | -| retrieveDir | string | directory where metadata after deploy should be saved | - - +| metadata | TYPE.AssetItem | a single asset definition | -### Automation.create(metadata) ⇒ Promise -Creates a single automation + -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise +### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | +| prefix | string | usually the customerkey | +| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| codeArr | Array.<object> | to be extended array for extracted code | - + -### Automation.update(metadata, metadataBefore) ⇒ Promise -Updates a single automation +### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their fileName without '.json' ending -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | -| metadataBefore | TYPE.AutomationItem | metadata mapped by their keyField | +| dir | string | directory that contains '.json' files to be read | +| [_] | void | unused parameter | +| selectedSubType | Array.<string> | asset, message, ... | - + -### Automation.preDeployTasks(metadata) ⇒ Promise.<TYPE.AutomationItem> -Gets executed before deploying metadata +### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItem> - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetSubType> - subtype name | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | metadata mapped by their keyField | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -### Automation.validateDeployMetadata(metadata) ⇒ boolean -Validates the automation to be sure it can be deployed. -Whitelisted Activites are deployed but require configuration +### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem +optional method used for some types to try a different folder structure -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - result if automation can be deployed based on steps +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.AssetItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single automation record | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | - + -### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | -| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Automation.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| customerKey | string | Identifier of data extension | - + -### Automation.setFolderId(metadata) -automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### Asset.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| customerKey | string | Identifier of metadata item | - + -### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap -Builds a schedule object to be used for scheduling an automation -based on combination of ical string and start/end dates. +### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationScheduleSoap - Schedulable object for soap API (currently not rest supported) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found | Param | Type | Description | | --- | --- | --- | -| scheduleObject | TYPE.AutomationSchedule | child of automation metadata used for scheduling | +| id | string | Identifier of metadata | - + -### Automation.\_calcTime(offsetServer, dateInput, [offsetInput]) ⇒ string -used to convert dates to the system timezone required for startDate +### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves Metadata of Asset -**Kind**: static method of [Automation](#Automation) -**Returns**: string - date in server +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| offsetServer | number | stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) | -| dateInput | string \| Date | date in ISO format (2021-12-05T20:00:00.983) | -| [offsetInput] | string | timzone difference (+02:00) | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | - | +| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | +| [key] | string | customer key | - + -### Automation.document([metadata]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves asset metadata for caching -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.AutomationMap | a list of dataExtension definitions | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### Automation.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> +Retrieves asset metadata for templating -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - + -### Automation.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit +### Asset.create(metadata) ⇒ Promise +Creates a single asset -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - deletion success status +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadata | TYPE.AssetItem | a single asset | - + -### Automation.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### Asset.update(metadata) ⇒ Promise +Updates a single asset -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| metadata | TYPE.AssetItem | a single asset | - + -## Campaign ⇐ [MetadataType](#MetadataType) -Campaign MetadataType +### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise +Retrieves Metadata of a specific asset type -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise -* [Campaign](#Campaign) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Campaign.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Campaign.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getAssetTags(retrieveDir, campaignId, name)](#Campaign.getAssetTags) ⇒ Promise.<TYPE.MetadataTypeMapObj> +| Param | Type | Description | +| --- | --- | --- | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| [retrieveDir] | string | target directory for saving assets | +| [templateName] | string | name of the metadata file | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| key | string | customer key to filter by | - + -### Campaign.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets +### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise +Retrieves extended metadata (files or extended content) of asset -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Campaign.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +| items | Array | array of items to retrieve | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### Campaign.getAssetTags(retrieveDir, campaignId, name) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Parses campaign asset response body and returns metadata entries mapped to their id +### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> +Some metadata types store their actual content as a separate file, e.g. images +This method retrieves these and saves them alongside the metadata json -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Campaign Asset Object +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | folder where to save | -| campaignId | string | of camapaign to retrieve | -| name | string | of camapaign for saving | +| metadata | TYPE.AssetItem | a single asset | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | - + -## ContentArea ⇐ [MetadataType](#MetadataType) -ContentArea MetadataType +### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> +helper for [preDeployTasks](#Asset.preDeployTasks) +Some metadata types store their actual content as a separate file, e.g. images +This method reads these from the local FS stores them in the metadata object allowing to deploy it -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<string> - if found will return the path of the binary file -* [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.setFolderPath(metadata)](#ContentArea.setFolderPath) - * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset | +| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | +| deployDir | string | | directory of deploy files | +| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - + -### ContentArea.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.AssetItem | a single asset | - + -### ContentArea.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [ContentArea](#ContentArea) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> +prepares an asset definition for deployment -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: TYPE.MetadataTypeItem - parsed item +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetItem> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.AssetItem | a single asset | +| deployDir | string | directory of deploy files | - + -## DataExtension ⇐ [MetadataType](#MetadataType) -DataExtension MetadataType +### Asset.\_getMainSubtype(extendedSubType) ⇒ string +find the subType matching the extendedSubType -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: string - subType: block, message, other, etc -* [DataExtension](#DataExtension) ⇐ [MetadataType](#MetadataType) - * [.upsert(metadataMap)](#DataExtension.upsert) ⇒ Promise - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#DataExtension.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.create(metadata)](#DataExtension.create) ⇒ Promise - * [.update(metadata)](#DataExtension.update) ⇒ Promise - * [.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated)](#DataExtension.postDeployTasks) ⇒ void - * [.retrieve(retrieveDir, [additionalFields], [_], [key])](#DataExtension.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveSharedForCache([additionalFields])](#DataExtension.retrieveSharedForCache) ⇒ Promise.<TYPE.DataExtensionMap> - * [.retrieveChangelog([additionalFields])](#DataExtension.retrieveChangelog) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.postRetrieveTasks(metadata)](#DataExtension.postRetrieveTasks) ⇒ TYPE.DataExtensionItem - * [.preDeployTasks(metadata)](#DataExtension.preDeployTasks) ⇒ Promise.<TYPE.DataExtensionItem> - * [.document([metadataMap])](#DataExtension.document) ⇒ Promise.<void> - * [.deleteByKey(customerKey)](#DataExtension.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#DataExtension.postDeleteTasks) ⇒ Promise.<void> - * [.retrieveForCache()](#DataExtension.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtension.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.setFolderPath(metadata)](#DataExtension.setFolderPath) - * [.getFilesToCommit(keyArr)](#DataExtension.getFilesToCommit) ⇒ Array.<string> +| Param | Type | Description | +| --- | --- | --- | +| extendedSubType | string | webpage, htmlblock, etc | - + -### DataExtension.upsert(metadataMap) ⇒ Promise -Upserts dataExtensions after retrieving them from source and target to compare -if create or update operation is needed. +### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.DataExtensionMap | dataExtensions mapped by their customerKey | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### DataExtension.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +``` + -### DataExtension.create(metadata) ⇒ Promise -Create a single dataExtension. Also creates their columns in 'dataExtension.columns' +### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### DataExtension.update(metadata) ⇒ Promise -Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' +### Asset.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### DataExtension.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +### Asset.setFolderId(metadata) +Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [DataExtension](#DataExtension) +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | -| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### DataExtension.retrieve(retrieveDir, [additionalFields], [_], [key]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval +### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset definition | +| deployDir | string | | directory of deploy files | +| subType | TYPE.AssetSubType | | asset-subtype name | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | + + + +### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| prefix | string | | usually the customerkey | +| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| readDirArr | Array.<string> | | directory of deploy files | +| subtypeExtension | string | | asset-subtype name ending on -meta | +| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | +| fileList | Array.<object> | | directory of files w/o leading deploy dir | +| customerKey | string | | external key of template (could have been changed if used during templating) | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | + + + +### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem +helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it +to allow saving that separately and formatted + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [_] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - +| metadata | TYPE.AssetItem | a single asset definition | -### DataExtension.retrieveSharedForCache([additionalFields]) ⇒ Promise.<TYPE.DataExtensionMap> -get shared dataExtensions from parent BU and merge them into the cache -helper for [retrieve](#DataExtension.retrieve) and for AttributeSet.fixShared_retrieve + -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionMap> - keyField => metadata map +### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| prefix | string | usually the customerkey | +| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| codeArr | Array.<object> | to be extended array for extracted code | - + -### DataExtension.retrieveChangelog([additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval +### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their fileName without '.json' ending -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| dir | string | directory that contains '.json' files to be read | +| [_] | void | unused parameter | +| selectedSubType | Array.<string> | asset, message, ... | - + -### DataExtension.postRetrieveTasks(metadata) ⇒ TYPE.DataExtensionItem -manages post retrieve steps +### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: TYPE.DataExtensionItem - metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetSubType> - subtype name | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single dataExtension | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -### DataExtension.preDeployTasks(metadata) ⇒ Promise.<TYPE.DataExtensionItem> -prepares a DataExtension for deployment +### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem +optional method used for some types to try a different folder structure -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionItem> - Promise of updated single DE +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.AssetItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single data Extension | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | - + -### DataExtension.document([metadataMap]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it +### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| [metadataMap] | TYPE.DataExtensionMap | a list of dataExtension definitions | +| keyArr | Array.<string> | customerkey of the metadata | - + -### DataExtension.deleteByKey(customerKey) ⇒ Promise.<boolean> +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -### DataExtension.postDeleteTasks(customerKey) ⇒ Promise.<void> +### Asset.postDeleteTasks(customerKey) ⇒ void clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - promise +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of metadata item | - - -### DataExtension.retrieveForCache() ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise - + -### DataExtension.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata in template format. +### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of items +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata item | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| id | string | Identifier of metadata | - + -### DataExtension.setFolderPath(metadata) -dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve -it also sets the content type which is basically the subtype +## AttributeGroup ⇐ [MetadataType](#MetadataType) +AttributeGroup MetadataType -**Kind**: static method of [DataExtension](#DataExtension) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [AttributeGroup](#AttributeGroup) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeGroup.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#AttributeGroup.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.postRetrieveTasks(metadata)](#AttributeGroup.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + + + +### AttributeGroup.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema attribute groups. + +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtension.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### AttributeGroup.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema attribute groups for caching. -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### AttributeGroup.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.MetadataTypeItem | a single metadata | - + -## DataExtensionField ⇐ [MetadataType](#MetadataType) -DataExtensionField MetadataType +## AttributeSet ⇐ [MetadataType](#MetadataType) +AttributeSet MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [DataExtensionField](#DataExtensionField) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields])](#DataExtensionField.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.retrieveForCache([requestParams], [additionalFields])](#DataExtensionField.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.convertToSortedArray(fieldsObj)](#DataExtensionField.convertToSortedArray) ⇒ Array.<TYPE.DataExtensionFieldItem> - * [.sortDeFields(a, b)](#DataExtensionField.sortDeFields) ⇒ boolean - * [.postRetrieveTasks(metadata, forDataExtension)](#DataExtensionField.postRetrieveTasks) ⇒ TYPE.DataExtensionFieldItem - * [.prepareDeployColumnsOnUpdate(deployColumns, deKey)](#DataExtensionField.prepareDeployColumnsOnUpdate) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - * [.deleteByKey(customerKey)](#DataExtensionField.deleteByKey) ⇒ Promise.<boolean> - * [.deleteByKeySOAP(customerKey, [fieldId])](#DataExtensionField.deleteByKeySOAP) ⇒ boolean - * [.postDeleteTasks(customerKey)](#DataExtensionField.postDeleteTasks) ⇒ void +* [AttributeSet](#AttributeSet) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeSet.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#AttributeSet.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.fixShared_retrieve(sharedDataExtensionMap, fixShared_fields)](#AttributeSet.fixShared_retrieve) ⇒ Promise.<Array.<string>> + * [.parseResponseBody(body, [singleRetrieve])](#AttributeSet.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.postRetrieveTasks(metadata)](#AttributeSet.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [._getSystemValueDefinitions()](#AttributeSet._getSystemValueDefinitions) ⇒ Array.<object> - + -### DataExtensionField.retrieve(retrieveDir, [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records and saves it to disk +### AttributeSet.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema set Definitions. -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtensionField.retrieveForCache([requestParams], [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records for caching +### AttributeSet.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema set definitions for caching. -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### AttributeSet.fixShared\_retrieve(sharedDataExtensionMap, fixShared_fields) ⇒ Promise.<Array.<string>> +used to identify updated shared data extensions that are used in attributeSets. +helper for DataExtension.#fixShared_onBU + +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<Array.<string>> - Promise of list of shared dataExtension IDs | Param | Type | Description | | --- | --- | --- | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | +| fixShared_fields | object | DataExtensionField.fixShared_fields | - + -### DataExtensionField.convertToSortedArray(fieldsObj) ⇒ Array.<TYPE.DataExtensionFieldItem> -helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array +### AttributeSet.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Array.<TYPE.DataExtensionFieldItem> - sorted array of field objects +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| fieldsObj | TYPE.DataExtensionFieldMap | customerKey-based list of fields for one dataExtension | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### DataExtensionField.sortDeFields(a, b) ⇒ boolean -sorting method to ensure `Ordinal` is respected +### AttributeSet.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - sorting based on Ordinal +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| a | TYPE.DataExtensionFieldItem | - | -| b | TYPE.DataExtensionFieldItem | - | +| metadata | TYPE.MetadataTypeItem | a single metadata | - + -### DataExtensionField.postRetrieveTasks(metadata, forDataExtension) ⇒ TYPE.DataExtensionFieldItem -manages post retrieve steps +### AttributeSet.\_getSystemValueDefinitions() ⇒ Array.<object> +helper for [postRetrieveTasks](#AttributeSet.postRetrieveTasks) -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: TYPE.DataExtensionFieldItem - metadata +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Array.<object> - all system value definitions + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.DataExtensionFieldItem | a single item | -| forDataExtension | boolean | when used by DataExtension class we remove more fields | +## Automation ⇐ [MetadataType](#MetadataType) +Automation MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -### DataExtensionField.prepareDeployColumnsOnUpdate(deployColumns, deKey) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> -Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. -Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type +* [Automation](#Automation) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Automation.retrieve) ⇒ Promise.<TYPE.AutomationMapObj> + * [.handleRESTErrors(ex, id)](#Automation.handleRESTErrors) ⇒ null + * [.retrieveChangelog()](#Automation.retrieveChangelog) ⇒ Promise.<TYPE.AutomationMapObj> + * [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj> + * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void + * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<Array.<string>> + * [.getErrorsREST(ex)](#Automation.getErrorsREST) ⇒ Array.<string> \| void + * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<Array.<string>> + * [.deploy(metadata, targetBU, retrieveDir)](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap> + * [.create(metadata)](#Automation.create) ⇒ Promise + * [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ Promise.<TYPE.AutomationItem> + * [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ boolean + * [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Automation.setFolderPath) + * [.setFolderId(metadata)](#Automation.setFolderId) + * [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap + * [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string + * [.document([metadata])](#Automation.document) ⇒ Promise.<void> + * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - existing fields by their original name to allow re-adding FieldType after update + + +### Automation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves Metadata of Automation + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| deployColumns | Array.<TYPE.DataExtensionFieldItem> | Columns of data extension that will be deployed | -| deKey | string | external/customer key of Data Extension | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtensionField.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Automation.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [Automation](#Automation) +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| ex | Error | exception | +| id | string | id or key of item | - + -### DataExtensionField.deleteByKeySOAP(customerKey, [fieldId]) ⇒ boolean -Delete a data extension from the specified business unit +### Automation.retrieveChangelog() ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves Metadata of Automation -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - deletion success flag +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata + -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [fieldId] | string | for programmatic deletes only one can pass in the ID directly | +### Automation.retrieveForCache() ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves automation metadata for caching - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata + -### DataExtensionField.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### Automation.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.AutomationItemObj> +Retrieve a specific Automation Definition by Name -**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -## DataExtensionTemplate ⇐ [MetadataType](#MetadataType) -DataExtensionTemplate MetadataType +### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem \| void +manages post retrieve steps -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - +**Kind**: static method of [Automation](#Automation) +**Returns**: TYPE.AutomationItem \| void - parsed item -### DataExtensionTemplate.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AutomationItem | a single automation | -**Kind**: static method of [DataExtensionTemplate](#DataExtensionTemplate) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### Automation.execute(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| keyArr | Array.<string> | customerkey of the metadata | - + -## DataExtract ⇐ [MetadataType](#MetadataType) -DataExtract MetadataType +### Automation.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages but adds query specific filters to error texts -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Automation](#Automation) +**Returns**: Array.<string> \| void - formatted Error Message -* [DataExtract](#DataExtract) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(dataExtract)](#DataExtract.create) ⇒ Promise - * [.update(dataExtract)](#DataExtract.update) ⇒ Promise - * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| ex | object | response payload from REST API | - + -### DataExtract.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity. -Endpoint /automation/v1/dataextracts/ returns all Data Extracts +### Automation.pause(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were paused | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### DataExtract.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching +| keyArr | Array.<string> | customerkey of the metadata | -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### DataExtract.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific dataExtract Definition by Name +### Automation.deploy(metadata, targetBU, retrieveDir) ⇒ Promise.<TYPE.AutomationMap> +Deploys automation - the saved file is the original one due to large differences required for deployment -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMap> - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.AutomationMap | metadata mapped by their keyField | +| targetBU | string | name/shorthand of target businessUnit for mapping | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### DataExtract.create(dataExtract) ⇒ Promise -Creates a single Data Extract +### Automation.create(metadata) ⇒ Promise +Creates a single automation -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [Automation](#Automation) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | +| metadata | TYPE.AutomationItem | single metadata entry | - + -### DataExtract.update(dataExtract) ⇒ Promise -Updates a single Data Extract +### Automation.update(metadata, metadataBefore) ⇒ Promise +Updates a single automation -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [Automation](#Automation) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | +| metadata | TYPE.AutomationItem | single metadata entry | +| metadataBefore | TYPE.AutomationItem | metadata mapped by their keyField | - + -### DataExtract.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a dataExtract for deployment +### Automation.preDeployTasks(metadata) ⇒ Promise.<TYPE.AutomationItem> +Gets executed before deploying metadata -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata object +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationItem> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | +| metadata | TYPE.AutomationItem | metadata mapped by their keyField | - + -### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Automation.validateDeployMetadata(metadata) ⇒ boolean +Validates the automation to be sure it can be deployed. +Whitelisted Activites are deployed but require configuration -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Automation](#Automation) +**Returns**: boolean - result if automation can be deployed based on steps | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.AutomationItem | single automation record | - + -### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | +| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | - + -## DataExtractType ⇐ [MetadataType](#MetadataType) -DataExtractType MetadataType -Only for Caching No retrieve/upsert is required -as this is a configuration in the EID +### Automation.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Automation](#Automation) -* [DataExtractType](#DataExtractType) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtractType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtractType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### DataExtractType.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type. +### Automation.setFolderId(metadata) +automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### DataExtractType.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type for caching. +### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap +Builds a schedule object to be used for scheduling an automation +based on combination of ical string and start/end dates. -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - +**Kind**: static method of [Automation](#Automation) +**Returns**: TYPE.AutomationScheduleSoap - Schedulable object for soap API (currently not rest supported) -## Discovery ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +| Param | Type | Description | +| --- | --- | --- | +| scheduleObject | TYPE.AutomationSchedule | child of automation metadata used for scheduling | -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - + -### Discovery.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves API endpoint -documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm +### Automation.\_calcTime(offsetServer, dateInput, [offsetInput]) ⇒ string +used to convert dates to the system timezone required for startDate -**Kind**: static method of [Discovery](#Discovery) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [Automation](#Automation) +**Returns**: string - date in server | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | not used | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| offsetServer | number | stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) | +| dateInput | string \| Date | date in ISO format (2021-12-05T20:00:00.983) | +| [offsetInput] | string | timzone difference (+02:00) | - + -## Email ⇐ [MetadataType](#MetadataType) -Email MetadataType +### Automation.document([metadata]) ⇒ Promise.<void> +Parses metadata into a readable Markdown/HTML format then saves it -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<void> - - -* [Email](#Email) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| Param | Type | Description | +| --- | --- | --- | +| [metadata] | TYPE.AutomationMap | a list of dataExtension definitions | - + -### Email.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Automation.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Automation](#Automation) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Email.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### Automation.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [Automation](#Automation) +**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| customerKey | string | Identifier of data extension | - + -### Email.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Automation.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [Email](#Email) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | +| customerKey | string | Identifier of metadata item | - + -## EmailSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType +## Campaign ⇐ [MetadataType](#MetadataType) +Campaign MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [EmailSend](#EmailSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#EmailSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadataItem)](#EmailSend.update) ⇒ Promise - * [.create(metadataItem)](#EmailSend.create) ⇒ Promise - * [.deleteByKey(customerKey)](#EmailSend.deleteByKey) ⇒ Promise.<boolean> - * [.preDeployTasks(metadata)](#EmailSend.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postRetrieveTasks(metadata)](#EmailSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +* [Campaign](#Campaign) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Campaign.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#Campaign.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getAssetTags(retrieveDir, campaignId, name)](#Campaign.getAssetTags) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### EmailSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Campaign.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Campaign](#Campaign) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -2488,564 +2606,498 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### EmailSend.update(metadataItem) ⇒ Promise -Updates a single item +### Campaign.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise - Promise +**Kind**: static method of [Campaign](#Campaign) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### Campaign.getAssetTags(retrieveDir, campaignId, name) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Parses campaign asset response body and returns metadata entries mapped to their id + +**Kind**: static method of [Campaign](#Campaign) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Campaign Asset Object | Param | Type | Description | | --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | +| retrieveDir | string | folder where to save | +| campaignId | string | of camapaign to retrieve | +| name | string | of camapaign for saving | - + -### EmailSend.create(metadataItem) ⇒ Promise -Creates a single item +## ContentArea ⇐ [MetadataType](#MetadataType) +ContentArea MetadataType -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | +* [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.setFolderPath(metadata)](#ContentArea.setFolderPath) + * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### EmailSend.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### ContentArea.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [ContentArea](#ContentArea) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### EmailSend.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a single item for deployment +### ContentArea.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise +**Kind**: static method of [ContentArea](#ContentArea) | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### EmailSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string +**Kind**: static method of [ContentArea](#ContentArea) +**Returns**: TYPE.MetadataTypeItem - parsed item | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | +| metadata | TYPE.MetadataTypeItem | a single item | - + -## Event ⇐ [MetadataType](#MetadataType) -Event MetadataType +## DataExtension ⇐ [MetadataType](#MetadataType) +DataExtension MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Event](#Event) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Event.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Event.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Event.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.postRetrieveTasks(eventDef)](#Event.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#Event.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.create(metadata)](#Event.create) ⇒ Promise - * [.update(metadataEntry)](#Event.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Event.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata)](#Event.parseMetadata) ⇒ TYPE.MetadataTypeItem +* [DataExtension](#DataExtension) ⇐ [MetadataType](#MetadataType) + * [.upsert(metadataMap)](#DataExtension.upsert) ⇒ Promise + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#DataExtension.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.create(metadata)](#DataExtension.create) ⇒ Promise + * [.update(metadata)](#DataExtension.update) ⇒ Promise + * [.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated)](#DataExtension.postDeployTasks) ⇒ void + * [.retrieve(retrieveDir, [additionalFields], [_], [key])](#DataExtension.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.retrieveSharedForCache([additionalFields])](#DataExtension.retrieveSharedForCache) ⇒ Promise.<TYPE.DataExtensionMap> + * [.retrieveChangelog([additionalFields])](#DataExtension.retrieveChangelog) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.postRetrieveTasks(metadata)](#DataExtension.postRetrieveTasks) ⇒ TYPE.DataExtensionItem + * [.preDeployTasks(metadata)](#DataExtension.preDeployTasks) ⇒ Promise.<TYPE.DataExtensionItem> + * [.document([metadataMap])](#DataExtension.document) ⇒ Promise.<void> + * [.deleteByKey(customerKey)](#DataExtension.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#DataExtension.postDeleteTasks) ⇒ Promise.<void> + * [.retrieveForCache()](#DataExtension.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtension.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.setFolderPath(metadata)](#DataExtension.setFolderPath) + * [.getFilesToCommit(keyArr)](#DataExtension.getFilesToCommit) ⇒ Array.<string> - + -### Event.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Event Definition. -Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. -Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} +### DataExtension.upsert(metadataMap) ⇒ Promise +Upserts dataExtensions after retrieving them from source and target to compare +if create or update operation is needed. -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Event.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +| metadataMap | TYPE.DataExtensionMap | dataExtensions mapped by their customerKey | -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### Event.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Event Definition by Name +### DataExtension.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### Event.postRetrieveTasks(eventDef) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### DataExtension.create(metadata) ⇒ Promise +Create a single dataExtension. Also creates their columns in 'dataExtension.columns' -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| eventDef | TYPE.MetadataTypeItem | a single item of Event Definition | +| metadata | TYPE.DataExtensionItem | single metadata entry | - + -### Event.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### DataExtension.update(metadata) ⇒ Promise +Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| metadata | TYPE.DataExtensionItem | single metadata entry | - + -### Event.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy +### DataExtension.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [DataExtension](#DataExtension) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | +| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### Event.create(metadata) ⇒ Promise -Creates a single Event Definition +### DataExtension.retrieve(retrieveDir, [additionalFields], [_], [key]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval -**Kind**: static method of [Event](#Event) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single Event Definition | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [_] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Event.update(metadataEntry) ⇒ Promise -Updates a single Event Definition (using PUT method since PATCH isn't supported) +### DataExtension.retrieveSharedForCache([additionalFields]) ⇒ Promise.<TYPE.DataExtensionMap> +get shared dataExtensions from parent BU and merge them into the cache +helper for [retrieve](#DataExtension.retrieve) and for AttributeSet.fixShared_retrieve -**Kind**: static method of [Event](#Event) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<TYPE.DataExtensionMap> - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single Event Definition | - - +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -### Event.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment + -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed version +### DataExtension.retrieveChangelog([additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval + +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single eventDefinition | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Event.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### DataExtension.postRetrieveTasks(metadata) ⇒ TYPE.DataExtensionItem +manages post retrieve steps -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed metadata +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: TYPE.DataExtensionItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single event definition | +| metadata | TYPE.DataExtensionItem | a single dataExtension | - + -## FtpLocation ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +### DataExtension.preDeployTasks(metadata) ⇒ Promise.<TYPE.DataExtensionItem> +prepares a DataExtension for deployment -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<TYPE.DataExtensionItem> - Promise of updated single DE -* [FtpLocation](#FtpLocation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FtpLocation.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FtpLocation.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.DataExtensionItem | a single data Extension | - + -### FtpLocation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FtpLocation -Endpoint /automation/v1/ftplocations/ return all FtpLocations +### DataExtension.document([metadataMap]) ⇒ Promise.<void> +Parses metadata into a readable Markdown/HTML format then saves it -**Kind**: static method of [FtpLocation](#FtpLocation) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### FtpLocation.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. +| [metadataMap] | TYPE.DataExtensionMap | a list of dataExtension definitions | -**Kind**: static method of [FtpLocation](#FtpLocation) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - + -## FileTransfer ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType +### DataExtension.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<boolean> - deletion success status -* [FileTransfer](#FileTransfer) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise - * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise - * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | - + -### FileTransfer.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity. -Endpoint /automation/v1/filetransfers/ returns all File Transfers +### DataExtension.postDeleteTasks(customerKey) ⇒ Promise.<void> +clean up after deleting a metadata item -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<void> - - promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| customerKey | string | Identifier of metadata item | - + -### FileTransfer.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity for caching +### DataExtension.retrieveForCache() ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise + -### FileTransfer.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific File Transfer Definition by Name +### DataExtension.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata in template format. -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | +| name | string | name of the metadata item | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### FileTransfer.create(fileTransfer) ⇒ Promise -Creates a single File Transfer +### DataExtension.setFolderPath(metadata) +dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve +it also sets the content type which is basically the subtype -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) | Param | Type | Description | | --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### FileTransfer.update(fileTransfer) ⇒ Promise -Updates a single File Transfer +### DataExtension.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | +| keyArr | Array.<string> | customerkey of the metadata | - + -### FileTransfer.preDeployTasks(metadata) ⇒ Promise -prepares a fileTransfer for deployment +## DataExtensionField ⇐ [MetadataType](#MetadataType) +DataExtensionField MetadataType -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | +* [DataExtensionField](#DataExtensionField) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [additionalFields])](#DataExtensionField.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> + * [.retrieveForCache([requestParams], [additionalFields])](#DataExtensionField.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> + * [.convertToSortedArray(fieldsObj)](#DataExtensionField.convertToSortedArray) ⇒ Array.<TYPE.DataExtensionFieldItem> + * [.sortDeFields(a, b)](#DataExtensionField.sortDeFields) ⇒ boolean + * [.postRetrieveTasks(metadata, forDataExtension)](#DataExtensionField.postRetrieveTasks) ⇒ TYPE.DataExtensionFieldItem + * [.prepareDeployColumnsOnUpdate(deployColumns, deKey)](#DataExtensionField.prepareDeployColumnsOnUpdate) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> + * [.deleteByKey(customerKey)](#DataExtensionField.deleteByKey) ⇒ Promise.<boolean> + * [.deleteByKeySOAP(customerKey, [fieldId])](#DataExtensionField.deleteByKeySOAP) ⇒ boolean + * [.postDeleteTasks(customerKey)](#DataExtensionField.postDeleteTasks) ⇒ void - + -### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### DataExtensionField.retrieve(retrieveDir, [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> +Retrieves all records and saves it to disk -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: TYPE.MetadataTypeItem - parsed metadata +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### DataExtensionField.retrieveForCache([requestParams], [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> +Retrieves all records for caching -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -## Filter ⇐ [MetadataType](#MetadataType) -Filter MetadataType +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - + -### Filter.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Filter. -Endpoint /automation/v1/filters/ returns all Filters, -but only with some of the fields. So it is needed to loop over -Filters with the endpoint /automation/v1/filters/{id} +### DataExtensionField.convertToSortedArray(fieldsObj) ⇒ Array.<TYPE.DataExtensionFieldItem> +helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array -**Kind**: static method of [Filter](#Filter) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Array.<TYPE.DataExtensionFieldItem> - sorted array of field objects | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| fieldsObj | TYPE.DataExtensionFieldMap | customerKey-based list of fields for one dataExtension | - + -## Folder ⇐ [MetadataType](#MetadataType) -Folder MetadataType +### DataExtensionField.sortDeFields(a, b) ⇒ boolean +sorting method to ensure `Ordinal` is respected -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: boolean - sorting based on Ordinal -* [Folder](#Folder) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise - * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise - * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> - * [.create(metadataEntry)](#Folder.create) ⇒ Promise - * [.update(metadataEntry)](#Folder.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Folder.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.getJsonFromFS(dir, [listBadKeys])](#Folder.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList])](#Folder.retrieveHelper) ⇒ Promise.<object> - * [.postRetrieveTasks(metadata)](#Folder.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.saveResults(results, retrieveDir, mid)](#Folder.saveResults) ⇒ Promise.<object> +| Param | Type | Description | +| --- | --- | --- | +| a | TYPE.DataExtensionFieldItem | - | +| b | TYPE.DataExtensionFieldItem | - | - + -### Folder.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise -Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata +### DataExtensionField.postRetrieveTasks(metadata, forDataExtension) ⇒ TYPE.DataExtensionFieldItem +manages post retrieve steps -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: TYPE.DataExtensionFieldItem - metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | content type of folder | -| [key] | string | customer key of single item to retrieve | - - - -### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise -Retrieves folder metadata for caching - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | content type of folder | - - - -### Folder.upsert(metadata) ⇒ Promise.<object> -Folder upsert (copied from Metadata Upsert), after retrieving from target -and comparing to check if create or update operation is needed. -Copied due to having a dependency on itself, meaning the created need to be serial - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | - - - -### Folder.create(metadataEntry) ⇒ Promise -creates a folder based on metatadata - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata of the folder | +| metadata | TYPE.DataExtensionFieldItem | a single item | +| forDataExtension | boolean | when used by DataExtension class we remove more fields | - + -### Folder.update(metadataEntry) ⇒ Promise -Updates a single Folder. +### DataExtensionField.prepareDeployColumnsOnUpdate(deployColumns, deKey) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> +Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. +Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - existing fields by their original name to allow re-adding FieldType after update | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| deployColumns | Array.<TYPE.DataExtensionFieldItem> | Columns of data extension that will be deployed | +| deKey | string | external/customer key of Data Extension | - + -### Folder.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a folder for deployment +### DataExtensionField.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of parsed folder metadata +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single folder definition | +| customerKey | string | Identifier of data extension | - + -### Folder.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending +### DataExtensionField.deleteByKeySOAP(customerKey, [fieldId]) ⇒ boolean +Delete a data extension from the specified business unit -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: boolean - deletion success flag | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| customerKey | string | Identifier of metadata | +| [fieldId] | string | for programmatic deletes only one can pass in the ID directly | - + -### Folder.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList]) ⇒ Promise.<object> -Helper to retrieve the folders as promise +### DataExtensionField.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - soap object +**Kind**: static method of [DataExtensionField](#DataExtensionField) | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [queryAllAccounts] | boolean | which queryAllAccounts setting to use | -| [contentTypeList] | Array.<string> | content type of folder | - - - -### Folder.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +| customerKey | string | Identifier of metadata item | -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeItem - cloned metadata + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | metadata mapped by their keyField | +## DataExtensionTemplate ⇐ [MetadataType](#MetadataType) +DataExtensionTemplate MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + -### Folder.saveResults(results, retrieveDir, mid) ⇒ Promise.<object> -Helper for writing Metadata to disk, used for Retrieve and deploy +### DataExtensionTemplate.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata +**Kind**: static method of [DataExtensionTemplate](#DataExtensionTemplate) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| results | object | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| mid | number | current mid for this credential / business unit | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -## ImportFile ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +## DataExtract ⇐ [MetadataType](#MetadataType) +DataExtract MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(importFile)](#ImportFile.create) ⇒ Promise - * [.update(importFile)](#ImportFile.update) ⇒ Promise - * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> +* [DataExtract](#DataExtract) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(dataExtract)](#DataExtract.create) ⇒ Promise + * [.update(dataExtract)](#DataExtract.update) ⇒ Promise + * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> - + -### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Import File. -Endpoint /automation/v1/imports/ return all Import Files with all details. -Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} +### DataExtract.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity. +Endpoint /automation/v1/dataextracts/ returns all Data Extracts -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | @@ -3054,27 +3106,20 @@ Currently it is not needed to loop over Imports with endpoint /automation/v1/imp | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | +### DataExtract.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity for caching - +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Import Definition by Name +### DataExtract.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific dataExtract Definition by Name -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | @@ -3082,111 +3127,87 @@ Retrieve a specific Import Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### ImportFile.create(importFile) ⇒ Promise -Creates a single Import File +### DataExtract.create(dataExtract) ⇒ Promise +Creates a single Data Extract -**Kind**: static method of [ImportFile](#ImportFile) +**Kind**: static method of [DataExtract](#DataExtract) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | +| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - + -### ImportFile.update(importFile) ⇒ Promise -Updates a single Import File +### DataExtract.update(dataExtract) ⇒ Promise +Updates a single Data Extract -**Kind**: static method of [ImportFile](#ImportFile) +**Kind**: static method of [DataExtract](#DataExtract) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - + -### ImportFile.preDeployTasks(metadata) ⇒ Promise -prepares a import definition for deployment +### DataExtract.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a dataExtract for deployment -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single importDef | +| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | - + -### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem manages post retrieve steps -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single item | - + -### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> +### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [ImportFile](#ImportFile) +**Kind**: static method of [DataExtract](#DataExtract) **Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -## Journey ⇐ [MetadataType](#MetadataType) -Journey MetadataType -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -id: A unique id of the journey assigned by the journey’s API during its creation -key: A unique id of the journey within the MID. Can be generated by the developer -definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId +## DataExtractType ⇐ [MetadataType](#MetadataType) +DataExtractType MetadataType +Only for Caching No retrieve/upsert is required +as this is a configuration in the EID **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Journey](#Journey) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.update(metadata)](#Journey.update) ⇒ Promise - * [.create(metadata)](#Journey.create) ⇒ Promise - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Journey.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [._postRetrieveTasksBulk(metadataMap)](#Journey._postRetrieveTasksBulk) - * [.postRetrieveTasks(metadata)](#Journey.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.preDeployTasks(metadata)](#Journey.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Journey.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' +* [DataExtractType](#DataExtractType) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtractType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#DataExtractType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### Journey.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Journey +### DataExtractType.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Type. -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [DataExtractType](#DataExtractType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | @@ -3195,62 +3216,70 @@ Retrieves Metadata of Journey | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### Journey.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### DataExtractType.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Type for caching. -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [DataExtractType](#DataExtractType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | +## Discovery ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + -### Journey.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy +### Discovery.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves API endpoint +documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [Discovery](#Discovery) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | not used | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Journey.update(metadata) ⇒ Promise -Updates a single item +## Email ⇐ [MetadataType](#MetadataType) +Email MetadataType -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +* [Email](#Email) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### Journey.create(metadata) ⇒ Promise -Creates a single item +### Email.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise +**Kind**: static method of [Email](#Email) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Journey.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +### Email.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [Journey](#Journey) +**Kind**: static method of [Email](#Email) **Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | @@ -3260,3056 +3289,8294 @@ Helper for writing Metadata to disk, used for Retrieve and deploy | [overrideType] | string | for use when there is a subtype (such as folder-queries) | | [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Journey.\_postRetrieveTasksBulk(metadataMap) -helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and +### Email.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [Journey](#Journey) +**Kind**: static method of [Email](#Email) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | key=customer key, value=metadata | +| metadata | TYPE.MetadataTypeItem | a single query | - + -### Journey.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! +## EmailSend ⇐ [MetadataType](#MetadataType) +MessageSendActivity MetadataType -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +* [EmailSend](#EmailSend) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#EmailSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadataItem)](#EmailSend.update) ⇒ Promise + * [.create(metadataItem)](#EmailSend.create) ⇒ Promise + * [.deleteByKey(customerKey)](#EmailSend.deleteByKey) ⇒ Promise.<boolean> + * [.preDeployTasks(metadata)](#EmailSend.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.postRetrieveTasks(metadata)](#EmailSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### Journey.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! +### EmailSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - metadata object +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Journey.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### EmailSend.update(metadataItem) ⇒ Promise +Updates a single item -**Kind**: static method of [Journey](#Journey) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -## List ⇐ [MetadataType](#MetadataType) -List MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [List](#List) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#List.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#List.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(customerKey)](#List.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(list)](#List.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata, [parseForCache])](#List.parseMetadata) ⇒ TYPE.MetadataTypeItem +| metadataItem | TYPE.MetadataTypeItem | a single item | - + -### List.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Lists +### EmailSend.create(metadataItem) ⇒ Promise +Creates a single item -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### List.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk +| metadataItem | TYPE.MetadataTypeItem | a single item | -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### List.deleteByKey(customerKey) ⇒ Promise.<boolean> +### EmailSend.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [List](#List) +**Kind**: static method of [EmailSend](#EmailSend) **Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -### List.postRetrieveTasks(list) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### EmailSend.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares a single item for deployment -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise | Param | Type | Description | | --- | --- | --- | -| list | TYPE.MetadataTypeItem | a single list | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### List.parseMetadata(metadata, [parseForCache]) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### EmailSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single list definition | -| [parseForCache] | boolean | if set to true, the Category ID is kept | +| metadata | TYPE.MetadataTypeItem | a single query | - + -## MetadataType -MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes +## Event ⇐ [MetadataType](#MetadataType) +Event MetadataType **Kind**: global class +**Extends**: [MetadataType](#MetadataType) -* [MetadataType](#MetadataType) - * [.client](#MetadataType.client) : TYPE.SDK - * [.properties](#MetadataType.properties) : TYPE.Mcdevrc - * [.subType](#MetadataType.subType) : string - * [.buObject](#MetadataType.buObject) : TYPE.BuObject - * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> - * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void - * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.setFolderPath(metadata)](#MetadataType.setFolderPath) - * [.setFolderId(metadata)](#MetadataType.setFolderId) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void - * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void - * [.refresh()](#MetadataType.refresh) ⇒ void - * [.execute()](#MetadataType.execute) ⇒ void - * [.pause()](#MetadataType.pause) ⇒ void - * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean - * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean - * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null - * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null - * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null - * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null - * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) - * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null - * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> - * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> - * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> - * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void - * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void - * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void - * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void - * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void - * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean - * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string - * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object - * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void - * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void - * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> - * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object - * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - - - -### MetadataType.client : TYPE.SDK -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.properties : TYPE.Mcdevrc -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.subType : string -**Kind**: static property of [MetadataType](#MetadataType) - +* [Event](#Event) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Event.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#Event.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Event.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.postRetrieveTasks(eventDef)](#Event.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(key)](#Event.deleteByKey) ⇒ Promise.<boolean> + * [.deploy(metadata, deployDir, retrieveDir)](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.create(metadata)](#Event.create) ⇒ Promise + * [.update(metadataEntry)](#Event.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Event.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.parseMetadata(metadata)](#Event.parseMetadata) ⇒ TYPE.MetadataTypeItem -### MetadataType.buObject : TYPE.BuObject -**Kind**: static property of [MetadataType](#MetadataType) - + -### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending +### Event.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Event Definition. +Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. +Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> -Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. +### Event.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - Fieldnames +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### Event.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Event Definition by Name + +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [isCaching] | boolean | if true, then check if field should be skipped for caching | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata +### Event.postRetrieveTasks(eventDef) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| eventDef | TYPE.MetadataTypeItem | a single item of Event Definition | - + -### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +### Event.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | -| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| key | string | Identifier of item | - + -### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) +### Event.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### Event.create(metadata) ⇒ Promise +Creates a single Event Definition -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Event](#Event) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| metadata | TYPE.MetadataTypeItem | a single Event Definition | - + -### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> -helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id +### Event.update(metadataEntry) ⇒ Promise +Updates a single Event Definition (using PUT method since PATCH isn't supported) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Kind**: static method of [Event](#Event) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| metadataEntry | TYPE.MetadataTypeItem | a single Event Definition | - + -### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +### Event.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares an event definition for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeItem - cloned metadata +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - parsed version | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| targetDir | string | folder where retrieves should be saved | -| [isTemplating] | boolean | signals that we are retrieving templates | +| metadata | TYPE.MetadataTypeItem | a single eventDefinition | - + -### MetadataType.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Event.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single event definition | - + -### MetadataType.setFolderId(metadata) -generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy +## FtpLocation ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +* [FtpLocation](#FtpLocation) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#FtpLocation.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#FtpLocation.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### FtpLocation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FtpLocation +Endpoint /automation/v1/ftplocations/ return all FtpLocations -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [FtpLocation](#FtpLocation) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [_] | void | unused parameter | +| [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### FtpLocation.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [FtpLocation](#FtpLocation) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +## FileTransfer ⇐ [MetadataType](#MetadataType) +FileTransfer MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk +* [FileTransfer](#FileTransfer) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise + * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise + * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + + +### FileTransfer.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FileTransfer Activity. +Endpoint /automation/v1/filetransfers/ returns all File Transfers + +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### FileTransfer.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FileTransfer Activity for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### FileTransfer.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific File Transfer Definition by Name + +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where retrieved metadata directory will be saved | | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [subType] | string | optionally limit to a single subtype | - + -### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> -Retrieve a specific Script by Name +### FileTransfer.create(fileTransfer) ⇒ Promise +Creates a single File Transfer -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| name | string | name (not key) of the metadata item | +| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - + -### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### FileTransfer.update(fileTransfer) ⇒ Promise +Updates a single File Transfer -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| templateDir | string | (List of) Directory where built definitions will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - + -### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -Gets executed before deploying metadata +### FileTransfer.preDeployTasks(metadata) ⇒ Promise +prepares a fileTransfer for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| deployDir | string | folder where files for deployment are stored | +| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - + -### MetadataType.create(metadata, deployDir) ⇒ void -Abstract create method that needs to be implemented in child metadata type +### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| deployDir | string | directory where deploy metadata are saved | +| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - + -### MetadataType.update(metadata, [metadataBefore]) ⇒ void -Abstract update method that needs to be implemented in child metadata type +### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | +| customerKey | string | Identifier of data extension | - + -### MetadataType.refresh() ⇒ void -Abstract refresh method that needs to be implemented in child metadata type +## Filter ⇐ [MetadataType](#MetadataType) +Filter MetadataType -**Kind**: static method of [MetadataType](#MetadataType) - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + -### MetadataType.execute() ⇒ void -Abstract execute method that needs to be implemented in child metadata type +### Filter.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Filter. +Endpoint /automation/v1/filters/ returns all Filters, +but only with some of the fields. So it is needed to loop over +Filters with the endpoint /automation/v1/filters/{id} -**Kind**: static method of [MetadataType](#MetadataType) - +**Kind**: static method of [Filter](#Filter) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise -### MetadataType.pause() ⇒ void -Abstract pause method that needs to be implemented in child metadata type +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +## Folder ⇐ [MetadataType](#MetadataType) +Folder MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true if metadata was changed +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | +* [Folder](#Folder) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise + * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise + * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> + * [.create(metadataEntry)](#Folder.create) ⇒ Promise + * [.update(metadataEntry)](#Folder.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Folder.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.getJsonFromFS(dir, [listBadKeys])](#Folder.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList])](#Folder.retrieveHelper) ⇒ Promise.<object> + * [.postRetrieveTasks(metadata)](#Folder.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.saveResults(results, retrieveDir, mid)](#Folder.saveResults) ⇒ Promise.<object> - + -### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### Folder.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise +Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true on first identified deviation or false if none are found +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | -| [silent] | boolean | optionally suppress logging | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | content type of folder | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> -MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. +### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise +Retrieves folder metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | content type of folder | - + -### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### Folder.upsert(metadata) ⇒ Promise.<object> +Folder upsert (copied from Metadata Upsert), after retrieving from target +and comparing to check if create or update operation is needed. +Copied due to having a dependency on itself, meaning the created need to be serial -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | - + -### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null -Creates a single metadata entry via REST +### Folder.create(metadataEntry) ⇒ Promise +creates a folder based on metatadata -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| uri | string | rest endpoint for POST | +| metadataEntry | TYPE.MetadataTypeItem | metadata of the folder | - + -### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Creates a single metadata entry via fuel-soap (generic lib not wrapper) +### Folder.update(metadataEntry) ⇒ Promise +Updates a single Folder. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | | metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - -### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null -Updates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | -| uri | string | | rest endpoint for PATCH | -| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | - - + -### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Updates a single metadata entry via fuel-soap (generic lib not wrapper) +### Folder.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares a folder for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of parsed folder metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.MetadataTypeItem | a single folder definition | - + -### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) -**Kind**: static method of [MetadataType](#MetadataType) +### Folder.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending + +**Kind**: static method of [Folder](#Folder) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | -| msg | 'creating' \| 'updating' | what to print in the log | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | - + -### MetadataType.getSOAPErrorMsg(ex) ⇒ string -helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) +### Folder.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList]) ⇒ Promise.<object> +Helper to retrieve the folders as promise -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - error message +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - soap object | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [queryAllAccounts] | boolean | which queryAllAccounts setting to use | +| [contentTypeList] | Array.<string> | content type of folder | - + -### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Folder.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [Folder](#Folder) +**Returns**: TYPE.MetadataTypeItem - cloned metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| metadata | TYPE.MetadataTypeItem | metadata mapped by their keyField | - + -### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -Retrieves Metadata for Rest Types +### Folder.saveResults(results, retrieveDir, mid) ⇒ Promise.<object> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| [singleRetrieve] | string \| number | key of single item to filter by | +| results | object | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| mid | number | current mid for this credential / business unit | - + -### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +## ImportFile ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | -| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | -| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) - +* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(importFile)](#ImportFile.create) ⇒ Promise + * [.update(importFile)](#ImportFile.update) ⇒ Promise + * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> -### MetadataType.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) + -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: null - - +### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Import File. +Endpoint /automation/v1/imports/ return all Import Files with all details. +Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> -Used to execute a query/automation etc. +### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| uri | string | REST endpoint where the POST request should be sent | -| key | string | item key | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> -Used to execute a query/automation etc. +### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Import Definition by Name -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise | Param | Type | Description | | --- | --- | --- | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> -helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) +### ImportFile.create(importFile) ⇒ Promise +Creates a single Import File -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [singleRetrieve] | string \| number | key of single item to filter by | -| metadataMap | TYPE.MetadataTypeMap | saved metadata | +| importFile | TYPE.MetadataTypeItem | a single Import File | - + -### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### ImportFile.update(importFile) ⇒ Promise +Updates a single Import File -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +| importFile | TYPE.MetadataTypeItem | a single Import File | - + -### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void -Deletes a field in a metadata entry if the selected definition property equals false. +### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | -| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | -| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | -| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | -**Example** -```js -Removes field (or nested fields childs) that are not updateable -deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); -``` - + -### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not createable +### ImportFile.preDeployTasks(metadata) ⇒ Promise +prepares a import definition for deployment -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| metadata | TYPE.MetadataTypeItem | a single importDef | - + -### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not updateable +### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.keepTemplateFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the template +### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - +| customerKey | string | Identifier of data extension | -### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the stored metadata + -**Kind**: static method of [MetadataType](#MetadataType) +## Journey ⇐ [MetadataType](#MetadataType) +Journey MetadataType +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! +id: A unique id of the journey assigned by the journey’s API during its creation +key: A unique id of the journey within the MID. Can be generated by the developer +definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) - +* [Journey](#Journey) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean> + * [.deploy(metadata, deployDir, retrieveDir)](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.update(metadata)](#Journey.update) ⇒ Promise + * [.create(metadata)](#Journey.create) ⇒ Promise + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Journey.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [._postRetrieveTasksBulk(metadataMap)](#Journey._postRetrieveTasksBulk) + * [.postRetrieveTasks(metadata)](#Journey.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.preDeployTasks(metadata)](#Journey.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Journey.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' -### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean -checks if the current metadata entry should be saved on retrieve or not + -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: skip saving == filtered; false: continue with saving +### Journey.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Journey + +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean -optionally filter by what folder something is in +### Journey.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadataEntry | object | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +| key | string | Identifier of item | - + -### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### Journey.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) -searches extracted file for template variable names and applies the market values +### Journey.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string -helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) -searches extracted file for template variable values and applies the market variable names +### Journey.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types (e.g script, asset, query) +### Journey.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### Journey.\_postRetrieveTasksBulk(metadataMap) +helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [Journey](#Journey) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| metadataMap | TYPE.MetadataTypeMap | key=customer key, value=metadata | - + -### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> -check template directory for complex types that open subfolders for their subtypes +### Journey.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - subtype name +**Kind**: static method of [Journey](#Journey) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object -optional method used for some types to try a different folder structure +### Journey.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a TSD for deployment +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - metadata +**Kind**: static method of [Journey](#Journey) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | -| ex | Error | error from first attempt | +| metadata | TYPE.MetadataTypeItem | of a single TSD | - + -### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Builds definition based on template -NOTE: Most metadata files should use this generic method, unless custom -parsing is required (for example scripts & queries) +### Journey.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [Journey](#Journey) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| templateName | string | name of the metadata file | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages +## List ⇐ [MetadataType](#MetadataType) +List MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | +* [List](#List) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#List.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#List.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.deleteByKey(customerKey)](#List.deleteByKey) ⇒ Promise.<boolean> + * [.postRetrieveTasks(list)](#List.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.parseMetadata(metadata, [parseForCache])](#List.parseMetadata) ⇒ TYPE.MetadataTypeItem - + -### MetadataType.document([metadata], [isDeploy]) ⇒ void -Gets metadata cache with limited fields and does not store value to disk +### List.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Lists -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [List](#List) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | -| [isDeploy] | boolean | used to skip non-supported message during deploy | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.deleteByKey(customerKey) ⇒ boolean +### List.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [List](#List) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### List.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success status +**Kind**: static method of [List](#List) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> -clean up after deleting a metadata item +### List.postRetrieveTasks(list) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - Promise +**Kind**: static method of [List](#List) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | -| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | +| list | TYPE.MetadataTypeItem | a single list | - + -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### List.parseMetadata(metadata, [parseForCache]) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [List](#List) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - +| metadata | TYPE.MetadataTypeItem | a single list definition | +| [parseForCache] | boolean | if set to true, the Category ID is kept | -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit + + +## MetadataType +MetadataType class that gets extended by their specific metadata type class. +Provides default functionality that can be overwritten by child metadata type classes + +**Kind**: global class + +* [MetadataType](#MetadataType) + * [.client](#MetadataType.client) : TYPE.SDK + * [.properties](#MetadataType.properties) : TYPE.Mcdevrc + * [.subType](#MetadataType.subType) : string + * [.buObject](#MetadataType.buObject) : TYPE.BuObject + * [.client](#MetadataType.client) : TYPE.SDK + * [.properties](#MetadataType.properties) : TYPE.Mcdevrc + * [.subType](#MetadataType.subType) : string + * [.buObject](#MetadataType.buObject) : TYPE.BuObject + * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> + * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void + * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.setFolderPath(metadata)](#MetadataType.setFolderPath) + * [.setFolderId(metadata)](#MetadataType.setFolderId) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> + * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void + * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void + * [.refresh()](#MetadataType.refresh) ⇒ void + * [.execute()](#MetadataType.execute) ⇒ void + * [.pause()](#MetadataType.pause) ⇒ void + * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean + * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean + * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null + * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null + * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null + * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null + * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) + * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null + * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> + * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> + * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> + * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void + * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void + * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void + * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void + * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void + * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean + * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string + * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object + * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void + * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void + * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> + * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> + * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> + * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> + * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object + * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> + * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> + * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void + * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.setFolderPath(metadata)](#MetadataType.setFolderPath) + * [.setFolderId(metadata)](#MetadataType.setFolderId) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> + * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void + * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void + * [.refresh()](#MetadataType.refresh) ⇒ void + * [.execute()](#MetadataType.execute) ⇒ void + * [.pause()](#MetadataType.pause) ⇒ void + * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean + * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean + * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null + * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null + * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null + * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null + * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) + * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null + * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> + * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> + * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> + * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void + * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void + * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void + * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void + * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void + * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean + * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string + * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object + * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void + * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void + * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> + * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> + * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> + * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> + * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object + * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> + + + +### MetadataType.client : TYPE.SDK +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.properties : TYPE.Mcdevrc +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.subType : string +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.buObject : TYPE.BuObject +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.client : TYPE.SDK +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.properties : TYPE.Mcdevrc +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.subType : string +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.buObject : TYPE.BuObject +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map + +| Param | Type | Description | +| --- | --- | --- | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | + + + +### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> +Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - Fieldnames + +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [isCaching] | boolean | if true, then check if field should be skipped for caching | + + + +### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + + + +### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | + + + +### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | + + + +### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> +helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeItem - cloned metadata + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | +| targetDir | string | folder where retrieves should be saved | +| [isTemplating] | boolean | signals that we are retrieving templates | + + + +### MetadataType.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MetadataType.setFolderId(metadata) +generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | + + + +### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | + + + +### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | + + + +### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [subType] | string | optionally limit to a single subtype | + + + +### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> +Retrieve a specific Script by Name + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| name | string | name (not key) of the metadata item | + + + +### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| templateDir | string | (List of) Directory where built definitions will be saved | +| key | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +Gets executed before deploying metadata + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single metadata item | +| deployDir | string | folder where files for deployment are stored | + + + +### MetadataType.create(metadata, deployDir) ⇒ void +Abstract create method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| deployDir | string | directory where deploy metadata are saved | + + + +### MetadataType.update(metadata, [metadataBefore]) ⇒ void +Abstract update method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | + + + +### MetadataType.refresh() ⇒ void +Abstract refresh method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.execute() ⇒ void +Abstract execute method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.pause() ⇒ void +Abstract pause method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true if metadata was changed + +| Param | Type | Description | +| --- | --- | --- | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | + + + +### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true on first identified deviation or false if none are found + +| Param | Type | Description | +| --- | --- | --- | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | +| [silent] | boolean | optionally suppress logging | + + + +### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> +MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | + + + +### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: 'create' \| 'update' \| 'skip' - action to take + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | + + + +### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null +Creates a single metadata entry via REST + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| uri | string | rest endpoint for POST | + + + +### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Creates a single metadata entry via fuel-soap (generic lib not wrapper) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null +Updates a single metadata entry via REST + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | +| uri | string | | rest endpoint for PATCH | +| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | + + + +### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Updates a single metadata entry via fuel-soap (generic lib not wrapper) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | error that occured | +| msg | 'creating' \| 'updating' | what to print in the log | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.getSOAPErrorMsg(ex) ⇒ string +helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - error message + +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | error that occured | + + + +### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | + + + +### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +Retrieves Metadata for Rest Types + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| [singleRetrieve] | string \| number | key of single item to filter by | + + + +### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | +| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | +| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | + + + +### MetadataType.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: null - - + +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | exception | +| id | string | id or key of item | + + + +### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> +Used to execute a query/automation etc. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) + +| Param | Type | Description | +| --- | --- | --- | +| uri | string | REST endpoint where the POST request should be sent | +| key | string | item key | + + + +### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> +Used to execute a query/automation etc. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:object}> - metadata key and API response + +| Param | Type | Description | +| --- | --- | --- | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | + + + +### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> +helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| [singleRetrieve] | string \| number | key of single item to filter by | +| metadataMap | TYPE.MetadataTypeMap | saved metadata | + + + +### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | + + + +### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void +Deletes a field in a metadata entry if the selected definition property equals false. + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | +| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | +| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | +| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | + +**Example** +```js +Removes field (or nested fields childs) that are not updateable +deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); +``` + + +### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not createable + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not updateable + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.keepTemplateFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the template + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the stored metadata + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean +checks if the current metadata entry should be saved on retrieve or not + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: skip saving == filtered; false: continue with saving + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | + + + +### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean +optionally filter by what folder something is in + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | object | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | + + + +### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata + +| Param | Type | Description | +| --- | --- | --- | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) +searches extracted file for template variable names and applies the market values + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied + +| Param | Type | Description | +| --- | --- | --- | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string +helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) +searches extracted file for template variable values and applies the market variable names + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied + +| Param | Type | Description | +| --- | --- | --- | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types (e.g script, asset, query) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> +check template directory for complex types that open subfolders for their subtypes + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - subtype name + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | + + + +### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object +optional method used for some types to try a different folder structure + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | +| ex | Error | error from first attempt | + + + +### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Builds definition based on template +NOTE: Most metadata files should use this generic method, unless custom +parsing is required (for example scripts & queries) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| templateName | string | name of the metadata file | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> \| void - formatted Error Message + +| Param | Type | Description | +| --- | --- | --- | +| ex | object | response payload from REST API | + + + +### MetadataType.document([metadata], [isDeploy]) ⇒ void +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | +| [isDeploy] | boolean | used to skip non-supported message during deploy | + + + +### MetadataType.resolveId(id) ⇒ Promise.<string> +get name & key for provided id + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - key of metadata + +| Param | Type | Description | +| --- | --- | --- | +| id | string | Identifier of metadata | + + + +### MetadataType.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> +clean up after deleting a metadata item + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - Promise + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | +| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | + + + +### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata | +| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| url | string | endpoint | +| key | string | Identifier of metadata | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object +Returns metadata of a business unit that is saved locally + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - Metadata of BU in local directory + +| Param | Type | Description | +| --- | --- | --- | +| readDir | string | root directory of metadata. | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| [buMetadata] | object | Metadata of BU in local directory | + + + +### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - list of keys + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | + + + +### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map + +| Param | Type | Description | +| --- | --- | --- | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | + + + +### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> +Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - Fieldnames + +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [isCaching] | boolean | if true, then check if field should be skipped for caching | + + + +### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + + + +### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | + + + +### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | + + + +### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> +helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeItem - cloned metadata + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | +| targetDir | string | folder where retrieves should be saved | +| [isTemplating] | boolean | signals that we are retrieving templates | + + + +### MetadataType.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MetadataType.setFolderId(metadata) +generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | + + + +### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | + + + +### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | + + + +### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [subType] | string | optionally limit to a single subtype | + + + +### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> +Retrieve a specific Script by Name + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| name | string | name (not key) of the metadata item | + + + +### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| templateDir | string | (List of) Directory where built definitions will be saved | +| key | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +Gets executed before deploying metadata + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single metadata item | +| deployDir | string | folder where files for deployment are stored | + + + +### MetadataType.create(metadata, deployDir) ⇒ void +Abstract create method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| deployDir | string | directory where deploy metadata are saved | + + + +### MetadataType.update(metadata, [metadataBefore]) ⇒ void +Abstract update method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | + + + +### MetadataType.refresh() ⇒ void +Abstract refresh method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.execute() ⇒ void +Abstract execute method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.pause() ⇒ void +Abstract pause method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true if metadata was changed + +| Param | Type | Description | +| --- | --- | --- | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | + + + +### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true on first identified deviation or false if none are found + +| Param | Type | Description | +| --- | --- | --- | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | +| [silent] | boolean | optionally suppress logging | + + + +### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> +MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | + + + +### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: 'create' \| 'update' \| 'skip' - action to take + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | + + + +### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null +Creates a single metadata entry via REST + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| uri | string | rest endpoint for POST | + + + +### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Creates a single metadata entry via fuel-soap (generic lib not wrapper) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null +Updates a single metadata entry via REST + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | +| uri | string | | rest endpoint for PATCH | +| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | + + + +### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Updates a single metadata entry via fuel-soap (generic lib not wrapper) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | error that occured | +| msg | 'creating' \| 'updating' | what to print in the log | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.getSOAPErrorMsg(ex) ⇒ string +helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - error message + +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | error that occured | + + + +### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | + + + +### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +Retrieves Metadata for Rest Types + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| [singleRetrieve] | string \| number | key of single item to filter by | + + + +### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | +| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | +| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | + + + +### MetadataType.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: null - - + +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | exception | +| id | string | id or key of item | + + + +### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> +Used to execute a query/automation etc. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) + +| Param | Type | Description | +| --- | --- | --- | +| uri | string | REST endpoint where the POST request should be sent | +| key | string | item key | + + + +### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> +Used to execute a query/automation etc. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:object}> - metadata key and API response + +| Param | Type | Description | +| --- | --- | --- | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | + + + +### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> +helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| [singleRetrieve] | string \| number | key of single item to filter by | +| metadataMap | TYPE.MetadataTypeMap | saved metadata | + + + +### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | + + + +### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void +Deletes a field in a metadata entry if the selected definition property equals false. + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | +| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | +| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | +| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | + +**Example** +```js +Removes field (or nested fields childs) that are not updateable +deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); +``` + + +### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not createable + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not updateable + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.keepTemplateFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the template + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the stored metadata + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | + + + +### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean +checks if the current metadata entry should be saved on retrieve or not + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: skip saving == filtered; false: continue with saving + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | + + + +### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean +optionally filter by what folder something is in + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | object | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | + + + +### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata + +| Param | Type | Description | +| --- | --- | --- | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) +searches extracted file for template variable names and applies the market values + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied + +| Param | Type | Description | +| --- | --- | --- | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string +helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) +searches extracted file for template variable values and applies the market variable names + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied + +| Param | Type | Description | +| --- | --- | --- | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types (e.g script, asset, query) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> +check template directory for complex types that open subfolders for their subtypes + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - subtype name + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | + + + +### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object +optional method used for some types to try a different folder structure + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | +| ex | Error | error from first attempt | + + + +### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Builds definition based on template +NOTE: Most metadata files should use this generic method, unless custom +parsing is required (for example scripts & queries) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| templateName | string | name of the metadata file | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> \| void - formatted Error Message + +| Param | Type | Description | +| --- | --- | --- | +| ex | object | response payload from REST API | + + + +### MetadataType.document([metadata], [isDeploy]) ⇒ void +Gets metadata cache with limited fields and does not store value to disk + +**Kind**: static method of [MetadataType](#MetadataType) + +| Param | Type | Description | +| --- | --- | --- | +| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | +| [isDeploy] | boolean | used to skip non-supported message during deploy | + + + +### MetadataType.resolveId(id) ⇒ Promise.<string> +get name & key for provided id + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - key of metadata + +| Param | Type | Description | +| --- | --- | --- | +| id | string | Identifier of metadata | + + + +### MetadataType.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> +clean up after deleting a metadata item + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - Promise + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | +| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | + + + +### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata | +| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| url | string | endpoint | +| key | string | Identifier of metadata | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + + + +### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object +Returns metadata of a business unit that is saved locally + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - Metadata of BU in local directory + +| Param | Type | Description | +| --- | --- | --- | +| readDir | string | root directory of metadata. | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| [buMetadata] | object | Metadata of BU in local directory | + + + +### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - list of keys + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | + + + +## MobileCode ⇐ [MetadataType](#MetadataType) +MobileCode MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [MobileCode](#MobileCode) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileCode.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#MobileCode.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + + + +### MobileCode.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Mobile Keywords +Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. + +**Kind**: static method of [MobileCode](#MobileCode) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### MobileCode.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching + +**Kind**: static method of [MobileCode](#MobileCode) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +## MobileKeyword ⇐ [MetadataType](#MetadataType) +MobileKeyword MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [MobileKeyword](#MobileKeyword) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void + * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(metadata)](#MobileKeyword.create) ⇒ Promise + * [.update(metadata)](#MobileKeyword.update) ⇒ Promise + * [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void + * [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ Object + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileKeyword._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.preDeployTasks(metadata, deployDir)](#MobileKeyword.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.postCreateTasks(metadataEntry, apiResponse)](#MobileKeyword.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileKeyword.postUpdateTasks) ⇒ void + * [._mergeCode(metadata, deployDir, [templateName])](#MobileKeyword._mergeCode) ⇒ Promise.<string> + * [.deleteByKey(key)](#MobileKeyword.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#MobileKeyword.postDeleteTasks) ⇒ void + * [.getFilesToCommit(keyArr)](#MobileKeyword.getFilesToCommit) ⇒ Array.<string> + + + +### MobileKeyword.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void +Retrieves Metadata of Mobile Keywords +Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | + + + +### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: 'create' \| 'update' \| 'skip' - action to take + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | + + + +### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | + + + +### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +retrieve an item and create a template from it + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| key | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### MobileKeyword.create(metadata) ⇒ Promise +Creates a single item + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MobileKeyword.update(metadata) ⇒ Promise +Updates a single item + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MobileKeyword.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void +manages post retrieve steps + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object +helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested) + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Object - returns found extension and file content + +| Param | Type | Description | +| --- | --- | --- | +| metadataScript | string | the code of the file | + + + +### MobileKeyword.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### MobileKeyword.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + + +### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested) +handles extracted code if any are found for complex types + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | + + + +### MobileKeyword.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares an event definition for deployment + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single MobileKeyword | +| deployDir | string | directory of deploy files | + + + +### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void +helper for [createREST](#MetadataType.createREST) + +**Kind**: static method of [MobileKeyword](#MobileKeyword) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) + +**Kind**: static method of [MobileKeyword](#MobileKeyword) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#MobileKeyword.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<string> - content for metadata.script + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | + + + +### MobileKeyword.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<boolean> - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| key | string | Identifier of item | + + + +### MobileKeyword.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item + +**Kind**: static method of [MobileKeyword](#MobileKeyword) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + + + +### MobileKeyword.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +## MobileMessage ⇐ [MetadataType](#MetadataType) +MobileMessage MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void + * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadata)](#MobileMessage.update) ⇒ Promise + * [.create(metadata)](#MobileMessage.create) ⇒ Promise + * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> + * [.prepExtractedCode(code)](#MobileMessage.prepExtractedCode) ⇒ Object + * [.getFilesToCommit(keyArr)](#MobileMessage.getFilesToCommit) ⇒ Array.<string> + * [.postRetrieveTasks(metadata)](#MobileMessage.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.preDeployTasks(metadata, deployDir)](#MobileMessage.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postCreateTasks(metadataEntry, apiResponse)](#MobileMessage.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileMessage.postUpdateTasks) ⇒ void + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileMessage._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.deleteByKey(id)](#MobileMessage.deleteByKey) ⇒ Promise.<boolean> + + + +### MobileMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void +Retrieves Metadata of Mobile Keywords + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | + + + +### MobileMessage.update(metadata) ⇒ Promise +Updates a single item + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MobileMessage.create(metadata) ⇒ Promise +Creates a single item + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<string> - code + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | + + + +### MobileMessage.prepExtractedCode(code) ⇒ Object +helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested) + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Object - returns found extension and file content + +| Param | Type | Description | +| --- | --- | --- | +| code | string | the code of the file | + + + +### MobileMessage.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### MobileMessage.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single query | + + + +### MobileMessage.preDeployTasks(metadata, deployDir) ⇒ TYPE.MetadataTypeItem +prepares an event definition for deployment + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: TYPE.MetadataTypeItem - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single MobileMessage | +| deployDir | string | directory of deploy files | + + + +### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void +helper for [createREST](#MetadataType.createREST) + +**Kind**: static method of [MobileMessage](#MobileMessage) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) + +**Kind**: static method of [MobileMessage](#MobileMessage) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | + + + +### MobileMessage.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### MobileMessage.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + + +### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested) +handles extracted code if any are found for complex types + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | + + + +### MobileMessage.deleteByKey(id) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit +! the endpoint expects the ID and not a key but for mcdev in this case key==id + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<boolean> - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| id | string | Identifier of item | + + + +## Query ⇐ [MetadataType](#MetadataType) +Query MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [Query](#Query) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> + * [.execute(keyArr)](#Query.execute) ⇒ Promise.<Array.<string>> + * [.retrieveForCache()](#Query.retrieveForCache) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Query.retrieveAsTemplate) ⇒ Promise.<{metadata: Query, type: string}> + * [.postRetrieveTasks(metadata)](#Query.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.create(query)](#Query.create) ⇒ Promise + * [.update(query)](#Query.update) ⇒ Promise + * [.preDeployTasks(metadata, deployDir)](#Query.preDeployTasks) ⇒ Promise.<TYPE.QueryItem> + * [.applyTemplateValues(code, templateVariables)](#Query.applyTemplateValues) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> + * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void + * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void + * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) + + + +### Query.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> +Retrieves Metadata of queries + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### Query.execute(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed successfully + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> +Retrieves query metadata for caching + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata + + +### Query.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: Query, type: string}> +Retrieve a specific Query by Name + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: Query, type: string}> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### Query.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps + +**Kind**: static method of [Query](#Query) +**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.QueryItem | a single query | + + + +### Query.create(query) ⇒ Promise +Creates a single query + +**Kind**: static method of [Query](#Query) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| query | TYPE.QueryItem | a single query | + + + +### Query.update(query) ⇒ Promise +Updates a single query + +**Kind**: static method of [Query](#Query) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| query | TYPE.QueryItem | a single query | + + + +### Query.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.QueryItem> +prepares a Query for deployment + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<TYPE.QueryItem> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.QueryItem | a single query activity | +| deployDir | string | directory of deploy files | + + + +### Query.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#Query.buildDefinitionForNested) +searches extracted SQL file for template variables and applies the market values + +**Kind**: static method of [Query](#Query) +**Returns**: string - code with markets applied + +| Param | Type | Description | +| --- | --- | --- | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### Query.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.QueryItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### Query.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.QueryItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + +**Example** +```js +queries are saved as 1 json and 1 sql file. both files need to be run through templating +``` + + +### Query.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [Query](#Query) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### Query.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages but adds query specific filters to error texts + +**Kind**: static method of [Query](#Query) +**Returns**: Array.<string> \| void - formatted Error Message + +| Param | Type | Description | +| --- | --- | --- | +| ex | object | response payload from REST API | + + + +### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### Query.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item + +**Kind**: static method of [Query](#Query) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + + + +### Query.postDeployTasks(upsertResults) +Gets executed after deployment of metadata type + +**Kind**: static method of [Query](#Query) + +| Param | Type | Description | +| --- | --- | --- | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | + + + +## Role ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [Role](#Role) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [___], [key])](#Role.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.preDeployTasks(metadata)](#Role.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.create(metadata)](#Role.create) ⇒ Promise + * [.update(metadata)](#Role.update) ⇒ Promise + * [.document([metadata])](#Role.document) ⇒ Promise.<void> + * [._traverseRoles(role, element, [permission], [isAllowed])](#Role._traverseRoles) ⇒ void + + + +### Role.retrieve(retrieveDir, _, [___], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud + +**Kind**: static method of [Role](#Role) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Metadata store object + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [___] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### Role.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +Gets executed before deploying metadata + +**Kind**: static method of [Role](#Role) +**Returns**: TYPE.MetadataTypeItem - Promise of a single metadata item + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single metadata item | + + + +### Role.create(metadata) ⇒ Promise +Create a single Role. + +**Kind**: static method of [Role](#Role) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | + + + +### Role.update(metadata) ⇒ Promise +Updates a single Role. + +**Kind**: static method of [Role](#Role) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | + + + +### Role.document([metadata]) ⇒ Promise.<void> +Creates markdown documentation of all roles + +**Kind**: static method of [Role](#Role) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| [metadata] | TYPE.MetadataTypeMap | role definitions | + + + +### Role.\_traverseRoles(role, element, [permission], [isAllowed]) ⇒ void +iterates through permissions to output proper row-names for nested permissionss + +**Kind**: static method of [Role](#Role) + +| Param | Type | Description | +| --- | --- | --- | +| role | string | name of the user role | +| element | object | data of the permission | +| [permission] | string | name of the permission | +| [isAllowed] | string | "true" / "false" from the | + + + +## Script ⇐ [MetadataType](#MetadataType) +Script MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [Script](#Script) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> + * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> + * [.update(script)](#Script.update) ⇒ Promise + * [.create(script)](#Script.create) ⇒ Promise + * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> + * [.preDeployTasks(metadata, dir)](#Script.preDeployTasks) ⇒ TYPE.ScriptItem + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object + * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void + + + +### Script.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> +Retrieves Metadata of Script +Endpoint /automation/v1/scripts/ return all Scripts with all details. + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### Script.retrieveForCache() ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> +Retrieves script metadata for caching + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise + + +### Script.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.Script, type: string}> +Retrieve a specific Script by Name + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.Script, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### Script.update(script) ⇒ Promise +Updates a single Script + +**Kind**: static method of [Script](#Script) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| script | TYPE.MetadataTypeItem | a single Script | + + + +### Script.create(script) ⇒ Promise +Creates a single Script + +**Kind**: static method of [Script](#Script) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| script | TYPE.MetadataTypeItem | a single Script | + + + +### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#Script.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<string> - content for metadata.script + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.ScriptItem | a single asset definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | + + + +### Script.preDeployTasks(metadata, dir) ⇒ TYPE.ScriptItem +prepares a Script for deployment + +**Kind**: static method of [Script](#Script) +**Returns**: TYPE.ScriptItem - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.ScriptItem | a single script activity definition | +| dir | string | directory of deploy files | + + + +### Script.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### Script.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + + +### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested) +handles extracted code if any are found for complex types + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | + + + +### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps + +**Kind**: static method of [Script](#Script) +**Returns**: TYPE.CodeExtractItem - a single item with code parts extracted + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.ScriptItem | a single item | + + + +### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object +helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) + +**Kind**: static method of [Script](#Script) +**Returns**: Object - returns found extension and file content + +| Param | Type | Description | +| --- | --- | --- | +| metadataScript | string | the code of the file | +| metadataName | string | the name of the metadata | + + + +### Script.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [Script](#Script) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### Script.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item + +**Kind**: static method of [Script](#Script) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + + + +## SendClassification ⇐ [MetadataType](#MetadataType) +SendClassification MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + + +### SendClassification.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [SendClassification](#SendClassification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +## TransactionalEmail ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalEmail MetadataType + +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) + +* [TransactionalEmail](#TransactionalEmail) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.update(metadata)](#TransactionalEmail.update) ⇒ Promise + * [.preDeployTasks(metadata)](#TransactionalEmail.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postCreateTasks(_, apiResponse)](#TransactionalEmail.postCreateTasks) ⇒ void + * [.postDeployTasks()](#TransactionalEmail.postDeployTasks) ⇒ void + * [.postRetrieveTasks(metadata)](#TransactionalEmail.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(key)](#TransactionalEmail.deleteByKey) ⇒ Promise.<boolean> + + + +### TransactionalEmail.update(metadata) ⇒ Promise +Updates a single item + +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | how the item shall look after the update | + + + +### TransactionalEmail.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares for deployment + +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: TYPE.MetadataTypeItem - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### TransactionalEmail.postCreateTasks(_, apiResponse) ⇒ void +helper for [TransactionalEmail.createREST](TransactionalEmail.createREST) + +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) + +| Param | Type | Description | +| --- | --- | --- | +| _ | TYPE.MetadataTypeItem | not used | +| apiResponse | object | varies depending on the API call | + + + +### TransactionalEmail.postDeployTasks() ⇒ void +Gets executed after deployment of metadata type + +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) + + +### TransactionalEmail.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: TYPE.MetadataTypeItem - a single item + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### TransactionalEmail.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: Promise.<boolean> - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| key | string | Identifier of item | + + + +## TransactionalMessage ⇐ [MetadataType](#MetadataType) +TransactionalMessage MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise + * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise + * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> + + + +### TransactionalMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata + +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching + +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to cache | + + + +### TransactionalMessage.update(metadata) ⇒ Promise +Updates a single item + +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### TransactionalMessage.create(metadata) ⇒ Promise +Creates a single item + +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### TransactionalMessage.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<boolean> - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| key | string | Identifier of item | + + + +## TransactionalPush ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalPush TransactionalMessage + +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) + +* [TransactionalPush](#TransactionalPush) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.preDeployTasks(metadata)](#TransactionalPush.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#TransactionalPush.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + + + +### TransactionalPush.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares for deployment + +**Kind**: static method of [TransactionalPush](#TransactionalPush) +**Returns**: TYPE.MetadataTypeItem - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### TransactionalPush.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [TransactionalPush](#TransactionalPush) +**Returns**: TYPE.MetadataTypeItem - a single item + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +## TransactionalSMS ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalSMS MetadataType + +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) + +* [TransactionalSMS](#TransactionalSMS) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.postDeleteTasks(customerKey)](#TransactionalSMS.postDeleteTasks) ⇒ void + * [.preDeployTasks(metadata, deployDir)](#TransactionalSMS.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [._mergeCode(metadata, deployDir, [templateName])](#TransactionalSMS._mergeCode) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#TransactionalSMS.postRetrieveTasks) ⇒ Promise.<TYPE.CodeExtractItem> + * [.prepExtractedCode(metadataScript)](#TransactionalSMS.prepExtractedCode) ⇒ Promise.<{fileExt:string, code:string}> + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#TransactionalSMS._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._isHTML(code)](#TransactionalSMS._isHTML) ⇒ boolean + * [.getFilesToCommit(keyArr)](#TransactionalSMS.getFilesToCommit) ⇒ Array.<string> + + + +### TransactionalSMS.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + + + +### TransactionalSMS.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares for deployment + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | +| deployDir | string | directory of deploy files | + + + +### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#TransactionalSMS.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<string> - content for metadata.script + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | + + + +### TransactionalSMS.postRetrieveTasks(metadata) ⇒ Promise.<TYPE.CodeExtractItem> +manages post retrieve steps + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<TYPE.CodeExtractItem> - Array with one metadata object and one ssjs string + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Promise.<{fileExt:string, code:string}> +helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested) + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<{fileExt:string, code:string}> - returns found extension and file content + +| Param | Type | Description | +| --- | --- | --- | +| metadataScript | string | the code of the file | + + + +### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition) +handles extracted code if any are found for complex types + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + + +### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested) +handles extracted code if any are found for complex types + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | + + + +### TransactionalSMS.\_isHTML(code) ⇒ boolean +very simplified test for HTML code in our SMS + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: boolean - true if HTML is found + +| Param | Type | Description | +| --- | --- | --- | +| code | string | sms source code | + + + +### TransactionalSMS.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +## TriggeredSend ⇐ [MetadataType](#MetadataType) +MessageSendActivity MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#TriggeredSend.create) ⇒ Promise + * [.update(metadata)](#TriggeredSend.update) ⇒ Promise + * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean> + * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void + * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.refresh([keyArr], [checkKey])](#TriggeredSend.refresh) ⇒ Promise.<void> + * [.getKeysForValidTSDs(metadata)](#TriggeredSend.getKeysForValidTSDs) ⇒ Promise.<Array.<string>> + * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean> + + + +### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### TriggeredSend.create(metadata) ⇒ Promise +Create a single TSD. + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | + + + +### TriggeredSend.update(metadata) ⇒ Promise +Updates a single TSD. + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | + + + +### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<boolean> - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void +parses retrieved Metadata before saving + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: TYPE.MetadataTypeItem \| void - Array with one metadata object and one sql string + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a TSD for deployment + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: TYPE.MetadataTypeItem - metadata object + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | of a single TSD | + + + +### TriggeredSend.refresh([keyArr], [checkKey]) ⇒ Promise.<void> +TSD-specific refresh method that finds active TSDs and refreshes them + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<void> - - + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [keyArr] | Array.<string> | | metadata keys | +| [checkKey] | boolean | true | whether to check if the key is valid | + + + +### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>> +helper for [refresh](#TriggeredSend.refresh) that extracts the keys from the TSD item map and eli + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<Array.<string>> - keyArr + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeMapObj | TSD item map | + + + +### TriggeredSend.findRefreshableItems([assetLoaded]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +helper for [refresh](#TriggeredSend.refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](#TriggeredSend.retrieve) is using to avoid refreshing TSDs with broken dependencies + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of TSD item map + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [assetLoaded] | boolean | false | if run after Asset.deploy via --refresh option this will skip caching assets | + + + +### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean> +helper for [refresh](#TriggeredSend.refresh) that pauses, publishes and starts a triggered send + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<boolean> - true if refresh was successful + +| Param | Type | Description | +| --- | --- | --- | +| key | string | external key of triggered send item | +| checkKey | boolean | whether to check if key exists on the server | + + + +## User ⇐ [MetadataType](#MetadataType) +MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [User](#User) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [__], [key])](#User.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#User.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#User.create) ⇒ Promise + * [.update(metadata)](#User.update) ⇒ Promise + * [.preDeployTasks(metadata)](#User.preDeployTasks) ⇒ TYPE.UserDocument + * [.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#User.createOrUpdate) ⇒ void + * [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ Promise.<void> + * [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ object + * [.retrieveChangelog()](#User.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.document([metadata])](#User.document) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void + + + +### User.retrieve(retrieveDir, _, [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +### User.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching + +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### User.create(metadata) ⇒ Promise +Create a single item. + +**Kind**: static method of [User](#User) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | + + + +### User.update(metadata) ⇒ Promise +Updates a single item. + +**Kind**: static method of [User](#User) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | + + + +### User.preDeployTasks(metadata) ⇒ TYPE.UserDocument +prepares a item for deployment + +**Kind**: static method of [User](#User) +**Returns**: TYPE.UserDocument - metadata object + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.UserDocument | of a single item | + + + +### User.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ void +helper for [upsert](#MetadataType.upsert) + +**Kind**: static method of [User](#User) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.UserDocumentDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.UserDocument> | list of items to create | + + + +### User.postDeployTasks(upsertResults) ⇒ Promise.<void> +Gets executed after deployment of metadata type + +**Kind**: static method of [User](#User) +**Returns**: Promise.<void> - promise + +| Param | Type | Description | +| --- | --- | --- | +| upsertResults | TYPE.UserDocumentMap | metadata mapped by their keyField | + + + +### User.\_getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale]) ⇒ object +helper for [User._prepareRoleAssignments](User._prepareRoleAssignments) + +**Kind**: static method of [User](#User) +**Returns**: object - format needed by API + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| roleId | string | | role.ObjectID | +| roleName | string | | role.Name | +| userId | number | | user.AccountUserID | +| assignmentOnly | boolean | | if true, only assignment configuration will be returned | +| [isRoleRemovale] | boolean | false | if true, role will be removed from user; otherwise added | + + + +### User.retrieveChangelog() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | + + + +### User.document([metadata]) ⇒ Promise.<void> +Creates markdown documentation of all roles + +**Kind**: static method of [User](#User) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| [metadata] | TYPE.MetadataTypeMap | user list | + + + +### User.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void +manages post retrieve steps + +**Kind**: static method of [User](#User) +**Returns**: TYPE.MetadataTypeItem \| void - a single item + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +## Verification ⇐ [MetadataType](#MetadataType) +Verification MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [Verification](#Verification) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], key)](#Verification.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.handleRESTErrors(ex, id)](#Verification.handleRESTErrors) ⇒ null + * [.retrieveForCache()](#Verification.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#Verification.create) ⇒ Promise + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#Verification.postCreateTasks) ⇒ void + * [.update(metadata)](#Verification.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem + * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem + * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> + + + +### Verification.retrieve(retrieveDir, [_], [__], key) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Verification Activity. + +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| key | string | customer key of single item to retrieve | + + + +### Verification.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) + +**Kind**: static method of [Verification](#Verification) +**Returns**: null - - + +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | exception | +| id | string | id or key of item | + + + +### Verification.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity for caching + +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### Verification.create(metadata) ⇒ Promise +Creates a single Data Extract + +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.VerificationItem | a single Data Extract | + + + +### Verification.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) + +**Kind**: static method of [Verification](#Verification) + +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | + + + +### Verification.update(metadata) ⇒ Promise +Updates a single Data Extract + +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.VerificationItem | a single Data Extract | + + + +### Verification.preDeployTasks(metadata) ⇒ TYPE.VerificationItem +prepares a verification for deployment + +**Kind**: static method of [Verification](#Verification) +**Returns**: TYPE.VerificationItem - metadata object + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.VerificationItem | a single verification activity definition | + + + +### Verification.postRetrieveTasks(metadata) ⇒ TYPE.VerificationItem +parses retrieved Metadata before saving + +**Kind**: static method of [Verification](#Verification) +**Returns**: TYPE.VerificationItem - Array with one metadata object and one sql string + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.VerificationItem | a single verification activity definition | + + + +### Verification.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<boolean> - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| key | string | Identifier of item | + + + +## Retriever +Retrieves metadata from a business unit and saves it to the local filesystem. + +**Kind**: global class + +* [Retriever](#Retriever) + * [new Retriever(properties, buObject)](#new_Retriever_new) + * [.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly])](#Retriever+retrieve) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [._getTypeDependencies(metadataTypes)](#Retriever+_getTypeDependencies) ⇒ Array.<TYPE.SupportedMetadataTypes> + + + +### new Retriever(properties, buObject) +Creates a Retriever, uses v2 auth if v2AuthOptions are passed. + + +| Param | Type | Description | +| --- | --- | --- | +| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | +| buObject | TYPE.BuObject | properties for auth | + + + +### retriever.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly]) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Retrieve metadata of specified types into local file system and Retriever.metadata + +**Kind**: instance method of [Retriever](#Retriever) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} + +| Param | Type | Description | +| --- | --- | --- | +| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | +| [namesOrKeys] | Array.<string> \| TYPE.TypeKeyCombo | name of Metadata to retrieveAsTemplate or list of keys for normal retrieval | +| [templateVariables] | TYPE.TemplateMap | Object of values which can be replaced (in case of templating) | +| [changelogOnly] | boolean | skip saving, only create json in memory | + + + +### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes> +helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of the given types + +**Kind**: instance method of [Retriever](#Retriever) +**Returns**: Array.<TYPE.SupportedMetadataTypes> - unique list dependent metadata types + +| Param | Type | Description | +| --- | --- | --- | +| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | + + + +## Mcdev +main class + +**Kind**: global class + +* [Mcdev](#Mcdev) + * [.version()](#Mcdev.version) ⇒ string + * [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ void + * [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ void + * [.setOptions(argv)](#Mcdev.setOptions) ⇒ void + * [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> + * [.selectTypes()](#Mcdev.selectTypes) ⇒ Promise + * [.explainTypes()](#Mcdev.explainTypes) ⇒ Array.<object> + * [.upgrade()](#Mcdev.upgrade) ⇒ Promise.<boolean> + * [.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly])](#Mcdev.retrieve) ⇒ Promise.<object> + * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Mcdev.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> + * [.initProject([credentialsName])](#Mcdev.initProject) ⇒ Promise.<void> + * [.joinProject()](#Mcdev.joinProject) ⇒ Promise.<void> + * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> + * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> + * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> + * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> + * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> + * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Mcdev.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [.buildDefinition(businessUnit, selectedType, name, market)](#Mcdev.buildDefinition) ⇒ Promise.<void> + * [.buildDefinitionBulk(listName, type, name)](#Mcdev.buildDefinitionBulk) ⇒ Promise.<void> + * [.getFilesToCommit(businessUnit, selectedType, keyArr)](#Mcdev.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.schedule(businessUnit, [selectedType], [keys])](#Mcdev.schedule) ⇒ Promise.<Object.<string, Array.<string>>> + * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> + * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> + * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> + * [.version()](#Mcdev.version) ⇒ string + * [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ void + * [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ void + * [.setOptions(argv)](#Mcdev.setOptions) ⇒ void + * [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> + * [.selectTypes()](#Mcdev.selectTypes) ⇒ Promise + * [.explainTypes()](#Mcdev.explainTypes) ⇒ Array.<object> + * [.upgrade()](#Mcdev.upgrade) ⇒ Promise.<boolean> + * [.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly])](#Mcdev.retrieve) ⇒ Promise.<object> + * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Mcdev.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> + * [.initProject([credentialsName])](#Mcdev.initProject) ⇒ Promise.<void> + * [.joinProject()](#Mcdev.joinProject) ⇒ Promise.<void> + * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> + * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> + * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> + * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> + * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> + * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Mcdev.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [.buildDefinition(businessUnit, selectedType, name, market)](#Mcdev.buildDefinition) ⇒ Promise.<void> + * [.buildDefinitionBulk(listName, type, name)](#Mcdev.buildDefinitionBulk) ⇒ Promise.<void> + * [.getFilesToCommit(businessUnit, selectedType, keyArr)](#Mcdev.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.schedule(businessUnit, [selectedType], [keys])](#Mcdev.schedule) ⇒ Promise.<Object.<string, Array.<string>>> + * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> + * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> + * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> + + + +### Mcdev.version() ⇒ string +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: string - current version of mcdev + + +### Mcdev.setSkipInteraction([skipInteraction]) ⇒ void +helper method to use unattended mode when including mcdev as a package + +**Kind**: static method of [Mcdev](#Mcdev) + +| Param | Type | Description | +| --- | --- | --- | +| [skipInteraction] | boolean \| TYPE.skipInteraction | signals what to insert automatically for things usually asked via wizard | + + + +### Mcdev.setLoggingLevel(argv) ⇒ void +configures what is displayed in the console + +**Kind**: static method of [Mcdev](#Mcdev) + +| Param | Type | Description | +| --- | --- | --- | +| argv | object | list of command line parameters given by user | +| [argv.silent] | boolean | only errors printed to CLI | +| [argv.verbose] | boolean | chatty user CLI output | +| [argv.debug] | boolean | enables developer output & features | + + + +### Mcdev.setOptions(argv) ⇒ void +allows setting system wide / command related options + +**Kind**: static method of [Mcdev](#Mcdev) + +| Param | Type | Description | +| --- | --- | --- | +| argv | object | list of command line parameters given by user | + + + +### Mcdev.createDeltaPkg(argv) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> +handler for 'mcdev createDeltaPkg + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - list of changed items + +| Param | Type | Description | +| --- | --- | --- | +| argv | object | yargs parameters | +| [argv.range] | string | git commit range into deploy directory | +| [argv.filter] | string | filter file paths that start with any | +| [argv.diffArr] | Array.<TYPE.DeltaPkgItem> | list of files to include in delta package (skips git diff when provided) | + + + +### Mcdev.selectTypes() ⇒ Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise - . + + +### Mcdev.explainTypes() ⇒ Array.<object> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Array.<object> - list of supported types with their apiNames + + +### Mcdev.upgrade() ⇒ Promise.<boolean> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<boolean> - success flag + + +### Mcdev.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly]) ⇒ Promise.<object> +Retrieve all metadata from the specified business unit into the local file system. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<object> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> \| TYPE.TypeKeyCombo | limit retrieval to given metadata type | +| [keys] | Array.<string> | limit retrieval to given metadata key | +| [changelogOnly] | boolean | skip saving, only create json in memory | + + + +### Mcdev.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> +Deploys all metadata located in the 'deploy' directory to the specified business unit + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | +| [keyArr] | Array.<string> | limit deployment to given metadata keys | + + + +### Mcdev.initProject([credentialsName]) ⇒ Promise.<void> +Creates template file for properties.json + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| [credentialsName] | string | identifying name of the installed package / project | + + + +### Mcdev.joinProject() ⇒ Promise.<void> +Clones an existing project from git repository and installs it + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + + +### Mcdev.findBUs(credentialsName) ⇒ Promise.<void> +Refreshes BU names and ID's from MC instance + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| credentialsName | string | identifying name of the installed package / project | + + + +### Mcdev.document(businessUnit, type) ⇒ Promise.<void> +Creates docs for supported metadata types in Markdown and/or HTML format + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | metadata type | + + + +### Mcdev.deleteByKey(businessUnit, type, customerKey) ⇒ Promise.<boolean> +deletes metadata from MC instance by key + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<boolean> - true if successful, false otherwise + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | supported metadata type | +| customerKey | string | Identifier of metadata | + + + +### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | supported metadata type | +| id | string | Identifier of metadata | + + + +### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> +ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | references credentials from properties.json | +| [keyArr] | Array.<string> | metadata keys | + + + +### Mcdev.badKeys(businessUnit) ⇒ Promise.<void> +Converts metadata to legacy format. Output is saved in 'converted' directory + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | + + + +### Mcdev.retrieveAsTemplate(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Retrieve a specific metadata file and templatise. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| name | Array.<string> | name of the metadata | +| market | string | market which should be used to revert template | + + + +### Mcdev.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Build a template based on a list of metadata files in the retrieve folder. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| keyArr | Array.<string> | customerkey of the metadata | +| market | string | market localizations | + + + +### Mcdev.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<void> +Build a specific metadata file based on a template. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| name | string | name of the metadata | +| market | string | market localizations | + + + +### Mcdev.buildDefinitionBulk(listName, type, name) ⇒ Promise.<void> +Build a specific metadata file based on a template using a list of bu-market combos + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| listName | string | name of list of BU-market combos | +| type | string | supported metadata type | +| name | string | name of the metadata | + + + +### Mcdev.getFilesToCommit(businessUnit, selectedType, keyArr) ⇒ Promise.<Array.<string>> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### Mcdev.schedule(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Schedule an item (shortcut for execute --schedule) + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of scheduled item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Start/execute an item + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of executed item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +pause an item + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +### Mcdev.fixKeys(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Updates the key to match the name field + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +### Mcdev.version() ⇒ string +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: string - current version of mcdev + + +### Mcdev.setSkipInteraction([skipInteraction]) ⇒ void +helper method to use unattended mode when including mcdev as a package + +**Kind**: static method of [Mcdev](#Mcdev) + +| Param | Type | Description | +| --- | --- | --- | +| [skipInteraction] | boolean \| TYPE.skipInteraction | signals what to insert automatically for things usually asked via wizard | + + + +### Mcdev.setLoggingLevel(argv) ⇒ void +configures what is displayed in the console + +**Kind**: static method of [Mcdev](#Mcdev) + +| Param | Type | Description | +| --- | --- | --- | +| argv | object | list of command line parameters given by user | +| [argv.silent] | boolean | only errors printed to CLI | +| [argv.verbose] | boolean | chatty user CLI output | +| [argv.debug] | boolean | enables developer output & features | + + + +### Mcdev.setOptions(argv) ⇒ void +allows setting system wide / command related options + +**Kind**: static method of [Mcdev](#Mcdev) + +| Param | Type | Description | +| --- | --- | --- | +| argv | object | list of command line parameters given by user | + + + +### Mcdev.createDeltaPkg(argv) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> +handler for 'mcdev createDeltaPkg + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - list of changed items + +| Param | Type | Description | +| --- | --- | --- | +| argv | object | yargs parameters | +| [argv.range] | string | git commit range into deploy directory | +| [argv.filter] | string | filter file paths that start with any | +| [argv.diffArr] | Array.<TYPE.DeltaPkgItem> | list of files to include in delta package (skips git diff when provided) | + + + +### Mcdev.selectTypes() ⇒ Promise +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise - . + + +### Mcdev.explainTypes() ⇒ Array.<object> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Array.<object> - list of supported types with their apiNames + + +### Mcdev.upgrade() ⇒ Promise.<boolean> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<boolean> - success flag + + +### Mcdev.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly]) ⇒ Promise.<object> +Retrieve all metadata from the specified business unit into the local file system. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<object> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> \| TYPE.TypeKeyCombo | limit retrieval to given metadata type | +| [keys] | Array.<string> | limit retrieval to given metadata key | +| [changelogOnly] | boolean | skip saving, only create json in memory | + + + +### Mcdev.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> +Deploys all metadata located in the 'deploy' directory to the specified business unit + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | +| [keyArr] | Array.<string> | limit deployment to given metadata keys | + + + +### Mcdev.initProject([credentialsName]) ⇒ Promise.<void> +Creates template file for properties.json + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| [credentialsName] | string | identifying name of the installed package / project | + + + +### Mcdev.joinProject() ⇒ Promise.<void> +Clones an existing project from git repository and installs it + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + + +### Mcdev.findBUs(credentialsName) ⇒ Promise.<void> +Refreshes BU names and ID's from MC instance + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| credentialsName | string | identifying name of the installed package / project | + + + +### Mcdev.document(businessUnit, type) ⇒ Promise.<void> +Creates docs for supported metadata types in Markdown and/or HTML format + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | metadata type | + + + +### Mcdev.deleteByKey(businessUnit, type, customerKey) ⇒ Promise.<boolean> +deletes metadata from MC instance by key + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<boolean> - true if successful, false otherwise + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | supported metadata type | +| customerKey | string | Identifier of metadata | + + + +### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | supported metadata type | +| id | string | Identifier of metadata | + + + +### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> +ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| type | string | references credentials from properties.json | +| [keyArr] | Array.<string> | metadata keys | + + + +### Mcdev.badKeys(businessUnit) ⇒ Promise.<void> +Converts metadata to legacy format. Output is saved in 'converted' directory + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | + + + +### Mcdev.retrieveAsTemplate(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Retrieve a specific metadata file and templatise. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| name | Array.<string> | name of the metadata | +| market | string | market which should be used to revert template | + + + +### Mcdev.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Build a template based on a list of metadata files in the retrieve folder. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| keyArr | Array.<string> | customerkey of the metadata | +| market | string | market localizations | + + + +### Mcdev.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<void> +Build a specific metadata file based on a template. + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| name | string | name of the metadata | +| market | string | market localizations | + + + +### Mcdev.buildDefinitionBulk(listName, type, name) ⇒ Promise.<void> +Build a specific metadata file based on a template using a list of bu-market combos + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| listName | string | name of list of BU-market combos | +| type | string | supported metadata type | +| name | string | name of the metadata | + + + +### Mcdev.getFilesToCommit(businessUnit, selectedType, keyArr) ⇒ Promise.<Array.<string>> +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | references credentials from properties.json | +| selectedType | string | supported metadata type | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### Mcdev.schedule(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Schedule an item (shortcut for execute --schedule) + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of scheduled item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Start/execute an item + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of executed item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +pause an item + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +### Mcdev.fixKeys(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +Updates the key to match the name field + +**Kind**: static method of [Mcdev](#Mcdev) +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys + +| Param | Type | Description | +| --- | --- | --- | +| businessUnit | string | name of BU | +| selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +## Asset ⇐ [MetadataType](#MetadataType) +FileTransfer MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + + + +### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves Metadata of Asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | - | +| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | +| [key] | string | customer key | + + + +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves asset metadata for caching + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | + + + +### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> +Retrieves asset metadata for templating + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | + + + +### Asset.create(metadata) ⇒ Promise +Creates a single asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | + + + +### Asset.update(metadata) ⇒ Promise +Updates a single asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | + + + +### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise +Retrieves Metadata of a specific asset type + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| [retrieveDir] | string | target directory for saving assets | +| [templateName] | string | name of the metadata file | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| key | string | customer key to filter by | + + + +### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise +Retrieves extended metadata (files or extended content) of asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| items | Array | array of items to retrieve | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> +Some metadata types store their actual content as a separate file, e.g. images +This method retrieves these and saves them alongside the metadata json + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | + + + +### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> +helper for [preDeployTasks](#Asset.preDeployTasks) +Some metadata types store their actual content as a separate file, e.g. images +This method reads these from the local FS stores them in the metadata object allowing to deploy it + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<string> - if found will return the path of the binary file + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset | +| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | +| deployDir | string | | directory of deploy files | +| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | + + + +### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - metadata + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | + + + +### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +Gets executed after deployment of metadata type + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | + + + +### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> +prepares an asset definition for deployment + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetItem> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | +| deployDir | string | directory of deploy files | + + + +### Asset.\_getMainSubtype(extendedSubType) ⇒ string +find the subType matching the extendedSubType + +**Kind**: static method of [Asset](#Asset) +**Returns**: string - subType: block, message, other, etc + +| Param | Type | Description | +| --- | --- | --- | +| extendedSubType | string | webpage, htmlblock, etc | + + + +### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + + + +### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | + +**Example** +```js +assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +``` + + +### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | + + + +### Asset.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve + +**Kind**: static method of [Asset](#Asset) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | + + + +### Asset.setFolderId(metadata) +Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy + +**Kind**: static method of [Asset](#Asset) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset definition | +| deployDir | string | | directory of deploy files | +| subType | TYPE.AssetSubType | | asset-subtype name | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | + + + +### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| prefix | string | | usually the customerkey | +| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| readDirArr | Array.<string> | | directory of deploy files | +| subtypeExtension | string | | asset-subtype name ending on -meta | +| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | +| fileList | Array.<object> | | directory of files w/o leading deploy dir | +| customerKey | string | | external key of template (could have been changed if used during templating) | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | + + + +### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem +helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it +to allow saving that separately and formatted + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } | Param | Type | Description | | --- | --- | --- | -| url | string | endpoint | -| key | string | Identifier of metadata | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.AssetItem | a single asset definition | - + -### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object -Returns metadata of a business unit that is saved locally +### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void +**Kind**: static method of [Asset](#Asset) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - Metadata of BU in local directory +| Param | Type | Description | +| --- | --- | --- | +| prefix | string | usually the customerkey | +| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| codeArr | Array.<object> | to be extended array for extracted code | + + + +### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their fileName without '.json' ending + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| readDir | string | root directory of metadata. | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | -| [buMetadata] | object | Metadata of BU in local directory | +| dir | string | directory that contains '.json' files to be read | +| [_] | void | unused parameter | +| selectedSubType | Array.<string> | asset, message, ... | - + -### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> +### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> +check template directory for complex types that open subfolders for their subtypes + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetSubType> - subtype name + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | + + + +### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem +optional method used for some types to try a different folder structure + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.AssetItem - metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | + + + +### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> should return only the json for all but asset, query and script that are saved as multiple files additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Asset](#Asset) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | | keyArr | Array.<string> | customerkey of the metadata | - + -### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - list of keys +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| customerKey | string | Identifier of data extension | - + -## MobileCode ⇐ [MetadataType](#MetadataType) -MobileCode MetadataType +### Asset.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) -* [MobileCode](#MobileCode) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileCode.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#MobileCode.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | - + -### MobileCode.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. +### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found + +| Param | Type | Description | +| --- | --- | --- | +| id | string | Identifier of metadata | + + + +### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves Metadata of Asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| _ | void | - | +| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | +| [key] | string | customer key | - + -### MobileCode.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves asset metadata for caching -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise -## MobileKeyword ⇐ [MetadataType](#MetadataType) -MobileKeyword MetadataType +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | + + + +### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> +Retrieves asset metadata for templating + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | + + + +### Asset.create(metadata) ⇒ Promise +Creates a single asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | + + + +### Asset.update(metadata) ⇒ Promise +Updates a single asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | + + + +### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise +Retrieves Metadata of a specific asset type + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| [retrieveDir] | string | target directory for saving assets | +| [templateName] | string | name of the metadata file | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| key | string | customer key to filter by | + + + +### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise +Retrieves extended metadata (files or extended content) of asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| items | Array | array of items to retrieve | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | + + + +### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> +Some metadata types store their actual content as a separate file, e.g. images +This method retrieves these and saves them alongside the metadata json + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | + + + +### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> +helper for [preDeployTasks](#Asset.preDeployTasks) +Some metadata types store their actual content as a separate file, e.g. images +This method reads these from the local FS stores them in the metadata object allowing to deploy it + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<string> - if found will return the path of the binary file + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset | +| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | +| deployDir | string | | directory of deploy files | +| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | + + -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -* [MobileKeyword](#MobileKeyword) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(metadata)](#MobileKeyword.create) ⇒ Promise - * [.update(metadata)](#MobileKeyword.update) ⇒ Promise - * [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - * [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ Object - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileKeyword._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.preDeployTasks(metadata, deployDir)](#MobileKeyword.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileKeyword.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileKeyword.postUpdateTasks) ⇒ void - * [._mergeCode(metadata, deployDir, [templateName])](#MobileKeyword._mergeCode) ⇒ Promise.<string> - * [.deleteByKey(key)](#MobileKeyword.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#MobileKeyword.postDeleteTasks) ⇒ void - * [.getFilesToCommit(keyArr)](#MobileKeyword.getFilesToCommit) ⇒ Array.<string> +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - metadata - +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | -### MobileKeyword.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. + -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata +### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +Gets executed after deployment of metadata type + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> +prepares an asset definition for deployment -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetItem> - Promise | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +| metadata | TYPE.AssetItem | a single asset | +| deployDir | string | directory of deploy files | - + -### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### Asset.\_getMainSubtype(extendedSubType) ⇒ string +find the subType matching the extendedSubType -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [Asset](#Asset) +**Returns**: string - subType: block, message, other, etc | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| extendedSubType | string | webpage, htmlblock, etc | - + -### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -retrieve an item and create a template from it +### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| key | string | name of the metadata file | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +``` + -### MobileKeyword.create(metadata) ⇒ Promise -Creates a single item +### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### MobileKeyword.update(metadata) ⇒ Promise -Updates a single item +### Asset.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### MobileKeyword.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void -manages post retrieve steps +### Asset.setFolderId(metadata) +Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single item | - + -### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object -helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested) +### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Object - returns found extension and file content +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset definition | +| deployDir | string | | directory of deploy files | +| subType | TYPE.AssetSubType | | asset-subtype name | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | + + + +### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| prefix | string | | usually the customerkey | +| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| readDirArr | Array.<string> | | directory of deploy files | +| subtypeExtension | string | | asset-subtype name ending on -meta | +| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | +| fileList | Array.<object> | | directory of files w/o leading deploy dir | +| customerKey | string | | external key of template (could have been changed if used during templating) | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | + + + +### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem +helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it +to allow saving that separately and formatted + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } | Param | Type | Description | | --- | --- | --- | -| metadataScript | string | the code of the file | - - +| metadata | TYPE.AssetItem | a single asset definition | -### MobileKeyword.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types + -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| prefix | string | usually the customerkey | +| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| codeArr | Array.<object> | to be extended array for extracted code | - + -### MobileKeyword.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their fileName without '.json' ending -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - +| dir | string | directory that contains '.json' files to be read | +| [_] | void | unused parameter | +| selectedSubType | Array.<string> | asset, message, ... | -### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested) -handles extracted code if any are found for complex types + -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> +check template directory for complex types that open subfolders for their subtypes + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetSubType> - subtype name | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| templateName | string | name of the metadata file | - + -### MobileKeyword.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares an event definition for deployment +### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem +optional method used for some types to try a different folder structure -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.AssetItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileKeyword | -| deployDir | string | directory of deploy files | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | - + -### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) +### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Kind**: static method of [Asset](#Asset) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| keyArr | Array.<string> | customerkey of the metadata | - + -### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| customerKey | string | Identifier of data extension | - + -### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileKeyword.preDeployTasks) that loads extracted code content back into JSON +### Asset.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<string> - content for metadata.script +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | +| customerKey | string | Identifier of metadata item | - + -### MobileKeyword.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| id | string | Identifier of metadata | - + -### MobileKeyword.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +## MetadataType +MetadataType class that gets extended by their specific metadata type class. +Provides default functionality that can be overwritten by child metadata type classes -**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Kind**: global class -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | +* [MetadataType](#MetadataType) + * [.client](#MetadataType.client) : TYPE.SDK + * [.properties](#MetadataType.properties) : TYPE.Mcdevrc + * [.subType](#MetadataType.subType) : string + * [.buObject](#MetadataType.buObject) : TYPE.BuObject + * [.client](#MetadataType.client) : TYPE.SDK + * [.properties](#MetadataType.properties) : TYPE.Mcdevrc + * [.subType](#MetadataType.subType) : string + * [.buObject](#MetadataType.buObject) : TYPE.BuObject + * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> + * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void + * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.setFolderPath(metadata)](#MetadataType.setFolderPath) + * [.setFolderId(metadata)](#MetadataType.setFolderId) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> + * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void + * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void + * [.refresh()](#MetadataType.refresh) ⇒ void + * [.execute()](#MetadataType.execute) ⇒ void + * [.pause()](#MetadataType.pause) ⇒ void + * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean + * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean + * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null + * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null + * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null + * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null + * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) + * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null + * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> + * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> + * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> + * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void + * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void + * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void + * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void + * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void + * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean + * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string + * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object + * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void + * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void + * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> + * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> + * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> + * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> + * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object + * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> + * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> + * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void + * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.setFolderPath(metadata)](#MetadataType.setFolderPath) + * [.setFolderId(metadata)](#MetadataType.setFolderId) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> + * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void + * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void + * [.refresh()](#MetadataType.refresh) ⇒ void + * [.execute()](#MetadataType.execute) ⇒ void + * [.pause()](#MetadataType.pause) ⇒ void + * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean + * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean + * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null + * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null + * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null + * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null + * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) + * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null + * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> + * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> + * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> + * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void + * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void + * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void + * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void + * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void + * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean + * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string + * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object + * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void + * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void + * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> + * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> + * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> + * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> + * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object + * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - + -### MobileKeyword.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.client : TYPE.SDK +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.properties : TYPE.Mcdevrc +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.subType : string +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.buObject : TYPE.BuObject +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.client : TYPE.SDK +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.properties : TYPE.Mcdevrc +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.subType : string +**Kind**: static property of [MetadataType](#MetadataType) + + +### MetadataType.buObject : TYPE.BuObject +**Kind**: static property of [MetadataType](#MetadataType) + -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | - + -## MobileMessage ⇐ [MetadataType](#MetadataType) -MobileMessage MetadataType +### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> +Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - Fieldnames -* [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#MobileMessage.update) ⇒ Promise - * [.create(metadata)](#MobileMessage.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> - * [.prepExtractedCode(code)](#MobileMessage.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#MobileMessage.getFilesToCommit) ⇒ Array.<string> - * [.postRetrieveTasks(metadata)](#MobileMessage.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.preDeployTasks(metadata, deployDir)](#MobileMessage.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileMessage.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileMessage.postUpdateTasks) ⇒ void - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileMessage._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.deleteByKey(id)](#MobileMessage.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [isCaching] | boolean | if true, then check if field should be skipped for caching | - + -### MobileMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords +### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### MobileMessage.update(metadata) ⇒ Promise -Updates a single item +### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - + -### MobileMessage.create(metadata) ⇒ Promise -Creates a single item +### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON +### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> +helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<string> - code +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### MobileMessage.prepExtractedCode(code) ⇒ Object -helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested) +### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Object - returns found extension and file content +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeItem - cloned metadata | Param | Type | Description | | --- | --- | --- | -| code | string | the code of the file | +| metadata | TYPE.MetadataTypeItem | a single item | +| targetDir | string | folder where retrieves should be saved | +| [isTemplating] | boolean | signals that we are retrieving templates | - + -### MobileMessage.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MobileMessage.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### MetadataType.setFolderId(metadata) +generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MobileMessage.preDeployTasks(metadata, deployDir) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment +### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.MetadataTypeItem - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileMessage | -| deployDir | string | directory of deploy files | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | - + -### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) +### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: static method of [MobileMessage](#MobileMessage) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [MobileMessage](#MobileMessage) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | - + -### MobileMessage.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| [subType] | string | optionally limit to a single subtype | - + -### MobileMessage.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> +Retrieve a specific Script by Name -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| name | string | name (not key) of the metadata item | -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - + -### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested) -handles extracted code if any are found for complex types +### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| templateDir | string | (List of) Directory where built definitions will be saved | +| key | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### MobileMessage.deleteByKey(id) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit -! the endpoint expects the ID and not a key but for mcdev in this case key==id +### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +Gets executed before deploying metadata -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item | Param | Type | Description | | --- | --- | --- | -| id | string | Identifier of item | +| metadata | TYPE.MetadataTypeItem | a single metadata item | +| deployDir | string | folder where files for deployment are stored | - + -## Query ⇐ [MetadataType](#MetadataType) -Query MetadataType +### MetadataType.create(metadata, deployDir) ⇒ void +Abstract create method that needs to be implemented in child metadata type -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) -* [Query](#Query) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.execute(keyArr)](#Query.execute) ⇒ Promise.<Array.<string>> - * [.retrieveForCache()](#Query.retrieveForCache) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Query.retrieveAsTemplate) ⇒ Promise.<{metadata: Query, type: string}> - * [.postRetrieveTasks(metadata)](#Query.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.create(query)](#Query.create) ⇒ Promise - * [.update(query)](#Query.update) ⇒ Promise - * [.preDeployTasks(metadata, deployDir)](#Query.preDeployTasks) ⇒ Promise.<TYPE.QueryItem> - * [.applyTemplateValues(code, templateVariables)](#Query.applyTemplateValues) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> - * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void - * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void - * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| deployDir | string | directory where deploy metadata are saved | - + -### Query.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves Metadata of queries +### MetadataType.update(metadata, [metadataBefore]) ⇒ void +Abstract update method that needs to be implemented in child metadata type -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - + -### Query.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API +### MetadataType.refresh() ⇒ void +Abstract refresh method that needs to be implemented in child metadata type -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed successfully +**Kind**: static method of [MetadataType](#MetadataType) + -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +### MetadataType.execute() ⇒ void +Abstract execute method that needs to be implemented in child metadata type - +**Kind**: static method of [MetadataType](#MetadataType) + -### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves query metadata for caching +### MetadataType.pause() ⇒ void +Abstract pause method that needs to be implemented in child metadata type -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata - +**Kind**: static method of [MetadataType](#MetadataType) + -### Query.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: Query, type: string}> -Retrieve a specific Query by Name +### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: Query, type: string}> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true if metadata was changed | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | - + -### Query.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment -**Kind**: static method of [Query](#Query) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true on first identified deviation or false if none are found | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.QueryItem | a single query | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | +| [silent] | boolean | optionally suppress logging | - + -### Query.create(query) ⇒ Promise -Creates a single query +### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> +MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| query | TYPE.QueryItem | a single query | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | - + -### Query.update(query) ⇒ Promise -Updates a single query +### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| query | TYPE.QueryItem | a single query | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### Query.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.QueryItem> -prepares a Query for deployment +### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null +Creates a single metadata entry via REST -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<TYPE.QueryItem> - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.QueryItem | a single query activity | -| deployDir | string | directory of deploy files | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| uri | string | rest endpoint for POST | - + -### Query.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#Query.buildDefinitionForNested) -searches extracted SQL file for template variables and applies the market values +### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Creates a single metadata entry via fuel-soap (generic lib not wrapper) -**Kind**: static method of [Query](#Query) -**Returns**: string - code with markets applied +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### Query.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null +Updates a single metadata entry via REST -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | +| uri | string | | rest endpoint for PATCH | +| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | + + + +### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Updates a single metadata entry via fuel-soap (generic lib not wrapper) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | -### Query.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types + -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| ex | Error | error that occured | +| msg | 'creating' \| 'updating' | what to print in the log | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | -**Example** -```js -queries are saved as 1 json and 1 sql file. both files need to be run through templating -``` - + -### Query.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.getSOAPErrorMsg(ex) ⇒ string +helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - error message | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| ex | Error | error that occured | - + -### Query.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts +### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| ex | object | response payload from REST API | - - +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit + -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<boolean> - deletion success flag +### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +Retrieves Metadata for Rest Types + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | - - +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| [singleRetrieve] | string \| number | key of single item to filter by | -### Query.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item + -**Kind**: static method of [Query](#Query) +### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | +| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | +| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | - + -### Query.postDeployTasks(upsertResults) -Gets executed after deployment of metadata type +### MetadataType.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) -**Kind**: static method of [Query](#Query) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| ex | Error | exception | +| id | string | id or key of item | - + -## Role ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> +Used to execute a query/automation etc. -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) -* [Role](#Role) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [___], [key])](#Role.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.preDeployTasks(metadata)](#Role.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.create(metadata)](#Role.create) ⇒ Promise - * [.update(metadata)](#Role.update) ⇒ Promise - * [.document([metadata])](#Role.document) ⇒ Promise.<void> - * [._traverseRoles(role, element, [permission], [isAllowed])](#Role._traverseRoles) ⇒ void +| Param | Type | Description | +| --- | --- | --- | +| uri | string | REST endpoint where the POST request should be sent | +| key | string | item key | - + -### Role.retrieve(retrieveDir, _, [___], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> +Used to execute a query/automation etc. -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Metadata store object +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:object}> - metadata key and API response | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [___] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | - + -### Role.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed before deploying metadata +### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> +helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) -**Kind**: static method of [Role](#Role) -**Returns**: TYPE.MetadataTypeItem - Promise of a single metadata item +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | +| [singleRetrieve] | string \| number | key of single item to filter by | +| metadataMap | TYPE.MetadataTypeMap | saved metadata | - + -### Role.create(metadata) ⇒ Promise -Create a single Role. +### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### Role.update(metadata) ⇒ Promise -Updates a single Role. +### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void +Deletes a field in a metadata entry if the selected definition property equals false. -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | +| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | +| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | +| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | - +**Example** +```js +Removes field (or nested fields childs) that are not updateable +deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); +``` + -### Role.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles +### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not createable -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<void> - - +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | role definitions | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### Role.\_traverseRoles(role, element, [permission], [isAllowed]) ⇒ void -iterates through permissions to output proper row-names for nested permissionss +### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not updateable -**Kind**: static method of [Role](#Role) +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| role | string | name of the user role | -| element | object | data of the permission | -| [permission] | string | name of the permission | -| [isAllowed] | string | "true" / "false" from the | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -## Script ⇐ [MetadataType](#MetadataType) -Script MetadataType +### MetadataType.keepTemplateFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the template -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) -* [Script](#Script) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> - * [.update(script)](#Script.update) ⇒ Promise - * [.create(script)](#Script.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> - * [.preDeployTasks(metadata, dir)](#Script.preDeployTasks) ⇒ TYPE.ScriptItem - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### Script.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves Metadata of Script -Endpoint /automation/v1/scripts/ return all Scripts with all details. +### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the stored metadata -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Script.retrieveForCache() ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves script metadata for caching +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise - + -### Script.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.Script, type: string}> -Retrieve a specific Script by Name +### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean +checks if the current metadata entry should be saved on retrieve or not -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.Script, type: string}> - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: skip saving == filtered; false: continue with saving | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - + -### Script.update(script) ⇒ Promise -Updates a single Script +### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean +optionally filter by what folder something is in -**Kind**: static method of [Script](#Script) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save | Param | Type | Description | | --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | +| metadataEntry | object | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - + -### Script.create(script) ⇒ Promise -Creates a single Script +### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [Script](#Script) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#Script.preDeployTasks) that loads extracted code content back into JSON +### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) +searches extracted file for template variable names and applies the market values -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<string> - content for metadata.script +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.ScriptItem | a single asset definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Script.preDeployTasks(metadata, dir) ⇒ TYPE.ScriptItem -prepares a Script for deployment +### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string +helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) +searches extracted file for template variable values and applies the market variable names -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.ScriptItem - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.ScriptItem | a single script activity definition | -| dir | string | directory of deploy files | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Script.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +handles extracted code if any are found for complex types (e.g script, asset, query) -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MetadataType](#MetadataType) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - + -### Script.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> helper for [buildTemplate](#MetadataType.buildTemplate) handles extracted code if any are found for complex types -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MetadataType](#MetadataType) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - + -### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested) -handles extracted code if any are found for complex types +### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - subtype name + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | + + + +### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object +optional method used for some types to try a different folder structure + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - metadata + +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | +| ex | Error | error from first attempt | + + + +### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Builds definition based on template +NOTE: Most metadata files should use this generic method, unless custom +parsing is required (for example scripts & queries) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| templateName | string | name of the metadata file | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.CodeExtractItem - a single item with code parts extracted +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.ScriptItem | a single item | +| ex | object | response payload from REST API | - + -### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object -helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) +### MetadataType.document([metadata], [isDeploy]) ⇒ void +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [Script](#Script) -**Returns**: Object - returns found extension and file content +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadataScript | string | the code of the file | -| metadataName | string | the name of the metadata | +| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | +| [isDeploy] | boolean | used to skip non-supported message during deploy | - + -### Script.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.resolveId(id) ⇒ Promise.<string> +get name & key for provided id -**Kind**: static method of [Script](#Script) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - key of metadata | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| id | string | Identifier of metadata | - + -### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> +### MetadataType.deleteByKey(customerKey) ⇒ boolean Delete a metadata item from the specified business unit -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -### Script.postDeleteTasks(customerKey) ⇒ void +### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> clean up after deleting a metadata item -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - Promise | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of metadata item | +| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | - + -## SendClassification ⇐ [MetadataType](#MetadataType) -SendClassification MetadataType +### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag -### SendClassification.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata | +| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | -**Kind**: static method of [SendClassification](#SendClassification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| url | string | endpoint | +| key | string | Identifier of metadata | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -## TransactionalEmail ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalEmail MetadataType +### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object +Returns metadata of a business unit that is saved locally -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - Metadata of BU in local directory -* [TransactionalEmail](#TransactionalEmail) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.update(metadata)](#TransactionalEmail.update) ⇒ Promise - * [.preDeployTasks(metadata)](#TransactionalEmail.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(_, apiResponse)](#TransactionalEmail.postCreateTasks) ⇒ void - * [.postDeployTasks()](#TransactionalEmail.postDeployTasks) ⇒ void - * [.postRetrieveTasks(metadata)](#TransactionalEmail.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#TransactionalEmail.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| readDir | string | root directory of metadata. | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| [buMetadata] | object | Metadata of BU in local directory | - + -### TransactionalEmail.update(metadata) ⇒ Promise -Updates a single item +### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | how the item shall look after the update | +| keyArr | Array.<string> | customerkey of the metadata | - + -### TransactionalEmail.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment +### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - list of keys -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - Promise +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | + + + +### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | - + -### TransactionalEmail.postCreateTasks(_, apiResponse) ⇒ void -helper for [TransactionalEmail.createREST](TransactionalEmail.createREST) +### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> +Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - Fieldnames | Param | Type | Description | | --- | --- | --- | -| _ | TYPE.MetadataTypeItem | not used | -| apiResponse | object | varies depending on the API call | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [isCaching] | boolean | if true, then check if field should be skipped for caching | - + -### TransactionalEmail.postDeployTasks() ⇒ void -Gets executed after deployment of metadata type +### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) - + -### TransactionalEmail.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - a single item +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### TransactionalEmail.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - + -## TransactionalMessage ⇐ [MetadataType](#MetadataType) -TransactionalMessage MetadataType +### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) -* [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise - * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise - * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### TransactionalMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata +### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> +helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeItem - cloned metadata | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to cache | +| metadata | TYPE.MetadataTypeItem | a single item | +| targetDir | string | folder where retrieves should be saved | +| [isTemplating] | boolean | signals that we are retrieving templates | - + -### TransactionalMessage.update(metadata) ⇒ Promise -Updates a single item +### MetadataType.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single item | - + -### TransactionalMessage.create(metadata) ⇒ Promise -Creates a single item +### MetadataType.setFolderId(metadata) +generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single item | - + -### TransactionalMessage.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | - + -## TransactionalPush ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalPush TransactionalMessage +### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata -* [TransactionalPush](#TransactionalPush) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.preDeployTasks(metadata)](#TransactionalPush.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#TransactionalPush.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### TransactionalPush.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment +### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | - + -### TransactionalPush.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - a single item +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [subType] | string | optionally limit to a single subtype | - + -## TransactionalSMS ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalSMS MetadataType +### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> +Retrieve a specific Script by Name -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise -* [TransactionalSMS](#TransactionalSMS) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.postDeleteTasks(customerKey)](#TransactionalSMS.postDeleteTasks) ⇒ void - * [.preDeployTasks(metadata, deployDir)](#TransactionalSMS.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [._mergeCode(metadata, deployDir, [templateName])](#TransactionalSMS._mergeCode) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#TransactionalSMS.postRetrieveTasks) ⇒ Promise.<TYPE.CodeExtractItem> - * [.prepExtractedCode(metadataScript)](#TransactionalSMS.prepExtractedCode) ⇒ Promise.<{fileExt:string, code:string}> - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#TransactionalSMS._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._isHTML(code)](#TransactionalSMS._isHTML) ⇒ boolean - * [.getFilesToCommit(keyArr)](#TransactionalSMS.getFilesToCommit) ⇒ Array.<string> +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| name | string | name (not key) of the metadata item | - + -### TransactionalSMS.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| templateDir | string | (List of) Directory where built definitions will be saved | +| key | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### TransactionalSMS.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares for deployment +### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +Gets executed before deploying metadata -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| deployDir | string | directory of deploy files | +| metadata | TYPE.MetadataTypeItem | a single metadata item | +| deployDir | string | folder where files for deployment are stored | - + -### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#TransactionalSMS.preDeployTasks) that loads extracted code content back into JSON +### MetadataType.create(metadata, deployDir) ⇒ void +Abstract create method that needs to be implemented in child metadata type -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<string> - content for metadata.script +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| deployDir | string | directory where deploy metadata are saved | - + -### TransactionalSMS.postRetrieveTasks(metadata) ⇒ Promise.<TYPE.CodeExtractItem> -manages post retrieve steps +### MetadataType.update(metadata, [metadataBefore]) ⇒ void +Abstract update method that needs to be implemented in child metadata type -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.CodeExtractItem> - Array with one metadata object and one ssjs string +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | + + + +### MetadataType.refresh() ⇒ void +Abstract refresh method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.execute() ⇒ void +Abstract execute method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.pause() ⇒ void +Abstract pause method that needs to be implemented in child metadata type - +**Kind**: static method of [MetadataType](#MetadataType) + -### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Promise.<{fileExt:string, code:string}> -helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested) +### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<{fileExt:string, code:string}> - returns found extension and file content +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true if metadata was changed | Param | Type | Description | | --- | --- | --- | -| metadataScript | string | the code of the file | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | - + -### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition) -handles extracted code if any are found for complex types +### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true on first identified deviation or false if none are found | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | +| [silent] | boolean | optionally suppress logging | - + -### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate) -handles extracted code if any are found for complex types +### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> +MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - + -### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested) -handles extracted code if any are found for complex types +### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### TransactionalSMS.\_isHTML(code) ⇒ boolean -very simplified test for HTML code in our SMS +### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null +Creates a single metadata entry via REST -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: boolean - true if HTML is found +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| code | string | sms source code | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| uri | string | rest endpoint for POST | - + -### TransactionalSMS.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Creates a single metadata entry via fuel-soap (generic lib not wrapper) -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -## TriggeredSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType +### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null +Updates a single metadata entry via REST -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error -* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#TriggeredSend.create) ⇒ Promise - * [.update(metadata)](#TriggeredSend.update) ⇒ Promise - * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.refresh([keyArr], [checkKey])](#TriggeredSend.refresh) ⇒ Promise.<void> - * [.getKeysForValidTSDs(metadata)](#TriggeredSend.getKeysForValidTSDs) ⇒ Promise.<Array.<string>> - * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean> +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | +| uri | string | | rest endpoint for PATCH | +| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | - + -### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Updates a single metadata entry via fuel-soap (generic lib not wrapper) -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | -### TriggeredSend.create(metadata) ⇒ Promise -Create a single TSD. + -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise +### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| ex | Error | error that occured | +| msg | 'creating' \| 'updating' | what to print in the log | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### TriggeredSend.update(metadata) ⇒ Promise -Updates a single TSD. +### MetadataType.getSOAPErrorMsg(ex) ⇒ string +helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - error message | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| ex | Error | error that occured | - + -### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -parses retrieved Metadata before saving +### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +Retrieves Metadata for Rest Types -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem \| void - Array with one metadata object and one sql string +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment +### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem - metadata object +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | +| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | +| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | + + + +### MetadataType.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | - - +| ex | Error | exception | +| id | string | id or key of item | -### TriggeredSend.refresh([keyArr], [checkKey]) ⇒ Promise.<void> -TSD-specific refresh method that finds active TSDs and refreshes them + -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<void> - - +### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> +Used to execute a query/automation etc. -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [keyArr] | Array.<string> | | metadata keys | -| [checkKey] | boolean | true | whether to check if the key is valid | +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) - +| Param | Type | Description | +| --- | --- | --- | +| uri | string | REST endpoint where the POST request should be sent | +| key | string | item key | -### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>> -helper for [refresh](#TriggeredSend.refresh) that extracts the keys from the TSD item map and eli + -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<Array.<string>> - keyArr +### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> +Used to execute a query/automation etc. + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:object}> - metadata key and API response | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMapObj | TSD item map | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | - + -### TriggeredSend.findRefreshableItems([assetLoaded]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -helper for [refresh](#TriggeredSend.refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](#TriggeredSend.retrieve) is using to avoid refreshing TSDs with broken dependencies +### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> +helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of TSD item map +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [assetLoaded] | boolean | false | if run after Asset.deploy via --refresh option this will skip caching assets | +| Param | Type | Description | +| --- | --- | --- | +| [singleRetrieve] | string \| number | key of single item to filter by | +| metadataMap | TYPE.MetadataTypeMap | saved metadata | - + -### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean> -helper for [refresh](#TriggeredSend.refresh) that pauses, publishes and starts a triggered send +### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - true if refresh was successful +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| key | string | external key of triggered send item | -| checkKey | boolean | whether to check if key exists on the server | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -## User ⇐ [MetadataType](#MetadataType) -MetadataType +### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void +Deletes a field in a metadata entry if the selected definition property equals false. -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) -* [User](#User) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [__], [key])](#User.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#User.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#User.create) ⇒ Promise - * [.update(metadata)](#User.update) ⇒ Promise - * [.preDeployTasks(metadata)](#User.preDeployTasks) ⇒ TYPE.UserDocument - * [.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#User.createOrUpdate) ⇒ void - * [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ Promise.<void> - * [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ object - * [.retrieveChangelog()](#User.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.document([metadata])](#User.document) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | +| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | +| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | +| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | - +**Example** +```js +Removes field (or nested fields childs) that are not updateable +deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); +``` + -### User.retrieve(retrieveDir, _, [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not createable -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### User.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - + -### User.create(metadata) ⇒ Promise -Create a single item. +### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not updateable -**Kind**: static method of [User](#User) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### User.update(metadata) ⇒ Promise -Updates a single item. +### MetadataType.keepTemplateFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the template -**Kind**: static method of [User](#User) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### User.preDeployTasks(metadata) ⇒ TYPE.UserDocument -prepares a item for deployment +### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the stored metadata -**Kind**: static method of [User](#User) -**Returns**: TYPE.UserDocument - metadata object +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.UserDocument | of a single item | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### User.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ void -helper for [upsert](#MetadataType.upsert) +### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean +checks if the current metadata entry should be saved on retrieve or not -**Kind**: static method of [User](#User) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: skip saving == filtered; false: continue with saving | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.UserDocumentDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.UserDocument> | list of items to create | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - + -### User.postDeployTasks(upsertResults) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean +optionally filter by what folder something is in -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.UserDocumentMap | metadata mapped by their keyField | - - - -### User.\_getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale]) ⇒ object -helper for [User._prepareRoleAssignments](User._prepareRoleAssignments) +| metadataEntry | object | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | -**Kind**: static method of [User](#User) -**Returns**: object - format needed by API + -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| roleId | string | | role.ObjectID | -| roleName | string | | role.Name | -| userId | number | | user.AccountUserID | -| assignmentOnly | boolean | | if true, only assignment configuration will be returned | -| [isRoleRemovale] | boolean | false | if true, role will be removed from user; otherwise added | +### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy - +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata -### User.retrieveChangelog() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +| Param | Type | Description | +| --- | --- | --- | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) +searches extracted file for template variable names and applies the market values -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### User.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles +### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string +helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) +searches extracted file for template variable values and applies the market variable names -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - - +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | user list | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### User.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -manages post retrieve steps +### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types (e.g script, asset, query) -**Kind**: static method of [User](#User) -**Returns**: TYPE.MetadataTypeItem \| void - a single item +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -## Verification ⇐ [MetadataType](#MetadataType) -Verification MetadataType +### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array -* [Verification](#Verification) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], key)](#Verification.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.handleRESTErrors(ex, id)](#Verification.handleRESTErrors) ⇒ null - * [.retrieveForCache()](#Verification.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#Verification.create) ⇒ Promise - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#Verification.postCreateTasks) ⇒ void - * [.update(metadata)](#Verification.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem - * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem - * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### Verification.retrieve(retrieveDir, [_], [__], key) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Verification Activity. +### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - subtype name | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| key | string | customer key of single item to retrieve | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -### Verification.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) +### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object +optional method used for some types to try a different folder structure -**Kind**: static method of [Verification](#Verification) -**Returns**: null - - +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - metadata | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | +| ex | Error | error from first attempt | - + -### Verification.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching +### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Builds definition based on template +NOTE: Most metadata files should use this generic method, unless custom +parsing is required (for example scripts & queries) -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map -### Verification.create(metadata) ⇒ Promise -Creates a single Data Extract +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| templateName | string | name of the metadata file | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise + + +### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | +| ex | object | response payload from REST API | - + -### Verification.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) +### MetadataType.document([metadata], [isDeploy]) ⇒ void +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [Verification](#Verification) +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | +| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | +| [isDeploy] | boolean | used to skip non-supported message during deploy | - + -### Verification.update(metadata) ⇒ Promise -Updates a single Data Extract +### MetadataType.resolveId(id) ⇒ Promise.<string> +get name & key for provided id -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - key of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | +| id | string | Identifier of metadata | - + -### Verification.preDeployTasks(metadata) ⇒ TYPE.VerificationItem -prepares a verification for deployment +### MetadataType.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - metadata object +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | +| customerKey | string | Identifier of data extension | - + -### Verification.postRetrieveTasks(metadata) ⇒ TYPE.VerificationItem -parses retrieved Metadata before saving +### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> +clean up after deleting a metadata item -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - Array with one metadata object and one sql string +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | +| customerKey | string | Identifier of metadata item | +| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | - + -### Verification.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| customerKey | string | Identifier of metadata | +| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -## Retriever -Retrieves metadata from a business unit and saves it to the local filesystem. +### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit -**Kind**: global class +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag -* [Retriever](#Retriever) - * [new Retriever(properties, buObject)](#new_Retriever_new) - * [.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly])](#Retriever+retrieve) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [._getTypeDependencies(metadataTypes)](#Retriever+_getTypeDependencies) ⇒ Array.<TYPE.SupportedMetadataTypes> +| Param | Type | Description | +| --- | --- | --- | +| url | string | endpoint | +| key | string | Identifier of metadata | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### new Retriever(properties, buObject) -Creates a Retriever, uses v2 auth if v2AuthOptions are passed. +### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object +Returns metadata of a business unit that is saved locally +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - Metadata of BU in local directory | Param | Type | Description | | --- | --- | --- | -| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | -| buObject | TYPE.BuObject | properties for auth | +| readDir | string | root directory of metadata. | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| [buMetadata] | object | Metadata of BU in local directory | - + -### retriever.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly]) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve metadata of specified types into local file system and Retriever.metadata +### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | -| [namesOrKeys] | Array.<string> \| TYPE.TypeKeyCombo | name of Metadata to retrieveAsTemplate or list of keys for normal retrieval | -| [templateVariables] | TYPE.TemplateMap | Object of values which can be replaced (in case of templating) | -| [changelogOnly] | boolean | skip saving, only create json in memory | - - +| keyArr | Array.<string> | customerkey of the metadata | -### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes> -helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of the given types + -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Array.<TYPE.SupportedMetadataTypes> - unique list dependent metadata types +### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - list of keys | Param | Type | Description | | --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | @@ -8476,6 +13743,77 @@ Returns an SDK instance to be used for API calls | sessionKey | string | key for specific BU | | authObject | TYPE.AuthObject | credentials for specific BU | + + +## csvToArray(csv) ⇒ Array.<string> +helper to convert CSVs into an array. if only one value was given, it's also returned as an array + +**Kind**: global function +**Returns**: Array.<string> - values split into an array. + +| Param | Type | Description | +| --- | --- | --- | +| csv | string | potentially comma-separated value or null | + + + +## Mcdev.(methodName, businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> +run a method across BUs + +**Kind**: global function +**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of affected item keys + +| Param | Type | Description | +| --- | --- | --- | +| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | +| businessUnit | string | name of BU | +| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | +| [keys] | Array.<string> | customerkey of the metadata | + + + +## Mcdev.(methodName, cred, bu, [type], keyArr) ⇒ Promise.<Array.<string>> +helper for [Mcdev.#runMethod](Mcdev.#runMethod) + +**Kind**: global function +**Returns**: Promise.<Array.<string>> - list of keys that were affected + +| Param | Type | Description | +| --- | --- | --- | +| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | +| cred | string | name of Credential | +| bu | string | name of BU | +| [type] | TYPE.SupportedMetadataTypes | limit execution to given metadata type | +| keyArr | Array.<string> | customerkey of the metadata | + + + +## Mcdev.(selectedType, buObject) ⇒ Array.<string> +helper for [Mcdev.#runOnBU](Mcdev.#runOnBU) + +**Kind**: global function +**Returns**: Array.<string> - keyArr + +| Param | Type | Description | +| --- | --- | --- | +| selectedType | TYPE.SupportedMetadataTypes | limit execution to given metadata type | +| buObject | TYPE.BuObject | properties for auth | + + + +## Mcdev.(cred, bu, type, [keyArr]) ⇒ Promise.<Array.<string>> +Updates the key to match the name field + +**Kind**: global function +**Returns**: Promise.<Array.<string>> - list of keys that were affected + +| Param | Type | Description | +| --- | --- | --- | +| cred | string | name of Credential | +| bu | string | name of BU | +| type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | +| [keyArr] | Array.<string> | customerkey of the metadata | + ## TypeKeyCombo : Object.<string, string> diff --git a/lib/cli.js b/lib/cli.js index 1e5229744..c03ce8a65 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -196,7 +196,7 @@ yargs(hideBin(process.argv)) }) .positional('TYPE', { type: 'string', - describe: 'metadata type to delete from; currently supported: dataExtension', + describe: 'metadata type to delete from;', }) .positional('EXTERNALKEY', { type: 'string', @@ -208,6 +208,36 @@ yargs(hideBin(process.argv)) Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.EXTERNALKEY); }, }) + .command({ + command: 'resolveId ', + aliases: ['rid'], + desc: 'resolves metadata key by ID', + builder: (yargs) => { + yargs + .positional('BU', { + type: 'string', + describe: + 'the business unit to search in (in format "credential name/BU name")', + }) + .positional('TYPE', { + type: 'string', + describe: 'metadata type to search in; currently supported: asset', + }) + .positional('ID', { + type: 'string', + describe: 'the id to resolve', + }) + .option('json', { + type: 'boolean', + group: 'Options for explainTypes:', + describe: 'optionaly return info in json format', + }); + }, + handler: (argv) => { + Mcdev.setOptions(argv); + Mcdev.resolveId(argv.BU, argv.TYPE, argv.ID); + }, + }) .command({ command: 'retrieveAsTemplate ', aliases: ['rt'], diff --git a/lib/index.js b/lib/index.js index 01e553142..22b5cd53e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -529,6 +529,49 @@ class Mcdev { } } } + /** + * get name & key for provided id + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} type supported metadata type + * @param {string} id Identifier of metadata + * @returns {Promise.<{key:string, name:string, path:string}>} key, name and path of metadata; null if not found + */ + static async resolveId(businessUnit, type, id) { + Util.startLogger(); + if (!Util.OPTIONS.json) { + Util.logger.info('mcdev:: resolveId'); + } + if (!Util._isValidType(type)) { + return; + } + const properties = await config.getProperties(); + if (!(await config.checkProperties(properties))) { + return null; + } + const buObject = await Cli.getCredentialObject(properties, businessUnit); + if (buObject !== null) { + try { + MetadataTypeInfo[type].client = auth.getSDK(buObject); + } catch (ex) { + Util.logger.error(ex.message); + return; + } + if (!Util.OPTIONS.json) { + Util.logger.info( + Util.getGrayMsg(` - Searching ${type} with id ${id} on BU ${businessUnit}`) + ); + } + try { + MetadataTypeInfo[type].properties = properties; + MetadataTypeInfo[type].buObject = buObject; + return await MetadataTypeInfo[type].resolveId(id); + } catch (ex) { + Util.logger.errorStack(ex, ` - Could not resolve ID of ${type} ${id}`); + } + } + } + /** * ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails * diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index badfeb065..a403890d2 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1689,6 +1689,60 @@ class Asset extends MetadataType { await File.remove(filePath); } } + /** + * get name & key for provided id + * + * @param {string} id Identifier of metadata + * @returns {Promise.<{key:string, name:string, path:string}>} key, name and path of metadata; null if not found + */ + static async resolveId(id) { + const uri = '/asset/v1/content/assets/query'; + const payload = { + query: { + property: 'id', + simpleOperator: 'equal', + value: id, + }, + }; + const response = await this.client.rest.post(uri, payload); + if (response.items.length === 1) { + const item = response.items[0]; + const subType = this._getMainSubtype(item.assetType.name); + // find path for code of content block, fall back to json if not found; undefined if not even the json exists + const pathBase1 = `./retrieve/${this.buObject.credential}/${this.buObject.businessUnit}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; + const pathBase2 = `./retrieve/${this.buObject.credential}/${this.buObject.businessUnit}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; + const paths = []; + for (const ext of ['html', 'ssjs', 'amp', 'json']) { + paths.push(pathBase1 + ext, pathBase2 + ext); + } + const path = paths.find((p) => File.pathExistsSync(p)); + + // prep response object + const json = { + key: item[this.definition.keyField], + name: item[this.definition.nameField], + path: path, + }; + if (Util.OPTIONS.json) { + // for automated processing by VSCode extension, optionally print the json + if (Util.OPTIONS.loggerLevel !== 'error') { + console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console + } + } else { + Util.logger.info( + ` - ${this.definition.type}-${subType} found: ${item[this.definition.keyField]} (${item[this.definition.nameField]})` + ); + Util.logger.info(' - link: ' + path); + } + return json; + } else { + if (Util.OPTIONS.json) { + return null; + } + Util.logger.error(` - ${this.definition.type} with id ${id} not found on BU`); + return null; + } + } } // Assign definition to static attributes diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index bea4107c7..055d87e5e 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1983,6 +1983,17 @@ class MetadataType { } } + /** + * get name & key for provided id + * + * @param {string} id Identifier of metadata + * @returns {Promise.} key of metadata + */ + static resolveId(id) { + Util.logger.error(`resolveId type ${this.definition.type} is not supported.`); + return false; + } + /** * Delete a metadata item from the specified business unit * From 1688840e4a54e03bd3c8ebb886a8c2aa17916e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 25 Mar 2024 12:43:30 +0100 Subject: [PATCH 059/359] #1238: switch to simpler get request --- docs/dist/documentation.md | 11711 ++++++++++++----------------------- lib/metadataTypes/Asset.js | 21 +- 2 files changed, 3882 insertions(+), 7850 deletions(-) diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 7ca0015c9..4aa1defae 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -132,16 +132,9 @@ Provides default functionality that can be overwritten by child metadata type cl
Retriever

Retrieves metadata from a business unit and saves it to the local filesystem.

-
Mcdev
-

main class

-
AssetMetadataType

FileTransfer MetadataType

-
MetadataType
-

MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes

-
## Constants @@ -252,21 +245,6 @@ helper for DataExtension.#fixShared_item
setupSDK(sessionKey, authObject)SDK

Returns an SDK instance to be used for API calls

-
csvToArray(csv)Array.<string>
-

helper to convert CSVs into an array. if only one value was given, it's also returned as an array

-
-
Mcdev.(methodName, businessUnit, [selectedType], [keys])Promise.<Object.<string, Array.<string>>>
-

run a method across BUs

-
-
Mcdev.(methodName, cred, bu, [type], keyArr)Promise.<Array.<string>>
-

helper for Mcdev.#runMethod

-
-
Mcdev.(selectedType, buObject)Array.<string>
-

helper for Mcdev.#runOnBU

-
-
Mcdev.(cred, bu, type, [keyArr])Promise.<Array.<string>>
-

Updates the key to match the name field

-
## Typedefs @@ -570,33 +548,6 @@ main class * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> - * [.version()](#Mcdev.version) ⇒ string - * [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ void - * [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ void - * [.setOptions(argv)](#Mcdev.setOptions) ⇒ void - * [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> - * [.selectTypes()](#Mcdev.selectTypes) ⇒ Promise - * [.explainTypes()](#Mcdev.explainTypes) ⇒ Array.<object> - * [.upgrade()](#Mcdev.upgrade) ⇒ Promise.<boolean> - * [.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly])](#Mcdev.retrieve) ⇒ Promise.<object> - * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Mcdev.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - * [.initProject([credentialsName])](#Mcdev.initProject) ⇒ Promise.<void> - * [.joinProject()](#Mcdev.joinProject) ⇒ Promise.<void> - * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> - * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> - * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> - * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> - * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> - * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Mcdev.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildDefinition(businessUnit, selectedType, name, market)](#Mcdev.buildDefinition) ⇒ Promise.<void> - * [.buildDefinitionBulk(listName, type, name)](#Mcdev.buildDefinitionBulk) ⇒ Promise.<void> - * [.getFilesToCommit(businessUnit, selectedType, keyArr)](#Mcdev.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.schedule(businessUnit, [selectedType], [keys])](#Mcdev.schedule) ⇒ Promise.<Object.<string, Array.<string>>> - * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> - * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> - * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> @@ -923,398 +874,483 @@ Updates the key to match the name field | selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | | [keys] | Array.<string> | customerkey of the metadata | - + -### Mcdev.version() ⇒ string -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: string - current version of mcdev - +## Asset ⇐ [MetadataType](#MetadataType) +FileTransfer MetadataType -### Mcdev.setSkipInteraction([skipInteraction]) ⇒ void -helper method to use unattended mode when including mcdev as a package +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -**Kind**: static method of [Mcdev](#Mcdev) +* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + + + +### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves Metadata of Asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| [skipInteraction] | boolean \| TYPE.skipInteraction | signals what to insert automatically for things usually asked via wizard | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | - | +| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | +| [key] | string | customer key | - + -### Mcdev.setLoggingLevel(argv) ⇒ void -configures what is displayed in the console +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves asset metadata for caching -**Kind**: static method of [Mcdev](#Mcdev) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| argv | object | list of command line parameters given by user | -| [argv.silent] | boolean | only errors printed to CLI | -| [argv.verbose] | boolean | chatty user CLI output | -| [argv.debug] | boolean | enables developer output & features | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### Mcdev.setOptions(argv) ⇒ void -allows setting system wide / command related options +### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> +Retrieves asset metadata for templating -**Kind**: static method of [Mcdev](#Mcdev) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| argv | object | list of command line parameters given by user | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - + -### Mcdev.createDeltaPkg(argv) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> -handler for 'mcdev createDeltaPkg +### Asset.create(metadata) ⇒ Promise +Creates a single asset -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - list of changed items +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| argv | object | yargs parameters | -| [argv.range] | string | git commit range into deploy directory | -| [argv.filter] | string | filter file paths that start with any | -| [argv.diffArr] | Array.<TYPE.DeltaPkgItem> | list of files to include in delta package (skips git diff when provided) | +| metadata | TYPE.AssetItem | a single asset | - + -### Mcdev.selectTypes() ⇒ Promise -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise - . - +### Asset.update(metadata) ⇒ Promise +Updates a single asset -### Mcdev.explainTypes() ⇒ Array.<object> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Array.<object> - list of supported types with their apiNames - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise -### Mcdev.upgrade() ⇒ Promise.<boolean> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - success flag - +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AssetItem | a single asset | -### Mcdev.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly]) ⇒ Promise.<object> -Retrieve all metadata from the specified business unit into the local file system. + -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<object> - - +### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise +Retrieves Metadata of a specific asset type + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> \| TYPE.TypeKeyCombo | limit retrieval to given metadata type | -| [keys] | Array.<string> | limit retrieval to given metadata key | -| [changelogOnly] | boolean | skip saving, only create json in memory | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| [retrieveDir] | string | target directory for saving assets | +| [templateName] | string | name of the metadata file | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| key | string | customer key to filter by | - + -### Mcdev.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> -Deploys all metadata located in the 'deploy' directory to the specified business unit +### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise +Retrieves extended metadata (files or extended content) of asset -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | -| [keyArr] | Array.<string> | limit deployment to given metadata keys | +| items | Array | array of items to retrieve | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Mcdev.initProject([credentialsName]) ⇒ Promise.<void> -Creates template file for properties.json +### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> +Some metadata types store their actual content as a separate file, e.g. images +This method retrieves these and saves them alongside the metadata json -**Kind**: static method of [Mcdev](#Mcdev) +**Kind**: static method of [Asset](#Asset) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| [credentialsName] | string | identifying name of the installed package / project | +| metadata | TYPE.AssetItem | a single asset | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | - + -### Mcdev.joinProject() ⇒ Promise.<void> -Clones an existing project from git repository and installs it +### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> +helper for [preDeployTasks](#Asset.preDeployTasks) +Some metadata types store their actual content as a separate file, e.g. images +This method reads these from the local FS stores them in the metadata object allowing to deploy it -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<string> - if found will return the path of the binary file -### Mcdev.findBUs(credentialsName) ⇒ Promise.<void> -Refreshes BU names and ID's from MC instance +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset | +| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | +| deployDir | string | | directory of deploy files | +| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - + + +### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - metadata | Param | Type | Description | | --- | --- | --- | -| credentialsName | string | identifying name of the installed package / project | +| metadata | TYPE.AssetItem | a single asset | - + -### Mcdev.document(businessUnit, type) ⇒ Promise.<void> -Creates docs for supported metadata types in Markdown and/or HTML format +### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [Mcdev](#Mcdev) +**Kind**: static method of [Asset](#Asset) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | metadata type | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### Mcdev.deleteByKey(businessUnit, type, customerKey) ⇒ Promise.<boolean> -deletes metadata from MC instance by key +### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> +prepares an asset definition for deployment -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - true if successful, false otherwise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetItem> - Promise | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| customerKey | string | Identifier of metadata | +| metadata | TYPE.AssetItem | a single asset | +| deployDir | string | directory of deploy files | - + -### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id +### Asset.\_getMainSubtype(extendedSubType) ⇒ string +find the subType matching the extendedSubType -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found +**Kind**: static method of [Asset](#Asset) +**Returns**: string - subType: block, message, other, etc | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| id | string | Identifier of metadata | +| extendedSubType | string | webpage, htmlblock, etc | - + -### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> -ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails +### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [Mcdev](#Mcdev) +**Kind**: static method of [Asset](#Asset) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | references credentials from properties.json | -| [keyArr] | Array.<string> | metadata keys | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### Mcdev.badKeys(businessUnit) ⇒ Promise.<void> -Converts metadata to legacy format. Output is saved in 'converted' directory +### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [Mcdev](#Mcdev) +**Kind**: static method of [Asset](#Asset) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +``` + -### Mcdev.retrieveAsTemplate(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve a specific metadata file and templatise. +### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | Array.<string> | name of the metadata | -| market | string | market which should be used to revert template | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### Mcdev.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Build a template based on a list of metadata files in the retrieve folder. +### Asset.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | -| market | string | market localizations | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### Mcdev.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<void> -Build a specific metadata file based on a template. +### Asset.setFolderId(metadata) +Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | string | name of the metadata | -| market | string | market localizations | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Mcdev.buildDefinitionBulk(listName, type, name) ⇒ Promise.<void> -Build a specific metadata file based on a template using a list of bu-market combos +### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) -| Param | Type | Description | -| --- | --- | --- | -| listName | string | name of list of BU-market combos | -| type | string | supported metadata type | -| name | string | name of the metadata | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset definition | +| deployDir | string | | directory of deploy files | +| subType | TYPE.AssetSubType | | asset-subtype name | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - + -### Mcdev.getFilesToCommit(businessUnit, selectedType, keyArr) ⇒ Promise.<Array.<string>> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - - +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| prefix | string | | usually the customerkey | +| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| readDirArr | Array.<string> | | directory of deploy files | +| subtypeExtension | string | | asset-subtype name ending on -meta | +| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | +| fileList | Array.<object> | | directory of files w/o leading deploy dir | +| customerKey | string | | external key of template (could have been changed if used during templating) | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | -### Mcdev.schedule(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Schedule an item (shortcut for execute --schedule) + -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of scheduled item keys +### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem +helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it +to allow saving that separately and formatted + +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - +| metadata | TYPE.AssetItem | a single asset definition | -### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Start/execute an item + -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of executed item keys +### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | +| prefix | string | usually the customerkey | +| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| codeArr | Array.<object> | to be extended array for extracted code | - + -### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -pause an item +### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their fileName without '.json' ending -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | +| dir | string | directory that contains '.json' files to be read | +| [_] | void | unused parameter | +| selectedSubType | Array.<string> | asset, message, ... | - + -### Mcdev.fixKeys(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Updates the key to match the name field +### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetSubType> - subtype name | Param | Type | Description | | --- | --- | --- | -| businessUnit | string | name of BU | -| selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -## Asset ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType +### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem +optional method used for some types to try a different folder structure -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.AssetItem - metadata -* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | + + + +### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [Asset](#Asset) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### Asset.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk + +**Kind**: static method of [Asset](#Asset) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + + + +### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found + +| Param | Type | Description | +| --- | --- | --- | +| id | string | Identifier of metadata | @@ -1726,436 +1762,468 @@ get name & key for provided id | --- | --- | --- | | id | string | Identifier of metadata | - + -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset +## AttributeGroup ⇐ [MetadataType](#MetadataType) +AttributeGroup MetadataType -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | +* [AttributeGroup](#AttributeGroup) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeGroup.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#AttributeGroup.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.postRetrieveTasks(metadata)](#AttributeGroup.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching +### AttributeGroup.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema attribute groups. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating +### AttributeGroup.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema attribute groups for caching. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### AttributeGroup.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | +| metadata | TYPE.MetadataTypeItem | a single metadata | - + -### Asset.create(metadata) ⇒ Promise -Creates a single asset +## AttributeSet ⇐ [MetadataType](#MetadataType) +AttributeSet MetadataType -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +* [AttributeSet](#AttributeSet) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeSet.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#AttributeSet.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.fixShared_retrieve(sharedDataExtensionMap, fixShared_fields)](#AttributeSet.fixShared_retrieve) ⇒ Promise.<Array.<string>> + * [.parseResponseBody(body, [singleRetrieve])](#AttributeSet.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.postRetrieveTasks(metadata)](#AttributeSet.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [._getSystemValueDefinitions()](#AttributeSet._getSystemValueDefinitions) ⇒ Array.<object> - + -### Asset.update(metadata) ⇒ Promise -Updates a single asset +### AttributeSet.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema set Definitions. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type +### AttributeSet.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema set definitions for caching. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### AttributeSet.fixShared\_retrieve(sharedDataExtensionMap, fixShared_fields) ⇒ Promise.<Array.<string>> +used to identify updated shared data extensions that are used in attributeSets. +helper for DataExtension.#fixShared_onBU + +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<Array.<string>> - Promise of list of shared dataExtension IDs | Param | Type | Description | | --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | +| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | +| fixShared_fields | object | DataExtensionField.fixShared_fields | - + -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset +### AttributeSet.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json +### AttributeSet.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | +| metadata | TYPE.MetadataTypeItem | a single metadata | - + -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it +### AttributeSet.\_getSystemValueDefinitions() ⇒ Array.<object> +helper for [postRetrieveTasks](#AttributeSet.postRetrieveTasks) -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Array.<object> - all system value definitions + -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | +## Automation ⇐ [MetadataType](#MetadataType) +Automation MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +* [Automation](#Automation) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Automation.retrieve) ⇒ Promise.<TYPE.AutomationMapObj> + * [.handleRESTErrors(ex, id)](#Automation.handleRESTErrors) ⇒ null + * [.retrieveChangelog()](#Automation.retrieveChangelog) ⇒ Promise.<TYPE.AutomationMapObj> + * [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj> + * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void + * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<Array.<string>> + * [.getErrorsREST(ex)](#Automation.getErrorsREST) ⇒ Array.<string> \| void + * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<Array.<string>> + * [.deploy(metadata, targetBU, retrieveDir)](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap> + * [.create(metadata)](#Automation.create) ⇒ Promise + * [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ Promise.<TYPE.AutomationItem> + * [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ boolean + * [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Automation.setFolderPath) + * [.setFolderId(metadata)](#Automation.setFolderId) + * [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap + * [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string + * [.document([metadata])](#Automation.document) ⇒ Promise.<void> + * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata + + +### Automation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves Metadata of Automation + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### Automation.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| ex | Error | exception | +| id | string | id or key of item | - + -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment +### Automation.retrieveChangelog() ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves Metadata of Automation -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata + + +### Automation.retrieveForCache() ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves automation metadata for caching + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata + + +### Automation.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.AutomationItemObj> +Retrieve a specific Automation Definition by Name + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType +### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem \| void +manages post retrieve steps -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc +**Kind**: static method of [Automation](#Automation) +**Returns**: TYPE.AutomationItem \| void - parsed item | Param | Type | Description | | --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | +| metadata | TYPE.AutomationItem | a single automation | - + -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### Automation.execute(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### Automation.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages but adds query specific filters to error texts -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| ex | object | response payload from REST API | -**Example** -```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating -``` - + -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### Automation.pause(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were paused | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Automation.deploy(metadata, targetBU, retrieveDir) ⇒ Promise.<TYPE.AutomationMap> +Deploys automation - the saved file is the original one due to large differences required for deployment -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMap> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| metadata | TYPE.AutomationMap | metadata mapped by their keyField | +| targetBU | string | name/shorthand of target businessUnit for mapping | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### Automation.create(metadata) ⇒ Promise +Creates a single automation -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.AutomationItem | single metadata entry | - + -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON +### Automation.update(metadata, metadataBefore) ⇒ Promise +Updates a single automation -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise - Promise -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AutomationItem | single metadata entry | +| metadataBefore | TYPE.AutomationItem | metadata mapped by their keyField | - + -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON +### Automation.preDeployTasks(metadata) ⇒ Promise.<TYPE.AutomationItem> +Gets executed before deploying metadata -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationItem> - Promise -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AutomationItem | metadata mapped by their keyField | - + -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted +### Automation.validateDeployMetadata(metadata) ⇒ boolean +Validates the automation to be sure it can be deployed. +Whitelisted Activites are deployed but require configuration -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } +**Kind**: static method of [Automation](#Automation) +**Returns**: boolean - result if automation can be deployed based on steps | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | +| metadata | TYPE.AutomationItem | single automation record | - + -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) +### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ Promise.<void> +Gets executed after deployment of metadata type + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | +| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | +| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | - + -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending +### Automation.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes +### Automation.setFolderId(metadata) +automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure +### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap +Builds a schedule object to be used for scheduling an automation +based on combination of ical string and start/end dates. -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata +**Kind**: static method of [Automation](#Automation) +**Returns**: TYPE.AutomationScheduleSoap - Schedulable object for soap API (currently not rest supported) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | +| scheduleObject | TYPE.AutomationSchedule | child of automation metadata used for scheduling | - + -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> +### Automation.\_calcTime(offsetServer, dateInput, [offsetInput]) ⇒ string +used to convert dates to the system timezone required for startDate + +**Kind**: static method of [Automation](#Automation) +**Returns**: string - date in server + +| Param | Type | Description | +| --- | --- | --- | +| offsetServer | number | stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) | +| dateInput | string \| Date | date in ISO format (2021-12-05T20:00:00.983) | +| [offsetInput] | string | timzone difference (+02:00) | + + + +### Automation.document([metadata]) ⇒ Promise.<void> +Parses metadata into a readable Markdown/HTML format then saves it + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<void> - - + +| Param | Type | Description | +| --- | --- | --- | +| [metadata] | TYPE.AutomationMap | a list of dataExtension definitions | + + + +### Automation.getFilesToCommit(keyArr) ⇒ Array.<string> should return only the json for all but asset, query and script that are saved as multiple files additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Automation](#Automation) **Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | | keyArr | Array.<string> | customerkey of the metadata | - + -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> +### Automation.deleteByKey(customerKey) ⇒ boolean Delete a metadata item from the specified business unit -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Automation](#Automation) +**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -### Asset.postDeleteTasks(customerKey) ⇒ void +### Automation.postDeleteTasks(customerKey) ⇒ void clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of metadata item | - - -### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | - - + -## AttributeGroup ⇐ [MetadataType](#MetadataType) -AttributeGroup MetadataType +## Campaign ⇐ [MetadataType](#MetadataType) +Campaign MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [AttributeGroup](#AttributeGroup) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeGroup.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeGroup.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.postRetrieveTasks(metadata)](#AttributeGroup.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +* [Campaign](#Campaign) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Campaign.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#Campaign.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getAssetTags(retrieveDir, campaignId, name)](#Campaign.getAssetTags) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### AttributeGroup.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups. +### Campaign.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Campaign](#Campaign) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -2164,48 +2232,47 @@ Retrieves Metadata of schema attribute groups. | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### AttributeGroup.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups for caching. +### Campaign.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Kind**: static method of [Campaign](#Campaign) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### AttributeGroup.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Campaign.getAssetTags(retrieveDir, campaignId, name) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Parses campaign asset response body and returns metadata entries mapped to their id -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Campaign](#Campaign) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Campaign Asset Object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | +| retrieveDir | string | folder where to save | +| campaignId | string | of camapaign to retrieve | +| name | string | of camapaign for saving | - + -## AttributeSet ⇐ [MetadataType](#MetadataType) -AttributeSet MetadataType +## ContentArea ⇐ [MetadataType](#MetadataType) +ContentArea MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [AttributeSet](#AttributeSet) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeSet.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeSet.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.fixShared_retrieve(sharedDataExtensionMap, fixShared_fields)](#AttributeSet.fixShared_retrieve) ⇒ Promise.<Array.<string>> - * [.parseResponseBody(body, [singleRetrieve])](#AttributeSet.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.postRetrieveTasks(metadata)](#AttributeSet.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [._getSystemValueDefinitions()](#AttributeSet._getSystemValueDefinitions) ⇒ Array.<object> +* [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.setFolderPath(metadata)](#ContentArea.setFolderPath) + * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### AttributeSet.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set Definitions. +### ContentArea.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [ContentArea](#ContentArea) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | @@ -2214,438 +2281,448 @@ Retrieves Metadata of schema set Definitions. | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### AttributeSet.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set definitions for caching. - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - + -### AttributeSet.fixShared\_retrieve(sharedDataExtensionMap, fixShared_fields) ⇒ Promise.<Array.<string>> -used to identify updated shared data extensions that are used in attributeSets. -helper for DataExtension.#fixShared_onBU +### ContentArea.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<Array.<string>> - Promise of list of shared dataExtension IDs +**Kind**: static method of [ContentArea](#ContentArea) | Param | Type | Description | | --- | --- | --- | -| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | -| fixShared_fields | object | DataExtensionField.fixShared_fields | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### AttributeSet.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Kind**: static method of [ContentArea](#ContentArea) +**Returns**: TYPE.MetadataTypeItem - parsed item | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### AttributeSet.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +## DataExtension ⇐ [MetadataType](#MetadataType) +DataExtension MetadataType -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | - - - -### AttributeSet.\_getSystemValueDefinitions() ⇒ Array.<object> -helper for [postRetrieveTasks](#AttributeSet.postRetrieveTasks) +* [DataExtension](#DataExtension) ⇐ [MetadataType](#MetadataType) + * [.upsert(metadataMap)](#DataExtension.upsert) ⇒ Promise + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#DataExtension.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.create(metadata)](#DataExtension.create) ⇒ Promise + * [.update(metadata)](#DataExtension.update) ⇒ Promise + * [.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated)](#DataExtension.postDeployTasks) ⇒ void + * [.retrieve(retrieveDir, [additionalFields], [_], [key])](#DataExtension.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.retrieveSharedForCache([additionalFields])](#DataExtension.retrieveSharedForCache) ⇒ Promise.<TYPE.DataExtensionMap> + * [.retrieveChangelog([additionalFields])](#DataExtension.retrieveChangelog) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.postRetrieveTasks(metadata)](#DataExtension.postRetrieveTasks) ⇒ TYPE.DataExtensionItem + * [.preDeployTasks(metadata)](#DataExtension.preDeployTasks) ⇒ Promise.<TYPE.DataExtensionItem> + * [.document([metadataMap])](#DataExtension.document) ⇒ Promise.<void> + * [.deleteByKey(customerKey)](#DataExtension.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#DataExtension.postDeleteTasks) ⇒ Promise.<void> + * [.retrieveForCache()](#DataExtension.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtension.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.setFolderPath(metadata)](#DataExtension.setFolderPath) + * [.getFilesToCommit(keyArr)](#DataExtension.getFilesToCommit) ⇒ Array.<string> -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Array.<object> - all system value definitions - + -## Automation ⇐ [MetadataType](#MetadataType) -Automation MetadataType +### DataExtension.upsert(metadataMap) ⇒ Promise +Upserts dataExtensions after retrieving them from source and target to compare +if create or update operation is needed. -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise -* [Automation](#Automation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Automation.retrieve) ⇒ Promise.<TYPE.AutomationMapObj> - * [.handleRESTErrors(ex, id)](#Automation.handleRESTErrors) ⇒ null - * [.retrieveChangelog()](#Automation.retrieveChangelog) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj> - * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void - * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<Array.<string>> - * [.getErrorsREST(ex)](#Automation.getErrorsREST) ⇒ Array.<string> \| void - * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<Array.<string>> - * [.deploy(metadata, targetBU, retrieveDir)](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap> - * [.create(metadata)](#Automation.create) ⇒ Promise - * [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ Promise.<TYPE.AutomationItem> - * [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ boolean - * [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Automation.setFolderPath) - * [.setFolderId(metadata)](#Automation.setFolderId) - * [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap - * [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string - * [.document([metadata])](#Automation.document) ⇒ Promise.<void> - * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.DataExtensionMap | dataExtensions mapped by their customerKey | - + -### Automation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation +### DataExtension.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### Automation.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) +### DataExtension.create(metadata) ⇒ Promise +Create a single dataExtension. Also creates their columns in 'dataExtension.columns' -**Kind**: static method of [Automation](#Automation) -**Returns**: null - - +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| metadata | TYPE.DataExtensionItem | single metadata entry | - + -### Automation.retrieveChangelog() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation +### DataExtension.update(metadata) ⇒ Promise +Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise -### Automation.retrieveForCache() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves automation metadata for caching +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.DataExtensionItem | single metadata entry | -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - + -### Automation.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.AutomationItemObj> -Retrieve a specific Automation Definition by Name +### DataExtension.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItemObj> - Promise of metadata +**Kind**: static method of [DataExtension](#DataExtension) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | +| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem \| void -manages post retrieve steps +### DataExtension.retrieve(retrieveDir, [additionalFields], [_], [key]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationItem \| void - parsed item +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | a single automation | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [_] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Automation.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API +### DataExtension.retrieveSharedForCache([additionalFields]) ⇒ Promise.<TYPE.DataExtensionMap> +get shared dataExtensions from parent BU and merge them into the cache +helper for [retrieve](#DataExtension.retrieve) and for AttributeSet.fixShared_retrieve -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<TYPE.DataExtensionMap> - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Automation.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts +### DataExtension.retrieveChangelog([additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| ex | object | response payload from REST API | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Automation.pause(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API +### DataExtension.postRetrieveTasks(metadata) ⇒ TYPE.DataExtensionItem +manages post retrieve steps -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were paused +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: TYPE.DataExtensionItem - metadata | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.DataExtensionItem | a single dataExtension | - + -### Automation.deploy(metadata, targetBU, retrieveDir) ⇒ Promise.<TYPE.AutomationMap> -Deploys automation - the saved file is the original one due to large differences required for deployment +### DataExtension.preDeployTasks(metadata) ⇒ Promise.<TYPE.DataExtensionItem> +prepares a DataExtension for deployment -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMap> - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<TYPE.DataExtensionItem> - Promise of updated single DE | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationMap | metadata mapped by their keyField | -| targetBU | string | name/shorthand of target businessUnit for mapping | -| retrieveDir | string | directory where metadata after deploy should be saved | +| metadata | TYPE.DataExtensionItem | a single data Extension | - + -### Automation.create(metadata) ⇒ Promise -Creates a single automation +### DataExtension.document([metadataMap]) ⇒ Promise.<void> +Parses metadata into a readable Markdown/HTML format then saves it -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | +| [metadataMap] | TYPE.DataExtensionMap | a list of dataExtension definitions | - + -### Automation.update(metadata, metadataBefore) ⇒ Promise -Updates a single automation +### DataExtension.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | -| metadataBefore | TYPE.AutomationItem | metadata mapped by their keyField | +| customerKey | string | Identifier of data extension | - + -### Automation.preDeployTasks(metadata) ⇒ Promise.<TYPE.AutomationItem> -Gets executed before deploying metadata +### DataExtension.postDeleteTasks(customerKey) ⇒ Promise.<void> +clean up after deleting a metadata item -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItem> - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<void> - - promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | metadata mapped by their keyField | +| customerKey | string | Identifier of metadata item | - + -### Automation.validateDeployMetadata(metadata) ⇒ boolean -Validates the automation to be sure it can be deployed. -Whitelisted Activites are deployed but require configuration +### DataExtension.retrieveForCache() ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - result if automation can be deployed based on steps +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise + + +### DataExtension.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata in template format. + +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single automation record | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata item | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### DataExtension.setFolderPath(metadata) +dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve +it also sets the content type which is basically the subtype -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - +**Kind**: static method of [DataExtension](#DataExtension) | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | -| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### Automation.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### DataExtension.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Automation.setFolderId(metadata) -automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy +## DataExtensionField ⇐ [MetadataType](#MetadataType) +DataExtensionField MetadataType -**Kind**: static method of [Automation](#Automation) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [DataExtensionField](#DataExtensionField) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [additionalFields])](#DataExtensionField.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> + * [.retrieveForCache([requestParams], [additionalFields])](#DataExtensionField.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> + * [.convertToSortedArray(fieldsObj)](#DataExtensionField.convertToSortedArray) ⇒ Array.<TYPE.DataExtensionFieldItem> + * [.sortDeFields(a, b)](#DataExtensionField.sortDeFields) ⇒ boolean + * [.postRetrieveTasks(metadata, forDataExtension)](#DataExtensionField.postRetrieveTasks) ⇒ TYPE.DataExtensionFieldItem + * [.prepareDeployColumnsOnUpdate(deployColumns, deKey)](#DataExtensionField.prepareDeployColumnsOnUpdate) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> + * [.deleteByKey(customerKey)](#DataExtensionField.deleteByKey) ⇒ Promise.<boolean> + * [.deleteByKeySOAP(customerKey, [fieldId])](#DataExtensionField.deleteByKeySOAP) ⇒ boolean + * [.postDeleteTasks(customerKey)](#DataExtensionField.postDeleteTasks) ⇒ void + + + +### DataExtensionField.retrieve(retrieveDir, [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> +Retrieves all records and saves it to disk + +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap -Builds a schedule object to be used for scheduling an automation -based on combination of ical string and start/end dates. +### DataExtensionField.retrieveForCache([requestParams], [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> +Retrieves all records for caching -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationScheduleSoap - Schedulable object for soap API (currently not rest supported) +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | -| scheduleObject | TYPE.AutomationSchedule | child of automation metadata used for scheduling | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Automation.\_calcTime(offsetServer, dateInput, [offsetInput]) ⇒ string -used to convert dates to the system timezone required for startDate +### DataExtensionField.convertToSortedArray(fieldsObj) ⇒ Array.<TYPE.DataExtensionFieldItem> +helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array -**Kind**: static method of [Automation](#Automation) -**Returns**: string - date in server +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Array.<TYPE.DataExtensionFieldItem> - sorted array of field objects | Param | Type | Description | | --- | --- | --- | -| offsetServer | number | stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) | -| dateInput | string \| Date | date in ISO format (2021-12-05T20:00:00.983) | -| [offsetInput] | string | timzone difference (+02:00) | +| fieldsObj | TYPE.DataExtensionFieldMap | customerKey-based list of fields for one dataExtension | - + -### Automation.document([metadata]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it +### DataExtensionField.sortDeFields(a, b) ⇒ boolean +sorting method to ensure `Ordinal` is respected -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: boolean - sorting based on Ordinal | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.AutomationMap | a list of dataExtension definitions | +| a | TYPE.DataExtensionFieldItem | - | +| b | TYPE.DataExtensionFieldItem | - | - + -### Automation.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### DataExtensionField.postRetrieveTasks(metadata, forDataExtension) ⇒ TYPE.DataExtensionFieldItem +manages post retrieve steps -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: TYPE.DataExtensionFieldItem - metadata | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.DataExtensionFieldItem | a single item | +| forDataExtension | boolean | when used by DataExtension class we remove more fields | - + -### Automation.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit +### DataExtensionField.prepareDeployColumnsOnUpdate(deployColumns, deKey) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> +Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. +Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - deletion success status +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - existing fields by their original name to allow re-adding FieldType after update | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| deployColumns | Array.<TYPE.DataExtensionFieldItem> | Columns of data extension that will be deployed | +| deKey | string | external/customer key of Data Extension | - + -### Automation.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### DataExtensionField.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| customerKey | string | Identifier of data extension | - + -## Campaign ⇐ [MetadataType](#MetadataType) -Campaign MetadataType +### DataExtensionField.deleteByKeySOAP(customerKey, [fieldId]) ⇒ boolean +Delete a data extension from the specified business unit -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: boolean - deletion success flag -* [Campaign](#Campaign) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Campaign.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Campaign.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getAssetTags(retrieveDir, campaignId, name)](#Campaign.getAssetTags) ⇒ Promise.<TYPE.MetadataTypeMapObj> +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata | +| [fieldId] | string | for programmatic deletes only one can pass in the ID directly | - + -### Campaign.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets +### DataExtensionField.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [DataExtensionField](#DataExtensionField) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| customerKey | string | Identifier of metadata item | - + -### Campaign.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +## DataExtensionTemplate ⇐ [MetadataType](#MetadataType) +DataExtensionTemplate MetadataType -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + -### Campaign.getAssetTags(retrieveDir, campaignId, name) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Parses campaign asset response body and returns metadata entries mapped to their id +### DataExtensionTemplate.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Campaign Asset Object +**Kind**: static method of [DataExtensionTemplate](#DataExtensionTemplate) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | folder where to save | -| campaignId | string | of camapaign to retrieve | -| name | string | of camapaign for saving | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -## ContentArea ⇐ [MetadataType](#MetadataType) -ContentArea MetadataType +## DataExtract ⇐ [MetadataType](#MetadataType) +DataExtract MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.setFolderPath(metadata)](#ContentArea.setFolderPath) - * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +* [DataExtract](#DataExtract) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(dataExtract)](#DataExtract.create) ⇒ Promise + * [.update(dataExtract)](#DataExtract.update) ⇒ Promise + * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> - + -### ContentArea.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### DataExtract.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity. +Endpoint /automation/v1/dataextracts/ returns all Data Extracts -**Kind**: static method of [ContentArea](#ContentArea) +**Kind**: static method of [DataExtract](#DataExtract) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | @@ -2655,415 +2732,456 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### ContentArea.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### DataExtract.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity for caching -**Kind**: static method of [ContentArea](#ContentArea) +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### DataExtract.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific dataExtract Definition by Name + +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### DataExtract.create(dataExtract) ⇒ Promise +Creates a single Data Extract -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: TYPE.MetadataTypeItem - parsed item +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - + -## DataExtension ⇐ [MetadataType](#MetadataType) -DataExtension MetadataType +### DataExtract.update(dataExtract) ⇒ Promise +Updates a single Data Extract -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise - Promise -* [DataExtension](#DataExtension) ⇐ [MetadataType](#MetadataType) - * [.upsert(metadataMap)](#DataExtension.upsert) ⇒ Promise - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#DataExtension.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.create(metadata)](#DataExtension.create) ⇒ Promise - * [.update(metadata)](#DataExtension.update) ⇒ Promise - * [.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated)](#DataExtension.postDeployTasks) ⇒ void - * [.retrieve(retrieveDir, [additionalFields], [_], [key])](#DataExtension.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveSharedForCache([additionalFields])](#DataExtension.retrieveSharedForCache) ⇒ Promise.<TYPE.DataExtensionMap> - * [.retrieveChangelog([additionalFields])](#DataExtension.retrieveChangelog) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.postRetrieveTasks(metadata)](#DataExtension.postRetrieveTasks) ⇒ TYPE.DataExtensionItem - * [.preDeployTasks(metadata)](#DataExtension.preDeployTasks) ⇒ Promise.<TYPE.DataExtensionItem> - * [.document([metadataMap])](#DataExtension.document) ⇒ Promise.<void> - * [.deleteByKey(customerKey)](#DataExtension.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#DataExtension.postDeleteTasks) ⇒ Promise.<void> - * [.retrieveForCache()](#DataExtension.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtension.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.setFolderPath(metadata)](#DataExtension.setFolderPath) - * [.getFilesToCommit(keyArr)](#DataExtension.getFilesToCommit) ⇒ Array.<string> +| Param | Type | Description | +| --- | --- | --- | +| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - + -### DataExtension.upsert(metadataMap) ⇒ Promise -Upserts dataExtensions after retrieving them from source and target to compare -if create or update operation is needed. +### DataExtract.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a dataExtract for deployment -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.DataExtensionMap | dataExtensions mapped by their customerKey | +| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | - + -### DataExtension.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### DataExtension.create(metadata) ⇒ Promise -Create a single dataExtension. Also creates their columns in 'dataExtension.columns' +### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | +| customerKey | string | Identifier of data extension | - + -### DataExtension.update(metadata) ⇒ Promise -Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' +## DataExtractType ⇐ [MetadataType](#MetadataType) +DataExtractType MetadataType +Only for Caching No retrieve/upsert is required +as this is a configuration in the EID -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [DataExtractType](#DataExtractType) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtractType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#DataExtractType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + + + +### DataExtractType.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Type. + +**Kind**: static method of [DataExtractType](#DataExtractType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtension.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +### DataExtractType.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Type for caching. -**Kind**: static method of [DataExtension](#DataExtension) +**Kind**: static method of [DataExtractType](#DataExtractType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +## Discovery ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + + +### Discovery.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves API endpoint +documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm + +**Kind**: static method of [Discovery](#Discovery) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | -| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | not used | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtension.retrieve(retrieveDir, [additionalFields], [_], [key]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval +## Email ⇐ [MetadataType](#MetadataType) +Email MetadataType -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [Email](#Email) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + + + +### Email.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [Email](#Email) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | | [_] | void | unused parameter | +| [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### DataExtension.retrieveSharedForCache([additionalFields]) ⇒ Promise.<TYPE.DataExtensionMap> -get shared dataExtensions from parent BU and merge them into the cache -helper for [retrieve](#DataExtension.retrieve) and for AttributeSet.fixShared_retrieve +### Email.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionMap> - keyField => metadata map +**Kind**: static method of [Email](#Email) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### DataExtension.retrieveChangelog([additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval +### Email.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map +**Kind**: static method of [Email](#Email) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| metadata | TYPE.MetadataTypeItem | a single query | - + -### DataExtension.postRetrieveTasks(metadata) ⇒ TYPE.DataExtensionItem -manages post retrieve steps +## EmailSend ⇐ [MetadataType](#MetadataType) +MessageSendActivity MetadataType -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: TYPE.DataExtensionItem - metadata +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [EmailSend](#EmailSend) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#EmailSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadataItem)](#EmailSend.update) ⇒ Promise + * [.create(metadataItem)](#EmailSend.create) ⇒ Promise + * [.deleteByKey(customerKey)](#EmailSend.deleteByKey) ⇒ Promise.<boolean> + * [.preDeployTasks(metadata)](#EmailSend.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.postRetrieveTasks(metadata)](#EmailSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + + + +### EmailSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single dataExtension | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtension.preDeployTasks(metadata) ⇒ Promise.<TYPE.DataExtensionItem> -prepares a DataExtension for deployment +### EmailSend.update(metadataItem) ⇒ Promise +Updates a single item -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionItem> - Promise of updated single DE +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single data Extension | +| metadataItem | TYPE.MetadataTypeItem | a single item | - + -### DataExtension.document([metadataMap]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it +### EmailSend.create(metadataItem) ⇒ Promise +Creates a single item -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [metadataMap] | TYPE.DataExtensionMap | a list of dataExtension definitions | +| metadataItem | TYPE.MetadataTypeItem | a single item | - + -### DataExtension.deleteByKey(customerKey) ⇒ Promise.<boolean> +### EmailSend.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtension](#DataExtension) +**Kind**: static method of [EmailSend](#EmailSend) **Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -### DataExtension.postDeleteTasks(customerKey) ⇒ Promise.<void> -clean up after deleting a metadata item +### EmailSend.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares a single item for deployment -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - promise +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - -### DataExtension.retrieveForCache() ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise - - -### DataExtension.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata in template format. - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of items - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata item | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### DataExtension.setFolderPath(metadata) -dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve -it also sets the content type which is basically the subtype - -**Kind**: static method of [DataExtension](#DataExtension) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - + -### DataExtension.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### EmailSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.MetadataTypeItem | a single query | - + -## DataExtensionField ⇐ [MetadataType](#MetadataType) -DataExtensionField MetadataType +## Event ⇐ [MetadataType](#MetadataType) +Event MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [DataExtensionField](#DataExtensionField) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields])](#DataExtensionField.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.retrieveForCache([requestParams], [additionalFields])](#DataExtensionField.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.convertToSortedArray(fieldsObj)](#DataExtensionField.convertToSortedArray) ⇒ Array.<TYPE.DataExtensionFieldItem> - * [.sortDeFields(a, b)](#DataExtensionField.sortDeFields) ⇒ boolean - * [.postRetrieveTasks(metadata, forDataExtension)](#DataExtensionField.postRetrieveTasks) ⇒ TYPE.DataExtensionFieldItem - * [.prepareDeployColumnsOnUpdate(deployColumns, deKey)](#DataExtensionField.prepareDeployColumnsOnUpdate) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - * [.deleteByKey(customerKey)](#DataExtensionField.deleteByKey) ⇒ Promise.<boolean> - * [.deleteByKeySOAP(customerKey, [fieldId])](#DataExtensionField.deleteByKeySOAP) ⇒ boolean - * [.postDeleteTasks(customerKey)](#DataExtensionField.postDeleteTasks) ⇒ void +* [Event](#Event) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Event.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#Event.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Event.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.postRetrieveTasks(eventDef)](#Event.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(key)](#Event.deleteByKey) ⇒ Promise.<boolean> + * [.deploy(metadata, deployDir, retrieveDir)](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.create(metadata)](#Event.create) ⇒ Promise + * [.update(metadataEntry)](#Event.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Event.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.parseMetadata(metadata)](#Event.parseMetadata) ⇒ TYPE.MetadataTypeItem - + -### DataExtensionField.retrieve(retrieveDir, [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records and saves it to disk +### Event.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Event Definition. +Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. +Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtensionField.retrieveForCache([requestParams], [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records for caching +### Event.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### Event.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Event Definition by Name + +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### DataExtensionField.convertToSortedArray(fieldsObj) ⇒ Array.<TYPE.DataExtensionFieldItem> -helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array +### Event.postRetrieveTasks(eventDef) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Array.<TYPE.DataExtensionFieldItem> - sorted array of field objects +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| fieldsObj | TYPE.DataExtensionFieldMap | customerKey-based list of fields for one dataExtension | +| eventDef | TYPE.MetadataTypeItem | a single item of Event Definition | - + -### DataExtensionField.sortDeFields(a, b) ⇒ boolean -sorting method to ensure `Ordinal` is respected +### Event.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - sorting based on Ordinal +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| a | TYPE.DataExtensionFieldItem | - | -| b | TYPE.DataExtensionFieldItem | - | +| key | string | Identifier of item | - + -### DataExtensionField.postRetrieveTasks(metadata, forDataExtension) ⇒ TYPE.DataExtensionFieldItem -manages post retrieve steps +### Event.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: TYPE.DataExtensionFieldItem - metadata +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionFieldItem | a single item | -| forDataExtension | boolean | when used by DataExtension class we remove more fields | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### DataExtensionField.prepareDeployColumnsOnUpdate(deployColumns, deKey) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> -Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. -Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type +### Event.create(metadata) ⇒ Promise +Creates a single Event Definition -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - existing fields by their original name to allow re-adding FieldType after update +**Kind**: static method of [Event](#Event) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| deployColumns | Array.<TYPE.DataExtensionFieldItem> | Columns of data extension that will be deployed | -| deKey | string | external/customer key of Data Extension | +| metadata | TYPE.MetadataTypeItem | a single Event Definition | - + -### DataExtensionField.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Event.update(metadataEntry) ⇒ Promise +Updates a single Event Definition (using PUT method since PATCH isn't supported) -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [Event](#Event) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadataEntry | TYPE.MetadataTypeItem | a single Event Definition | - + -### DataExtensionField.deleteByKeySOAP(customerKey, [fieldId]) ⇒ boolean -Delete a data extension from the specified business unit +### Event.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares an event definition for deployment -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - deletion success flag +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - parsed version | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [fieldId] | string | for programmatic deletes only one can pass in the ID directly | +| metadata | TYPE.MetadataTypeItem | a single eventDefinition | - + -### DataExtensionField.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### Event.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| metadata | TYPE.MetadataTypeItem | a single event definition | - + -## DataExtensionTemplate ⇐ [MetadataType](#MetadataType) -DataExtensionTemplate MetadataType +## FtpLocation ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) - -### DataExtensionTemplate.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +* [FtpLocation](#FtpLocation) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#FtpLocation.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#FtpLocation.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> -**Kind**: static method of [DataExtensionTemplate](#DataExtensionTemplate) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### FtpLocation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FtpLocation +Endpoint /automation/v1/ftplocations/ return all FtpLocations + +**Kind**: static method of [FtpLocation](#FtpLocation) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -3072,32 +3190,39 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -## DataExtract ⇐ [MetadataType](#MetadataType) -DataExtract MetadataType +### FtpLocation.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. + +**Kind**: static method of [FtpLocation](#FtpLocation) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +## FileTransfer ⇐ [MetadataType](#MetadataType) +FileTransfer MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [DataExtract](#DataExtract) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(dataExtract)](#DataExtract.create) ⇒ Promise - * [.update(dataExtract)](#DataExtract.update) ⇒ Promise - * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> +* [FileTransfer](#FileTransfer) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise + * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise + * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> - + -### DataExtract.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity. -Endpoint /automation/v1/dataextracts/ returns all Data Extracts +### FileTransfer.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FileTransfer Activity. +Endpoint /automation/v1/filetransfers/ returns all File Transfers -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -3106,20 +3231,20 @@ Endpoint /automation/v1/dataextracts/ returns all Data Extracts | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### DataExtract.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching +### FileTransfer.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FileTransfer Activity for caching -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + -### DataExtract.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific dataExtract Definition by Name +### FileTransfer.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific File Transfer Definition by Name -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -3127,87 +3252,83 @@ Retrieve a specific dataExtract Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### DataExtract.create(dataExtract) ⇒ Promise -Creates a single Data Extract +### FileTransfer.create(fileTransfer) ⇒ Promise +Creates a single File Transfer -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [FileTransfer](#FileTransfer) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | +| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - + -### DataExtract.update(dataExtract) ⇒ Promise -Updates a single Data Extract +### FileTransfer.update(fileTransfer) ⇒ Promise +Updates a single File Transfer -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [FileTransfer](#FileTransfer) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | +| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - + -### DataExtract.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a dataExtract for deployment +### FileTransfer.preDeployTasks(metadata) ⇒ Promise +prepares a fileTransfer for deployment -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata object +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | +| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - + -### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem manages post retrieve steps -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - + -### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> +### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [FileTransfer](#FileTransfer) **Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -## DataExtractType ⇐ [MetadataType](#MetadataType) -DataExtractType MetadataType -Only for Caching No retrieve/upsert is required -as this is a configuration in the EID +## Filter ⇐ [MetadataType](#MetadataType) +Filter MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) + -* [DataExtractType](#DataExtractType) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtractType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtractType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - - - -### DataExtractType.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type. +### Filter.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Filter. +Endpoint /automation/v1/filters/ returns all Filters, +but only with some of the fields. So it is needed to loop over +Filters with the endpoint /automation/v1/filters/{id} -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Filter](#Filter) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -3216,211 +3337,185 @@ Retrieves Metadata of Data Extract Type. | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### DataExtractType.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type for caching. - -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -## Discovery ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +## Folder ⇐ [MetadataType](#MetadataType) +Folder MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) - -### Discovery.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves API endpoint -documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm +* [Folder](#Folder) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise + * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise + * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> + * [.create(metadataEntry)](#Folder.create) ⇒ Promise + * [.update(metadataEntry)](#Folder.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Folder.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.getJsonFromFS(dir, [listBadKeys])](#Folder.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList])](#Folder.retrieveHelper) ⇒ Promise.<object> + * [.postRetrieveTasks(metadata)](#Folder.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.saveResults(results, retrieveDir, mid)](#Folder.saveResults) ⇒ Promise.<object> -**Kind**: static method of [Discovery](#Discovery) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### Folder.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise +Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | not used | -| [__] | void | unused parameter | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | content type of folder | | [key] | string | customer key of single item to retrieve | - + -## Email ⇐ [MetadataType](#MetadataType) -Email MetadataType +### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise +Retrieves folder metadata for caching -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise -* [Email](#Email) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | content type of folder | - + -### Email.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Folder.upsert(metadata) ⇒ Promise.<object> +Folder upsert (copied from Metadata Upsert), after retrieving from target +and comparing to check if create or update operation is needed. +Copied due to having a dependency on itself, meaning the created need to be serial -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | - + -### Email.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### Folder.create(metadataEntry) ⇒ Promise +creates a folder based on metatadata -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadataEntry | TYPE.MetadataTypeItem | metadata of the folder | - + -### Email.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Folder.update(metadataEntry) ⇒ Promise +Updates a single Folder. -**Kind**: static method of [Email](#Email) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | - + -## EmailSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType +### Folder.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares a folder for deployment -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of parsed folder metadata -* [EmailSend](#EmailSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#EmailSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadataItem)](#EmailSend.update) ⇒ Promise - * [.create(metadataItem)](#EmailSend.create) ⇒ Promise - * [.deleteByKey(customerKey)](#EmailSend.deleteByKey) ⇒ Promise.<boolean> - * [.preDeployTasks(metadata)](#EmailSend.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postRetrieveTasks(metadata)](#EmailSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single folder definition | - + -### EmailSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Folder.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Folder](#Folder) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | - + -### EmailSend.update(metadataItem) ⇒ Promise -Updates a single item +### Folder.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList]) ⇒ Promise.<object> +Helper to retrieve the folders as promise -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise - Promise +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - soap object | Param | Type | Description | | --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [queryAllAccounts] | boolean | which queryAllAccounts setting to use | +| [contentTypeList] | Array.<string> | content type of folder | - - -### EmailSend.create(metadataItem) ⇒ Promise -Creates a single item - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | - - - -### EmailSend.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - + -### EmailSend.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a single item for deployment +### Folder.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise +**Kind**: static method of [Folder](#Folder) +**Returns**: TYPE.MetadataTypeItem - cloned metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| metadata | TYPE.MetadataTypeItem | metadata mapped by their keyField | - + -### EmailSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Folder.saveResults(results, retrieveDir, mid) ⇒ Promise.<object> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | +| results | object | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| mid | number | current mid for this credential / business unit | - + -## Event ⇐ [MetadataType](#MetadataType) -Event MetadataType +## ImportFile ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Event](#Event) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Event.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Event.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Event.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.postRetrieveTasks(eventDef)](#Event.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#Event.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.create(metadata)](#Event.create) ⇒ Promise - * [.update(metadataEntry)](#Event.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Event.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata)](#Event.parseMetadata) ⇒ TYPE.MetadataTypeItem +* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(importFile)](#ImportFile.create) ⇒ Promise + * [.update(importFile)](#ImportFile.update) ⇒ Promise + * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> - + -### Event.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Event Definition. -Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. -Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} +### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Import File. +Endpoint /automation/v1/imports/ return all Import Files with all details. +Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -3429,20 +3524,27 @@ Currently it is not needed to loop over Imports with endpoint /interaction/v1/Ev | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### Event.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise -### Event.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Event Definition by Name +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata + + +### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Import Definition by Name + +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -3450,111 +3552,110 @@ Retrieve a specific Event Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Event.postRetrieveTasks(eventDef) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### ImportFile.create(importFile) ⇒ Promise +Creates a single Import File -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| eventDef | TYPE.MetadataTypeItem | a single item of Event Definition | +| importFile | TYPE.MetadataTypeItem | a single Import File | - + -### Event.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### ImportFile.update(importFile) ⇒ Promise +Updates a single Import File -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| importFile | TYPE.MetadataTypeItem | a single Import File | - + -### Event.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy +### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata -**Kind**: static method of [Event](#Event) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | | deployDir | string | directory where deploy metadata are saved | | retrieveDir | string | directory where metadata after deploy should be saved | - - -### Event.create(metadata) ⇒ Promise -Creates a single Event Definition - -**Kind**: static method of [Event](#Event) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single Event Definition | - - + -### Event.update(metadataEntry) ⇒ Promise -Updates a single Event Definition (using PUT method since PATCH isn't supported) +### ImportFile.preDeployTasks(metadata) ⇒ Promise +prepares a import definition for deployment -**Kind**: static method of [Event](#Event) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single Event Definition | +| metadata | TYPE.MetadataTypeItem | a single importDef | - + -### Event.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment +### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed version +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single eventDefinition | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Event.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed metadata +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single event definition | +| customerKey | string | Identifier of data extension | - + -## FtpLocation ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +## Journey ⇐ [MetadataType](#MetadataType) +Journey MetadataType +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! +id: A unique id of the journey assigned by the journey’s API during its creation +key: A unique id of the journey within the MID. Can be generated by the developer +definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [FtpLocation](#FtpLocation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FtpLocation.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FtpLocation.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> +* [Journey](#Journey) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean> + * [.deploy(metadata, deployDir, retrieveDir)](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.update(metadata)](#Journey.update) ⇒ Promise + * [.create(metadata)](#Journey.create) ⇒ Promise + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Journey.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [._postRetrieveTasksBulk(metadataMap)](#Journey._postRetrieveTasksBulk) + * [.postRetrieveTasks(metadata)](#Journey.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.preDeployTasks(metadata)](#Journey.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Journey.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - + -### FtpLocation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FtpLocation -Endpoint /automation/v1/ftplocations/ return all FtpLocations +### Journey.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Journey -**Kind**: static method of [FtpLocation](#FtpLocation) +**Kind**: static method of [Journey](#Journey) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | @@ -3564,1519 +3665,1350 @@ Endpoint /automation/v1/ftplocations/ return all FtpLocations | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### FtpLocation.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. +### Journey.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [FtpLocation](#FtpLocation) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<boolean> - deletion success status -## FileTransfer ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType +| Param | Type | Description | +| --- | --- | --- | +| key | string | Identifier of item | -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) + -* [FileTransfer](#FileTransfer) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise - * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise - * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> - - - -### FileTransfer.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity. -Endpoint /automation/v1/filetransfers/ returns all File Transfers +### Journey.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### FileTransfer.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity for caching +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - + -### FileTransfer.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific File Transfer Definition by Name +### Journey.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### FileTransfer.create(fileTransfer) ⇒ Promise -Creates a single File Transfer +### Journey.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [Journey](#Journey) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### FileTransfer.update(fileTransfer) ⇒ Promise -Updates a single File Transfer +### Journey.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### FileTransfer.preDeployTasks(metadata) ⇒ Promise -prepares a fileTransfer for deployment +### Journey.\_postRetrieveTasksBulk(metadataMap) +helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise +**Kind**: static method of [Journey](#Journey) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | +| metadataMap | TYPE.MetadataTypeMap | key=customer key, value=metadata | - + -### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +### Journey.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem manages post retrieve steps +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: TYPE.MetadataTypeItem - parsed metadata +**Kind**: static method of [Journey](#Journey) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Journey.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a TSD for deployment +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Journey](#Journey) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -## Filter ⇐ [MetadataType](#MetadataType) -Filter MetadataType +| metadata | TYPE.MetadataTypeItem | of a single TSD | -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - + -### Filter.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Filter. -Endpoint /automation/v1/filters/ returns all Filters, -but only with some of the fields. So it is needed to loop over -Filters with the endpoint /automation/v1/filters/{id} +### Journey.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [Filter](#Filter) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [Journey](#Journey) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -## Folder ⇐ [MetadataType](#MetadataType) -Folder MetadataType +## List ⇐ [MetadataType](#MetadataType) +List MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Folder](#Folder) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise - * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise - * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> - * [.create(metadataEntry)](#Folder.create) ⇒ Promise - * [.update(metadataEntry)](#Folder.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Folder.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.getJsonFromFS(dir, [listBadKeys])](#Folder.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList])](#Folder.retrieveHelper) ⇒ Promise.<object> - * [.postRetrieveTasks(metadata)](#Folder.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.saveResults(results, retrieveDir, mid)](#Folder.saveResults) ⇒ Promise.<object> +* [List](#List) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#List.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#List.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.deleteByKey(customerKey)](#List.deleteByKey) ⇒ Promise.<boolean> + * [.postRetrieveTasks(list)](#List.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.parseMetadata(metadata, [parseForCache])](#List.parseMetadata) ⇒ TYPE.MetadataTypeItem - + -### Folder.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise -Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata +### List.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Lists -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise +**Kind**: static method of [List](#List) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | content type of folder | +| [_] | void | unused parameter | +| [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise -Retrieves folder metadata for caching - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | content type of folder | - - - -### Folder.upsert(metadata) ⇒ Promise.<object> -Folder upsert (copied from Metadata Upsert), after retrieving from target -and comparing to check if create or update operation is needed. -Copied due to having a dependency on itself, meaning the created need to be serial - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +### List.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk - +**Kind**: static method of [List](#List) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -### Folder.create(metadataEntry) ⇒ Promise -creates a folder based on metatadata +### List.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise +**Kind**: static method of [List](#List) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata of the folder | +| customerKey | string | Identifier of data extension | - + -### Folder.update(metadataEntry) ⇒ Promise -Updates a single Folder. +### List.postRetrieveTasks(list) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise +**Kind**: static method of [List](#List) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| list | TYPE.MetadataTypeItem | a single list | - + -### Folder.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a folder for deployment +### List.parseMetadata(metadata, [parseForCache]) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of parsed folder metadata +**Kind**: static method of [List](#List) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single folder definition | - - - -### Folder.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending - -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +| metadata | TYPE.MetadataTypeItem | a single list definition | +| [parseForCache] | boolean | if set to true, the Category ID is kept | -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | + - +## MetadataType +MetadataType class that gets extended by their specific metadata type class. +Provides default functionality that can be overwritten by child metadata type classes -### Folder.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList]) ⇒ Promise.<object> -Helper to retrieve the folders as promise +**Kind**: global class -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - soap object - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [queryAllAccounts] | boolean | which queryAllAccounts setting to use | -| [contentTypeList] | Array.<string> | content type of folder | +* [MetadataType](#MetadataType) + * [.client](#MetadataType.client) : TYPE.SDK + * [.properties](#MetadataType.properties) : TYPE.Mcdevrc + * [.subType](#MetadataType.subType) : string + * [.buObject](#MetadataType.buObject) : TYPE.BuObject + * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> + * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void + * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.setFolderPath(metadata)](#MetadataType.setFolderPath) + * [.setFolderId(metadata)](#MetadataType.setFolderId) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> + * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void + * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void + * [.refresh()](#MetadataType.refresh) ⇒ void + * [.execute()](#MetadataType.execute) ⇒ void + * [.pause()](#MetadataType.pause) ⇒ void + * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean + * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean + * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null + * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null + * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null + * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null + * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) + * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null + * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> + * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> + * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> + * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void + * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void + * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void + * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void + * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void + * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean + * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string + * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object + * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void + * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void + * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> + * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> + * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> + * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> + * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object + * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - + -### Folder.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +### MetadataType.client : TYPE.SDK +**Kind**: static property of [MetadataType](#MetadataType) + -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeItem - cloned metadata +### MetadataType.properties : TYPE.Mcdevrc +**Kind**: static property of [MetadataType](#MetadataType) + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | metadata mapped by their keyField | +### MetadataType.subType : string +**Kind**: static property of [MetadataType](#MetadataType) + - +### MetadataType.buObject : TYPE.BuObject +**Kind**: static property of [MetadataType](#MetadataType) + -### Folder.saveResults(results, retrieveDir, mid) ⇒ Promise.<object> -Helper for writing Metadata to disk, used for Retrieve and deploy +### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| results | object | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| mid | number | current mid for this credential / business unit | - - - -## ImportFile ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(importFile)](#ImportFile.create) ⇒ Promise - * [.update(importFile)](#ImportFile.update) ⇒ Promise - * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | - + -### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Import File. -Endpoint /automation/v1/imports/ return all Import Files with all details. -Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} +### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> +Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - Fieldnames | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [isCaching] | boolean | if true, then check if field should be skipped for caching | - + -### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching +### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Import Definition by Name +### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### ImportFile.create(importFile) ⇒ Promise -Creates a single Import File +### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - + -### ImportFile.update(importFile) ⇒ Promise -Updates a single Import File +### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata +### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> +helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### ImportFile.preDeployTasks(metadata) ⇒ Promise -prepares a import definition for deployment +### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeItem - cloned metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single importDef | +| metadata | TYPE.MetadataTypeItem | a single item | +| targetDir | string | folder where retrieves should be saved | +| [isTemplating] | boolean | signals that we are retrieving templates | - + -### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### MetadataType.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single item | - + -### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.setFolderId(metadata) +generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadata | TYPE.MetadataTypeItem | a single item | - - -## Journey ⇐ [MetadataType](#MetadataType) -Journey MetadataType -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -id: A unique id of the journey assigned by the journey’s API during its creation -key: A unique id of the journey within the MID. Can be generated by the developer -definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Journey](#Journey) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.update(metadata)](#Journey.update) ⇒ Promise - * [.create(metadata)](#Journey.create) ⇒ Promise - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Journey.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [._postRetrieveTasksBulk(metadataMap)](#Journey._postRetrieveTasksBulk) - * [.postRetrieveTasks(metadata)](#Journey.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.preDeployTasks(metadata)](#Journey.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Journey.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - - + -### Journey.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Journey +### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | | [key] | string | customer key of single item to retrieve | - + -### Journey.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### Journey.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy +### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | - + -### Journey.update(metadata) ⇒ Promise -Updates a single item +### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [subType] | string | optionally limit to a single subtype | - + -### Journey.create(metadata) ⇒ Promise -Creates a single item +### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> +Retrieve a specific Script by Name -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| name | string | name (not key) of the metadata item | - + -### Journey.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| templateDir | string | (List of) Directory where built definitions will be saved | +| key | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Journey.\_postRetrieveTasksBulk(metadataMap) -helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and +### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +Gets executed before deploying metadata -**Kind**: static method of [Journey](#Journey) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | key=customer key, value=metadata | +| metadata | TYPE.MetadataTypeItem | a single metadata item | +| deployDir | string | folder where files for deployment are stored | - + -### Journey.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! +### MetadataType.create(metadata, deployDir) ⇒ void +Abstract create method that needs to be implemented in child metadata type -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| deployDir | string | directory where deploy metadata are saved | - + -### Journey.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! +### MetadataType.update(metadata, [metadataBefore]) ⇒ void +Abstract update method that needs to be implemented in child metadata type -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - metadata object +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | - - - -### Journey.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | -**Kind**: static method of [Journey](#Journey) -**Returns**: 'create' \| 'update' \| 'skip' - action to take + -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +### MetadataType.refresh() ⇒ void +Abstract refresh method that needs to be implemented in child metadata type - +**Kind**: static method of [MetadataType](#MetadataType) + -## List ⇐ [MetadataType](#MetadataType) -List MetadataType +### MetadataType.execute() ⇒ void +Abstract execute method that needs to be implemented in child metadata type -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) + -* [List](#List) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#List.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#List.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(customerKey)](#List.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(list)](#List.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata, [parseForCache])](#List.parseMetadata) ⇒ TYPE.MetadataTypeItem +### MetadataType.pause() ⇒ void +Abstract pause method that needs to be implemented in child metadata type - +**Kind**: static method of [MetadataType](#MetadataType) + -### List.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Lists +### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true if metadata was changed | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### List.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### List.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment -**Kind**: static method of [List](#List) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true on first identified deviation or false if none are found | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | +| [silent] | boolean | optionally suppress logging | - + -### List.postRetrieveTasks(list) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> +MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| list | TYPE.MetadataTypeItem | a single list | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | - + -### List.parseMetadata(metadata, [parseForCache]) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single list definition | -| [parseForCache] | boolean | if set to true, the Category ID is kept | - - - -## MetadataType -MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes - -**Kind**: global class - -* [MetadataType](#MetadataType) - * [.client](#MetadataType.client) : TYPE.SDK - * [.properties](#MetadataType.properties) : TYPE.Mcdevrc - * [.subType](#MetadataType.subType) : string - * [.buObject](#MetadataType.buObject) : TYPE.BuObject - * [.client](#MetadataType.client) : TYPE.SDK - * [.properties](#MetadataType.properties) : TYPE.Mcdevrc - * [.subType](#MetadataType.subType) : string - * [.buObject](#MetadataType.buObject) : TYPE.BuObject - * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> - * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void - * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.setFolderPath(metadata)](#MetadataType.setFolderPath) - * [.setFolderId(metadata)](#MetadataType.setFolderId) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void - * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void - * [.refresh()](#MetadataType.refresh) ⇒ void - * [.execute()](#MetadataType.execute) ⇒ void - * [.pause()](#MetadataType.pause) ⇒ void - * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean - * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean - * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null - * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null - * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null - * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null - * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) - * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null - * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> - * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> - * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> - * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void - * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void - * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void - * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void - * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void - * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean - * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string - * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object - * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void - * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void - * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> - * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> - * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object - * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> - * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void - * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.setFolderPath(metadata)](#MetadataType.setFolderPath) - * [.setFolderId(metadata)](#MetadataType.setFolderId) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void - * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void - * [.refresh()](#MetadataType.refresh) ⇒ void - * [.execute()](#MetadataType.execute) ⇒ void - * [.pause()](#MetadataType.pause) ⇒ void - * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean - * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean - * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null - * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null - * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null - * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null - * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) - * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null - * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> - * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> - * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> - * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void - * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void - * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void - * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void - * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void - * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean - * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string - * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object - * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void - * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void - * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> - * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> - * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object - * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### MetadataType.client : TYPE.SDK -**Kind**: static property of [MetadataType](#MetadataType) - +### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null +Creates a single metadata entry via REST -### MetadataType.properties : TYPE.Mcdevrc -**Kind**: static property of [MetadataType](#MetadataType) - +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error -### MetadataType.subType : string -**Kind**: static property of [MetadataType](#MetadataType) - +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| uri | string | rest endpoint for POST | -### MetadataType.buObject : TYPE.BuObject -**Kind**: static property of [MetadataType](#MetadataType) - + -### MetadataType.client : TYPE.SDK -**Kind**: static property of [MetadataType](#MetadataType) - +### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Creates a single metadata entry via fuel-soap (generic lib not wrapper) -### MetadataType.properties : TYPE.Mcdevrc -**Kind**: static property of [MetadataType](#MetadataType) - +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error -### MetadataType.subType : string -**Kind**: static property of [MetadataType](#MetadataType) - +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | -### MetadataType.buObject : TYPE.BuObject -**Kind**: static property of [MetadataType](#MetadataType) - + -### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending +### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null +Updates a single metadata entry via REST **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | +| uri | string | | rest endpoint for PATCH | +| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | - + -### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> -Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. +### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Updates a single metadata entry via fuel-soap (generic lib not wrapper) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - Fieldnames +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [isCaching] | boolean | if true, then check if field should be skipped for caching | - - +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | -### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata + +### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| ex | Error | error that occured | +| msg | 'creating' \| 'updating' | what to print in the log | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +### MetadataType.getSOAPErrorMsg(ex) ⇒ string +helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - error message | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | -| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| ex | Error | error that occured | - + -### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) +### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +Retrieves Metadata for Rest Types **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| [singleRetrieve] | string \| number | key of single item to filter by | -### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> -helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id + +### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | +| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | +| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | - + -### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +### MetadataType.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeItem - cloned metadata +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| targetDir | string | folder where retrieves should be saved | -| [isTemplating] | boolean | signals that we are retrieving templates | +| ex | Error | exception | +| id | string | id or key of item | - + -### MetadataType.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> +Used to execute a query/automation etc. **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| uri | string | REST endpoint where the POST request should be sent | +| key | string | item key | - + -### MetadataType.setFolderId(metadata) -generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> +Used to execute a query/automation etc. **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:object}> - metadata key and API response | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | - + -### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> +helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | +| [singleRetrieve] | string \| number | key of single item to filter by | +| metadataMap | TYPE.MetadataTypeMap | saved metadata | - + -### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk +### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void +Deletes a field in a metadata entry if the selected definition property equals false. **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | +| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | +| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | +| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | +| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | - +**Example** +```js +Removes field (or nested fields childs) that are not updateable +deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); +``` + -### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not createable **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [subType] | string | optionally limit to a single subtype | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> -Retrieve a specific Script by Name +### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not updateable **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| name | string | name (not key) of the metadata item | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### MetadataType.keepTemplateFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the template **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| templateDir | string | (List of) Directory where built definitions will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -Gets executed before deploying metadata +### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the stored metadata **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| deployDir | string | folder where files for deployment are stored | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MetadataType.create(metadata, deployDir) ⇒ void -Abstract create method that needs to be implemented in child metadata type +### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean +checks if the current metadata entry should be saved on retrieve or not **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: skip saving == filtered; false: continue with saving | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| deployDir | string | directory where deploy metadata are saved | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - + -### MetadataType.update(metadata, [metadataBefore]) ⇒ void -Abstract update method that needs to be implemented in child metadata type +### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean +optionally filter by what folder something is in **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - - - -### MetadataType.refresh() ⇒ void -Abstract refresh method that needs to be implemented in child metadata type +| metadataEntry | object | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.execute() ⇒ void -Abstract execute method that needs to be implemented in child metadata type +### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy **Kind**: static method of [MetadataType](#MetadataType) - +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata -### MetadataType.pause() ⇒ void -Abstract pause method that needs to be implemented in child metadata type +| Param | Type | Description | +| --- | --- | --- | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) +searches extracted file for template variable names and applies the market values **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true if metadata was changed +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string +helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) +searches extracted file for template variable values and applies the market variable names **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true on first identified deviation or false if none are found +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | -| [silent] | boolean | optionally suppress logging | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> -MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. +### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types (e.g script, asset, query) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null -Creates a single metadata entry via REST +### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> +check template directory for complex types that open subfolders for their subtypes **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Returns**: Promise.<string> - subtype name | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| uri | string | rest endpoint for POST | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Creates a single metadata entry via fuel-soap (generic lib not wrapper) +### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object +optional method used for some types to try a different folder structure **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Returns**: object - metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null -Updates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | -| uri | string | | rest endpoint for PATCH | -| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | +| ex | Error | error from first attempt | - + -### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Updates a single metadata entry via fuel-soap (generic lib not wrapper) +### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Builds definition based on template +NOTE: Most metadata files should use this generic method, unless custom +parsing is required (for example scripts & queries) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| templateName | string | name of the metadata file | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | - + + +### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages -### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | -| msg | 'creating' \| 'updating' | what to print in the log | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| ex | object | response payload from REST API | - + -### MetadataType.getSOAPErrorMsg(ex) ⇒ string -helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) +### MetadataType.document([metadata], [isDeploy]) ⇒ void +Gets metadata cache with limited fields and does not store value to disk **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - error message | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | +| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | +| [isDeploy] | boolean | used to skip non-supported message during deploy | - + -### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### MetadataType.resolveId(id) ⇒ Promise.<string> +get name & key for provided id **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Returns**: Promise.<string> - key of metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| id | string | Identifier of metadata | - + -### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -Retrieves Metadata for Rest Types +### MetadataType.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | -| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | -| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | +| customerKey | string | Identifier of data extension | - + -### MetadataType.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) +### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> +clean up after deleting a metadata item **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: null - - +**Returns**: Promise.<void> - - Promise | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| customerKey | string | Identifier of metadata item | +| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | - + -### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> -Used to execute a query/automation etc. +### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| uri | string | REST endpoint where the POST request should be sent | -| key | string | item key | +| customerKey | string | Identifier of metadata | +| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> -Used to execute a query/automation etc. +### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| url | string | endpoint | +| key | string | Identifier of metadata | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> -helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) +### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object +Returns metadata of a business unit that is saved locally **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Returns**: object - Metadata of BU in local directory | Param | Type | Description | | --- | --- | --- | -| [singleRetrieve] | string \| number | key of single item to filter by | -| metadataMap | TYPE.MetadataTypeMap | saved metadata | +| readDir | string | root directory of metadata. | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| [buMetadata] | object | Metadata of BU in local directory | - + -### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | - - +| keyArr | Array.<string> | customerkey of the metadata | -### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void -Deletes a field in a metadata entry if the selected definition property equals false. + +### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> **Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - list of keys | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | -| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | -| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | -| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -**Example** -```js -Removes field (or nested fields childs) that are not updateable -deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); -``` - + -### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not createable +## MobileCode ⇐ [MetadataType](#MetadataType) +MobileCode MetadataType -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +* [MobileCode](#MobileCode) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileCode.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#MobileCode.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not updateable +### MobileCode.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Mobile Keywords +Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileCode](#MobileCode) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.keepTemplateFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the template +### MobileCode.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileCode](#MobileCode) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +## MobileKeyword ⇐ [MetadataType](#MetadataType) +MobileKeyword MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the stored metadata +* [MobileKeyword](#MobileKeyword) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void + * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(metadata)](#MobileKeyword.create) ⇒ Promise + * [.update(metadata)](#MobileKeyword.update) ⇒ Promise + * [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void + * [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ Object + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileKeyword._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.preDeployTasks(metadata, deployDir)](#MobileKeyword.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.postCreateTasks(metadataEntry, apiResponse)](#MobileKeyword.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileKeyword.postUpdateTasks) ⇒ void + * [._mergeCode(metadata, deployDir, [templateName])](#MobileKeyword._mergeCode) ⇒ Promise.<string> + * [.deleteByKey(key)](#MobileKeyword.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#MobileKeyword.postDeleteTasks) ⇒ void + * [.getFilesToCommit(keyArr)](#MobileKeyword.getFilesToCommit) ⇒ Array.<string> -**Kind**: static method of [MetadataType](#MetadataType) + + +### MobileKeyword.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void +Retrieves Metadata of Mobile Keywords +Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean -checks if the current metadata entry should be saved on retrieve or not +### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: skip saving == filtered; false: continue with saving +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean -optionally filter by what folder something is in +### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| metadataEntry | object | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) -searches extracted file for template variable names and applies the market values +### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +retrieve an item and create a template from it -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| key | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string -helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) -searches extracted file for template variable values and applies the market variable names +### MobileKeyword.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### MobileKeyword.update(metadata) ⇒ Promise +Updates a single item + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MobileKeyword.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void +manages post retrieve steps + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | + + + +### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object +helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested) + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Object - returns found extension and file content + +| Param | Type | Description | +| --- | --- | --- | +| metadataScript | string | the code of the file | + + + +### MobileKeyword.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types (e.g script, asset, query) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileKeyword](#MobileKeyword) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | | metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - + -### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### MobileKeyword.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> helper for [buildTemplate](#MetadataType.buildTemplate) handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileKeyword](#MobileKeyword) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | @@ -5087,6496 +5019,2668 @@ handles extracted code if any are found for complex types | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + -### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> -check template directory for complex types that open subfolders for their subtypes +### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - subtype name +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object -optional method used for some types to try a different folder structure +### MobileKeyword.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares an event definition for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - metadata +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | -| ex | Error | error from first attempt | +| metadata | TYPE.MetadataTypeItem | a single MobileKeyword | +| deployDir | string | directory of deploy files | - + -### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Builds definition based on template -NOTE: Most metadata files should use this generic method, unless custom -parsing is required (for example scripts & queries) +### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [MobileKeyword](#MobileKeyword) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| templateName | string | name of the metadata file | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages +### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [MobileKeyword](#MobileKeyword) | Param | Type | Description | | --- | --- | --- | -| ex | object | response payload from REST API | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### MetadataType.document([metadata], [isDeploy]) ⇒ void -Gets metadata cache with limited fields and does not store value to disk +### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#MobileKeyword.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<string> - content for metadata.script | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | -| [isDeploy] | boolean | used to skip non-supported message during deploy | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | - + -### MetadataType.resolveId(id) ⇒ Promise.<string> -get name & key for provided id +### MobileKeyword.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - key of metadata +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| id | string | Identifier of metadata | +| key | string | Identifier of item | - + -### MetadataType.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit +### MobileKeyword.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success status +**Kind**: static method of [MobileKeyword](#MobileKeyword) | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| customerKey | string | Identifier of metadata item | - + -### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> -clean up after deleting a metadata item +### MobileKeyword.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - Promise +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | -| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | +| keyArr | Array.<string> | customerkey of the metadata | - + -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +## MobileMessage ⇐ [MetadataType](#MetadataType) +MobileMessage MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +* [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void + * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadata)](#MobileMessage.update) ⇒ Promise + * [.create(metadata)](#MobileMessage.create) ⇒ Promise + * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> + * [.prepExtractedCode(code)](#MobileMessage.prepExtractedCode) ⇒ Object + * [.getFilesToCommit(keyArr)](#MobileMessage.getFilesToCommit) ⇒ Array.<string> + * [.postRetrieveTasks(metadata)](#MobileMessage.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.preDeployTasks(metadata, deployDir)](#MobileMessage.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postCreateTasks(metadataEntry, apiResponse)](#MobileMessage.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileMessage.postUpdateTasks) ⇒ void + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileMessage._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.deleteByKey(id)](#MobileMessage.deleteByKey) ⇒ Promise.<boolean> - + -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### MobileMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void +Retrieves Metadata of Mobile Keywords -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| url | string | endpoint | -| key | string | Identifier of metadata | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object -Returns metadata of a business unit that is saved locally +### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - Metadata of BU in local directory +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| readDir | string | root directory of metadata. | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | -| [buMetadata] | object | Metadata of BU in local directory | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MobileMessage.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - list of keys +### MobileMessage.create(metadata) ⇒ Promise +Creates a single item + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending +### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<string> - code | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | - + -### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> -Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. +### MobileMessage.prepExtractedCode(code) ⇒ Object +helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - Fieldnames +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Object - returns found extension and file content | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [isCaching] | boolean | if true, then check if field should be skipped for caching | +| code | string | the code of the file | - + -### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata +### MobileMessage.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| keyArr | Array.<string> | customerkey of the metadata | - + -### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +### MobileMessage.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | -| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| metadata | TYPE.MetadataTypeItem | a single query | - + -### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) +### MobileMessage.preDeployTasks(metadata, deployDir) ⇒ TYPE.MetadataTypeItem +prepares an event definition for deployment -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: TYPE.MetadataTypeItem - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | +| metadata | TYPE.MetadataTypeItem | a single MobileMessage | +| deployDir | string | directory of deploy files | - + -### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileMessage](#MobileMessage) | Param | Type | Description | | --- | --- | --- | | metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | | apiResponse | object | varies depending on the API call | - + -### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> -helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id +### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Kind**: static method of [MobileMessage](#MobileMessage) | Param | Type | Description | | --- | --- | --- | | metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | | apiResponse | object | varies depending on the API call | - + -### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +### MobileMessage.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeItem - cloned metadata +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| targetDir | string | folder where retrieves should be saved | -| [isTemplating] | boolean | signals that we are retrieving templates | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MetadataType.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### MobileMessage.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + -### MetadataType.setFolderId(metadata) -generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + + +### MobileMessage.deleteByKey(id) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit +! the endpoint expects the ID and not a key but for mcdev in this case key==id + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | +| id | string | Identifier of item | - + -### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +## Query ⇐ [MetadataType](#MetadataType) +Query MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +* [Query](#Query) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> + * [.execute(keyArr)](#Query.execute) ⇒ Promise.<Array.<string>> + * [.retrieveForCache()](#Query.retrieveForCache) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Query.retrieveAsTemplate) ⇒ Promise.<{metadata: Query, type: string}> + * [.postRetrieveTasks(metadata)](#Query.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.create(query)](#Query.create) ⇒ Promise + * [.update(query)](#Query.update) ⇒ Promise + * [.preDeployTasks(metadata, deployDir)](#Query.preDeployTasks) ⇒ Promise.<TYPE.QueryItem> + * [.applyTemplateValues(code, templateVariables)](#Query.applyTemplateValues) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> + * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void + * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void + * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) - + -### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk +### Query.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> +Retrieves Metadata of queries -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### Query.execute(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed successfully | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [subType] | string | optionally limit to a single subtype | +| keyArr | Array.<string> | customerkey of the metadata | - + -### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> -Retrieve a specific Script by Name +### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> +Retrieves query metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata + + +### Query.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: Query, type: string}> +Retrieve a specific Query by Name + +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: Query, type: string}> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | +| name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| name | string | name (not key) of the metadata item | - + -### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### Query.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata +**Kind**: static method of [Query](#Query) +**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| templateDir | string | (List of) Directory where built definitions will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.QueryItem | a single query | - + -### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -Gets executed before deploying metadata +### Query.create(query) ⇒ Promise +Creates a single query -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item +**Kind**: static method of [Query](#Query) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| deployDir | string | folder where files for deployment are stored | +| query | TYPE.QueryItem | a single query | - + -### MetadataType.create(metadata, deployDir) ⇒ void -Abstract create method that needs to be implemented in child metadata type +### Query.update(query) ⇒ Promise +Updates a single query -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Query](#Query) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| deployDir | string | directory where deploy metadata are saved | +| query | TYPE.QueryItem | a single query | - + -### MetadataType.update(metadata, [metadataBefore]) ⇒ void -Abstract update method that needs to be implemented in child metadata type +### Query.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.QueryItem> +prepares a Query for deployment -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<TYPE.QueryItem> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - - - -### MetadataType.refresh() ⇒ void -Abstract refresh method that needs to be implemented in child metadata type +| metadata | TYPE.QueryItem | a single query activity | +| deployDir | string | directory of deploy files | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.execute() ⇒ void -Abstract execute method that needs to be implemented in child metadata type +### Query.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#Query.buildDefinitionForNested) +searches extracted SQL file for template variables and applies the market values -**Kind**: static method of [MetadataType](#MetadataType) - +**Kind**: static method of [Query](#Query) +**Returns**: string - code with markets applied -### MetadataType.pause() ⇒ void -Abstract pause method that needs to be implemented in child metadata type +| Param | Type | Description | +| --- | --- | --- | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### Query.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true if metadata was changed +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.QueryItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### Query.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true on first identified deviation or false if none are found +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | -| [silent] | boolean | optionally suppress logging | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.QueryItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +queries are saved as 1 json and 1 sql file. both files need to be run through templating +``` + -### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> -MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. +### Query.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map +**Kind**: static method of [Query](#Query) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | +| keyArr | Array.<string> | customerkey of the metadata | - + -### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### Query.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages but adds query specific filters to error texts -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [Query](#Query) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| ex | object | response payload from REST API | - + -### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null -Creates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| uri | string | rest endpoint for POST | - - - -### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Creates a single metadata entry via fuel-soap (generic lib not wrapper) +### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null -Updates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | -| uri | string | | rest endpoint for PATCH | -| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | - - - -### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Updates a single metadata entry via fuel-soap (generic lib not wrapper) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +| customerKey | string | Identifier of data extension | -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | + - +### Query.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Query](#Query) | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | -| msg | 'creating' \| 'updating' | what to print in the log | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| customerKey | string | Identifier of metadata item | - + -### MetadataType.getSOAPErrorMsg(ex) ⇒ string -helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) +### Query.postDeployTasks(upsertResults) +Gets executed after deployment of metadata type -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - error message +**Kind**: static method of [Query](#Query) | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | - + -### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata +## Role ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +* [Role](#Role) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [___], [key])](#Role.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.preDeployTasks(metadata)](#Role.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.create(metadata)](#Role.create) ⇒ Promise + * [.update(metadata)](#Role.update) ⇒ Promise + * [.document([metadata])](#Role.document) ⇒ Promise.<void> + * [._traverseRoles(role, element, [permission], [isAllowed])](#Role._traverseRoles) ⇒ void - + -### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -Retrieves Metadata for Rest Types +### Role.retrieve(retrieveDir, _, [___], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +**Kind**: static method of [Role](#Role) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Metadata store object | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | -| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | -| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | +| _ | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [___] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) +### Role.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +Gets executed before deploying metadata -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: null - - +**Kind**: static method of [Role](#Role) +**Returns**: TYPE.MetadataTypeItem - Promise of a single metadata item | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| metadata | TYPE.MetadataTypeItem | a single metadata item | - + -### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> -Used to execute a query/automation etc. +### Role.create(metadata) ⇒ Promise +Create a single Role. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) +**Kind**: static method of [Role](#Role) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| uri | string | REST endpoint where the POST request should be sent | -| key | string | item key | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> -Used to execute a query/automation etc. +### Role.update(metadata) ⇒ Promise +Updates a single Role. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response +**Kind**: static method of [Role](#Role) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> -helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) +### Role.document([metadata]) ⇒ Promise.<void> +Creates markdown documentation of all roles -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Role](#Role) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| [singleRetrieve] | string \| number | key of single item to filter by | -| metadataMap | TYPE.MetadataTypeMap | saved metadata | - - - -### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void -Deletes a field in a metadata entry if the selected definition property equals false. - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | -| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | -| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | -| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | +| [metadata] | TYPE.MetadataTypeMap | role definitions | -**Example** -```js -Removes field (or nested fields childs) that are not updateable -deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); -``` - + -### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not createable +### Role.\_traverseRoles(role, element, [permission], [isAllowed]) ⇒ void +iterates through permissions to output proper row-names for nested permissionss -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Role](#Role) | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| role | string | name of the user role | +| element | object | data of the permission | +| [permission] | string | name of the permission | +| [isAllowed] | string | "true" / "false" from the | - + -### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not updateable +## Script ⇐ [MetadataType](#MetadataType) +Script MetadataType -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +* [Script](#Script) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> + * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> + * [.update(script)](#Script.update) ⇒ Promise + * [.create(script)](#Script.create) ⇒ Promise + * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> + * [.preDeployTasks(metadata, dir)](#Script.preDeployTasks) ⇒ TYPE.ScriptItem + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object + * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void - + -### MetadataType.keepTemplateFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the template +### Script.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> +Retrieves Metadata of Script +Endpoint /automation/v1/scripts/ return all Scripts with all details. -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the stored metadata - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean -checks if the current metadata entry should be saved on retrieve or not - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: skip saving == filtered; false: continue with saving - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - - - -### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean -optionally filter by what folder something is in - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | object | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - - - -### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) -searches extracted file for template variable names and applies the market values - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string -helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) -searches extracted file for template variable values and applies the market variable names - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types (e.g script, asset, query) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> -check template directory for complex types that open subfolders for their subtypes - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - subtype name - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | - - - -### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object -optional method used for some types to try a different folder structure - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | -| ex | Error | error from first attempt | - - - -### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Builds definition based on template -NOTE: Most metadata files should use this generic method, unless custom -parsing is required (for example scripts & queries) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| templateName | string | name of the metadata file | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> \| void - formatted Error Message - -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | - - - -### MetadataType.document([metadata], [isDeploy]) ⇒ void -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | -| [isDeploy] | boolean | used to skip non-supported message during deploy | - - - -### MetadataType.resolveId(id) ⇒ Promise.<string> -get name & key for provided id - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - key of metadata - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | - - - -### MetadataType.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> -clean up after deleting a metadata item - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - Promise - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | -| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | - - - -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| url | string | endpoint | -| key | string | Identifier of metadata | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object -Returns metadata of a business unit that is saved locally - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - Metadata of BU in local directory - -| Param | Type | Description | -| --- | --- | --- | -| readDir | string | root directory of metadata. | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | -| [buMetadata] | object | Metadata of BU in local directory | - - - -### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - list of keys - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | - - - -## MobileCode ⇐ [MetadataType](#MetadataType) -MobileCode MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [MobileCode](#MobileCode) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileCode.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#MobileCode.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - - - -### MobileCode.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. - -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### MobileCode.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -## MobileKeyword ⇐ [MetadataType](#MetadataType) -MobileKeyword MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [MobileKeyword](#MobileKeyword) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(metadata)](#MobileKeyword.create) ⇒ Promise - * [.update(metadata)](#MobileKeyword.update) ⇒ Promise - * [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - * [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ Object - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileKeyword._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.preDeployTasks(metadata, deployDir)](#MobileKeyword.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileKeyword.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileKeyword.postUpdateTasks) ⇒ void - * [._mergeCode(metadata, deployDir, [templateName])](#MobileKeyword._mergeCode) ⇒ Promise.<string> - * [.deleteByKey(key)](#MobileKeyword.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#MobileKeyword.postDeleteTasks) ⇒ void - * [.getFilesToCommit(keyArr)](#MobileKeyword.getFilesToCommit) ⇒ Array.<string> - - - -### MobileKeyword.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: 'create' \| 'update' \| 'skip' - action to take - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -retrieve an item and create a template from it - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MobileKeyword.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileKeyword.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileKeyword.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void -manages post retrieve steps - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object -helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Object - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| metadataScript | string | the code of the file | - - - -### MobileKeyword.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MobileKeyword.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### MobileKeyword.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares an event definition for deployment - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileKeyword | -| deployDir | string | directory of deploy files | - - - -### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileKeyword.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<string> - content for metadata.script - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### MobileKeyword.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -### MobileKeyword.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [MobileKeyword](#MobileKeyword) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### MobileKeyword.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## MobileMessage ⇐ [MetadataType](#MetadataType) -MobileMessage MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#MobileMessage.update) ⇒ Promise - * [.create(metadata)](#MobileMessage.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> - * [.prepExtractedCode(code)](#MobileMessage.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#MobileMessage.getFilesToCommit) ⇒ Array.<string> - * [.postRetrieveTasks(metadata)](#MobileMessage.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.preDeployTasks(metadata, deployDir)](#MobileMessage.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileMessage.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileMessage.postUpdateTasks) ⇒ void - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileMessage._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.deleteByKey(id)](#MobileMessage.deleteByKey) ⇒ Promise.<boolean> - - - -### MobileMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### MobileMessage.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileMessage.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<string> - code - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### MobileMessage.prepExtractedCode(code) ⇒ Object -helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested) - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Object - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| code | string | the code of the file | - - - -### MobileMessage.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### MobileMessage.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | - - - -### MobileMessage.preDeployTasks(metadata, deployDir) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.MetadataTypeItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileMessage | -| deployDir | string | directory of deploy files | - - - -### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [MobileMessage](#MobileMessage) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) - -**Kind**: static method of [MobileMessage](#MobileMessage) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileMessage.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MobileMessage.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### MobileMessage.deleteByKey(id) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit -! the endpoint expects the ID and not a key but for mcdev in this case key==id - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of item | - - - -## Query ⇐ [MetadataType](#MetadataType) -Query MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Query](#Query) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.execute(keyArr)](#Query.execute) ⇒ Promise.<Array.<string>> - * [.retrieveForCache()](#Query.retrieveForCache) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Query.retrieveAsTemplate) ⇒ Promise.<{metadata: Query, type: string}> - * [.postRetrieveTasks(metadata)](#Query.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.create(query)](#Query.create) ⇒ Promise - * [.update(query)](#Query.update) ⇒ Promise - * [.preDeployTasks(metadata, deployDir)](#Query.preDeployTasks) ⇒ Promise.<TYPE.QueryItem> - * [.applyTemplateValues(code, templateVariables)](#Query.applyTemplateValues) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> - * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void - * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void - * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) - - - -### Query.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves Metadata of queries - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Query.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed successfully - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves query metadata for caching - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata - - -### Query.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: Query, type: string}> -Retrieve a specific Query by Name - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: Query, type: string}> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Query.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Query](#Query) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.QueryItem | a single query | - - - -### Query.create(query) ⇒ Promise -Creates a single query - -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| query | TYPE.QueryItem | a single query | - - - -### Query.update(query) ⇒ Promise -Updates a single query - -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| query | TYPE.QueryItem | a single query | - - - -### Query.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.QueryItem> -prepares a Query for deployment - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<TYPE.QueryItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.QueryItem | a single query activity | -| deployDir | string | directory of deploy files | - - - -### Query.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#Query.buildDefinitionForNested) -searches extracted SQL file for template variables and applies the market values - -**Kind**: static method of [Query](#Query) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Query.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### Query.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -queries are saved as 1 json and 1 sql file. both files need to be run through templating -``` - - -### Query.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Query.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts - -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> \| void - formatted Error Message - -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | - - - -### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Query.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [Query](#Query) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### Query.postDeployTasks(upsertResults) -Gets executed after deployment of metadata type - -**Kind**: static method of [Query](#Query) - -| Param | Type | Description | -| --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | - - - -## Role ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Role](#Role) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [___], [key])](#Role.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.preDeployTasks(metadata)](#Role.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.create(metadata)](#Role.create) ⇒ Promise - * [.update(metadata)](#Role.update) ⇒ Promise - * [.document([metadata])](#Role.document) ⇒ Promise.<void> - * [._traverseRoles(role, element, [permission], [isAllowed])](#Role._traverseRoles) ⇒ void - - - -### Role.retrieve(retrieveDir, _, [___], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud - -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Metadata store object - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [___] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Role.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed before deploying metadata - -**Kind**: static method of [Role](#Role) -**Returns**: TYPE.MetadataTypeItem - Promise of a single metadata item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | - - - -### Role.create(metadata) ⇒ Promise -Create a single Role. - -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### Role.update(metadata) ⇒ Promise -Updates a single Role. - -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### Role.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles - -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | role definitions | - - - -### Role.\_traverseRoles(role, element, [permission], [isAllowed]) ⇒ void -iterates through permissions to output proper row-names for nested permissionss - -**Kind**: static method of [Role](#Role) - -| Param | Type | Description | -| --- | --- | --- | -| role | string | name of the user role | -| element | object | data of the permission | -| [permission] | string | name of the permission | -| [isAllowed] | string | "true" / "false" from the | - - - -## Script ⇐ [MetadataType](#MetadataType) -Script MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Script](#Script) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> - * [.update(script)](#Script.update) ⇒ Promise - * [.create(script)](#Script.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> - * [.preDeployTasks(metadata, dir)](#Script.preDeployTasks) ⇒ TYPE.ScriptItem - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void - - - -### Script.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves Metadata of Script -Endpoint /automation/v1/scripts/ return all Scripts with all details. - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Script.retrieveForCache() ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves script metadata for caching - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise - - -### Script.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.Script, type: string}> -Retrieve a specific Script by Name - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.Script, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Script.update(script) ⇒ Promise -Updates a single Script - -**Kind**: static method of [Script](#Script) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | - - - -### Script.create(script) ⇒ Promise -Creates a single Script - -**Kind**: static method of [Script](#Script) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | - - - -### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#Script.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<string> - content for metadata.script - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.ScriptItem | a single asset definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### Script.preDeployTasks(metadata, dir) ⇒ TYPE.ScriptItem -prepares a Script for deployment - -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.ScriptItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.ScriptItem | a single script activity definition | -| dir | string | directory of deploy files | - - - -### Script.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### Script.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.CodeExtractItem - a single item with code parts extracted - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.ScriptItem | a single item | - - - -### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object -helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) - -**Kind**: static method of [Script](#Script) -**Returns**: Object - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| metadataScript | string | the code of the file | -| metadataName | string | the name of the metadata | - - - -### Script.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Script](#Script) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Script.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [Script](#Script) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -## SendClassification ⇐ [MetadataType](#MetadataType) -SendClassification MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - - -### SendClassification.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [SendClassification](#SendClassification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -## TransactionalEmail ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalEmail MetadataType - -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) - -* [TransactionalEmail](#TransactionalEmail) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.update(metadata)](#TransactionalEmail.update) ⇒ Promise - * [.preDeployTasks(metadata)](#TransactionalEmail.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(_, apiResponse)](#TransactionalEmail.postCreateTasks) ⇒ void - * [.postDeployTasks()](#TransactionalEmail.postDeployTasks) ⇒ void - * [.postRetrieveTasks(metadata)](#TransactionalEmail.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#TransactionalEmail.deleteByKey) ⇒ Promise.<boolean> - - - -### TransactionalEmail.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | how the item shall look after the update | - - - -### TransactionalEmail.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalEmail.postCreateTasks(_, apiResponse) ⇒ void -helper for [TransactionalEmail.createREST](TransactionalEmail.createREST) - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) - -| Param | Type | Description | -| --- | --- | --- | -| _ | TYPE.MetadataTypeItem | not used | -| apiResponse | object | varies depending on the API call | - - - -### TransactionalEmail.postDeployTasks() ⇒ void -Gets executed after deployment of metadata type - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) - - -### TransactionalEmail.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - a single item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalEmail.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -## TransactionalMessage ⇐ [MetadataType](#MetadataType) -TransactionalMessage MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise - * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise - * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> - - - -### TransactionalMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to cache | - - - -### TransactionalMessage.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalMessage.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalMessage.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -## TransactionalPush ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalPush TransactionalMessage - -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) - -* [TransactionalPush](#TransactionalPush) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.preDeployTasks(metadata)](#TransactionalPush.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#TransactionalPush.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - - - -### TransactionalPush.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment - -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalPush.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - a single item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -## TransactionalSMS ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalSMS MetadataType - -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) - -* [TransactionalSMS](#TransactionalSMS) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.postDeleteTasks(customerKey)](#TransactionalSMS.postDeleteTasks) ⇒ void - * [.preDeployTasks(metadata, deployDir)](#TransactionalSMS.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [._mergeCode(metadata, deployDir, [templateName])](#TransactionalSMS._mergeCode) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#TransactionalSMS.postRetrieveTasks) ⇒ Promise.<TYPE.CodeExtractItem> - * [.prepExtractedCode(metadataScript)](#TransactionalSMS.prepExtractedCode) ⇒ Promise.<{fileExt:string, code:string}> - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#TransactionalSMS._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._isHTML(code)](#TransactionalSMS._isHTML) ⇒ boolean - * [.getFilesToCommit(keyArr)](#TransactionalSMS.getFilesToCommit) ⇒ Array.<string> - - - -### TransactionalSMS.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### TransactionalSMS.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares for deployment - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| deployDir | string | directory of deploy files | - - - -### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#TransactionalSMS.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<string> - content for metadata.script - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### TransactionalSMS.postRetrieveTasks(metadata) ⇒ Promise.<TYPE.CodeExtractItem> -manages post retrieve steps - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.CodeExtractItem> - Array with one metadata object and one ssjs string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Promise.<{fileExt:string, code:string}> -helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested) - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<{fileExt:string, code:string}> - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| metadataScript | string | the code of the file | - - - -### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### TransactionalSMS.\_isHTML(code) ⇒ boolean -very simplified test for HTML code in our SMS - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: boolean - true if HTML is found - -| Param | Type | Description | -| --- | --- | --- | -| code | string | sms source code | - - - -### TransactionalSMS.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## TriggeredSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#TriggeredSend.create) ⇒ Promise - * [.update(metadata)](#TriggeredSend.update) ⇒ Promise - * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.refresh([keyArr], [checkKey])](#TriggeredSend.refresh) ⇒ Promise.<void> - * [.getKeysForValidTSDs(metadata)](#TriggeredSend.getKeysForValidTSDs) ⇒ Promise.<Array.<string>> - * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean> - - - -### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### TriggeredSend.create(metadata) ⇒ Promise -Create a single TSD. - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### TriggeredSend.update(metadata) ⇒ Promise -Updates a single TSD. - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -parses retrieved Metadata before saving - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem \| void - Array with one metadata object and one sql string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | - - - -### TriggeredSend.refresh([keyArr], [checkKey]) ⇒ Promise.<void> -TSD-specific refresh method that finds active TSDs and refreshes them - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<void> - - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [keyArr] | Array.<string> | | metadata keys | -| [checkKey] | boolean | true | whether to check if the key is valid | - - - -### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>> -helper for [refresh](#TriggeredSend.refresh) that extracts the keys from the TSD item map and eli - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<Array.<string>> - keyArr - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMapObj | TSD item map | - - - -### TriggeredSend.findRefreshableItems([assetLoaded]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -helper for [refresh](#TriggeredSend.refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](#TriggeredSend.retrieve) is using to avoid refreshing TSDs with broken dependencies - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of TSD item map - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [assetLoaded] | boolean | false | if run after Asset.deploy via --refresh option this will skip caching assets | - - - -### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean> -helper for [refresh](#TriggeredSend.refresh) that pauses, publishes and starts a triggered send - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - true if refresh was successful - -| Param | Type | Description | -| --- | --- | --- | -| key | string | external key of triggered send item | -| checkKey | boolean | whether to check if key exists on the server | - - - -## User ⇐ [MetadataType](#MetadataType) -MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [User](#User) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [__], [key])](#User.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#User.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#User.create) ⇒ Promise - * [.update(metadata)](#User.update) ⇒ Promise - * [.preDeployTasks(metadata)](#User.preDeployTasks) ⇒ TYPE.UserDocument - * [.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#User.createOrUpdate) ⇒ void - * [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ Promise.<void> - * [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ object - * [.retrieveChangelog()](#User.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.document([metadata])](#User.document) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - - - -### User.retrieve(retrieveDir, _, [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### User.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - - -### User.create(metadata) ⇒ Promise -Create a single item. - -**Kind**: static method of [User](#User) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### User.update(metadata) ⇒ Promise -Updates a single item. - -**Kind**: static method of [User](#User) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### User.preDeployTasks(metadata) ⇒ TYPE.UserDocument -prepares a item for deployment - -**Kind**: static method of [User](#User) -**Returns**: TYPE.UserDocument - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.UserDocument | of a single item | - - - -### User.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ void -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [User](#User) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.UserDocumentDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.UserDocument> | list of items to create | - - - -### User.postDeployTasks(upsertResults) ⇒ Promise.<void> -Gets executed after deployment of metadata type - -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - promise - -| Param | Type | Description | -| --- | --- | --- | -| upsertResults | TYPE.UserDocumentMap | metadata mapped by their keyField | - - - -### User.\_getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale]) ⇒ object -helper for [User._prepareRoleAssignments](User._prepareRoleAssignments) - -**Kind**: static method of [User](#User) -**Returns**: object - format needed by API - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| roleId | string | | role.ObjectID | -| roleName | string | | role.Name | -| userId | number | | user.AccountUserID | -| assignmentOnly | boolean | | if true, only assignment configuration will be returned | -| [isRoleRemovale] | boolean | false | if true, role will be removed from user; otherwise added | - - - -### User.retrieveChangelog() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### User.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles - -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | user list | - - - -### User.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -manages post retrieve steps - -**Kind**: static method of [User](#User) -**Returns**: TYPE.MetadataTypeItem \| void - a single item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -## Verification ⇐ [MetadataType](#MetadataType) -Verification MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Verification](#Verification) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], key)](#Verification.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.handleRESTErrors(ex, id)](#Verification.handleRESTErrors) ⇒ null - * [.retrieveForCache()](#Verification.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#Verification.create) ⇒ Promise - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#Verification.postCreateTasks) ⇒ void - * [.update(metadata)](#Verification.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem - * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem - * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> - - - -### Verification.retrieve(retrieveDir, [_], [__], key) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Verification Activity. - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| key | string | customer key of single item to retrieve | - - - -### Verification.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) - -**Kind**: static method of [Verification](#Verification) -**Returns**: null - - - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | - - - -### Verification.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### Verification.create(metadata) ⇒ Promise -Creates a single Data Extract - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | - - - -### Verification.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [Verification](#Verification) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - - - -### Verification.update(metadata) ⇒ Promise -Updates a single Data Extract - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | - - - -### Verification.preDeployTasks(metadata) ⇒ TYPE.VerificationItem -prepares a verification for deployment - -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | - - - -### Verification.postRetrieveTasks(metadata) ⇒ TYPE.VerificationItem -parses retrieved Metadata before saving - -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - Array with one metadata object and one sql string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | - - - -### Verification.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -## Retriever -Retrieves metadata from a business unit and saves it to the local filesystem. - -**Kind**: global class - -* [Retriever](#Retriever) - * [new Retriever(properties, buObject)](#new_Retriever_new) - * [.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly])](#Retriever+retrieve) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [._getTypeDependencies(metadataTypes)](#Retriever+_getTypeDependencies) ⇒ Array.<TYPE.SupportedMetadataTypes> - - - -### new Retriever(properties, buObject) -Creates a Retriever, uses v2 auth if v2AuthOptions are passed. - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | -| buObject | TYPE.BuObject | properties for auth | - - - -### retriever.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly]) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve metadata of specified types into local file system and Retriever.metadata - -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} - -| Param | Type | Description | -| --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | -| [namesOrKeys] | Array.<string> \| TYPE.TypeKeyCombo | name of Metadata to retrieveAsTemplate or list of keys for normal retrieval | -| [templateVariables] | TYPE.TemplateMap | Object of values which can be replaced (in case of templating) | -| [changelogOnly] | boolean | skip saving, only create json in memory | - - - -### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes> -helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of the given types - -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Array.<TYPE.SupportedMetadataTypes> - unique list dependent metadata types - -| Param | Type | Description | -| --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | - - - -## Mcdev -main class - -**Kind**: global class - -* [Mcdev](#Mcdev) - * [.version()](#Mcdev.version) ⇒ string - * [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ void - * [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ void - * [.setOptions(argv)](#Mcdev.setOptions) ⇒ void - * [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> - * [.selectTypes()](#Mcdev.selectTypes) ⇒ Promise - * [.explainTypes()](#Mcdev.explainTypes) ⇒ Array.<object> - * [.upgrade()](#Mcdev.upgrade) ⇒ Promise.<boolean> - * [.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly])](#Mcdev.retrieve) ⇒ Promise.<object> - * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Mcdev.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - * [.initProject([credentialsName])](#Mcdev.initProject) ⇒ Promise.<void> - * [.joinProject()](#Mcdev.joinProject) ⇒ Promise.<void> - * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> - * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> - * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> - * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> - * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> - * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Mcdev.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildDefinition(businessUnit, selectedType, name, market)](#Mcdev.buildDefinition) ⇒ Promise.<void> - * [.buildDefinitionBulk(listName, type, name)](#Mcdev.buildDefinitionBulk) ⇒ Promise.<void> - * [.getFilesToCommit(businessUnit, selectedType, keyArr)](#Mcdev.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.schedule(businessUnit, [selectedType], [keys])](#Mcdev.schedule) ⇒ Promise.<Object.<string, Array.<string>>> - * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> - * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> - * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> - * [.version()](#Mcdev.version) ⇒ string - * [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ void - * [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ void - * [.setOptions(argv)](#Mcdev.setOptions) ⇒ void - * [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> - * [.selectTypes()](#Mcdev.selectTypes) ⇒ Promise - * [.explainTypes()](#Mcdev.explainTypes) ⇒ Array.<object> - * [.upgrade()](#Mcdev.upgrade) ⇒ Promise.<boolean> - * [.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly])](#Mcdev.retrieve) ⇒ Promise.<object> - * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Mcdev.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - * [.initProject([credentialsName])](#Mcdev.initProject) ⇒ Promise.<void> - * [.joinProject()](#Mcdev.joinProject) ⇒ Promise.<void> - * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> - * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> - * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> - * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> - * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> - * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Mcdev.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildDefinition(businessUnit, selectedType, name, market)](#Mcdev.buildDefinition) ⇒ Promise.<void> - * [.buildDefinitionBulk(listName, type, name)](#Mcdev.buildDefinitionBulk) ⇒ Promise.<void> - * [.getFilesToCommit(businessUnit, selectedType, keyArr)](#Mcdev.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.schedule(businessUnit, [selectedType], [keys])](#Mcdev.schedule) ⇒ Promise.<Object.<string, Array.<string>>> - * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> - * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> - * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> - - - -### Mcdev.version() ⇒ string -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: string - current version of mcdev - - -### Mcdev.setSkipInteraction([skipInteraction]) ⇒ void -helper method to use unattended mode when including mcdev as a package - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| [skipInteraction] | boolean \| TYPE.skipInteraction | signals what to insert automatically for things usually asked via wizard | - - - -### Mcdev.setLoggingLevel(argv) ⇒ void -configures what is displayed in the console - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | list of command line parameters given by user | -| [argv.silent] | boolean | only errors printed to CLI | -| [argv.verbose] | boolean | chatty user CLI output | -| [argv.debug] | boolean | enables developer output & features | - - - -### Mcdev.setOptions(argv) ⇒ void -allows setting system wide / command related options - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | list of command line parameters given by user | - - - -### Mcdev.createDeltaPkg(argv) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> -handler for 'mcdev createDeltaPkg - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - list of changed items - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | yargs parameters | -| [argv.range] | string | git commit range into deploy directory | -| [argv.filter] | string | filter file paths that start with any | -| [argv.diffArr] | Array.<TYPE.DeltaPkgItem> | list of files to include in delta package (skips git diff when provided) | - - - -### Mcdev.selectTypes() ⇒ Promise -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise - . - - -### Mcdev.explainTypes() ⇒ Array.<object> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Array.<object> - list of supported types with their apiNames - - -### Mcdev.upgrade() ⇒ Promise.<boolean> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - success flag - - -### Mcdev.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly]) ⇒ Promise.<object> -Retrieve all metadata from the specified business unit into the local file system. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<object> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> \| TYPE.TypeKeyCombo | limit retrieval to given metadata type | -| [keys] | Array.<string> | limit retrieval to given metadata key | -| [changelogOnly] | boolean | skip saving, only create json in memory | - - - -### Mcdev.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> -Deploys all metadata located in the 'deploy' directory to the specified business unit - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | -| [keyArr] | Array.<string> | limit deployment to given metadata keys | - - - -### Mcdev.initProject([credentialsName]) ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [credentialsName] | string | identifying name of the installed package / project | - - - -### Mcdev.joinProject() ⇒ Promise.<void> -Clones an existing project from git repository and installs it - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - - -### Mcdev.findBUs(credentialsName) ⇒ Promise.<void> -Refreshes BU names and ID's from MC instance - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| credentialsName | string | identifying name of the installed package / project | - - - -### Mcdev.document(businessUnit, type) ⇒ Promise.<void> -Creates docs for supported metadata types in Markdown and/or HTML format - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | metadata type | - - - -### Mcdev.deleteByKey(businessUnit, type, customerKey) ⇒ Promise.<boolean> -deletes metadata from MC instance by key - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - true if successful, false otherwise - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| customerKey | string | Identifier of metadata | - - - -### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| id | string | Identifier of metadata | - - - -### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> -ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | references credentials from properties.json | -| [keyArr] | Array.<string> | metadata keys | - - - -### Mcdev.badKeys(businessUnit) ⇒ Promise.<void> -Converts metadata to legacy format. Output is saved in 'converted' directory - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | - - - -### Mcdev.retrieveAsTemplate(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve a specific metadata file and templatise. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | Array.<string> | name of the metadata | -| market | string | market which should be used to revert template | - - - -### Mcdev.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Build a template based on a list of metadata files in the retrieve folder. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | -| market | string | market localizations | - - - -### Mcdev.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<void> -Build a specific metadata file based on a template. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | string | name of the metadata | -| market | string | market localizations | - - - -### Mcdev.buildDefinitionBulk(listName, type, name) ⇒ Promise.<void> -Build a specific metadata file based on a template using a list of bu-market combos - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| listName | string | name of list of BU-market combos | -| type | string | supported metadata type | -| name | string | name of the metadata | - - - -### Mcdev.getFilesToCommit(businessUnit, selectedType, keyArr) ⇒ Promise.<Array.<string>> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Mcdev.schedule(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Schedule an item (shortcut for execute --schedule) - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of scheduled item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Start/execute an item - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of executed item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -pause an item - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.fixKeys(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Updates the key to match the name field - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.version() ⇒ string -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: string - current version of mcdev - - -### Mcdev.setSkipInteraction([skipInteraction]) ⇒ void -helper method to use unattended mode when including mcdev as a package - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| [skipInteraction] | boolean \| TYPE.skipInteraction | signals what to insert automatically for things usually asked via wizard | - - - -### Mcdev.setLoggingLevel(argv) ⇒ void -configures what is displayed in the console - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | list of command line parameters given by user | -| [argv.silent] | boolean | only errors printed to CLI | -| [argv.verbose] | boolean | chatty user CLI output | -| [argv.debug] | boolean | enables developer output & features | - - - -### Mcdev.setOptions(argv) ⇒ void -allows setting system wide / command related options - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | list of command line parameters given by user | - - - -### Mcdev.createDeltaPkg(argv) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> -handler for 'mcdev createDeltaPkg - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - list of changed items - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | yargs parameters | -| [argv.range] | string | git commit range into deploy directory | -| [argv.filter] | string | filter file paths that start with any | -| [argv.diffArr] | Array.<TYPE.DeltaPkgItem> | list of files to include in delta package (skips git diff when provided) | - - - -### Mcdev.selectTypes() ⇒ Promise -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise - . - - -### Mcdev.explainTypes() ⇒ Array.<object> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Array.<object> - list of supported types with their apiNames - - -### Mcdev.upgrade() ⇒ Promise.<boolean> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - success flag - - -### Mcdev.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly]) ⇒ Promise.<object> -Retrieve all metadata from the specified business unit into the local file system. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<object> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> \| TYPE.TypeKeyCombo | limit retrieval to given metadata type | -| [keys] | Array.<string> | limit retrieval to given metadata key | -| [changelogOnly] | boolean | skip saving, only create json in memory | - - - -### Mcdev.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> -Deploys all metadata located in the 'deploy' directory to the specified business unit - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | -| [keyArr] | Array.<string> | limit deployment to given metadata keys | - - - -### Mcdev.initProject([credentialsName]) ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [credentialsName] | string | identifying name of the installed package / project | - - - -### Mcdev.joinProject() ⇒ Promise.<void> -Clones an existing project from git repository and installs it - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - - -### Mcdev.findBUs(credentialsName) ⇒ Promise.<void> -Refreshes BU names and ID's from MC instance - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| credentialsName | string | identifying name of the installed package / project | - - - -### Mcdev.document(businessUnit, type) ⇒ Promise.<void> -Creates docs for supported metadata types in Markdown and/or HTML format - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | metadata type | - - - -### Mcdev.deleteByKey(businessUnit, type, customerKey) ⇒ Promise.<boolean> -deletes metadata from MC instance by key - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - true if successful, false otherwise - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| customerKey | string | Identifier of metadata | - - - -### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| id | string | Identifier of metadata | - - - -### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> -ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | references credentials from properties.json | -| [keyArr] | Array.<string> | metadata keys | - - - -### Mcdev.badKeys(businessUnit) ⇒ Promise.<void> -Converts metadata to legacy format. Output is saved in 'converted' directory - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | - - - -### Mcdev.retrieveAsTemplate(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve a specific metadata file and templatise. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | Array.<string> | name of the metadata | -| market | string | market which should be used to revert template | - - - -### Mcdev.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Build a template based on a list of metadata files in the retrieve folder. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | -| market | string | market localizations | - - - -### Mcdev.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<void> -Build a specific metadata file based on a template. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | string | name of the metadata | -| market | string | market localizations | - - - -### Mcdev.buildDefinitionBulk(listName, type, name) ⇒ Promise.<void> -Build a specific metadata file based on a template using a list of bu-market combos - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| listName | string | name of list of BU-market combos | -| type | string | supported metadata type | -| name | string | name of the metadata | - - - -### Mcdev.getFilesToCommit(businessUnit, selectedType, keyArr) ⇒ Promise.<Array.<string>> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Mcdev.schedule(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Schedule an item (shortcut for execute --schedule) - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of scheduled item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Start/execute an item - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of executed item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -pause an item - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.fixKeys(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Updates the key to match the name field - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -## Asset ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - - - -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | - - - -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - - - -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - - - -### Asset.create(metadata) ⇒ Promise -Creates a single asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.update(metadata) ⇒ Promise -Updates a single asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | - - - -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | - - - -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - - - -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> -Gets executed after deployment of metadata type - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | - - - -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType - -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc - -| Param | Type | Description | -| --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | - - - -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating -``` - - -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - - -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | - - - -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | - - - -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map - -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | - - - -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | - - - -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | - - - -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Asset](#Asset) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Asset.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | - - - -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | - - - -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - - - -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - - - -### Asset.create(metadata) ⇒ Promise -Creates a single asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.update(metadata) ⇒ Promise -Updates a single asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | - - - -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | - - - -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - - - -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> -Gets executed after deployment of metadata type - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | - - - -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType - -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc - -| Param | Type | Description | -| --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | - - - -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating -``` - - -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - - -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | - - - -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | - - - -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map - -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | | [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | - - - -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | - - - -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | - - - -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Asset](#Asset) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Asset.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | - - - -## MetadataType -MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes - -**Kind**: global class - -* [MetadataType](#MetadataType) - * [.client](#MetadataType.client) : TYPE.SDK - * [.properties](#MetadataType.properties) : TYPE.Mcdevrc - * [.subType](#MetadataType.subType) : string - * [.buObject](#MetadataType.buObject) : TYPE.BuObject - * [.client](#MetadataType.client) : TYPE.SDK - * [.properties](#MetadataType.properties) : TYPE.Mcdevrc - * [.subType](#MetadataType.subType) : string - * [.buObject](#MetadataType.buObject) : TYPE.BuObject - * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> - * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void - * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.setFolderPath(metadata)](#MetadataType.setFolderPath) - * [.setFolderId(metadata)](#MetadataType.setFolderId) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void - * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void - * [.refresh()](#MetadataType.refresh) ⇒ void - * [.execute()](#MetadataType.execute) ⇒ void - * [.pause()](#MetadataType.pause) ⇒ void - * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean - * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean - * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null - * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null - * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null - * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null - * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) - * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null - * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> - * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> - * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> - * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void - * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void - * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void - * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void - * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void - * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean - * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string - * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object - * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void - * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void - * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> - * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> - * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object - * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> - * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void - * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.setFolderPath(metadata)](#MetadataType.setFolderPath) - * [.setFolderId(metadata)](#MetadataType.setFolderId) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void - * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void - * [.refresh()](#MetadataType.refresh) ⇒ void - * [.execute()](#MetadataType.execute) ⇒ void - * [.pause()](#MetadataType.pause) ⇒ void - * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean - * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean - * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null - * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null - * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null - * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null - * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) - * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null - * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> - * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> - * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> - * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void - * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void - * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void - * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void - * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void - * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean - * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string - * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object - * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void - * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void - * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> - * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> - * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object - * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.client : TYPE.SDK -**Kind**: static property of [MetadataType](#MetadataType) - +### Script.retrieveForCache() ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> +Retrieves script metadata for caching -### MetadataType.properties : TYPE.Mcdevrc -**Kind**: static property of [MetadataType](#MetadataType) - +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise + -### MetadataType.subType : string -**Kind**: static property of [MetadataType](#MetadataType) - +### Script.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.Script, type: string}> +Retrieve a specific Script by Name -### MetadataType.buObject : TYPE.BuObject -**Kind**: static property of [MetadataType](#MetadataType) - +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.Script, type: string}> - Promise -### MetadataType.client : TYPE.SDK -**Kind**: static property of [MetadataType](#MetadataType) - +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -### MetadataType.properties : TYPE.Mcdevrc -**Kind**: static property of [MetadataType](#MetadataType) - + -### MetadataType.subType : string -**Kind**: static property of [MetadataType](#MetadataType) - +### Script.update(script) ⇒ Promise +Updates a single Script -### MetadataType.buObject : TYPE.BuObject -**Kind**: static property of [MetadataType](#MetadataType) - +**Kind**: static method of [Script](#Script) +**Returns**: Promise - Promise -### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending +| Param | Type | Description | +| --- | --- | --- | +| script | TYPE.MetadataTypeItem | a single Script | -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map + + +### Script.create(script) ⇒ Promise +Creates a single Script + +**Kind**: static method of [Script](#Script) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| script | TYPE.MetadataTypeItem | a single Script | - + -### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> -Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. +### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#Script.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - Fieldnames +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<string> - content for metadata.script | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [isCaching] | boolean | if true, then check if field should be skipped for caching | +| metadata | TYPE.ScriptItem | a single asset definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | - + -### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata +### Script.preDeployTasks(metadata, dir) ⇒ TYPE.ScriptItem +prepares a Script for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [Script](#Script) +**Returns**: TYPE.ScriptItem - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| metadata | TYPE.ScriptItem | a single script activity definition | +| dir | string | directory of deploy files | - + -### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +### Script.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | -| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) +### Script.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + -### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> -helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id +### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Kind**: static method of [Script](#Script) +**Returns**: TYPE.CodeExtractItem - a single item with code parts extracted | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| metadata | TYPE.ScriptItem | a single item | - + -### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object +helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeItem - cloned metadata +**Kind**: static method of [Script](#Script) +**Returns**: Object - returns found extension and file content | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| targetDir | string | folder where retrieves should be saved | -| [isTemplating] | boolean | signals that we are retrieving templates | +| metadataScript | string | the code of the file | +| metadataName | string | the name of the metadata | - + -### MetadataType.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Script.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [Script](#Script) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<boolean> - deletion success flag + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of data extension | + + + +### Script.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item + +**Kind**: static method of [Script](#Script) + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | + + + +## SendClassification ⇐ [MetadataType](#MetadataType) +SendClassification MetadataType + +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + + +### SendClassification.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [SendClassification](#SendClassification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + +| Param | Type | Description | +| --- | --- | --- | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | + + + +## TransactionalEmail ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalEmail MetadataType + +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) + +* [TransactionalEmail](#TransactionalEmail) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.update(metadata)](#TransactionalEmail.update) ⇒ Promise + * [.preDeployTasks(metadata)](#TransactionalEmail.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postCreateTasks(_, apiResponse)](#TransactionalEmail.postCreateTasks) ⇒ void + * [.postDeployTasks()](#TransactionalEmail.postDeployTasks) ⇒ void + * [.postRetrieveTasks(metadata)](#TransactionalEmail.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(key)](#TransactionalEmail.deleteByKey) ⇒ Promise.<boolean> + + + +### TransactionalEmail.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | how the item shall look after the update | - + -### MetadataType.setFolderId(metadata) -generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### TransactionalEmail.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares for deployment -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: TYPE.MetadataTypeItem - Promise | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### TransactionalEmail.postCreateTasks(_, apiResponse) ⇒ void +helper for [TransactionalEmail.createREST](TransactionalEmail.createREST) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | - - - -### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +| _ | TYPE.MetadataTypeItem | not used | +| apiResponse | object | varies depending on the API call | -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata + -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +### TransactionalEmail.postDeployTasks() ⇒ void +Gets executed after deployment of metadata type - +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) + -### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk +### TransactionalEmail.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: TYPE.MetadataTypeItem - a single item | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### TransactionalEmail.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [subType] | string | optionally limit to a single subtype | +| key | string | Identifier of item | - + -### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> -Retrieve a specific Script by Name +## TransactionalMessage ⇐ [MetadataType](#MetadataType) +TransactionalMessage MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| name | string | name (not key) of the metadata item | +* [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise + * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise + * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> - + -### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### TransactionalMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| templateDir | string | (List of) Directory where built definitions will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -Gets executed before deploying metadata +### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| deployDir | string | folder where files for deployment are stored | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to cache | - + -### MetadataType.create(metadata, deployDir) ⇒ void -Abstract create method that needs to be implemented in child metadata type +### TransactionalMessage.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| deployDir | string | directory where deploy metadata are saved | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.update(metadata, [metadataBefore]) ⇒ void -Abstract update method that needs to be implemented in child metadata type +### TransactionalMessage.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - - - -### MetadataType.refresh() ⇒ void -Abstract refresh method that needs to be implemented in child metadata type +| metadata | TYPE.MetadataTypeItem | a single item | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.execute() ⇒ void -Abstract execute method that needs to be implemented in child metadata type +### TransactionalMessage.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) - +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<boolean> - deletion success status -### MetadataType.pause() ⇒ void -Abstract pause method that needs to be implemented in child metadata type +| Param | Type | Description | +| --- | --- | --- | +| key | string | Identifier of item | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +## TransactionalPush ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalPush TransactionalMessage -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true if metadata was changed +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) -| Param | Type | Description | -| --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | +* [TransactionalPush](#TransactionalPush) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.preDeployTasks(metadata)](#TransactionalPush.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#TransactionalPush.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### TransactionalPush.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true on first identified deviation or false if none are found +**Kind**: static method of [TransactionalPush](#TransactionalPush) +**Returns**: TYPE.MetadataTypeItem - Promise | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | -| [silent] | boolean | optionally suppress logging | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> -MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. +### TransactionalPush.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map +**Kind**: static method of [TransactionalPush](#TransactionalPush) +**Returns**: TYPE.MetadataTypeItem - a single item | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +## TransactionalSMS ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalSMS MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +* [TransactionalSMS](#TransactionalSMS) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.postDeleteTasks(customerKey)](#TransactionalSMS.postDeleteTasks) ⇒ void + * [.preDeployTasks(metadata, deployDir)](#TransactionalSMS.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [._mergeCode(metadata, deployDir, [templateName])](#TransactionalSMS._mergeCode) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#TransactionalSMS.postRetrieveTasks) ⇒ Promise.<TYPE.CodeExtractItem> + * [.prepExtractedCode(metadataScript)](#TransactionalSMS.prepExtractedCode) ⇒ Promise.<{fileExt:string, code:string}> + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#TransactionalSMS._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._isHTML(code)](#TransactionalSMS._isHTML) ⇒ boolean + * [.getFilesToCommit(keyArr)](#TransactionalSMS.getFilesToCommit) ⇒ Array.<string> - + -### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null -Creates a single metadata entry via REST +### TransactionalSMS.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| uri | string | rest endpoint for POST | +| customerKey | string | Identifier of metadata item | - + -### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Creates a single metadata entry via fuel-soap (generic lib not wrapper) +### TransactionalSMS.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.MetadataTypeItem | a single item | +| deployDir | string | directory of deploy files | - + -### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null -Updates a single metadata entry via REST +### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#TransactionalSMS.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<string> - content for metadata.script -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | -| uri | string | | rest endpoint for PATCH | -| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | - + -### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Updates a single metadata entry via fuel-soap (generic lib not wrapper) +### TransactionalSMS.postRetrieveTasks(metadata) ⇒ Promise.<TYPE.CodeExtractItem> +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<TYPE.CodeExtractItem> - Array with one metadata object and one ssjs string | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) -**Kind**: static method of [MetadataType](#MetadataType) +### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Promise.<{fileExt:string, code:string}> +helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested) + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<{fileExt:string, code:string}> - returns found extension and file content | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | -| msg | 'creating' \| 'updating' | what to print in the log | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadataScript | string | the code of the file | - + -### MetadataType.getSOAPErrorMsg(ex) ⇒ string -helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) +### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - error message +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + -### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -Retrieves Metadata for Rest Types +### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| [singleRetrieve] | string \| number | key of single item to filter by | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +### TransactionalSMS.\_isHTML(code) ⇒ boolean +very simplified test for HTML code in our SMS -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | -| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | -| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: boolean - true if HTML is found - +| Param | Type | Description | +| --- | --- | --- | +| code | string | sms source code | -### MetadataType.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) + -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: null - - +### TransactionalSMS.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| keyArr | Array.<string> | customerkey of the metadata | - + -### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> -Used to execute a query/automation etc. +## TriggeredSend ⇐ [MetadataType](#MetadataType) +MessageSendActivity MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + +* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#TriggeredSend.create) ⇒ Promise + * [.update(metadata)](#TriggeredSend.update) ⇒ Promise + * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean> + * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void + * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.refresh([keyArr], [checkKey])](#TriggeredSend.refresh) ⇒ Promise.<void> + * [.getKeysForValidTSDs(metadata)](#TriggeredSend.getKeysForValidTSDs) ⇒ Promise.<Array.<string>> + * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean> + + + +### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| uri | string | REST endpoint where the POST request should be sent | -| key | string | item key | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> -Used to execute a query/automation etc. +### TriggeredSend.create(metadata) ⇒ Promise +Create a single TSD. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> -helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) +### TriggeredSend.update(metadata) ⇒ Promise +Updates a single TSD. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [singleRetrieve] | string \| number | key of single item to filter by | -| metadataMap | TYPE.MetadataTypeMap | saved metadata | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +| customerKey | string | Identifier of data extension | - + -### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void -Deletes a field in a metadata entry if the selected definition property equals false. +### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void +parses retrieved Metadata before saving -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: TYPE.MetadataTypeItem \| void - Array with one metadata object and one sql string | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | -| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | -| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | -| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | +| metadata | TYPE.MetadataTypeItem | a single item | -**Example** -```js -Removes field (or nested fields childs) that are not updateable -deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); -``` - + -### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not createable +### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a TSD for deployment -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| metadata | TYPE.MetadataTypeItem | of a single TSD | - + -### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not updateable +### TriggeredSend.refresh([keyArr], [checkKey]) ⇒ Promise.<void> +TSD-specific refresh method that finds active TSDs and refreshes them -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<void> - - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [keyArr] | Array.<string> | | metadata keys | +| [checkKey] | boolean | true | whether to check if the key is valid | - + -### MetadataType.keepTemplateFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the template +### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>> +helper for [refresh](#TriggeredSend.refresh) that extracts the keys from the TSD item map and eli -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<Array.<string>> - keyArr | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| metadata | TYPE.MetadataTypeMapObj | TSD item map | - + -### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the stored metadata +### TriggeredSend.findRefreshableItems([assetLoaded]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +helper for [refresh](#TriggeredSend.refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](#TriggeredSend.retrieve) is using to avoid refreshing TSDs with broken dependencies -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of TSD item map -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [assetLoaded] | boolean | false | if run after Asset.deploy via --refresh option this will skip caching assets | - + -### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean -checks if the current metadata entry should be saved on retrieve or not +### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean> +helper for [refresh](#TriggeredSend.refresh) that pauses, publishes and starts a triggered send -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: skip saving == filtered; false: continue with saving +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<boolean> - true if refresh was successful | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +| key | string | external key of triggered send item | +| checkKey | boolean | whether to check if key exists on the server | - + -### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean -optionally filter by what folder something is in +## User ⇐ [MetadataType](#MetadataType) +MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | object | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +* [User](#User) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [__], [key])](#User.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#User.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#User.create) ⇒ Promise + * [.update(metadata)](#User.update) ⇒ Promise + * [.preDeployTasks(metadata)](#User.preDeployTasks) ⇒ TYPE.UserDocument + * [.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#User.createOrUpdate) ⇒ void + * [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ Promise.<void> + * [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ object + * [.retrieveChangelog()](#User.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.document([metadata])](#User.document) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - + -### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### User.retrieve(retrieveDir, _, [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) -searches extracted file for template variable names and applies the market values +### User.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### User.create(metadata) ⇒ Promise +Create a single item. + +**Kind**: static method of [User](#User) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string -helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) -searches extracted file for template variable values and applies the market variable names +### User.update(metadata) ⇒ Promise +Updates a single item. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [User](#User) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types (e.g script, asset, query) +### User.preDeployTasks(metadata) ⇒ TYPE.UserDocument +prepares a item for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [User](#User) +**Returns**: TYPE.UserDocument - metadata object | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| metadata | TYPE.UserDocument | of a single item | - + -### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### User.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ void +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [User](#User) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| metadata | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.UserDocumentDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.UserDocument> | list of items to create | - + -### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> -check template directory for complex types that open subfolders for their subtypes +### User.postDeployTasks(upsertResults) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - subtype name +**Kind**: static method of [User](#User) +**Returns**: Promise.<void> - promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| upsertResults | TYPE.UserDocumentMap | metadata mapped by their keyField | - + -### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object -optional method used for some types to try a different folder structure +### User.\_getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale]) ⇒ object +helper for [User._prepareRoleAssignments](User._prepareRoleAssignments) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - metadata +**Kind**: static method of [User](#User) +**Returns**: object - format needed by API -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | -| ex | Error | error from first attempt | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| roleId | string | | role.ObjectID | +| roleName | string | | role.Name | +| userId | number | | user.AccountUserID | +| assignmentOnly | boolean | | if true, only assignment configuration will be returned | +| [isRoleRemovale] | boolean | false | if true, role will be removed from user; otherwise added | - + -### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Builds definition based on template -NOTE: Most metadata files should use this generic method, unless custom -parsing is required (for example scripts & queries) +### User.retrieveChangelog() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [User](#User) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| templateName | string | name of the metadata file | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages +### User.document([metadata]) ⇒ Promise.<void> +Creates markdown documentation of all roles -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [User](#User) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| ex | object | response payload from REST API | +| [metadata] | TYPE.MetadataTypeMap | user list | - + -### MetadataType.document([metadata], [isDeploy]) ⇒ void -Gets metadata cache with limited fields and does not store value to disk +### User.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [User](#User) +**Returns**: TYPE.MetadataTypeItem \| void - a single item | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | -| [isDeploy] | boolean | used to skip non-supported message during deploy | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.resolveId(id) ⇒ Promise.<string> -get name & key for provided id +## Verification ⇐ [MetadataType](#MetadataType) +Verification MetadataType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - key of metadata +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | +* [Verification](#Verification) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], key)](#Verification.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.handleRESTErrors(ex, id)](#Verification.handleRESTErrors) ⇒ null + * [.retrieveForCache()](#Verification.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#Verification.create) ⇒ Promise + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#Verification.postCreateTasks) ⇒ void + * [.update(metadata)](#Verification.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem + * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem + * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> - + -### MetadataType.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit +### Verification.retrieve(retrieveDir, [_], [__], key) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Verification Activity. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success status +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| key | string | customer key of single item to retrieve | - + -### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> -clean up after deleting a metadata item +### Verification.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - Promise +**Kind**: static method of [Verification](#Verification) +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | -| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | +| ex | Error | exception | +| id | string | id or key of item | - + -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### Verification.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### Verification.create(metadata) ⇒ Promise +Creates a single Data Extract + +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.VerificationItem | a single Data Extract | - + -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### Verification.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Verification](#Verification) | Param | Type | Description | | --- | --- | --- | -| url | string | endpoint | -| key | string | Identifier of metadata | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - + -### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object -Returns metadata of a business unit that is saved locally +### Verification.update(metadata) ⇒ Promise +Updates a single Data Extract -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - Metadata of BU in local directory +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| readDir | string | root directory of metadata. | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | -| [buMetadata] | object | Metadata of BU in local directory | +| metadata | TYPE.VerificationItem | a single Data Extract | - + -### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Verification.preDeployTasks(metadata) ⇒ TYPE.VerificationItem +prepares a verification for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Verification](#Verification) +**Returns**: TYPE.VerificationItem - metadata object | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.VerificationItem | a single verification activity definition | - + -### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - list of keys +### Verification.postRetrieveTasks(metadata) ⇒ TYPE.VerificationItem +parses retrieved Metadata before saving + +**Kind**: static method of [Verification](#Verification) +**Returns**: TYPE.VerificationItem - Array with one metadata object and one sql string | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| metadata | TYPE.VerificationItem | a single verification activity definition | - + -### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending +### Verification.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| key | string | Identifier of item | - + -### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> -Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. +## Retriever +Retrieves metadata from a business unit and saves it to the local filesystem. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - Fieldnames +**Kind**: global class -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [isCaching] | boolean | if true, then check if field should be skipped for caching | +* [Retriever](#Retriever) + * [new Retriever(properties, buObject)](#new_Retriever_new) + * [.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly])](#Retriever+retrieve) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [._getTypeDependencies(metadataTypes)](#Retriever+_getTypeDependencies) ⇒ Array.<TYPE.SupportedMetadataTypes> - + -### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata +### new Retriever(properties, buObject) +Creates a Retriever, uses v2 auth if v2AuthOptions are passed. -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | +| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | +| buObject | TYPE.BuObject | properties for auth | - + -### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +### retriever.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly]) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Retrieve metadata of specified types into local file system and Retriever.metadata -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: instance method of [Retriever](#Retriever) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | -| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | +| [namesOrKeys] | Array.<string> \| TYPE.TypeKeyCombo | name of Metadata to retrieveAsTemplate or list of keys for normal retrieval | +| [templateVariables] | TYPE.TemplateMap | Object of values which can be replaced (in case of templating) | +| [changelogOnly] | boolean | skip saving, only create json in memory | - + -### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) +### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes> +helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of the given types -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: instance method of [Retriever](#Retriever) +**Returns**: Array.<TYPE.SupportedMetadataTypes> - unique list dependent metadata types | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | +| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | - + -### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +## Asset ⇐ [MetadataType](#MetadataType) +FileTransfer MetadataType -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> + * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> + * [.create(metadata)](#Asset.create) ⇒ Promise + * [.update(metadata)](#Asset.update) ⇒ Promise + * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise + * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise + * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> + * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> + * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> + * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Asset.setFolderPath) + * [.setFolderId(metadata)](#Asset.setFolderId) + * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> + * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> + * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem + * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void + * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem + * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void + * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - + -### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> -helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id +### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves Metadata of Asset -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | - | +| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | +| [key] | string | customer key | - + -### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves asset metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeItem - cloned metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| targetDir | string | folder where retrieves should be saved | -| [isTemplating] | boolean | signals that we are retrieving templates | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### MetadataType.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> +Retrieves asset metadata for templating -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - + -### MetadataType.setFolderId(metadata) -generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### Asset.create(metadata) ⇒ Promise +Creates a single asset -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.AssetItem | a single asset | - + -### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### Asset.update(metadata) ⇒ Promise +Updates a single asset -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.AssetItem | a single asset | - + -### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise +Retrieves Metadata of a specific asset type -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| [retrieveDir] | string | target directory for saving assets | +| [templateName] | string | name of the metadata file | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| key | string | customer key to filter by | - + -### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk +### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise +Retrieves extended metadata (files or extended content) of asset -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | +| items | Array | array of items to retrieve | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> +Some metadata types store their actual content as a separate file, e.g. images +This method retrieves these and saves them alongside the metadata json -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [subType] | string | optionally limit to a single subtype | +| metadata | TYPE.AssetItem | a single asset | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | - + -### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> -Retrieve a specific Script by Name +### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> +helper for [preDeployTasks](#Asset.preDeployTasks) +Some metadata types store their actual content as a separate file, e.g. images +This method reads these from the local FS stores them in the metadata object allowing to deploy it -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<string> - if found will return the path of the binary file -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| name | string | name (not key) of the metadata item | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset | +| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | +| deployDir | string | | directory of deploy files | +| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - + -### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk +### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| templateDir | string | (List of) Directory where built definitions will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.AssetItem | a single asset | - + -### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -Gets executed before deploying metadata +### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| deployDir | string | folder where files for deployment are stored | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### MetadataType.create(metadata, deployDir) ⇒ void -Abstract create method that needs to be implemented in child metadata type +### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> +prepares an asset definition for deployment -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetItem> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| deployDir | string | directory where deploy metadata are saved | +| metadata | TYPE.AssetItem | a single asset | +| deployDir | string | directory of deploy files | - + -### MetadataType.update(metadata, [metadataBefore]) ⇒ void -Abstract update method that needs to be implemented in child metadata type +### Asset.\_getMainSubtype(extendedSubType) ⇒ string +find the subType matching the extendedSubType -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: string - subType: block, message, other, etc | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - - - -### MetadataType.refresh() ⇒ void -Abstract refresh method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.execute() ⇒ void -Abstract execute method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.pause() ⇒ void -Abstract pause method that needs to be implemented in child metadata type +| extendedSubType | string | webpage, htmlblock, etc | -**Kind**: static method of [MetadataType](#MetadataType) - + -### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true if metadata was changed +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment +### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true on first identified deviation or false if none are found +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | -| [silent] | boolean | optionally suppress logging | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +``` + -### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> -MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. +### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### Asset.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null -Creates a single metadata entry via REST +### Asset.setFolderId(metadata) +Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| uri | string | rest endpoint for POST | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Creates a single metadata entry via fuel-soap (generic lib not wrapper) +### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset definition | +| deployDir | string | | directory of deploy files | +| subType | TYPE.AssetSubType | | asset-subtype name | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - + -### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null -Updates a single metadata entry via REST +### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Default | Description | | --- | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | -| uri | string | | rest endpoint for PATCH | -| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | +| prefix | string | | usually the customerkey | +| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| readDirArr | Array.<string> | | directory of deploy files | +| subtypeExtension | string | | asset-subtype name ending on -meta | +| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | +| fileList | Array.<object> | | directory of files w/o leading deploy dir | +| customerKey | string | | external key of template (could have been changed if used during templating) | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - + -### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Updates a single metadata entry via fuel-soap (generic lib not wrapper) +### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem +helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it +to allow saving that separately and formatted -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.AssetItem | a single asset definition | - + -### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) -**Kind**: static method of [MetadataType](#MetadataType) +### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | -| msg | 'creating' \| 'updating' | what to print in the log | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| prefix | string | usually the customerkey | +| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| codeArr | Array.<object> | to be extended array for extracted code | - + -### MetadataType.getSOAPErrorMsg(ex) ⇒ string -helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) +### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their fileName without '.json' ending -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - error message +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| ex | Error | error that occured | +| dir | string | directory that contains '.json' files to be read | +| [_] | void | unused parameter | +| selectedSubType | Array.<string> | asset, message, ... | - + -### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetSubType> - subtype name | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -Retrieves Metadata for Rest Types +### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem +optional method used for some types to try a different folder structure -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.AssetItem - metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| [singleRetrieve] | string \| number | key of single item to filter by | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | - + -### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) +### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | -| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | -| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | +**Kind**: static method of [Asset](#Asset) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | -### MetadataType.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) + -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: null - - +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | +| customerKey | string | Identifier of data extension | - + -### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> -Used to execute a query/automation etc. +### Asset.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| uri | string | REST endpoint where the POST request should be sent | -| key | string | item key | +| customerKey | string | Identifier of metadata item | - + -### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> -Used to execute a query/automation etc. +### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found + +| Param | Type | Description | +| --- | --- | --- | +| id | string | Identifier of metadata | + + -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response +### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves Metadata of Asset + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | - | +| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | +| [key] | string | customer key | - + -### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> -helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) +### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> +Retrieves asset metadata for caching -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| [singleRetrieve] | string \| number | key of single item to filter by | -| metadataMap | TYPE.MetadataTypeMap | saved metadata | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> +Retrieves asset metadata for templating -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - + -### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void -Deletes a field in a metadata entry if the selected definition property equals false. +### Asset.create(metadata) ⇒ Promise +Creates a single asset -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | -| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | -| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | -| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | +| metadata | TYPE.AssetItem | a single asset | -**Example** -```js -Removes field (or nested fields childs) that are not updateable -deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); -``` - + -### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not createable +### Asset.update(metadata) ⇒ Promise +Updates a single asset -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| metadata | TYPE.AssetItem | a single asset | - + -### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not updateable +### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise +Retrieves Metadata of a specific asset type -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| [retrieveDir] | string | target directory for saving assets | +| [templateName] | string | name of the metadata file | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| key | string | customer key to filter by | - + -### MetadataType.keepTemplateFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the template +### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise +Retrieves extended metadata (files or extended content) of asset -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| items | Array | array of items to retrieve | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the stored metadata +### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> +Some metadata types store their actual content as a separate file, e.g. images +This method retrieves these and saves them alongside the metadata json -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| metadata | TYPE.AssetItem | a single asset | +| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | +| retrieveDir | string | target directory for saving assets | - + -### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean -checks if the current metadata entry should be saved on retrieve or not +### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> +helper for [preDeployTasks](#Asset.preDeployTasks) +Some metadata types store their actual content as a separate file, e.g. images +This method reads these from the local FS stores them in the metadata object allowing to deploy it -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: skip saving == filtered; false: continue with saving +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<string> - if found will return the path of the binary file -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset | +| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | +| deployDir | string | | directory of deploy files | +| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - + -### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean -optionally filter by what folder something is in +### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | object | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | +| metadata | TYPE.AssetItem | a single asset | - + -### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) -searches extracted file for template variable names and applies the market values +### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> +prepares an asset definition for deployment -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetItem> - Promise | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.AssetItem | a single asset | +| deployDir | string | directory of deploy files | - + -### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string -helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) -searches extracted file for template variable values and applies the market variable names +### Asset.\_getMainSubtype(extendedSubType) ⇒ string +find the subType matching the extendedSubType -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied +**Kind**: static method of [Asset](#Asset) +**Returns**: string - subType: block, message, other, etc | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| extendedSubType | string | webpage, htmlblock, etc | - + -### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types (e.g script, asset, query) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - + -### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> helper for [buildTemplate](#MetadataType.buildTemplate) handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - +**Example** +```js +assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +``` + -### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> -check template directory for complex types that open subfolders for their subtypes +### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - subtype name +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| targetDir | string | Directory where built definitions will be saved | +| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object -optional method used for some types to try a different folder structure +### Asset.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve + +**Kind**: static method of [Asset](#Asset) + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | + + + +### Asset.setFolderId(metadata) +Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - metadata +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | -| ex | Error | error from first attempt | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Builds definition based on template -NOTE: Most metadata files should use this generic method, unless custom -parsing is required (for example scripts & queries) +### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| templateName | string | name of the metadata file | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadata | TYPE.AssetItem | | a single asset definition | +| deployDir | string | | directory of deploy files | +| subType | TYPE.AssetSubType | | asset-subtype name | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - + -### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages +### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> +helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<void> - - -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| prefix | string | | usually the customerkey | +| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| readDirArr | Array.<string> | | directory of deploy files | +| subtypeExtension | string | | asset-subtype name ending on -meta | +| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | +| fileList | Array.<object> | | directory of files w/o leading deploy dir | +| customerKey | string | | external key of template (could have been changed if used during templating) | +| [templateName] | string | | name of the template used to built defintion (prior applying templating) | +| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - + -### MetadataType.document([metadata], [isDeploy]) ⇒ void -Gets metadata cache with limited fields and does not store value to disk +### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem +helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it +to allow saving that separately and formatted -**Kind**: static method of [MetadataType](#MetadataType) +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | -| [isDeploy] | boolean | used to skip non-supported message during deploy | - - +| metadata | TYPE.AssetItem | a single asset definition | -### MetadataType.resolveId(id) ⇒ Promise.<string> -get name & key for provided id + -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - key of metadata +### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| id | string | Identifier of metadata | +| prefix | string | usually the customerkey | +| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | +| codeArr | Array.<object> | to be extended array for extracted code | - + -### MetadataType.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit +### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their fileName without '.json' ending -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success status +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| dir | string | directory that contains '.json' files to be read | +| [_] | void | unused parameter | +| selectedSubType | Array.<string> | asset, message, ... | - + -### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> -clean up after deleting a metadata item +### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - Promise +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<TYPE.AssetSubType> - subtype name | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | -| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem +optional method used for some types to try a different folder structure -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Asset](#Asset) +**Returns**: TYPE.AssetItem - metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | - + -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Asset](#Asset) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| url | string | endpoint | -| key | string | Identifier of metadata | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| keyArr | Array.<string> | customerkey of the metadata | - + -### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object -Returns metadata of a business unit that is saved locally +### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - Metadata of BU in local directory +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| readDir | string | root directory of metadata. | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | -| [buMetadata] | object | Metadata of BU in local directory | +| customerKey | string | Identifier of data extension | - + -### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Asset.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item +cannot use the generic method due to the complexity of how assets are saved to disk -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Asset](#Asset) | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| customerKey | string | Identifier of metadata item | - + -### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - list of keys +### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> +get name & key for provided id + +**Kind**: static method of [Asset](#Asset) +**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| id | string | Identifier of metadata | @@ -13743,77 +9847,6 @@ Returns an SDK instance to be used for API calls | sessionKey | string | key for specific BU | | authObject | TYPE.AuthObject | credentials for specific BU | - - -## csvToArray(csv) ⇒ Array.<string> -helper to convert CSVs into an array. if only one value was given, it's also returned as an array - -**Kind**: global function -**Returns**: Array.<string> - values split into an array. - -| Param | Type | Description | -| --- | --- | --- | -| csv | string | potentially comma-separated value or null | - - - -## Mcdev.(methodName, businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -run a method across BUs - -**Kind**: global function -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of affected item keys - -| Param | Type | Description | -| --- | --- | --- | -| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -## Mcdev.(methodName, cred, bu, [type], keyArr) ⇒ Promise.<Array.<string>> -helper for [Mcdev.#runMethod](Mcdev.#runMethod) - -**Kind**: global function -**Returns**: Promise.<Array.<string>> - list of keys that were affected - -| Param | Type | Description | -| --- | --- | --- | -| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | -| cred | string | name of Credential | -| bu | string | name of BU | -| [type] | TYPE.SupportedMetadataTypes | limit execution to given metadata type | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## Mcdev.(selectedType, buObject) ⇒ Array.<string> -helper for [Mcdev.#runOnBU](Mcdev.#runOnBU) - -**Kind**: global function -**Returns**: Array.<string> - keyArr - -| Param | Type | Description | -| --- | --- | --- | -| selectedType | TYPE.SupportedMetadataTypes | limit execution to given metadata type | -| buObject | TYPE.BuObject | properties for auth | - - - -## Mcdev.(cred, bu, type, [keyArr]) ⇒ Promise.<Array.<string>> -Updates the key to match the name field - -**Kind**: global function -**Returns**: Promise.<Array.<string>> - list of keys that were affected - -| Param | Type | Description | -| --- | --- | --- | -| cred | string | name of Credential | -| bu | string | name of BU | -| type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | -| [keyArr] | Array.<string> | customerkey of the metadata | - ## TypeKeyCombo : Object.<string, string> diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index a403890d2..febd1a0b9 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1696,17 +1696,16 @@ class Asset extends MetadataType { * @returns {Promise.<{key:string, name:string, path:string}>} key, name and path of metadata; null if not found */ static async resolveId(id) { - const uri = '/asset/v1/content/assets/query'; - const payload = { - query: { - property: 'id', - simpleOperator: 'equal', - value: id, - }, - }; - const response = await this.client.rest.post(uri, payload); - if (response.items.length === 1) { - const item = response.items[0]; + let response; + try { + response = await this.client.rest.get('asset/v1/content/assets/' + id); + } catch (ex) { + if (ex.response?.status !== 404) { + throw ex; + } + } + if (response?.id) { + const item = response; const subType = this._getMainSubtype(item.assetType.name); // find path for code of content block, fall back to json if not found; undefined if not even the json exists const pathBase1 = `./retrieve/${this.buObject.credential}/${this.buObject.businessUnit}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; From b98c700030a2c6cf8b2b4fa568c02678212a498c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 25 Mar 2024 12:46:02 +0100 Subject: [PATCH 060/359] #1238: add owning MID to response --- lib/metadataTypes/Asset.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index febd1a0b9..778f3972d 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1721,6 +1721,7 @@ class Asset extends MetadataType { key: item[this.definition.keyField], name: item[this.definition.nameField], path: path, + mid: item.memberId, }; if (Util.OPTIONS.json) { // for automated processing by VSCode extension, optionally print the json From fa4e9499a018e7f9f8a27dbb7a3289dd53ac586e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 25 Mar 2024 12:48:26 +0100 Subject: [PATCH 061/359] #1238: add proper error response for id-not-found and file-not-found --- lib/metadataTypes/Asset.js | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 778f3972d..210c63800 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1720,27 +1720,37 @@ class Asset extends MetadataType { const json = { key: item[this.definition.keyField], name: item[this.definition.nameField], - path: path, mid: item.memberId, }; + if (path) { + json.path = path; + } else { + json.error = 'file not found on local disk'; + } if (Util.OPTIONS.json) { // for automated processing by VSCode extension, optionally print the json - if (Util.OPTIONS.loggerLevel !== 'error') { - console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console - } + console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console } else { Util.logger.info( ` - ${this.definition.type}-${subType} found: ${item[this.definition.keyField]} (${item[this.definition.nameField]})` ); - Util.logger.info(' - link: ' + path); + Util.logger.info( + ' - link: ' + + (path || + `404. Try running mcdev r ${this.buObject.credential}/${this.buObject.businessUnit} ${this.definition.type}-${subType} ${item[this.definition.keyField]}`) + ); } return json; } else { + const json = { + error: 'id not found', + }; if (Util.OPTIONS.json) { - return null; + console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console + return json; } Util.logger.error(` - ${this.definition.type} with id ${id} not found on BU`); - return null; + return json; } } } From 3ac6d8fcd4b80523e4221c26207451f9f549d5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 25 Mar 2024 12:49:49 +0100 Subject: [PATCH 062/359] #1238: add test-cases for resolveId method --- docs/dist/documentation.md | 7122 +++++++---------- .../resolveId-1234-notFound-expected.json | 1 + .../resolveId-1295064-noPath-expected.json | 6 + .../resolveId-1295064-withPath-expected.json | 6 + test/type.asset.test.js | 61 + 5 files changed, 2988 insertions(+), 4208 deletions(-) create mode 100644 test/resources/9999999/asset/resolveId-1234-notFound-expected.json create mode 100644 test/resources/9999999/asset/resolveId-1295064-noPath-expected.json create mode 100644 test/resources/9999999/asset/resolveId-1295064-withPath-expected.json diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 4aa1defae..e5895a01f 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -132,9 +132,6 @@ Provides default functionality that can be overwritten by child metadata type cl
Retriever

Retrieves metadata from a business unit and saves it to the local filesystem.

-
AssetMetadataType
-

FileTransfer MetadataType

-
## Constants @@ -245,6 +242,12 @@ helper for DataExtension.#fixShared_item
setupSDK(sessionKey, authObject)SDK

Returns an SDK instance to be used for API calls

+
getActualJson(customerKey, type, subtype, [buName])Promise.<string>
+

gets file from Retrieve folder

+
+
getActualFile(customerKey, type, subtype, ext)string
+

gets file from Retrieve folder

+
## Typedefs @@ -912,35 +915,6 @@ FileTransfer MetadataType * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> @@ -1352,485 +1326,467 @@ get name & key for provided id | --- | --- | --- | | id | string | Identifier of metadata | - + -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset +## AttributeGroup ⇐ [MetadataType](#MetadataType) +AttributeGroup MetadataType -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | +* [AttributeGroup](#AttributeGroup) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeGroup.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#AttributeGroup.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.postRetrieveTasks(metadata)](#AttributeGroup.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching +### AttributeGroup.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema attribute groups. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating +### AttributeGroup.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema attribute groups for caching. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### AttributeGroup.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [AttributeGroup](#AttributeGroup) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | +| metadata | TYPE.MetadataTypeItem | a single metadata | - + -### Asset.create(metadata) ⇒ Promise -Creates a single asset +## AttributeSet ⇐ [MetadataType](#MetadataType) +AttributeSet MetadataType -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +* [AttributeSet](#AttributeSet) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeSet.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#AttributeSet.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.fixShared_retrieve(sharedDataExtensionMap, fixShared_fields)](#AttributeSet.fixShared_retrieve) ⇒ Promise.<Array.<string>> + * [.parseResponseBody(body, [singleRetrieve])](#AttributeSet.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.postRetrieveTasks(metadata)](#AttributeSet.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [._getSystemValueDefinitions()](#AttributeSet._getSystemValueDefinitions) ⇒ Array.<object> - + -### Asset.update(metadata) ⇒ Promise -Updates a single asset +### AttributeSet.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema set Definitions. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type +### AttributeSet.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of schema set definitions for caching. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### AttributeSet.fixShared\_retrieve(sharedDataExtensionMap, fixShared_fields) ⇒ Promise.<Array.<string>> +used to identify updated shared data extensions that are used in attributeSets. +helper for DataExtension.#fixShared_onBU + +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Promise.<Array.<string>> - Promise of list of shared dataExtension IDs | Param | Type | Description | | --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | +| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | +| fixShared_fields | object | DataExtensionField.fixShared_fields | - + -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset +### AttributeSet.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json +### AttributeSet.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | +| metadata | TYPE.MetadataTypeItem | a single metadata | - + -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it +### AttributeSet.\_getSystemValueDefinitions() ⇒ Array.<object> +helper for [postRetrieveTasks](#AttributeSet.postRetrieveTasks) -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file +**Kind**: static method of [AttributeSet](#AttributeSet) +**Returns**: Array.<object> - all system value definitions + -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | +## Automation ⇐ [MetadataType](#MetadataType) +Automation MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +* [Automation](#Automation) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Automation.retrieve) ⇒ Promise.<TYPE.AutomationMapObj> + * [.handleRESTErrors(ex, id)](#Automation.handleRESTErrors) ⇒ null + * [.retrieveChangelog()](#Automation.retrieveChangelog) ⇒ Promise.<TYPE.AutomationMapObj> + * [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj> + * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void + * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<Array.<string>> + * [.getErrorsREST(ex)](#Automation.getErrorsREST) ⇒ Array.<string> \| void + * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<Array.<string>> + * [.deploy(metadata, targetBU, retrieveDir)](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap> + * [.create(metadata)](#Automation.create) ⇒ Promise + * [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ Promise.<TYPE.AutomationItem> + * [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ boolean + * [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void> + * [.setFolderPath(metadata)](#Automation.setFolderPath) + * [.setFolderId(metadata)](#Automation.setFolderId) + * [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap + * [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string + * [.document([metadata])](#Automation.document) ⇒ Promise.<void> + * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata + + +### Automation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves Metadata of Automation + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> -Gets executed after deployment of metadata type + -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +### Automation.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise +**Kind**: static method of [Automation](#Automation) +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | +| ex | Error | exception | +| id | string | id or key of item | - + -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType +### Automation.retrieveChangelog() ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves Metadata of Automation -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata + -| Param | Type | Description | -| --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | +### Automation.retrieveForCache() ⇒ Promise.<TYPE.AutomationMapObj> +Retrieves automation metadata for caching - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata + -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### Automation.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.AutomationItemObj> +Retrieve a specific Automation Definition by Name -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - + -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem \| void +manages post retrieve steps -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: TYPE.AutomationItem \| void - parsed item | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| metadata | TYPE.AutomationItem | a single automation | -**Example** -```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating -``` - + -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### Automation.execute(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### Automation.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages but adds query specific filters to error texts -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Automation](#Automation) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| ex | object | response payload from REST API | - + -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### Automation.pause(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were paused | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON +### Automation.deploy(metadata, targetBU, retrieveDir) ⇒ Promise.<TYPE.AutomationMap> +Deploys automation - the saved file is the original one due to large differences required for deployment -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationMap> - Promise -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AutomationMap | metadata mapped by their keyField | +| targetBU | string | name/shorthand of target businessUnit for mapping | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON +### Automation.create(metadata) ⇒ Promise +Creates a single automation -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise - Promise -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.AutomationItem | single metadata entry | - + -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted +### Automation.update(metadata, metadataBefore) ⇒ Promise +Updates a single automation -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | +| metadata | TYPE.AutomationItem | single metadata entry | +| metadataBefore | TYPE.AutomationItem | metadata mapped by their keyField | - + -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) +### Automation.preDeployTasks(metadata) ⇒ Promise.<TYPE.AutomationItem> +Gets executed before deploying metadata + +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<TYPE.AutomationItem> - Promise | Param | Type | Description | | --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | +| metadata | TYPE.AutomationItem | metadata mapped by their keyField | - + -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending +### Automation.validateDeployMetadata(metadata) ⇒ boolean +Validates the automation to be sure it can be deployed. +Whitelisted Activites are deployed but require configuration -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [Automation](#Automation) +**Returns**: boolean - result if automation can be deployed based on steps | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | +| metadata | TYPE.AutomationItem | single automation record | - + -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes +### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ Promise.<void> +Gets executed after deployment of metadata type -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | +| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | - + -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure +### Automation.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Automation.setFolderId(metadata) +automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy -**Kind**: static method of [Asset](#Asset) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap +Builds a schedule object to be used for scheduling an automation +based on combination of ical string and start/end dates. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Automation](#Automation) +**Returns**: TYPE.AutomationScheduleSoap - Schedulable object for soap API (currently not rest supported) | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| scheduleObject | TYPE.AutomationSchedule | child of automation metadata used for scheduling | - + -### Asset.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk +### Automation.\_calcTime(offsetServer, dateInput, [offsetInput]) ⇒ string +used to convert dates to the system timezone required for startDate -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Automation](#Automation) +**Returns**: string - date in server | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| offsetServer | number | stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) | +| dateInput | string \| Date | date in ISO format (2021-12-05T20:00:00.983) | +| [offsetInput] | string | timzone difference (+02:00) | - + -### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id +### Automation.document([metadata]) ⇒ Promise.<void> +Parses metadata into a readable Markdown/HTML format then saves it -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found +**Kind**: static method of [Automation](#Automation) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| id | string | Identifier of metadata | +| [metadata] | TYPE.AutomationMap | a list of dataExtension definitions | - + -## AttributeGroup ⇐ [MetadataType](#MetadataType) -AttributeGroup MetadataType +### Automation.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Automation](#Automation) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] -* [AttributeGroup](#AttributeGroup) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeGroup.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeGroup.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.postRetrieveTasks(metadata)](#AttributeGroup.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | - + -### AttributeGroup.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups. +### Automation.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Automation](#Automation) +**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### AttributeGroup.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups for caching. +| customerKey | string | Identifier of data extension | -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### AttributeGroup.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Automation.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Automation](#Automation) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | +| customerKey | string | Identifier of metadata item | - + -## AttributeSet ⇐ [MetadataType](#MetadataType) -AttributeSet MetadataType +## Campaign ⇐ [MetadataType](#MetadataType) +Campaign MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [AttributeSet](#AttributeSet) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeSet.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeSet.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.fixShared_retrieve(sharedDataExtensionMap, fixShared_fields)](#AttributeSet.fixShared_retrieve) ⇒ Promise.<Array.<string>> - * [.parseResponseBody(body, [singleRetrieve])](#AttributeSet.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.postRetrieveTasks(metadata)](#AttributeSet.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [._getSystemValueDefinitions()](#AttributeSet._getSystemValueDefinitions) ⇒ Array.<object> +* [Campaign](#Campaign) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Campaign.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#Campaign.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getAssetTags(retrieveDir, campaignId, name)](#Campaign.getAssetTags) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### AttributeSet.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set Definitions. +### Campaign.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets -**Kind**: static method of [AttributeSet](#AttributeSet) +**Kind**: static method of [Campaign](#Campaign) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | @@ -1840,99 +1796,47 @@ Retrieves Metadata of schema set Definitions. | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### AttributeSet.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set definitions for caching. - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - - -### AttributeSet.fixShared\_retrieve(sharedDataExtensionMap, fixShared_fields) ⇒ Promise.<Array.<string>> -used to identify updated shared data extensions that are used in attributeSets. -helper for DataExtension.#fixShared_onBU - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<Array.<string>> - Promise of list of shared dataExtension IDs - -| Param | Type | Description | -| --- | --- | --- | -| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | -| fixShared_fields | object | DataExtensionField.fixShared_fields | - - - -### AttributeSet.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map + -| Param | Type | Description | -| --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +### Campaign.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching - +**Kind**: static method of [Campaign](#Campaign) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -### AttributeSet.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Campaign.getAssetTags(retrieveDir, campaignId, name) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Parses campaign asset response body and returns metadata entries mapped to their id -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Campaign](#Campaign) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Campaign Asset Object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | - - - -### AttributeSet.\_getSystemValueDefinitions() ⇒ Array.<object> -helper for [postRetrieveTasks](#AttributeSet.postRetrieveTasks) +| retrieveDir | string | folder where to save | +| campaignId | string | of camapaign to retrieve | +| name | string | of camapaign for saving | -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Array.<object> - all system value definitions - + -## Automation ⇐ [MetadataType](#MetadataType) -Automation MetadataType +## ContentArea ⇐ [MetadataType](#MetadataType) +ContentArea MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Automation](#Automation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Automation.retrieve) ⇒ Promise.<TYPE.AutomationMapObj> - * [.handleRESTErrors(ex, id)](#Automation.handleRESTErrors) ⇒ null - * [.retrieveChangelog()](#Automation.retrieveChangelog) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj> - * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void - * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<Array.<string>> - * [.getErrorsREST(ex)](#Automation.getErrorsREST) ⇒ Array.<string> \| void - * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<Array.<string>> - * [.deploy(metadata, targetBU, retrieveDir)](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap> - * [.create(metadata)](#Automation.create) ⇒ Promise - * [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ Promise.<TYPE.AutomationItem> - * [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ boolean - * [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Automation.setFolderPath) - * [.setFolderId(metadata)](#Automation.setFolderId) - * [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap - * [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string - * [.document([metadata])](#Automation.document) ⇒ Promise.<void> - * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void +* [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.setFolderPath(metadata)](#ContentArea.setFolderPath) + * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### Automation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation +### ContentArea.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata +**Kind**: static method of [ContentArea](#ContentArea) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | @@ -1941,788 +1845,771 @@ Retrieves Metadata of Automation | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### Automation.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) +### ContentArea.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve -**Kind**: static method of [Automation](#Automation) -**Returns**: null - - +**Kind**: static method of [ContentArea](#ContentArea) | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | - - - -### Automation.retrieveChangelog() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - - -### Automation.retrieveForCache() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves automation metadata for caching +| metadata | TYPE.MetadataTypeItem | a single script activity definition | -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - + -### Automation.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.AutomationItemObj> -Retrieve a specific Automation Definition by Name +### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItemObj> - Promise of metadata +**Kind**: static method of [ContentArea](#ContentArea) +**Returns**: TYPE.MetadataTypeItem - parsed item | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem \| void -manages post retrieve steps +## DataExtension ⇐ [MetadataType](#MetadataType) +DataExtension MetadataType -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationItem \| void - parsed item +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | a single automation | +* [DataExtension](#DataExtension) ⇐ [MetadataType](#MetadataType) + * [.upsert(metadataMap)](#DataExtension.upsert) ⇒ Promise + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#DataExtension.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.create(metadata)](#DataExtension.create) ⇒ Promise + * [.update(metadata)](#DataExtension.update) ⇒ Promise + * [.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated)](#DataExtension.postDeployTasks) ⇒ void + * [.retrieve(retrieveDir, [additionalFields], [_], [key])](#DataExtension.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.retrieveSharedForCache([additionalFields])](#DataExtension.retrieveSharedForCache) ⇒ Promise.<TYPE.DataExtensionMap> + * [.retrieveChangelog([additionalFields])](#DataExtension.retrieveChangelog) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.postRetrieveTasks(metadata)](#DataExtension.postRetrieveTasks) ⇒ TYPE.DataExtensionItem + * [.preDeployTasks(metadata)](#DataExtension.preDeployTasks) ⇒ Promise.<TYPE.DataExtensionItem> + * [.document([metadataMap])](#DataExtension.document) ⇒ Promise.<void> + * [.deleteByKey(customerKey)](#DataExtension.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#DataExtension.postDeleteTasks) ⇒ Promise.<void> + * [.retrieveForCache()](#DataExtension.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtension.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> + * [.setFolderPath(metadata)](#DataExtension.setFolderPath) + * [.getFilesToCommit(keyArr)](#DataExtension.getFilesToCommit) ⇒ Array.<string> - + -### Automation.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API +### DataExtension.upsert(metadataMap) ⇒ Promise +Upserts dataExtensions after retrieving them from source and target to compare +if create or update operation is needed. -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadataMap | TYPE.DataExtensionMap | dataExtensions mapped by their customerKey | - + -### Automation.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts +### DataExtension.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| ex | object | response payload from REST API | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### Automation.pause(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API +### DataExtension.create(metadata) ⇒ Promise +Create a single dataExtension. Also creates their columns in 'dataExtension.columns' -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were paused +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadata | TYPE.DataExtensionItem | single metadata entry | - + -### Automation.deploy(metadata, targetBU, retrieveDir) ⇒ Promise.<TYPE.AutomationMap> -Deploys automation - the saved file is the original one due to large differences required for deployment +### DataExtension.update(metadata) ⇒ Promise +Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMap> - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationMap | metadata mapped by their keyField | -| targetBU | string | name/shorthand of target businessUnit for mapping | -| retrieveDir | string | directory where metadata after deploy should be saved | +| metadata | TYPE.DataExtensionItem | single metadata entry | - + -### Automation.create(metadata) ⇒ Promise -Creates a single automation +### DataExtension.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | +| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | +| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### Automation.update(metadata, metadataBefore) ⇒ Promise -Updates a single automation +### DataExtension.retrieve(retrieveDir, [additionalFields], [_], [key]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | -| metadataBefore | TYPE.AutomationItem | metadata mapped by their keyField | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [_] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Automation.preDeployTasks(metadata) ⇒ Promise.<TYPE.AutomationItem> -Gets executed before deploying metadata +### DataExtension.retrieveSharedForCache([additionalFields]) ⇒ Promise.<TYPE.DataExtensionMap> +get shared dataExtensions from parent BU and merge them into the cache +helper for [retrieve](#DataExtension.retrieve) and for AttributeSet.fixShared_retrieve -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItem> - Promise +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<TYPE.DataExtensionMap> - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | metadata mapped by their keyField | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Automation.validateDeployMetadata(metadata) ⇒ boolean -Validates the automation to be sure it can be deployed. -Whitelisted Activites are deployed but require configuration +### DataExtension.retrieveChangelog([additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - result if automation can be deployed based on steps +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AutomationItem | single automation record | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### DataExtension.postRetrieveTasks(metadata) ⇒ TYPE.DataExtensionItem +manages post retrieve steps -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: TYPE.DataExtensionItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | -| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | +| metadata | TYPE.DataExtensionItem | a single dataExtension | - + -### Automation.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### DataExtension.preDeployTasks(metadata) ⇒ Promise.<TYPE.DataExtensionItem> +prepares a DataExtension for deployment -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<TYPE.DataExtensionItem> - Promise of updated single DE | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| metadata | TYPE.DataExtensionItem | a single data Extension | - + -### Automation.setFolderId(metadata) -automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### DataExtension.document([metadataMap]) ⇒ Promise.<void> +Parses metadata into a readable Markdown/HTML format then saves it -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| [metadataMap] | TYPE.DataExtensionMap | a list of dataExtension definitions | - + -### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap -Builds a schedule object to be used for scheduling an automation -based on combination of ical string and start/end dates. +### DataExtension.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationScheduleSoap - Schedulable object for soap API (currently not rest supported) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| scheduleObject | TYPE.AutomationSchedule | child of automation metadata used for scheduling | +| customerKey | string | Identifier of data extension | - + -### Automation.\_calcTime(offsetServer, dateInput, [offsetInput]) ⇒ string -used to convert dates to the system timezone required for startDate +### DataExtension.postDeleteTasks(customerKey) ⇒ Promise.<void> +clean up after deleting a metadata item -**Kind**: static method of [Automation](#Automation) -**Returns**: string - date in server +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<void> - - promise | Param | Type | Description | | --- | --- | --- | -| offsetServer | number | stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) | -| dateInput | string \| Date | date in ISO format (2021-12-05T20:00:00.983) | -| [offsetInput] | string | timzone difference (+02:00) | - - - -### Automation.document([metadata]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it +| customerKey | string | Identifier of metadata item | -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - + -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.AutomationMap | a list of dataExtension definitions | +### DataExtension.retrieveForCache() ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. - +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise + -### Automation.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### DataExtension.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> +Retrieves dataExtension metadata in template format. -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata item | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Automation.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit +### DataExtension.setFolderPath(metadata) +dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve +it also sets the content type which is basically the subtype -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - deletion success status +**Kind**: static method of [DataExtension](#DataExtension) | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadata | TYPE.MetadataTypeItem | a single script activity definition | - + -### Automation.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### DataExtension.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Automation](#Automation) +**Kind**: static method of [DataExtension](#DataExtension) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| keyArr | Array.<string> | customerkey of the metadata | - + -## Campaign ⇐ [MetadataType](#MetadataType) -Campaign MetadataType +## DataExtensionField ⇐ [MetadataType](#MetadataType) +DataExtensionField MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Campaign](#Campaign) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Campaign.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Campaign.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getAssetTags(retrieveDir, campaignId, name)](#Campaign.getAssetTags) ⇒ Promise.<TYPE.MetadataTypeMapObj> - - +* [DataExtensionField](#DataExtensionField) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [additionalFields])](#DataExtensionField.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> + * [.retrieveForCache([requestParams], [additionalFields])](#DataExtensionField.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> + * [.convertToSortedArray(fieldsObj)](#DataExtensionField.convertToSortedArray) ⇒ Array.<TYPE.DataExtensionFieldItem> + * [.sortDeFields(a, b)](#DataExtensionField.sortDeFields) ⇒ boolean + * [.postRetrieveTasks(metadata, forDataExtension)](#DataExtensionField.postRetrieveTasks) ⇒ TYPE.DataExtensionFieldItem + * [.prepareDeployColumnsOnUpdate(deployColumns, deKey)](#DataExtensionField.prepareDeployColumnsOnUpdate) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> + * [.deleteByKey(customerKey)](#DataExtensionField.deleteByKey) ⇒ Promise.<boolean> + * [.deleteByKeySOAP(customerKey, [fieldId])](#DataExtensionField.deleteByKeySOAP) ⇒ boolean + * [.postDeleteTasks(customerKey)](#DataExtensionField.postDeleteTasks) ⇒ void -### Campaign.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets + -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +### DataExtensionField.retrieve(retrieveDir, [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> +Retrieves all records and saves it to disk + +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Campaign.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### Campaign.getAssetTags(retrieveDir, campaignId, name) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Parses campaign asset response body and returns metadata entries mapped to their id +### DataExtensionField.retrieveForCache([requestParams], [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> +Retrieves all records for caching -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Campaign Asset Object +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | folder where to save | -| campaignId | string | of camapaign to retrieve | -| name | string | of camapaign for saving | - - - -## ContentArea ⇐ [MetadataType](#MetadataType) -ContentArea MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.setFolderPath(metadata)](#ContentArea.setFolderPath) - * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### ContentArea.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### DataExtensionField.convertToSortedArray(fieldsObj) ⇒ Array.<TYPE.DataExtensionFieldItem> +helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Array.<TYPE.DataExtensionFieldItem> - sorted array of field objects | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| fieldsObj | TYPE.DataExtensionFieldMap | customerKey-based list of fields for one dataExtension | - + -### ContentArea.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### DataExtensionField.sortDeFields(a, b) ⇒ boolean +sorting method to ensure `Ordinal` is respected -**Kind**: static method of [ContentArea](#ContentArea) +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: boolean - sorting based on Ordinal | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| a | TYPE.DataExtensionFieldItem | - | +| b | TYPE.DataExtensionFieldItem | - | - + -### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### DataExtensionField.postRetrieveTasks(metadata, forDataExtension) ⇒ TYPE.DataExtensionFieldItem +manages post retrieve steps -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: TYPE.MetadataTypeItem - parsed item +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: TYPE.DataExtensionFieldItem - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.DataExtensionFieldItem | a single item | +| forDataExtension | boolean | when used by DataExtension class we remove more fields | - + -## DataExtension ⇐ [MetadataType](#MetadataType) -DataExtension MetadataType +### DataExtensionField.prepareDeployColumnsOnUpdate(deployColumns, deKey) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> +Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. +Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - existing fields by their original name to allow re-adding FieldType after update -* [DataExtension](#DataExtension) ⇐ [MetadataType](#MetadataType) - * [.upsert(metadataMap)](#DataExtension.upsert) ⇒ Promise - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#DataExtension.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.create(metadata)](#DataExtension.create) ⇒ Promise - * [.update(metadata)](#DataExtension.update) ⇒ Promise - * [.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated)](#DataExtension.postDeployTasks) ⇒ void - * [.retrieve(retrieveDir, [additionalFields], [_], [key])](#DataExtension.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveSharedForCache([additionalFields])](#DataExtension.retrieveSharedForCache) ⇒ Promise.<TYPE.DataExtensionMap> - * [.retrieveChangelog([additionalFields])](#DataExtension.retrieveChangelog) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.postRetrieveTasks(metadata)](#DataExtension.postRetrieveTasks) ⇒ TYPE.DataExtensionItem - * [.preDeployTasks(metadata)](#DataExtension.preDeployTasks) ⇒ Promise.<TYPE.DataExtensionItem> - * [.document([metadataMap])](#DataExtension.document) ⇒ Promise.<void> - * [.deleteByKey(customerKey)](#DataExtension.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#DataExtension.postDeleteTasks) ⇒ Promise.<void> - * [.retrieveForCache()](#DataExtension.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtension.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.setFolderPath(metadata)](#DataExtension.setFolderPath) - * [.getFilesToCommit(keyArr)](#DataExtension.getFilesToCommit) ⇒ Array.<string> +| Param | Type | Description | +| --- | --- | --- | +| deployColumns | Array.<TYPE.DataExtensionFieldItem> | Columns of data extension that will be deployed | +| deKey | string | external/customer key of Data Extension | - + -### DataExtension.upsert(metadataMap) ⇒ Promise -Upserts dataExtensions after retrieving them from source and target to compare -if create or update operation is needed. +### DataExtensionField.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.DataExtensionMap | dataExtensions mapped by their customerKey | +| customerKey | string | Identifier of data extension | - + -### DataExtension.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### DataExtensionField.deleteByKeySOAP(customerKey, [fieldId]) ⇒ boolean +Delete a data extension from the specified business unit -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Returns**: boolean - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| customerKey | string | Identifier of metadata | +| [fieldId] | string | for programmatic deletes only one can pass in the ID directly | - + -### DataExtension.create(metadata) ⇒ Promise -Create a single dataExtension. Also creates their columns in 'dataExtension.columns' +### DataExtensionField.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: static method of [DataExtensionField](#DataExtensionField) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | +| customerKey | string | Identifier of metadata item | - + -### DataExtension.update(metadata) ⇒ Promise -Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' +## DataExtensionTemplate ⇐ [MetadataType](#MetadataType) +DataExtensionTemplate MetadataType -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + + +### DataExtensionTemplate.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [DataExtensionTemplate](#DataExtensionTemplate) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtension.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type +## DataExtract ⇐ [MetadataType](#MetadataType) +DataExtract MetadataType -**Kind**: static method of [DataExtension](#DataExtension) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | -| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +* [DataExtract](#DataExtract) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(dataExtract)](#DataExtract.create) ⇒ Promise + * [.update(dataExtract)](#DataExtract.update) ⇒ Promise + * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> - + -### DataExtension.retrieve(retrieveDir, [additionalFields], [_], [key]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval +### DataExtract.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity. +Endpoint /automation/v1/dataextracts/ returns all Data Extracts -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | | [_] | void | unused parameter | +| [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### DataExtension.retrieveSharedForCache([additionalFields]) ⇒ Promise.<TYPE.DataExtensionMap> -get shared dataExtensions from parent BU and merge them into the cache -helper for [retrieve](#DataExtension.retrieve) and for AttributeSet.fixShared_retrieve +### DataExtract.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity for caching -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionMap> - keyField => metadata map +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### DataExtract.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific dataExtract Definition by Name + +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### DataExtension.retrieveChangelog([additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval +### DataExtract.create(dataExtract) ⇒ Promise +Creates a single Data Extract -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - + -### DataExtension.postRetrieveTasks(metadata) ⇒ TYPE.DataExtensionItem -manages post retrieve steps +### DataExtract.update(dataExtract) ⇒ Promise +Updates a single Data Extract -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: TYPE.DataExtensionItem - metadata +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single dataExtension | +| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - + -### DataExtension.preDeployTasks(metadata) ⇒ Promise.<TYPE.DataExtensionItem> -prepares a DataExtension for deployment +### DataExtract.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a dataExtract for deployment -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionItem> - Promise of updated single DE +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single data Extension | +| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | - + -### DataExtension.document([metadataMap]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it +### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| [metadataMap] | TYPE.DataExtensionMap | a list of dataExtension definitions | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### DataExtension.deleteByKey(customerKey) ⇒ Promise.<boolean> +### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [DataExtract](#DataExtract) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - - -### DataExtension.postDeleteTasks(customerKey) ⇒ Promise.<void> -clean up after deleting a metadata item - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - promise + -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | +## DataExtractType ⇐ [MetadataType](#MetadataType) +DataExtractType MetadataType +Only for Caching No retrieve/upsert is required +as this is a configuration in the EID - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -### DataExtension.retrieveForCache() ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. +* [DataExtractType](#DataExtractType) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtractType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#DataExtractType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise - + -### DataExtension.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata in template format. +### DataExtractType.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Type. -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of items +**Kind**: static method of [DataExtractType](#DataExtractType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata item | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtension.setFolderPath(metadata) -dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve -it also sets the content type which is basically the subtype +### DataExtractType.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Type for caching. -**Kind**: static method of [DataExtension](#DataExtension) +**Kind**: static method of [DataExtractType](#DataExtractType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +## Discovery ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + -### DataExtension.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Discovery.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves API endpoint +documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Discovery](#Discovery) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | not used | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -## DataExtensionField ⇐ [MetadataType](#MetadataType) -DataExtensionField MetadataType +## Email ⇐ [MetadataType](#MetadataType) +Email MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [DataExtensionField](#DataExtensionField) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields])](#DataExtensionField.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.retrieveForCache([requestParams], [additionalFields])](#DataExtensionField.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.convertToSortedArray(fieldsObj)](#DataExtensionField.convertToSortedArray) ⇒ Array.<TYPE.DataExtensionFieldItem> - * [.sortDeFields(a, b)](#DataExtensionField.sortDeFields) ⇒ boolean - * [.postRetrieveTasks(metadata, forDataExtension)](#DataExtensionField.postRetrieveTasks) ⇒ TYPE.DataExtensionFieldItem - * [.prepareDeployColumnsOnUpdate(deployColumns, deKey)](#DataExtensionField.prepareDeployColumnsOnUpdate) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - * [.deleteByKey(customerKey)](#DataExtensionField.deleteByKey) ⇒ Promise.<boolean> - * [.deleteByKeySOAP(customerKey, [fieldId])](#DataExtensionField.deleteByKeySOAP) ⇒ boolean - * [.postDeleteTasks(customerKey)](#DataExtensionField.postDeleteTasks) ⇒ void +* [Email](#Email) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### DataExtensionField.retrieve(retrieveDir, [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records and saves it to disk +### Email.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items +**Kind**: static method of [Email](#Email) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtensionField.retrieveForCache([requestParams], [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records for caching +### Email.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items +**Kind**: static method of [Email](#Email) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### DataExtensionField.convertToSortedArray(fieldsObj) ⇒ Array.<TYPE.DataExtensionFieldItem> -helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array +### Email.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Array.<TYPE.DataExtensionFieldItem> - sorted array of field objects +**Kind**: static method of [Email](#Email) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| fieldsObj | TYPE.DataExtensionFieldMap | customerKey-based list of fields for one dataExtension | +| metadata | TYPE.MetadataTypeItem | a single query | - + -### DataExtensionField.sortDeFields(a, b) ⇒ boolean -sorting method to ensure `Ordinal` is respected +## EmailSend ⇐ [MetadataType](#MetadataType) +MessageSendActivity MetadataType -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - sorting based on Ordinal +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| a | TYPE.DataExtensionFieldItem | - | -| b | TYPE.DataExtensionFieldItem | - | +* [EmailSend](#EmailSend) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#EmailSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadataItem)](#EmailSend.update) ⇒ Promise + * [.create(metadataItem)](#EmailSend.create) ⇒ Promise + * [.deleteByKey(customerKey)](#EmailSend.deleteByKey) ⇒ Promise.<boolean> + * [.preDeployTasks(metadata)](#EmailSend.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.postRetrieveTasks(metadata)](#EmailSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### DataExtensionField.postRetrieveTasks(metadata, forDataExtension) ⇒ TYPE.DataExtensionFieldItem -manages post retrieve steps +### EmailSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: TYPE.DataExtensionFieldItem - metadata +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.DataExtensionFieldItem | a single item | -| forDataExtension | boolean | when used by DataExtension class we remove more fields | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### DataExtensionField.prepareDeployColumnsOnUpdate(deployColumns, deKey) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> -Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. -Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type +### EmailSend.update(metadataItem) ⇒ Promise +Updates a single item -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - existing fields by their original name to allow re-adding FieldType after update +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| deployColumns | Array.<TYPE.DataExtensionFieldItem> | Columns of data extension that will be deployed | -| deKey | string | external/customer key of Data Extension | +| metadataItem | TYPE.MetadataTypeItem | a single item | - + -### DataExtensionField.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### EmailSend.create(metadataItem) ⇒ Promise +Creates a single item -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadataItem | TYPE.MetadataTypeItem | a single item | - + -### DataExtensionField.deleteByKeySOAP(customerKey, [fieldId]) ⇒ boolean -Delete a data extension from the specified business unit +### EmailSend.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - deletion success flag +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [fieldId] | string | for programmatic deletes only one can pass in the ID directly | +| customerKey | string | Identifier of data extension | - + -### DataExtensionField.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### EmailSend.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares a single item for deployment -**Kind**: static method of [DataExtensionField](#DataExtensionField) +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -## DataExtensionTemplate ⇐ [MetadataType](#MetadataType) -DataExtensionTemplate MetadataType +| metadata | TYPE.MetadataTypeItem | a single script activity definition | -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - + -### DataExtensionTemplate.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### EmailSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtensionTemplate](#DataExtensionTemplate) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [EmailSend](#EmailSend) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeItem | a single query | - + -## DataExtract ⇐ [MetadataType](#MetadataType) -DataExtract MetadataType +## Event ⇐ [MetadataType](#MetadataType) +Event MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [DataExtract](#DataExtract) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(dataExtract)](#DataExtract.create) ⇒ Promise - * [.update(dataExtract)](#DataExtract.update) ⇒ Promise - * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> +* [Event](#Event) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Event.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#Event.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Event.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.postRetrieveTasks(eventDef)](#Event.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(key)](#Event.deleteByKey) ⇒ Promise.<boolean> + * [.deploy(metadata, deployDir, retrieveDir)](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.create(metadata)](#Event.create) ⇒ Promise + * [.update(metadataEntry)](#Event.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Event.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.parseMetadata(metadata)](#Event.parseMetadata) ⇒ TYPE.MetadataTypeItem - + -### DataExtract.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity. -Endpoint /automation/v1/dataextracts/ returns all Data Extracts +### Event.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Event Definition. +Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. +Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [Event](#Event) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | @@ -2732,19 +2619,19 @@ Endpoint /automation/v1/dataextracts/ returns all Data Extracts | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### DataExtract.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching +### Event.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [Event](#Event) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### DataExtract.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific dataExtract Definition by Name +### Event.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Event Definition by Name -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [Event](#Event) **Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | @@ -2753,87 +2640,112 @@ Retrieve a specific dataExtract Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### DataExtract.create(dataExtract) ⇒ Promise -Creates a single Data Extract +### Event.postRetrieveTasks(eventDef) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise - Promise +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | +| eventDef | TYPE.MetadataTypeItem | a single item of Event Definition | - + -### DataExtract.update(dataExtract) ⇒ Promise -Updates a single Data Extract +### Event.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [DataExtract](#DataExtract) +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<boolean> - deletion success status + +| Param | Type | Description | +| --- | --- | --- | +| key | string | Identifier of item | + + + +### Event.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy + +**Kind**: static method of [Event](#Event) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + + + +### Event.create(metadata) ⇒ Promise +Creates a single Event Definition + +**Kind**: static method of [Event](#Event) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | +| metadata | TYPE.MetadataTypeItem | a single Event Definition | - + -### DataExtract.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a dataExtract for deployment +### Event.update(metadataEntry) ⇒ Promise +Updates a single Event Definition (using PUT method since PATCH isn't supported) -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata object +**Kind**: static method of [Event](#Event) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | +| metadataEntry | TYPE.MetadataTypeItem | a single Event Definition | - + -### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Event.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares an event definition for deployment -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - parsed version | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single eventDefinition | - + -### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Event.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [Event](#Event) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadata | TYPE.MetadataTypeItem | a single event definition | - + -## DataExtractType ⇐ [MetadataType](#MetadataType) -DataExtractType MetadataType -Only for Caching No retrieve/upsert is required -as this is a configuration in the EID +## FtpLocation ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [DataExtractType](#DataExtractType) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtractType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtractType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> +* [FtpLocation](#FtpLocation) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#FtpLocation.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#FtpLocation.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### DataExtractType.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type. +### FtpLocation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FtpLocation +Endpoint /automation/v1/ftplocations/ return all FtpLocations -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [FtpLocation](#FtpLocation) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | @@ -2842,386 +2754,331 @@ Retrieves Metadata of Data Extract Type. | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### DataExtractType.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type for caching. +### FtpLocation.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - +**Kind**: static method of [FtpLocation](#FtpLocation) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + -## Discovery ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +## FileTransfer ⇐ [MetadataType](#MetadataType) +FileTransfer MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) - -### Discovery.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves API endpoint -documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm +* [FileTransfer](#FileTransfer) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise + * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise + * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> -**Kind**: static method of [Discovery](#Discovery) + + +### FileTransfer.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FileTransfer Activity. +Endpoint /automation/v1/filetransfers/ returns all File Transfers + +**Kind**: static method of [FileTransfer](#FileTransfer) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | not used | +| [_] | void | unused parameter | | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -## Email ⇐ [MetadataType](#MetadataType) -Email MetadataType + -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +### FileTransfer.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of FileTransfer Activity for caching -* [Email](#Email) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - - - -### Email.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + -### Email.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy +### FileTransfer.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific File Transfer Definition by Name -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise | Param | Type | Description | | --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Email.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### FileTransfer.create(fileTransfer) ⇒ Promise +Creates a single File Transfer -**Kind**: static method of [Email](#Email) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | - - - -## EmailSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [EmailSend](#EmailSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#EmailSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadataItem)](#EmailSend.update) ⇒ Promise - * [.create(metadataItem)](#EmailSend.create) ⇒ Promise - * [.deleteByKey(customerKey)](#EmailSend.deleteByKey) ⇒ Promise.<boolean> - * [.preDeployTasks(metadata)](#EmailSend.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postRetrieveTasks(metadata)](#EmailSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - + -### EmailSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### FileTransfer.update(fileTransfer) ⇒ Promise +Updates a single File Transfer -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - + -### EmailSend.update(metadataItem) ⇒ Promise -Updates a single item +### FileTransfer.preDeployTasks(metadata) ⇒ Promise +prepares a fileTransfer for deployment -**Kind**: static method of [EmailSend](#EmailSend) +**Kind**: static method of [FileTransfer](#FileTransfer) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - + -### EmailSend.create(metadataItem) ⇒ Promise -Creates a single item +### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise - Promise +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - + -### EmailSend.deleteByKey(customerKey) ⇒ Promise.<boolean> +### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [FileTransfer](#FileTransfer) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - - -### EmailSend.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a single item for deployment - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +## Filter ⇐ [MetadataType](#MetadataType) +Filter MetadataType - +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + -### EmailSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Filter.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Filter. +Endpoint /automation/v1/filters/ returns all Filters, +but only with some of the fields. So it is needed to loop over +Filters with the endpoint /automation/v1/filters/{id} -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string +**Kind**: static method of [Filter](#Filter) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -## Event ⇐ [MetadataType](#MetadataType) -Event MetadataType +## Folder ⇐ [MetadataType](#MetadataType) +Folder MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Event](#Event) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Event.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Event.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Event.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.postRetrieveTasks(eventDef)](#Event.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#Event.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.create(metadata)](#Event.create) ⇒ Promise - * [.update(metadataEntry)](#Event.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Event.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata)](#Event.parseMetadata) ⇒ TYPE.MetadataTypeItem +* [Folder](#Folder) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise + * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise + * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> + * [.create(metadataEntry)](#Folder.create) ⇒ Promise + * [.update(metadataEntry)](#Folder.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Folder.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.getJsonFromFS(dir, [listBadKeys])](#Folder.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList])](#Folder.retrieveHelper) ⇒ Promise.<object> + * [.postRetrieveTasks(metadata)](#Folder.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.saveResults(results, retrieveDir, mid)](#Folder.saveResults) ⇒ Promise.<object> - + -### Event.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Event Definition. -Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. -Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} +### Folder.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise +Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | content type of folder | | [key] | string | customer key of single item to retrieve | - - -### Event.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### Event.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Event Definition by Name +### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise +Retrieves folder metadata for caching -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [_] | void | parameter not used | +| [subTypeArr] | Array.<string> | content type of folder | - + -### Event.postRetrieveTasks(eventDef) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Folder.upsert(metadata) ⇒ Promise.<object> +Folder upsert (copied from Metadata Upsert), after retrieving from target +and comparing to check if create or update operation is needed. +Copied due to having a dependency on itself, meaning the created need to be serial -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - metadata +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| eventDef | TYPE.MetadataTypeItem | a single item of Event Definition | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | - + -### Event.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Folder.create(metadataEntry) ⇒ Promise +creates a folder based on metatadata -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| metadataEntry | TYPE.MetadataTypeItem | metadata of the folder | - + -### Event.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy +### Folder.update(metadataEntry) ⇒ Promise +Updates a single Folder. -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -### Event.create(metadata) ⇒ Promise -Creates a single Event Definition + -**Kind**: static method of [Event](#Event) -**Returns**: Promise - Promise +### Folder.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares a folder for deployment + +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of parsed folder metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single Event Definition | +| metadata | TYPE.MetadataTypeItem | a single folder definition | - + -### Event.update(metadataEntry) ⇒ Promise -Updates a single Event Definition (using PUT method since PATCH isn't supported) +### Folder.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending -**Kind**: static method of [Event](#Event) -**Returns**: Promise - Promise +**Kind**: static method of [Folder](#Folder) +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single Event Definition | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | - + -### Event.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment +### Folder.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList]) ⇒ Promise.<object> +Helper to retrieve the folders as promise -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed version +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - soap object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single eventDefinition | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [queryAllAccounts] | boolean | which queryAllAccounts setting to use | +| [contentTypeList] | Array.<string> | content type of folder | - + -### Event.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving +### Folder.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed metadata +**Kind**: static method of [Folder](#Folder) +**Returns**: TYPE.MetadataTypeItem - cloned metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single event definition | - - - -## FtpLocation ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [FtpLocation](#FtpLocation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FtpLocation.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FtpLocation.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> +| metadata | TYPE.MetadataTypeItem | metadata mapped by their keyField | - + -### FtpLocation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FtpLocation -Endpoint /automation/v1/ftplocations/ return all FtpLocations +### Folder.saveResults(results, retrieveDir, mid) ⇒ Promise.<object> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [FtpLocation](#FtpLocation) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise +**Kind**: static method of [Folder](#Folder) +**Returns**: Promise.<object> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### FtpLocation.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. +| results | object | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| mid | number | current mid for this credential / business unit | -**Kind**: static method of [FtpLocation](#FtpLocation) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - + -## FileTransfer ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType +## ImportFile ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [FileTransfer](#FileTransfer) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise - * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise - * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> +* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(importFile)](#ImportFile.create) ⇒ Promise + * [.update(importFile)](#ImportFile.update) ⇒ Promise + * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise + * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> - + -### FileTransfer.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity. -Endpoint /automation/v1/filetransfers/ returns all File Transfers +### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Import File. +Endpoint /automation/v1/imports/ return all Import Files with all details. +Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | @@ -3231,19 +3088,26 @@ Endpoint /automation/v1/filetransfers/ returns all File Transfers | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### FileTransfer.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity for caching +### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -### FileTransfer.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific File Transfer Definition by Name +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | -**Kind**: static method of [FileTransfer](#FileTransfer) + + +### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Retrieve a specific Import Definition by Name + +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise | Param | Type | Description | @@ -3252,82 +3116,110 @@ Retrieve a specific File Transfer Definition by Name | name | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### FileTransfer.create(fileTransfer) ⇒ Promise -Creates a single File Transfer +### ImportFile.create(importFile) ⇒ Promise +Creates a single Import File -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | +| importFile | TYPE.MetadataTypeItem | a single Import File | - + -### FileTransfer.update(fileTransfer) ⇒ Promise -Updates a single File Transfer +### ImportFile.update(importFile) ⇒ Promise +Updates a single Import File -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | +| importFile | TYPE.MetadataTypeItem | a single Import File | - + -### FileTransfer.preDeployTasks(metadata) ⇒ Promise -prepares a fileTransfer for deployment +### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [ImportFile](#ImportFile) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map + +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | + + + +### ImportFile.preDeployTasks(metadata) ⇒ Promise +prepares a import definition for deployment + +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | +| metadata | TYPE.MetadataTypeItem | a single importDef | - + -### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem manages post retrieve steps -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: TYPE.MetadataTypeItem - parsed metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> +### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [FileTransfer](#FileTransfer) +**Kind**: static method of [ImportFile](#ImportFile) **Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of data extension | - + -## Filter ⇐ [MetadataType](#MetadataType) -Filter MetadataType +## Journey ⇐ [MetadataType](#MetadataType) +Journey MetadataType +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! +id: A unique id of the journey assigned by the journey’s API during its creation +key: A unique id of the journey within the MID. Can be generated by the developer +definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId **Kind**: global class **Extends**: [MetadataType](#MetadataType) - -### Filter.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Filter. -Endpoint /automation/v1/filters/ returns all Filters, -but only with some of the fields. So it is needed to loop over -Filters with the endpoint /automation/v1/filters/{id} +* [Journey](#Journey) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean> + * [.deploy(metadata, deployDir, retrieveDir)](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.update(metadata)](#Journey.update) ⇒ Promise + * [.create(metadata)](#Journey.create) ⇒ Promise + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Journey.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [._postRetrieveTasksBulk(metadataMap)](#Journey._postRetrieveTasksBulk) + * [.postRetrieveTasks(metadata)](#Journey.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.preDeployTasks(metadata)](#Journey.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Journey.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' -**Kind**: static method of [Filter](#Filter) + + +### Journey.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Journey + +**Kind**: static method of [Journey](#Journey) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | @@ -3337,184 +3229,145 @@ Filters with the endpoint /automation/v1/filters/{id} | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -## Folder ⇐ [MetadataType](#MetadataType) -Folder MetadataType +### Journey.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Folder](#Folder) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise - * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise - * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> - * [.create(metadataEntry)](#Folder.create) ⇒ Promise - * [.update(metadataEntry)](#Folder.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Folder.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.getJsonFromFS(dir, [listBadKeys])](#Folder.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList])](#Folder.retrieveHelper) ⇒ Promise.<object> - * [.postRetrieveTasks(metadata)](#Folder.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.saveResults(results, retrieveDir, mid)](#Folder.saveResults) ⇒ Promise.<object> - - - -### Folder.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise -Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | content type of folder | -| [key] | string | customer key of single item to retrieve | - - - -### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise -Retrieves folder metadata for caching - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | content type of folder | +| key | string | Identifier of item | - + -### Folder.upsert(metadata) ⇒ Promise.<object> -Folder upsert (copied from Metadata Upsert), after retrieving from target -and comparing to check if create or update operation is needed. -Copied due to having a dependency on itself, meaning the created need to be serial +### Journey.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### Folder.create(metadataEntry) ⇒ Promise -creates a folder based on metatadata +### Journey.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [Folder](#Folder) +**Kind**: static method of [Journey](#Journey) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata of the folder | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Folder.update(metadataEntry) ⇒ Promise -Updates a single Folder. +### Journey.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [Folder](#Folder) +**Kind**: static method of [Journey](#Journey) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Folder.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a folder for deployment +### Journey.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of parsed folder metadata +**Kind**: static method of [Journey](#Journey) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single folder definition | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Folder.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending +### Journey.\_postRetrieveTasksBulk(metadataMap) +helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [Journey](#Journey) | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| metadataMap | TYPE.MetadataTypeMap | key=customer key, value=metadata | - + -### Folder.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList]) ⇒ Promise.<object> -Helper to retrieve the folders as promise +### Journey.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - soap object +**Kind**: static method of [Journey](#Journey) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object | Param | Type | Description | | --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [queryAllAccounts] | boolean | which queryAllAccounts setting to use | -| [contentTypeList] | Array.<string> | content type of folder | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Folder.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type +### Journey.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a TSD for deployment +! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeItem - cloned metadata +**Kind**: static method of [Journey](#Journey) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | metadata mapped by their keyField | +| metadata | TYPE.MetadataTypeItem | of a single TSD | - + -### Folder.saveResults(results, retrieveDir, mid) ⇒ Promise.<object> -Helper for writing Metadata to disk, used for Retrieve and deploy +### Journey.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata +**Kind**: static method of [Journey](#Journey) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| results | object | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| mid | number | current mid for this credential / business unit | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -## ImportFile ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +## List ⇐ [MetadataType](#MetadataType) +List MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(importFile)](#ImportFile.create) ⇒ Promise - * [.update(importFile)](#ImportFile.update) ⇒ Promise - * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> +* [List](#List) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#List.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#List.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.deleteByKey(customerKey)](#List.deleteByKey) ⇒ Promise.<boolean> + * [.postRetrieveTasks(list)](#List.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.parseMetadata(metadata, [parseForCache])](#List.parseMetadata) ⇒ TYPE.MetadataTypeItem - + -### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Import File. -Endpoint /automation/v1/imports/ return all Import Files with all details. -Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} +### List.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Lists -**Kind**: static method of [ImportFile](#ImportFile) +**Kind**: static method of [List](#List) **Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise | Param | Type | Description | @@ -3524,1821 +3377,811 @@ Currently it is not needed to loop over Imports with endpoint /automation/v1/imp | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Import Definition by Name - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise + -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +### List.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk - +**Kind**: static method of [List](#List) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -### ImportFile.create(importFile) ⇒ Promise -Creates a single Import File +### List.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise +**Kind**: static method of [List](#List) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | +| customerKey | string | Identifier of data extension | - + -### ImportFile.update(importFile) ⇒ Promise -Updates a single Import File +### List.postRetrieveTasks(list) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise +**Kind**: static method of [List](#List) +**Returns**: TYPE.MetadataTypeItem - metadata | Param | Type | Description | | --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | +| list | TYPE.MetadataTypeItem | a single list | - + -### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata +### List.parseMetadata(metadata, [parseForCache]) ⇒ TYPE.MetadataTypeItem +parses retrieved Metadata before saving -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map +**Kind**: static method of [List](#List) +**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### ImportFile.preDeployTasks(metadata) ⇒ Promise -prepares a import definition for deployment - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise +| metadata | TYPE.MetadataTypeItem | a single list definition | +| [parseForCache] | boolean | if set to true, the Category ID is kept | -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single importDef | + - +## MetadataType +MetadataType class that gets extended by their specific metadata type class. +Provides default functionality that can be overwritten by child metadata type classes -### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +**Kind**: global class -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -## Journey ⇐ [MetadataType](#MetadataType) -Journey MetadataType -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -id: A unique id of the journey assigned by the journey’s API during its creation -key: A unique id of the journey within the MID. Can be generated by the developer -definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Journey](#Journey) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.update(metadata)](#Journey.update) ⇒ Promise - * [.create(metadata)](#Journey.create) ⇒ Promise - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Journey.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [._postRetrieveTasksBulk(metadataMap)](#Journey._postRetrieveTasksBulk) - * [.postRetrieveTasks(metadata)](#Journey.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.preDeployTasks(metadata)](#Journey.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Journey.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - - - -### Journey.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Journey - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Journey.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -### Journey.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### Journey.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Journey.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Journey.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Journey.\_postRetrieveTasksBulk(metadataMap) -helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and - -**Kind**: static method of [Journey](#Journey) - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | key=customer key, value=metadata | - - - -### Journey.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! - -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Journey.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! - -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | - - - -### Journey.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [Journey](#Journey) -**Returns**: 'create' \| 'update' \| 'skip' - action to take - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -## List ⇐ [MetadataType](#MetadataType) -List MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [List](#List) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#List.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#List.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(customerKey)](#List.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(list)](#List.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata, [parseForCache])](#List.parseMetadata) ⇒ TYPE.MetadataTypeItem - - - -### List.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Lists - -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### List.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### List.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [List](#List) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### List.postRetrieveTasks(list) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| list | TYPE.MetadataTypeItem | a single list | - - - -### List.parseMetadata(metadata, [parseForCache]) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving - -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single list definition | -| [parseForCache] | boolean | if set to true, the Category ID is kept | - - - -## MetadataType -MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes - -**Kind**: global class - -* [MetadataType](#MetadataType) - * [.client](#MetadataType.client) : TYPE.SDK - * [.properties](#MetadataType.properties) : TYPE.Mcdevrc - * [.subType](#MetadataType.subType) : string - * [.buObject](#MetadataType.buObject) : TYPE.BuObject - * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> - * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void - * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.setFolderPath(metadata)](#MetadataType.setFolderPath) - * [.setFolderId(metadata)](#MetadataType.setFolderId) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void - * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void - * [.refresh()](#MetadataType.refresh) ⇒ void - * [.execute()](#MetadataType.execute) ⇒ void - * [.pause()](#MetadataType.pause) ⇒ void - * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean - * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean - * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null - * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null - * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null - * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null - * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) - * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null - * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> - * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> - * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> - * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void - * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void - * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void - * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void - * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void - * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean - * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string - * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object - * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void - * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void - * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> - * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> - * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object - * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - - - -### MetadataType.client : TYPE.SDK -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.properties : TYPE.Mcdevrc -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.subType : string -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.buObject : TYPE.BuObject -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map - -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | - - - -### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> -Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - Fieldnames - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [isCaching] | boolean | if true, then check if field should be skipped for caching | - - - -### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | -| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - - - -### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> -helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeItem - cloned metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| targetDir | string | folder where retrieves should be saved | -| [isTemplating] | boolean | signals that we are retrieving templates | - - - -### MetadataType.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MetadataType.setFolderId(metadata) -generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | - - - -### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - - - -### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | - - - -### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [subType] | string | optionally limit to a single subtype | - - - -### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> -Retrieve a specific Script by Name - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| name | string | name (not key) of the metadata item | - - - -### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| templateDir | string | (List of) Directory where built definitions will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -Gets executed before deploying metadata - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| deployDir | string | folder where files for deployment are stored | - - - -### MetadataType.create(metadata, deployDir) ⇒ void -Abstract create method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| deployDir | string | directory where deploy metadata are saved | - - - -### MetadataType.update(metadata, [metadataBefore]) ⇒ void -Abstract update method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - - - -### MetadataType.refresh() ⇒ void -Abstract refresh method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.execute() ⇒ void -Abstract execute method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.pause() ⇒ void -Abstract pause method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true if metadata was changed - -| Param | Type | Description | -| --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | - - - -### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true on first identified deviation or false if none are found - -| Param | Type | Description | -| --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | -| [silent] | boolean | optionally suppress logging | - - - -### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> -MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | - - - -### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: 'create' \| 'update' \| 'skip' - action to take - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null -Creates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| uri | string | rest endpoint for POST | - - - -### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Creates a single metadata entry via fuel-soap (generic lib not wrapper) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null -Updates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | -| uri | string | | rest endpoint for PATCH | -| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | - - - -### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Updates a single metadata entry via fuel-soap (generic lib not wrapper) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | error that occured | -| msg | 'creating' \| 'updating' | what to print in the log | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.getSOAPErrorMsg(ex) ⇒ string -helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - error message - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | error that occured | - - - -### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -Retrieves Metadata for Rest Types - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | -| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | -| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | - - - -### MetadataType.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: null - - - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | - - - -### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> -Used to execute a query/automation etc. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) - -| Param | Type | Description | -| --- | --- | --- | -| uri | string | REST endpoint where the POST request should be sent | -| key | string | item key | - - - -### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> -Used to execute a query/automation etc. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response - -| Param | Type | Description | -| --- | --- | --- | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | - - - -### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> -helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [singleRetrieve] | string \| number | key of single item to filter by | -| metadataMap | TYPE.MetadataTypeMap | saved metadata | - - - -### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void -Deletes a field in a metadata entry if the selected definition property equals false. - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | -| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | -| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | -| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | - -**Example** -```js -Removes field (or nested fields childs) that are not updateable -deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); -``` - - -### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not createable - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not updateable - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.keepTemplateFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the template - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the stored metadata - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean -checks if the current metadata entry should be saved on retrieve or not - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: skip saving == filtered; false: continue with saving - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - - - -### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean -optionally filter by what folder something is in - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | object | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - - - -### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) -searches extracted file for template variable names and applies the market values - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string -helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) -searches extracted file for template variable values and applies the market variable names - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types (e.g script, asset, query) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +* [MetadataType](#MetadataType) + * [.client](#MetadataType.client) : TYPE.SDK + * [.properties](#MetadataType.properties) : TYPE.Mcdevrc + * [.subType](#MetadataType.subType) : string + * [.buObject](#MetadataType.buObject) : TYPE.BuObject + * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap + * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> + * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void + * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.setFolderPath(metadata)](#MetadataType.setFolderPath) + * [.setFolderId(metadata)](#MetadataType.setFolderId) + * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> + * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void + * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void + * [.refresh()](#MetadataType.refresh) ⇒ void + * [.execute()](#MetadataType.execute) ⇒ void + * [.pause()](#MetadataType.pause) ⇒ void + * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean + * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean + * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null + * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null + * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null + * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null + * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) + * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> + * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null + * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> + * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> + * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> + * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void + * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void + * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void + * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void + * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void + * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean + * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean + * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> + * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string + * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> + * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object + * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void + * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void + * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> + * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean + * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> + * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> + * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> + * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object + * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> + * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - + -### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> -check template directory for complex types that open subfolders for their subtypes +### MetadataType.client : TYPE.SDK +**Kind**: static property of [MetadataType](#MetadataType) + -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - subtype name +### MetadataType.properties : TYPE.Mcdevrc +**Kind**: static property of [MetadataType](#MetadataType) + -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +### MetadataType.subType : string +**Kind**: static property of [MetadataType](#MetadataType) + - +### MetadataType.buObject : TYPE.BuObject +**Kind**: static property of [MetadataType](#MetadataType) + -### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object -optional method used for some types to try a different folder structure +### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap +Returns file contents mapped to their filename without '.json' ending **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - metadata +**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | -| ex | Error | error from first attempt | +| dir | string | directory that contains '.json' files to be read | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | - + -### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Builds definition based on template -NOTE: Most metadata files should use this generic method, unless custom -parsing is required (for example scripts & queries) +### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> +Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Returns**: Array.<string> - Fieldnames | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| templateName | string | name of the metadata file | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [isCaching] | boolean | if true, then check if field should be skipped for caching | - + -### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages +### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> +Deploys metadata **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> \| void - formatted Error Message +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| ex | object | response payload from REST API | +| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | +| retrieveDir | string | directory where metadata after deploy should be saved | - + -### MetadataType.document([metadata], [isDeploy]) ⇒ void -Gets metadata cache with limited fields and does not store value to disk +### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void +Gets executed after deployment of metadata type **Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | -| [isDeploy] | boolean | used to skip non-supported message during deploy | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | +| createdUpdated | Object | counter representing successful creates/updates | - + -### MetadataType.resolveId(id) ⇒ Promise.<string> -get name & key for provided id +### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - key of metadata | Param | Type | Description | | --- | --- | --- | -| id | string | Identifier of metadata | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - + -### MetadataType.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit +### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> -clean up after deleting a metadata item +### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> +helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - Promise +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | -| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem +Gets executed after retreive of metadata type **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag +**Returns**: TYPE.MetadataTypeItem - cloned metadata | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.MetadataTypeItem | a single item | +| targetDir | string | folder where retrieves should be saved | +| [isTemplating] | boolean | signals that we are retrieving templates | - + -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit +### MetadataType.setFolderPath(metadata) +generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| url | string | endpoint | -| key | string | Identifier of metadata | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object -Returns metadata of a business unit that is saved locally +### MetadataType.setFolderId(metadata) +generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - Metadata of BU in local directory | Param | Type | Description | | --- | --- | --- | -| readDir | string | root directory of metadata. | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | -| [buMetadata] | object | Metadata of BU in local directory | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | - + + +### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> **Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - list of keys +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - + -## MobileCode ⇐ [MetadataType](#MetadataType) -MobileCode MetadataType +### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata -* [MobileCode](#MobileCode) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileCode.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#MobileCode.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> +| Param | Type | Description | +| --- | --- | --- | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [key] | string | customer key of single item to retrieve | - + -### MobileCode.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. +### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### MobileCode.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| [subType] | string | optionally limit to a single subtype | -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -## MobileKeyword ⇐ [MetadataType](#MetadataType) -MobileKeyword MetadataType +### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> +Retrieve a specific Script by Name -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise -* [MobileKeyword](#MobileKeyword) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(metadata)](#MobileKeyword.create) ⇒ Promise - * [.update(metadata)](#MobileKeyword.update) ⇒ Promise - * [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - * [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ Object - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileKeyword._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.preDeployTasks(metadata, deployDir)](#MobileKeyword.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileKeyword.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileKeyword.postUpdateTasks) ⇒ void - * [._mergeCode(metadata, deployDir, [templateName])](#MobileKeyword._mergeCode) ⇒ Promise.<string> - * [.deleteByKey(key)](#MobileKeyword.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#MobileKeyword.postDeleteTasks) ⇒ void - * [.getFilesToCommit(keyArr)](#MobileKeyword.getFilesToCommit) ⇒ Array.<string> +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| name | string | name (not key) of the metadata item | - + -### MobileKeyword.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. +### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| templateDir | string | (List of) Directory where built definitions will be saved | +| key | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields +### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +Gets executed before deploying metadata -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item | Param | Type | Description | | --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | +| metadata | TYPE.MetadataTypeItem | a single metadata item | +| deployDir | string | folder where files for deployment are stored | - + -### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) +### MetadataType.create(metadata, deployDir) ⇒ void +Abstract create method that needs to be implemented in child metadata type -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: 'create' \| 'update' \| 'skip' - action to take +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| deployDir | string | directory where deploy metadata are saved | - + -### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### MetadataType.update(metadata, [metadataBefore]) ⇒ void +Abstract update method that needs to be implemented in child metadata type -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | +| metadata | TYPE.MetadataTypeItem | single metadata entry | +| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - + -### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -retrieve an item and create a template from it +### MetadataType.refresh() ⇒ void +Abstract refresh method that needs to be implemented in child metadata type -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.execute() ⇒ void +Abstract execute method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.pause() ⇒ void +Abstract pause method that needs to be implemented in child metadata type + +**Kind**: static method of [MetadataType](#MetadataType) + + +### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment + +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true if metadata was changed | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | - + -### MobileKeyword.create(metadata) ⇒ Promise -Creates a single item +### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean +test if metadata was actually changed or not to potentially skip it during deployment -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true on first identified deviation or false if none are found | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | +| metadata | TYPE.MetadataTypeItem | item to upload | +| [fieldName] | string | optional field name to use for identifying the record in logs | +| [silent] | boolean | optionally suppress logging | - + -### MobileKeyword.update(metadata) ⇒ Promise -Updates a single item +### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> +MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | +| deployDir | string | directory where deploy metadata are saved | - + -### MobileKeyword.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void -manages post retrieve steps +### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: 'create' \| 'update' \| 'skip' - action to take | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object -helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested) +### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null +Creates a single metadata entry via REST -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Object - returns found extension and file content +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| metadataScript | string | the code of the file | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| uri | string | rest endpoint for POST | - + -### MobileKeyword.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Creates a single metadata entry via fuel-soap (generic lib not wrapper) -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### MobileKeyword.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null +Updates a single metadata entry via REST -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | +| uri | string | | rest endpoint for PATCH | +| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - + -### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested) -handles extracted code if any are found for complex types +### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null +Updates a single metadata entry via fuel-soap (generic lib not wrapper) -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - +| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | -### MobileKeyword.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares an event definition for deployment + -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise +### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileKeyword | -| deployDir | string | directory of deploy files | +| ex | Error | error that occured | +| msg | 'creating' \| 'updating' | what to print in the log | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) +### MetadataType.getSOAPErrorMsg(ex) ⇒ string +helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) -**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - error message | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| ex | Error | error that occured | - + -### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileKeyword.preDeployTasks) that loads extracted code content back into JSON +### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +Retrieves Metadata for Rest Types -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<string> - content for metadata.script +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| uri | string | rest endpoint for GET | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| [singleRetrieve] | string \| number | key of single item to filter by | -### MobileKeyword.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit + -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<boolean> - deletion success status +### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | +| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | +| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | - + -### MobileKeyword.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### MetadataType.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) -**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: null - - | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| ex | Error | exception | +| id | string | id or key of item | - + -### MobileKeyword.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> +Used to execute a query/automation etc. -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| uri | string | REST endpoint where the POST request should be sent | +| key | string | item key | - + -## MobileMessage ⇐ [MetadataType](#MetadataType) -MobileMessage MetadataType +### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> +Used to execute a query/automation etc. -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<{key:string, response:object}> - metadata key and API response -* [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#MobileMessage.update) ⇒ Promise - * [.create(metadata)](#MobileMessage.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> - * [.prepExtractedCode(code)](#MobileMessage.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#MobileMessage.getFilesToCommit) ⇒ Array.<string> - * [.postRetrieveTasks(metadata)](#MobileMessage.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.preDeployTasks(metadata, deployDir)](#MobileMessage.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileMessage.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileMessage.postUpdateTasks) ⇒ void - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileMessage._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.deleteByKey(id)](#MobileMessage.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | - + -### MobileMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords +### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> +helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| [singleRetrieve] | string \| number | key of single item to filter by | +| metadataMap | TYPE.MetadataTypeMap | saved metadata | - + -### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -### MobileMessage.update(metadata) ⇒ Promise -Updates a single item +### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void +Deletes a field in a metadata entry if the selected definition property equals false. -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | +| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | +| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | +| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | - +**Example** +```js +Removes field (or nested fields childs) that are not updateable +deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); +``` + -### MobileMessage.create(metadata) ⇒ Promise -Creates a single item +### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not createable -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON +### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not updateable -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<string> - code +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MobileMessage.prepExtractedCode(code) ⇒ Object -helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested) +### MetadataType.keepTemplateFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the template -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Object - returns found extension and file content +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| code | string | the code of the file | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MobileMessage.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void +Remove fields from metadata entry that are not needed in the stored metadata -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - + -### MobileMessage.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean +checks if the current metadata entry should be saved on retrieve or not -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: skip saving == filtered; false: continue with saving | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | +| metadataEntry | TYPE.MetadataTypeItem | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - + -### MobileMessage.preDeployTasks(metadata, deployDir) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment +### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean +optionally filter by what folder something is in -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.MetadataTypeItem - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileMessage | -| deployDir | string | directory of deploy files | +| metadataEntry | object | metadata entry | +| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - + -### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) +### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> +Helper for writing Metadata to disk, used for Retrieve and deploy -**Kind**: static method of [MobileMessage](#MobileMessage) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| results | TYPE.MetadataTypeMap | metadata results from deploy | +| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | +| [overrideType] | string | for use when there is a subtype (such as folder-queries) | +| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) +### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) +searches extracted file for template variable names and applies the market values -**Kind**: static method of [MobileMessage](#MobileMessage) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### MobileMessage.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string +helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) +searches extracted file for template variable values and applies the market variable names -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| code | string | code from extracted code | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - + -### MobileMessage.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types (e.g script, asset, query) -**Kind**: static method of [MobileMessage](#MobileMessage) +**Kind**: static method of [MetadataType](#MetadataType) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| targetDir | string | Directory where built definitions will be saved | | metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - + -### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested) +### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) handles extracted code if any are found for complex types -**Kind**: static method of [MobileMessage](#MobileMessage) +**Kind**: static method of [MetadataType](#MetadataType) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | @@ -5348,492 +4191,395 @@ handles extracted code if any are found for complex types | metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### MobileMessage.deleteByKey(id) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit -! the endpoint expects the ID and not a key but for mcdev in this case key==id - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of item | - - - -## Query ⇐ [MetadataType](#MetadataType) -Query MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Query](#Query) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.execute(keyArr)](#Query.execute) ⇒ Promise.<Array.<string>> - * [.retrieveForCache()](#Query.retrieveForCache) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Query.retrieveAsTemplate) ⇒ Promise.<{metadata: Query, type: string}> - * [.postRetrieveTasks(metadata)](#Query.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.create(query)](#Query.create) ⇒ Promise - * [.update(query)](#Query.update) ⇒ Promise - * [.preDeployTasks(metadata, deployDir)](#Query.preDeployTasks) ⇒ Promise.<TYPE.QueryItem> - * [.applyTemplateValues(code, templateVariables)](#Query.applyTemplateValues) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> - * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void - * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void - * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) - - - -### Query.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves Metadata of queries - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Query.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed successfully - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - -### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves query metadata for caching - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata - + -### Query.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: Query, type: string}> -Retrieve a specific Query by Name +### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> +check template directory for complex types that open subfolders for their subtypes -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: Query, type: string}> - Promise of metadata +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - subtype name | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateDir | string | Directory where metadata templates are stored | +| templateName | string | name of the metadata file | - + -### Query.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object +optional method used for some types to try a different folder structure -**Kind**: static method of [Query](#Query) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.QueryItem | a single query | +| templateDir | string | Directory where metadata templates are stored | +| typeDirArr | Array.<string> | current subdir for this type | +| templateName | string | name of the metadata template | +| fileName | string | name of the metadata template file w/o extension | +| ex | Error | error from first attempt | - + -### Query.create(query) ⇒ Promise -Creates a single query +### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Builds definition based on template +NOTE: Most metadata files should use this generic method, unless custom +parsing is required (for example scripts & queries) -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| query | TYPE.QueryItem | a single query | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| templateName | string | name of the metadata file | +| variables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Query.update(query) ⇒ Promise -Updates a single query +### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| query | TYPE.QueryItem | a single query | +| ex | object | response payload from REST API | - + -### Query.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.QueryItem> -prepares a Query for deployment +### MetadataType.document([metadata], [isDeploy]) ⇒ void +Gets metadata cache with limited fields and does not store value to disk -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<TYPE.QueryItem> - Promise +**Kind**: static method of [MetadataType](#MetadataType) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.QueryItem | a single query activity | -| deployDir | string | directory of deploy files | +| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | +| [isDeploy] | boolean | used to skip non-supported message during deploy | - + -### Query.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#Query.buildDefinitionForNested) -searches extracted SQL file for template variables and applies the market values +### MetadataType.resolveId(id) ⇒ Promise.<string> +get name & key for provided id -**Kind**: static method of [Query](#Query) -**Returns**: string - code with markets applied +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<string> - key of metadata | Param | Type | Description | | --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| id | string | Identifier of metadata | - + -### Query.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### MetadataType.deleteByKey(customerKey) ⇒ boolean +Delete a metadata item from the specified business unit -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: boolean - deletion success status | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| customerKey | string | Identifier of data extension | - + -### Query.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> +clean up after deleting a metadata item -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<void> - - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| customerKey | string | Identifier of metadata item | +| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | -**Example** -```js -queries are saved as 1 json and 1 sql file. both files need to be run through templating -``` - + -### Query.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| customerKey | string | Identifier of metadata | +| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### Query.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts +### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> +Delete a data extension from the specified business unit -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> \| void - formatted Error Message +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| ex | object | response payload from REST API | +| url | string | endpoint | +| key | string | Identifier of metadata | +| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - + -### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object +Returns metadata of a business unit that is saved locally -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: object - Metadata of BU in local directory | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| readDir | string | root directory of metadata. | +| [listBadKeys] | boolean | do not print errors, used for badKeys() | +| [buMetadata] | object | Metadata of BU in local directory | - + -### Query.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Query](#Query) +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - +| keyArr | Array.<string> | customerkey of the metadata | -### Query.postDeployTasks(upsertResults) -Gets executed after deployment of metadata type + -**Kind**: static method of [Query](#Query) +### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> +**Kind**: static method of [MetadataType](#MetadataType) +**Returns**: Array.<string> - list of keys | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | +| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | - + -## Role ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType +## MobileCode ⇐ [MetadataType](#MetadataType) +MobileCode MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Role](#Role) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [___], [key])](#Role.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.preDeployTasks(metadata)](#Role.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.create(metadata)](#Role.create) ⇒ Promise - * [.update(metadata)](#Role.update) ⇒ Promise - * [.document([metadata])](#Role.document) ⇒ Promise.<void> - * [._traverseRoles(role, element, [permission], [isAllowed])](#Role._traverseRoles) ⇒ void +* [MobileCode](#MobileCode) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileCode.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#MobileCode.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - + -### Role.retrieve(retrieveDir, _, [___], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud +### MobileCode.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Mobile Keywords +Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Metadata store object +**Kind**: static method of [MobileCode](#MobileCode) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [___] | void | unused parameter | +| [_] | void | unused parameter | +| [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - - -### Role.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed before deploying metadata - -**Kind**: static method of [Role](#Role) -**Returns**: TYPE.MetadataTypeItem - Promise of a single metadata item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | - - - -### Role.create(metadata) ⇒ Promise -Create a single Role. - -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +### MobileCode.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching - +**Kind**: static method of [MobileCode](#MobileCode) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -### Role.update(metadata) ⇒ Promise -Updates a single Role. +## MobileKeyword ⇐ [MetadataType](#MetadataType) +MobileKeyword MetadataType -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +* [MobileKeyword](#MobileKeyword) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void + * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap + * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' + * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> + * [.create(metadata)](#MobileKeyword.create) ⇒ Promise + * [.update(metadata)](#MobileKeyword.update) ⇒ Promise + * [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void + * [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ Object + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileKeyword._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.preDeployTasks(metadata, deployDir)](#MobileKeyword.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [.postCreateTasks(metadataEntry, apiResponse)](#MobileKeyword.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileKeyword.postUpdateTasks) ⇒ void + * [._mergeCode(metadata, deployDir, [templateName])](#MobileKeyword._mergeCode) ⇒ Promise.<string> + * [.deleteByKey(key)](#MobileKeyword.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#MobileKeyword.postDeleteTasks) ⇒ void + * [.getFilesToCommit(keyArr)](#MobileKeyword.getFilesToCommit) ⇒ Array.<string> - + -### Role.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles +### MobileKeyword.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void +Retrieves Metadata of Mobile Keywords +Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<void> - - +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | role definitions | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Role.\_traverseRoles(role, element, [permission], [isAllowed]) ⇒ void -iterates through permissions to output proper row-names for nested permissionss +### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap +Builds map of metadata entries mapped to their keyfields -**Kind**: static method of [Role](#Role) +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: TYPE.MetadataTypeMap - keyField => metadata map | Param | Type | Description | | --- | --- | --- | -| role | string | name of the user role | -| element | object | data of the permission | -| [permission] | string | name of the permission | -| [isAllowed] | string | "true" / "false" from the | +| body | object | json of response body | +| [singleRetrieve] | string \| number | key of single item to filter by | - + -## Script ⇐ [MetadataType](#MetadataType) -Script MetadataType +### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' +helper for [upsert](#MetadataType.upsert) -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: 'create' \| 'update' \| 'skip' - action to take -* [Script](#Script) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> - * [.update(script)](#Script.update) ⇒ Promise - * [.create(script)](#Script.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> - * [.preDeployTasks(metadata, dir)](#Script.preDeployTasks) ⇒ TYPE.ScriptItem - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void +| Param | Type | Description | +| --- | --- | --- | +| metadataMap | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - + -### Script.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves Metadata of Script -Endpoint /automation/v1/scripts/ return all Scripts with all details. +### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | +| [_] | void | parameter not used | +| [__] | void | parameter not used | | [key] | string | customer key of single item to retrieve | - - -### Script.retrieveForCache() ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves script metadata for caching - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise - + -### Script.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.Script, type: string}> -Retrieve a specific Script by Name +### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> +retrieve an item and create a template from it -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.Script, type: string}> - Promise +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | +| key | string | name of the metadata file | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### Script.update(script) ⇒ Promise -Updates a single Script +### MobileKeyword.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MobileKeyword](#MobileKeyword) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Script.create(script) ⇒ Promise -Creates a single Script +### MobileKeyword.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MobileKeyword](#MobileKeyword) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#Script.preDeployTasks) that loads extracted code content back into JSON +### MobileKeyword.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void +manages post retrieve steps -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<string> - content for metadata.script +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.ScriptItem | a single asset definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Script.preDeployTasks(metadata, dir) ⇒ TYPE.ScriptItem -prepares a Script for deployment +### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object +helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested) -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.ScriptItem - Promise +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Object - returns found extension and file content | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.ScriptItem | a single script activity definition | -| dir | string | directory of deploy files | +| metadataScript | string | the code of the file | - + -### Script.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### MobileKeyword.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> helper for [buildDefinition](#MetadataType.buildDefinition) handles extracted code if any are found for complex types -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MobileKeyword](#MobileKeyword) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - + -### Script.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +### MobileKeyword.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> helper for [buildTemplate](#MetadataType.buildTemplate) handles extracted code if any are found for complex types -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MobileKeyword](#MobileKeyword) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | @@ -5841,99 +4587,143 @@ handles extracted code if any are found for complex types ```js scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating ``` - + -### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested) +### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested) handles extracted code if any are found for complex types -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MobileKeyword](#MobileKeyword) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | | mode | 'definition' \| 'template' | defines what we use this helper for | - + -### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### MobileKeyword.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares an event definition for deployment -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.CodeExtractItem - a single item with code parts extracted +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.ScriptItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single MobileKeyword | +| deployDir | string | directory of deploy files | - + -### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object -helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) +### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: static method of [Script](#Script) -**Returns**: Object - returns found extension and file content +**Kind**: static method of [MobileKeyword](#MobileKeyword) | Param | Type | Description | | --- | --- | --- | -| metadataScript | string | the code of the file | -| metadataName | string | the name of the metadata | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### Script.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) -**Kind**: static method of [Script](#Script) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [MobileKeyword](#MobileKeyword) | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> +### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#MobileKeyword.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<string> - content for metadata.script + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | + + + +### MobileKeyword.deleteByKey(key) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| key | string | Identifier of item | - + -### Script.postDeleteTasks(customerKey) ⇒ void +### MobileKeyword.postDeleteTasks(customerKey) ⇒ void clean up after deleting a metadata item -**Kind**: static method of [Script](#Script) +**Kind**: static method of [MobileKeyword](#MobileKeyword) | Param | Type | Description | | --- | --- | --- | | customerKey | string | Identifier of metadata item | - + + +### MobileKeyword.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [MobileKeyword](#MobileKeyword) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + -## SendClassification ⇐ [MetadataType](#MetadataType) -SendClassification MetadataType +## MobileMessage ⇐ [MetadataType](#MetadataType) +MobileMessage MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) - -### SendClassification.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +* [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void + * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadata)](#MobileMessage.update) ⇒ Promise + * [.create(metadata)](#MobileMessage.create) ⇒ Promise + * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> + * [.prepExtractedCode(code)](#MobileMessage.prepExtractedCode) ⇒ Object + * [.getFilesToCommit(keyArr)](#MobileMessage.getFilesToCommit) ⇒ Array.<string> + * [.postRetrieveTasks(metadata)](#MobileMessage.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.preDeployTasks(metadata, deployDir)](#MobileMessage.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postCreateTasks(metadataEntry, apiResponse)](#MobileMessage.postCreateTasks) ⇒ void + * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileMessage.postUpdateTasks) ⇒ void + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileMessage._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.deleteByKey(id)](#MobileMessage.deleteByKey) ⇒ Promise.<boolean> -**Kind**: static method of [SendClassification](#SendClassification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + + +### MobileMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void +Retrieves Metadata of Mobile Keywords + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata | Param | Type | Description | | --- | --- | --- | @@ -5942,1745 +4732,1631 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -## TransactionalEmail ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalEmail MetadataType +### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata -* [TransactionalEmail](#TransactionalEmail) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.update(metadata)](#TransactionalEmail.update) ⇒ Promise - * [.preDeployTasks(metadata)](#TransactionalEmail.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(_, apiResponse)](#TransactionalEmail.postCreateTasks) ⇒ void - * [.postDeployTasks()](#TransactionalEmail.postDeployTasks) ⇒ void - * [.postRetrieveTasks(metadata)](#TransactionalEmail.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#TransactionalEmail.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| [_] | void | parameter not used | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to retrieve | - + -### TransactionalEmail.update(metadata) ⇒ Promise +### MobileMessage.update(metadata) ⇒ Promise Updates a single item -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Kind**: static method of [MobileMessage](#MobileMessage) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | how the item shall look after the update | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### TransactionalEmail.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment +### MobileMessage.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - Promise +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | | metadata | TYPE.MetadataTypeItem | a single item | - + -### TransactionalEmail.postCreateTasks(_, apiResponse) ⇒ void -helper for [TransactionalEmail.createREST](TransactionalEmail.createREST) +### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<string> - code | Param | Type | Description | | --- | --- | --- | -| _ | TYPE.MetadataTypeItem | not used | -| apiResponse | object | varies depending on the API call | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | - + -### TransactionalEmail.postDeployTasks() ⇒ void -Gets executed after deployment of metadata type +### MobileMessage.prepExtractedCode(code) ⇒ Object +helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested) -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) - +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Object - returns found extension and file content -### TransactionalEmail.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +| Param | Type | Description | +| --- | --- | --- | +| code | string | the code of the file | + + + +### MobileMessage.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned + +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + +| Param | Type | Description | +| --- | --- | --- | +| keyArr | Array.<string> | customerkey of the metadata | + + + +### MobileMessage.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem manages post retrieve steps -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - a single item +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | a single query | - + -### TransactionalEmail.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### MobileMessage.preDeployTasks(metadata, deployDir) ⇒ TYPE.MetadataTypeItem +prepares an event definition for deployment -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: TYPE.MetadataTypeItem - Promise | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| metadata | TYPE.MetadataTypeItem | a single MobileMessage | +| deployDir | string | directory of deploy files | - + -## TransactionalMessage ⇐ [MetadataType](#MetadataType) -TransactionalMessage MetadataType +### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void +helper for [createREST](#MetadataType.createREST) -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [MobileMessage](#MobileMessage) -* [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise - * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise - * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### TransactionalMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata +### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void +helper for [updateREST](#MetadataType.updateREST) -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MobileMessage](#MobileMessage) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | - + -### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching +### MobileMessage.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to cache | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### TransactionalMessage.update(metadata) ⇒ Promise -Updates a single item +### MobileMessage.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + -### TransactionalMessage.create(metadata) ⇒ Promise -Creates a single item +### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested) +handles extracted code if any are found for complex types -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise +**Kind**: static method of [MobileMessage](#MobileMessage) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### TransactionalMessage.deleteByKey(key) ⇒ Promise.<boolean> +### MobileMessage.deleteByKey(id) ⇒ Promise.<boolean> Delete a metadata item from the specified business unit +! the endpoint expects the ID and not a key but for mcdev in this case key==id -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Kind**: static method of [MobileMessage](#MobileMessage) **Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| id | string | Identifier of item | - + -## TransactionalPush ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalPush TransactionalMessage +## Query ⇐ [MetadataType](#MetadataType) +Query MetadataType **Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) +**Extends**: [MetadataType](#MetadataType) -* [TransactionalPush](#TransactionalPush) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.preDeployTasks(metadata)](#TransactionalPush.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#TransactionalPush.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem +* [Query](#Query) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> + * [.execute(keyArr)](#Query.execute) ⇒ Promise.<Array.<string>> + * [.retrieveForCache()](#Query.retrieveForCache) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Query.retrieveAsTemplate) ⇒ Promise.<{metadata: Query, type: string}> + * [.postRetrieveTasks(metadata)](#Query.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.create(query)](#Query.create) ⇒ Promise + * [.update(query)](#Query.update) ⇒ Promise + * [.preDeployTasks(metadata, deployDir)](#Query.preDeployTasks) ⇒ Promise.<TYPE.QueryItem> + * [.applyTemplateValues(code, templateVariables)](#Query.applyTemplateValues) ⇒ string + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> + * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void + * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void + * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) - + -### TransactionalPush.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment +### Query.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> +Retrieves Metadata of queries -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - Promise +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### TransactionalPush.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps +### Query.execute(keyArr) ⇒ Promise.<Array.<string>> +a function to start query execution via API -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - a single item +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed successfully | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| keyArr | Array.<string> | customerkey of the metadata | - + -## TransactionalSMS ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalSMS MetadataType +### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> +Retrieves query metadata for caching -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata + -* [TransactionalSMS](#TransactionalSMS) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.postDeleteTasks(customerKey)](#TransactionalSMS.postDeleteTasks) ⇒ void - * [.preDeployTasks(metadata, deployDir)](#TransactionalSMS.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [._mergeCode(metadata, deployDir, [templateName])](#TransactionalSMS._mergeCode) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#TransactionalSMS.postRetrieveTasks) ⇒ Promise.<TYPE.CodeExtractItem> - * [.prepExtractedCode(metadataScript)](#TransactionalSMS.prepExtractedCode) ⇒ Promise.<{fileExt:string, code:string}> - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#TransactionalSMS._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._isHTML(code)](#TransactionalSMS._isHTML) ⇒ boolean - * [.getFilesToCommit(keyArr)](#TransactionalSMS.getFilesToCommit) ⇒ Array.<string> +### Query.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: Query, type: string}> +Retrieve a specific Query by Name - +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<{metadata: Query, type: string}> - Promise of metadata -### TransactionalSMS.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) + + +### Query.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps + +**Kind**: static method of [Query](#Query) +**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| metadata | TYPE.QueryItem | a single query | - + -### TransactionalSMS.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares for deployment +### Query.create(query) ⇒ Promise +Creates a single query -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise +**Kind**: static method of [Query](#Query) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| deployDir | string | directory of deploy files | +| query | TYPE.QueryItem | a single query | - + -### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#TransactionalSMS.preDeployTasks) that loads extracted code content back into JSON +### Query.update(query) ⇒ Promise +Updates a single query -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<string> - content for metadata.script +**Kind**: static method of [Query](#Query) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | +| query | TYPE.QueryItem | a single query | - + -### TransactionalSMS.postRetrieveTasks(metadata) ⇒ Promise.<TYPE.CodeExtractItem> -manages post retrieve steps +### Query.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.QueryItem> +prepares a Query for deployment -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.CodeExtractItem> - Array with one metadata object and one ssjs string +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<TYPE.QueryItem> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.QueryItem | a single query activity | +| deployDir | string | directory of deploy files | - + -### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Promise.<{fileExt:string, code:string}> -helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested) +### Query.applyTemplateValues(code, templateVariables) ⇒ string +helper for [buildDefinitionForNested](#Query.buildDefinitionForNested) +searches extracted SQL file for template variables and applies the market values -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<{fileExt:string, code:string}> - returns found extension and file content +**Kind**: static method of [Query](#Query) +**Returns**: string - code with markets applied | Param | Type | Description | | --- | --- | --- | -| metadataScript | string | the code of the file | +| code | string | code from extracted code | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition) +### Query.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) handles extracted code if any are found for complex types -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Kind**: static method of [Query](#Query) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| metadata | TYPE.QueryItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - + -### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate) +### Query.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) handles extracted code if any are found for complex types -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Kind**: static method of [Query](#Query) **Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | +| metadata | TYPE.QueryItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | **Example** ```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +queries are saved as 1 json and 1 sql file. both files need to be run through templating ``` - + -### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested) -handles extracted code if any are found for complex types +### Query.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array +**Kind**: static method of [Query](#Query) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| keyArr | Array.<string> | customerkey of the metadata | - + -### TransactionalSMS.\_isHTML(code) ⇒ boolean -very simplified test for HTML code in our SMS +### Query.getErrorsREST(ex) ⇒ Array.<string> \| void +Standardizes a check for multiple messages but adds query specific filters to error texts -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: boolean - true if HTML is found +**Kind**: static method of [Query](#Query) +**Returns**: Array.<string> \| void - formatted Error Message | Param | Type | Description | | --- | --- | --- | -| code | string | sms source code | +| ex | object | response payload from REST API | - + -### TransactionalSMS.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Query](#Query) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| customerKey | string | Identifier of data extension | - + -## TriggeredSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType +### Query.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Query](#Query) -* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#TriggeredSend.create) ⇒ Promise - * [.update(metadata)](#TriggeredSend.update) ⇒ Promise - * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.refresh([keyArr], [checkKey])](#TriggeredSend.refresh) ⇒ Promise.<void> - * [.getKeysForValidTSDs(metadata)](#TriggeredSend.getKeysForValidTSDs) ⇒ Promise.<Array.<string>> - * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | Identifier of metadata item | - + -### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Query.postDeployTasks(upsertResults) +Gets executed after deployment of metadata type -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Query](#Query) | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | +| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | - + -### TriggeredSend.create(metadata) ⇒ Promise -Create a single TSD. +## Role ⇐ [MetadataType](#MetadataType) +ImportFile MetadataType -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +* [Role](#Role) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [___], [key])](#Role.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.preDeployTasks(metadata)](#Role.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.create(metadata)](#Role.create) ⇒ Promise + * [.update(metadata)](#Role.update) ⇒ Promise + * [.document([metadata])](#Role.document) ⇒ Promise.<void> + * [._traverseRoles(role, element, [permission], [isAllowed])](#Role._traverseRoles) ⇒ void - + -### TriggeredSend.update(metadata) ⇒ Promise -Updates a single TSD. +### Role.retrieve(retrieveDir, _, [___], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Gets metadata from Marketing Cloud -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise +**Kind**: static method of [Role](#Role) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Metadata store object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| [___] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### Role.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +Gets executed before deploying metadata -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [Role](#Role) +**Returns**: TYPE.MetadataTypeItem - Promise of a single metadata item | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadata | TYPE.MetadataTypeItem | a single metadata item | - + -### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -parses retrieved Metadata before saving +### Role.create(metadata) ⇒ Promise +Create a single Role. -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem \| void - Array with one metadata object and one sql string +**Kind**: static method of [Role](#Role) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment +### Role.update(metadata) ⇒ Promise +Updates a single Role. -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem - metadata object +**Kind**: static method of [Role](#Role) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### TriggeredSend.refresh([keyArr], [checkKey]) ⇒ Promise.<void> -TSD-specific refresh method that finds active TSDs and refreshes them +### Role.document([metadata]) ⇒ Promise.<void> +Creates markdown documentation of all roles -**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Kind**: static method of [Role](#Role) **Returns**: Promise.<void> - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [keyArr] | Array.<string> | | metadata keys | -| [checkKey] | boolean | true | whether to check if the key is valid | - - - -### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>> -helper for [refresh](#TriggeredSend.refresh) that extracts the keys from the TSD item map and eli - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<Array.<string>> - keyArr - | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMapObj | TSD item map | - - - -### TriggeredSend.findRefreshableItems([assetLoaded]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -helper for [refresh](#TriggeredSend.refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](#TriggeredSend.retrieve) is using to avoid refreshing TSDs with broken dependencies - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of TSD item map - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [assetLoaded] | boolean | false | if run after Asset.deploy via --refresh option this will skip caching assets | +| [metadata] | TYPE.MetadataTypeMap | role definitions | - + -### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean> -helper for [refresh](#TriggeredSend.refresh) that pauses, publishes and starts a triggered send +### Role.\_traverseRoles(role, element, [permission], [isAllowed]) ⇒ void +iterates through permissions to output proper row-names for nested permissionss -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - true if refresh was successful +**Kind**: static method of [Role](#Role) | Param | Type | Description | | --- | --- | --- | -| key | string | external key of triggered send item | -| checkKey | boolean | whether to check if key exists on the server | +| role | string | name of the user role | +| element | object | data of the permission | +| [permission] | string | name of the permission | +| [isAllowed] | string | "true" / "false" from the | - + -## User ⇐ [MetadataType](#MetadataType) -MetadataType +## Script ⇐ [MetadataType](#MetadataType) +Script MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [User](#User) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [__], [key])](#User.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#User.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#User.create) ⇒ Promise - * [.update(metadata)](#User.update) ⇒ Promise - * [.preDeployTasks(metadata)](#User.preDeployTasks) ⇒ TYPE.UserDocument - * [.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#User.createOrUpdate) ⇒ void - * [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ Promise.<void> - * [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ object - * [.retrieveChangelog()](#User.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.document([metadata])](#User.document) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void +* [Script](#Script) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> + * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> + * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> + * [.update(script)](#Script.update) ⇒ Promise + * [.create(script)](#Script.create) ⇒ Promise + * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> + * [.preDeployTasks(metadata, dir)](#Script.preDeployTasks) ⇒ TYPE.ScriptItem + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem + * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object + * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> + * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> + * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void - + -### User.retrieve(retrieveDir, _, [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Script.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> +Retrieves Metadata of Script +Endpoint /automation/v1/scripts/ return all Scripts with all details. -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | unused parameter | +| [_] | void | unused parameter | | [__] | void | unused parameter | | [key] | string | customer key of single item to retrieve | - + -### User.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching +### Script.retrieveForCache() ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> +Retrieves script metadata for caching -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise + -### User.create(metadata) ⇒ Promise -Create a single item. +### Script.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.Script, type: string}> +Retrieve a specific Script by Name -**Kind**: static method of [User](#User) -**Returns**: Promise - Promise +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<{metadata: TYPE.Script, type: string}> - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | +| templateDir | string | Directory where retrieved metadata directory will be saved | +| name | string | name of the metadata file | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - + -### User.update(metadata) ⇒ Promise -Updates a single item. +### Script.update(script) ⇒ Promise +Updates a single Script -**Kind**: static method of [User](#User) +**Kind**: static method of [Script](#Script) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### User.preDeployTasks(metadata) ⇒ TYPE.UserDocument -prepares a item for deployment - -**Kind**: static method of [User](#User) -**Returns**: TYPE.UserDocument - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.UserDocument | of a single item | +| script | TYPE.MetadataTypeItem | a single Script | - + -### User.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ void -helper for [upsert](#MetadataType.upsert) +### Script.create(script) ⇒ Promise +Creates a single Script -**Kind**: static method of [User](#User) +**Kind**: static method of [Script](#Script) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.UserDocumentDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.UserDocument> | list of items to create | +| script | TYPE.MetadataTypeItem | a single Script | - + -### User.postDeployTasks(upsertResults) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#Script.preDeployTasks) that loads extracted code content back into JSON -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - promise +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<string> - content for metadata.script | Param | Type | Description | | --- | --- | --- | -| upsertResults | TYPE.UserDocumentMap | metadata mapped by their keyField | - - - -### User.\_getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale]) ⇒ object -helper for [User._prepareRoleAssignments](User._prepareRoleAssignments) - -**Kind**: static method of [User](#User) -**Returns**: object - format needed by API - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| roleId | string | | role.ObjectID | -| roleName | string | | role.Name | -| userId | number | | user.AccountUserID | -| assignmentOnly | boolean | | if true, only assignment configuration will be returned | -| [isRoleRemovale] | boolean | false | if true, role will be removed from user; otherwise added | - - - -### User.retrieveChangelog() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata +| metadata | TYPE.ScriptItem | a single asset definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata +### Script.preDeployTasks(metadata, dir) ⇒ TYPE.ScriptItem +prepares a Script for deployment -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map +**Kind**: static method of [Script](#Script) +**Returns**: TYPE.ScriptItem - Promise | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | +| metadata | TYPE.ScriptItem | a single script activity definition | +| dir | string | directory of deploy files | - + -### User.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles +### Script.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildDefinition](#MetadataType.buildDefinition) +handles extracted code if any are found for complex types -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - - +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | user list | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - + -### User.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -manages post retrieve steps +### Script.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplate](#MetadataType.buildTemplate) +handles extracted code if any are found for complex types -**Kind**: static method of [User](#User) -**Returns**: TYPE.MetadataTypeItem \| void - a single item +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | - +**Example** +```js +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating +``` + -## Verification ⇐ [MetadataType](#MetadataType) -Verification MetadataType +### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested) +handles extracted code if any are found for complex types -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array -* [Verification](#Verification) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], key)](#Verification.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.handleRESTErrors(ex, id)](#Verification.handleRESTErrors) ⇒ null - * [.retrieveForCache()](#Verification.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#Verification.create) ⇒ Promise - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#Verification.postCreateTasks) ⇒ void - * [.update(metadata)](#Verification.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem - * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem - * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> +| Param | Type | Description | +| --- | --- | --- | +| templateDir | string | Directory where metadata templates are stored | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.ScriptItem | main JSON file that was read from file system | +| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | +| templateName | string | name of the template to be built | +| mode | 'definition' \| 'template' | defines what we use this helper for | - + -### Verification.retrieve(retrieveDir, [_], [__], key) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Verification Activity. +### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem +manages post retrieve steps -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata +**Kind**: static method of [Script](#Script) +**Returns**: TYPE.CodeExtractItem - a single item with code parts extracted | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| key | string | customer key of single item to retrieve | +| metadata | TYPE.ScriptItem | a single item | - + -### Verification.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) +### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object +helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) -**Kind**: static method of [Verification](#Verification) -**Returns**: null - - +**Kind**: static method of [Script](#Script) +**Returns**: Object - returns found extension and file content | Param | Type | Description | | --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | - - - -### Verification.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching +| metadataScript | string | the code of the file | +| metadataName | string | the name of the metadata | -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - + -### Verification.create(metadata) ⇒ Promise -Creates a single Data Extract +### Script.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise +**Kind**: static method of [Script](#Script) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | +| keyArr | Array.<string> | customerkey of the metadata | - + -### Verification.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) +### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Verification](#Verification) +**Kind**: static method of [Script](#Script) +**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | +| customerKey | string | Identifier of data extension | - + -### Verification.update(metadata) ⇒ Promise -Updates a single Data Extract +### Script.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise +**Kind**: static method of [Script](#Script) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | +| customerKey | string | Identifier of metadata item | - + -### Verification.preDeployTasks(metadata) ⇒ TYPE.VerificationItem -prepares a verification for deployment +## SendClassification ⇐ [MetadataType](#MetadataType) +SendClassification MetadataType -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - metadata object +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) + + +### SendClassification.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + +**Kind**: static method of [SendClassification](#SendClassification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Verification.postRetrieveTasks(metadata) ⇒ TYPE.VerificationItem -parses retrieved Metadata before saving +## TransactionalEmail ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalEmail MetadataType -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - Array with one metadata object and one sql string +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | +* [TransactionalEmail](#TransactionalEmail) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.update(metadata)](#TransactionalEmail.update) ⇒ Promise + * [.preDeployTasks(metadata)](#TransactionalEmail.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postCreateTasks(_, apiResponse)](#TransactionalEmail.postCreateTasks) ⇒ void + * [.postDeployTasks()](#TransactionalEmail.postDeployTasks) ⇒ void + * [.postRetrieveTasks(metadata)](#TransactionalEmail.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem + * [.deleteByKey(key)](#TransactionalEmail.deleteByKey) ⇒ Promise.<boolean> - + -### Verification.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### TransactionalEmail.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<boolean> - deletion success status +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| key | string | Identifier of item | +| metadata | TYPE.MetadataTypeItem | how the item shall look after the update | - + -## Retriever -Retrieves metadata from a business unit and saves it to the local filesystem. +### TransactionalEmail.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares for deployment -**Kind**: global class +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: TYPE.MetadataTypeItem - Promise -* [Retriever](#Retriever) - * [new Retriever(properties, buObject)](#new_Retriever_new) - * [.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly])](#Retriever+retrieve) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [._getTypeDependencies(metadataTypes)](#Retriever+_getTypeDependencies) ⇒ Array.<TYPE.SupportedMetadataTypes> +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### new Retriever(properties, buObject) -Creates a Retriever, uses v2 auth if v2AuthOptions are passed. +### TransactionalEmail.postCreateTasks(_, apiResponse) ⇒ void +helper for [TransactionalEmail.createREST](TransactionalEmail.createREST) +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) | Param | Type | Description | | --- | --- | --- | -| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | -| buObject | TYPE.BuObject | properties for auth | +| _ | TYPE.MetadataTypeItem | not used | +| apiResponse | object | varies depending on the API call | - + -### retriever.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly]) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve metadata of specified types into local file system and Retriever.metadata +### TransactionalEmail.postDeployTasks() ⇒ void +Gets executed after deployment of metadata type -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) + + +### TransactionalEmail.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps + +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: TYPE.MetadataTypeItem - a single item | Param | Type | Description | | --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | -| [namesOrKeys] | Array.<string> \| TYPE.TypeKeyCombo | name of Metadata to retrieveAsTemplate or list of keys for normal retrieval | -| [templateVariables] | TYPE.TemplateMap | Object of values which can be replaced (in case of templating) | -| [changelogOnly] | boolean | skip saving, only create json in memory | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes> -helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of the given types +### TransactionalEmail.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Array.<TYPE.SupportedMetadataTypes> - unique list dependent metadata types +**Kind**: static method of [TransactionalEmail](#TransactionalEmail) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | +| key | string | Identifier of item | - + -## Asset ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType +## TransactionalMessage ⇐ [MetadataType](#MetadataType) +TransactionalMessage MetadataType **Kind**: global class **Extends**: [MetadataType](#MetadataType) -* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> +* [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise + * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise + * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> - + -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset +### TransactionalMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching +### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves event definition metadata for caching -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | | [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| [__] | void | parameter not used | +| [key] | string | customer key of single item to cache | - + -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating +### TransactionalMessage.update(metadata) ⇒ Promise +Updates a single item -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.create(metadata) ⇒ Promise -Creates a single asset +### TransactionalMessage.create(metadata) ⇒ Promise +Creates a single item -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.update(metadata) ⇒ Promise -Updates a single asset +### TransactionalMessage.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [TransactionalMessage](#TransactionalMessage) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| key | string | Identifier of item | - + -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type +## TransactionalPush ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalPush TransactionalMessage -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) -| Param | Type | Description | -| --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | +* [TransactionalPush](#TransactionalPush) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.preDeployTasks(metadata)](#TransactionalPush.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.postRetrieveTasks(metadata)](#TransactionalPush.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - + -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset +### TransactionalPush.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares for deployment -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [TransactionalPush](#TransactionalPush) +**Returns**: TYPE.MetadataTypeItem - Promise | Param | Type | Description | | --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json +### TransactionalPush.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem +manages post retrieve steps -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [TransactionalPush](#TransactionalPush) +**Returns**: TYPE.MetadataTypeItem - a single item | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it +## TransactionalSMS ⇐ [TransactionalMessage](#TransactionalMessage) +TransactionalSMS MetadataType -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file +**Kind**: global class +**Extends**: [TransactionalMessage](#TransactionalMessage) -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | +* [TransactionalSMS](#TransactionalSMS) ⇐ [TransactionalMessage](#TransactionalMessage) + * [.postDeleteTasks(customerKey)](#TransactionalSMS.postDeleteTasks) ⇒ void + * [.preDeployTasks(metadata, deployDir)](#TransactionalSMS.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> + * [._mergeCode(metadata, deployDir, [templateName])](#TransactionalSMS._mergeCode) ⇒ Promise.<string> + * [.postRetrieveTasks(metadata)](#TransactionalSMS.postRetrieveTasks) ⇒ Promise.<TYPE.CodeExtractItem> + * [.prepExtractedCode(metadataScript)](#TransactionalSMS.prepExtractedCode) ⇒ Promise.<{fileExt:string, code:string}> + * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> + * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#TransactionalSMS._buildForNested) ⇒ Promise.<Array.<Array.<string>>> + * [._isHTML(code)](#TransactionalSMS._isHTML) ⇒ boolean + * [.getFilesToCommit(keyArr)](#TransactionalSMS.getFilesToCommit) ⇒ Array.<string> - + -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### TransactionalSMS.postDeleteTasks(customerKey) ⇒ void +clean up after deleting a metadata item -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| customerKey | string | Identifier of metadata item | - + -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> -Gets executed after deployment of metadata type +### TransactionalSMS.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> +prepares for deployment -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise + +| Param | Type | Description | +| --- | --- | --- | +| metadata | TYPE.MetadataTypeItem | a single item | +| deployDir | string | directory of deploy files | + + + +### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> +helper for [preDeployTasks](#TransactionalSMS.preDeployTasks) that loads extracted code content back into JSON + +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<string> - content for metadata.script | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | +| metadata | TYPE.MetadataTypeItem | a single definition | +| deployDir | string | directory of deploy files | +| [templateName] | string | name of the template used to built defintion (prior applying templating) | - + -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment +### TransactionalSMS.postRetrieveTasks(metadata) ⇒ Promise.<TYPE.CodeExtractItem> +manages post retrieve steps -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<TYPE.CodeExtractItem> - Array with one metadata object and one ssjs string | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType +### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Promise.<{fileExt:string, code:string}> +helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested) -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<{fileExt:string, code:string}> - returns found extension and file content | Param | Type | Description | | --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | +| metadataScript | string | the code of the file | - + -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) +### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition) handles extracted code if any are found for complex types -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | - + -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) +### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> +helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate) handles extracted code if any are found for complex types -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | | targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | **Example** ```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating +scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating ``` - + -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) +### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> +helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested) handles extracted code if any are found for complex types -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array | Param | Type | Description | | --- | --- | --- | | templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | +| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | +| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | | templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | | templateName | string | name of the template to be built | | mode | 'definition' \| 'template' | defines what we use this helper for | - + -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +### TransactionalSMS.\_isHTML(code) ⇒ boolean +very simplified test for HTML code in our SMS -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: boolean - true if HTML is found | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +| code | string | sms source code | - + -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### TransactionalSMS.getFilesToCommit(keyArr) ⇒ Array.<string> +should return only the json for all but asset, query and script that are saved as multiple files +additionally, the documentation for dataExtension and automation should be returned -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [TransactionalSMS](#TransactionalSMS) +**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } +| keyArr | Array.<string> | customerkey of the metadata | -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | + - +## TriggeredSend ⇐ [MetadataType](#MetadataType) +MessageSendActivity MetadataType -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | +* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#TriggeredSend.create) ⇒ Promise + * [.update(metadata)](#TriggeredSend.update) ⇒ Promise + * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean> + * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void + * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem + * [.refresh([keyArr], [checkKey])](#TriggeredSend.refresh) ⇒ Promise.<void> + * [.getKeysForValidTSDs(metadata)](#TriggeredSend.getKeysForValidTSDs) ⇒ Promise.<Array.<string>> + * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean> - + -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending +### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | | [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes +### TriggeredSend.create(metadata) ⇒ Promise +Create a single TSD. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure +### TriggeredSend.update(metadata) ⇒ Promise +Updates a single TSD. -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Asset](#Asset) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| customerKey | string | Identifier of data extension | - + -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void +parses retrieved Metadata before saving -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: TYPE.MetadataTypeItem \| void - Array with one metadata object and one sql string | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk +### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem +prepares a TSD for deployment -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: TYPE.MetadataTypeItem - metadata object | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| metadata | TYPE.MetadataTypeItem | of a single TSD | - + -### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id +### TriggeredSend.refresh([keyArr], [checkKey]) ⇒ Promise.<void> +TSD-specific refresh method that finds active TSDs and refreshes them -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<void> - - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [keyArr] | Array.<string> | | metadata keys | +| [checkKey] | boolean | true | whether to check if the key is valid | - + -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset +### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>> +helper for [refresh](#TriggeredSend.refresh) that extracts the keys from the TSD item map and eli -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<Array.<string>> - keyArr | Param | Type | Description | | --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | +| metadata | TYPE.MetadataTypeMapObj | TSD item map | - + -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching +### TriggeredSend.findRefreshableItems([assetLoaded]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +helper for [refresh](#TriggeredSend.refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](#TriggeredSend.retrieve) is using to avoid refreshing TSDs with broken dependencies -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of TSD item map -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| [assetLoaded] | boolean | false | if run after Asset.deploy via --refresh option this will skip caching assets | - + -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating +### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean> +helper for [refresh](#TriggeredSend.refresh) that pauses, publishes and starts a triggered send -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise +**Kind**: static method of [TriggeredSend](#TriggeredSend) +**Returns**: Promise.<boolean> - true if refresh was successful | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | +| key | string | external key of triggered send item | +| checkKey | boolean | whether to check if key exists on the server | - + -### Asset.create(metadata) ⇒ Promise -Creates a single asset +## User ⇐ [MetadataType](#MetadataType) +MetadataType -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +* [User](#User) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, _, [__], [key])](#User.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveForCache()](#User.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#User.create) ⇒ Promise + * [.update(metadata)](#User.update) ⇒ Promise + * [.preDeployTasks(metadata)](#User.preDeployTasks) ⇒ TYPE.UserDocument + * [.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#User.createOrUpdate) ⇒ void + * [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ Promise.<void> + * [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ object + * [.retrieveChangelog()](#User.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.document([metadata])](#User.document) ⇒ Promise.<void> + * [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - + -### Asset.update(metadata) ⇒ Promise -Updates a single asset +### User.retrieve(retrieveDir, _, [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| _ | void | unused parameter | +| [__] | void | unused parameter | +| [key] | string | customer key of single item to retrieve | - + -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type +### User.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves import definition metadata for caching -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise + + +### User.create(metadata) ⇒ Promise +Create a single item. + +**Kind**: static method of [User](#User) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset +### User.update(metadata) ⇒ Promise +Updates a single item. -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [User](#User) **Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | +| metadata | TYPE.MetadataTypeItem | single metadata entry | - + -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json +### User.preDeployTasks(metadata) ⇒ TYPE.UserDocument +prepares a item for deployment -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [User](#User) +**Returns**: TYPE.UserDocument - metadata object | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | - - - -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | +| metadata | TYPE.UserDocument | of a single item | - + -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps +### User.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ void +helper for [upsert](#MetadataType.upsert) -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata +**Kind**: static method of [User](#User) | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | +| metadata | TYPE.MetadataTypeMap | list of metadata | +| metadataKey | string | key of item we are looking at | +| hasError | boolean | error flag from previous code | +| metadataToUpdate | Array.<TYPE.UserDocumentDiff> | list of items to update | +| metadataToCreate | Array.<TYPE.UserDocument> | list of items to create | - + -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> +### User.postDeployTasks(upsertResults) ⇒ Promise.<void> Gets executed after deployment of metadata type -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [User](#User) +**Returns**: Promise.<void> - promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment +| upsertResults | TYPE.UserDocumentMap | metadata mapped by their keyField | -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise + -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | +### User.\_getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale]) ⇒ object +helper for [User._prepareRoleAssignments](User._prepareRoleAssignments) - +**Kind**: static method of [User](#User) +**Returns**: object - format needed by API -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| roleId | string | | role.ObjectID | +| roleName | string | | role.Name | +| userId | number | | user.AccountUserID | +| assignmentOnly | boolean | | if true, only assignment configuration will be returned | +| [isRoleRemovale] | boolean | false | if true, role will be removed from user; otherwise added | -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc + -| Param | Type | Description | -| --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | +### User.retrieveChangelog() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [User](#User) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | +| [singleRetrieve] | string \| number | key of single item to filter by | +| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - + -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types +### User.document([metadata]) ⇒ Promise.<void> +Creates markdown documentation of all roles -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [User](#User) **Returns**: Promise.<void> - - | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | +| [metadata] | TYPE.MetadataTypeMap | user list | -**Example** -```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating -``` - + -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types +### User.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void +manages post retrieve steps -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - +**Kind**: static method of [User](#User) +**Returns**: TYPE.MetadataTypeItem \| void - a single item | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | +| metadata | TYPE.MetadataTypeItem | a single item | - + -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve +## Verification ⇐ [MetadataType](#MetadataType) +Verification MetadataType -**Kind**: static method of [Asset](#Asset) +**Kind**: global class +**Extends**: [MetadataType](#MetadataType) -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | +* [Verification](#Verification) ⇐ [MetadataType](#MetadataType) + * [.retrieve(retrieveDir, [_], [__], key)](#Verification.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.handleRESTErrors(ex, id)](#Verification.handleRESTErrors) ⇒ null + * [.retrieveForCache()](#Verification.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> + * [.create(metadata)](#Verification.create) ⇒ Promise + * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#Verification.postCreateTasks) ⇒ void + * [.update(metadata)](#Verification.update) ⇒ Promise + * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem + * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem + * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> - + -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy +### Verification.retrieve(retrieveDir, [_], [__], key) ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Verification Activity. -**Kind**: static method of [Asset](#Asset) +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON +| retrieveDir | string | Directory where retrieved metadata directory will be saved | +| [_] | void | unused parameter | +| [__] | void | unused parameter | +| key | string | customer key of single item to retrieve | -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) + -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | +### Verification.handleRESTErrors(ex, id) ⇒ null +helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) - +**Kind**: static method of [Verification](#Verification) +**Returns**: null - - -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON +| Param | Type | Description | +| --- | --- | --- | +| ex | Error | exception | +| id | string | id or key of item | -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - + -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | +### Verification.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> +Retrieves Metadata of Data Extract Activity for caching - +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata + -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted +### Verification.create(metadata) ⇒ Promise +Creates a single Data Extract -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | +| metadata | TYPE.VerificationItem | a single Data Extract | - + -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) +### Verification.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void +helper for [createREST](#MetadataType.createREST) + +**Kind**: static method of [Verification](#Verification) | Param | Type | Description | | --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | +| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | +| apiResponse | object | varies depending on the API call | +| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - + -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending +### Verification.update(metadata) ⇒ Promise +Updates a single Data Extract -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise - Promise | Param | Type | Description | | --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | +| metadata | TYPE.VerificationItem | a single Data Extract | - + -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes +### Verification.preDeployTasks(metadata) ⇒ TYPE.VerificationItem +prepares a verification for deployment -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name +**Kind**: static method of [Verification](#Verification) +**Returns**: TYPE.VerificationItem - metadata object | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | +| metadata | TYPE.VerificationItem | a single verification activity definition | - + -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure +### Verification.postRetrieveTasks(metadata) ⇒ TYPE.VerificationItem +parses retrieved Metadata before saving -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata +**Kind**: static method of [Verification](#Verification) +**Returns**: TYPE.VerificationItem - Array with one metadata object and one sql string | Param | Type | Description | | --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | +| metadata | TYPE.VerificationItem | a single verification activity definition | - + -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned +### Verification.deleteByKey(key) ⇒ Promise.<boolean> +Delete a metadata item from the specified business unit -**Kind**: static method of [Asset](#Asset) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] +**Kind**: static method of [Verification](#Verification) +**Returns**: Promise.<boolean> - deletion success status | Param | Type | Description | | --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | +| key | string | Identifier of item | - + -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit +## Retriever +Retrieves metadata from a business unit and saves it to the local filesystem. + +**Kind**: global class + +* [Retriever](#Retriever) + * [new Retriever(properties, buObject)](#new_Retriever_new) + * [.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly])](#Retriever+retrieve) ⇒ Promise.<TYPE.MultiMetadataTypeList> + * [._getTypeDependencies(metadataTypes)](#Retriever+_getTypeDependencies) ⇒ Array.<TYPE.SupportedMetadataTypes> + + + +### new Retriever(properties, buObject) +Creates a Retriever, uses v2 auth if v2AuthOptions are passed. -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of data extension | +| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | +| buObject | TYPE.BuObject | properties for auth | - + -### Asset.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk +### retriever.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly]) ⇒ Promise.<TYPE.MultiMetadataTypeList> +Retrieve metadata of specified types into local file system and Retriever.metadata -**Kind**: static method of [Asset](#Asset) +**Kind**: instance method of [Retriever](#Retriever) +**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} | Param | Type | Description | | --- | --- | --- | -| customerKey | string | Identifier of metadata item | +| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | +| [namesOrKeys] | Array.<string> \| TYPE.TypeKeyCombo | name of Metadata to retrieveAsTemplate or list of keys for normal retrieval | +| [templateVariables] | TYPE.TemplateMap | Object of values which can be replaced (in case of templating) | +| [changelogOnly] | boolean | skip saving, only create json in memory | - + -### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id +### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes> +helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of the given types -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found +**Kind**: instance method of [Retriever](#Retriever) +**Returns**: Array.<TYPE.SupportedMetadataTypes> - unique list dependent metadata types | Param | Type | Description | | --- | --- | --- | -| id | string | Identifier of metadata | +| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | @@ -9847,6 +8523,36 @@ Returns an SDK instance to be used for API calls | sessionKey | string | key for specific BU | | authObject | TYPE.AuthObject | credentials for specific BU | + + +## getActualJson(customerKey, type, subtype, [buName]) ⇒ Promise.<string> +gets file from Retrieve folder + +**Kind**: global function +**Returns**: Promise.<string> - file in string form + +| Param | Type | Default | Description | +| --- | --- | --- | --- | +| customerKey | string | | of metadata | +| type | string | | of metadata | +| subtype | string | | of metadata | +| [buName] | string | "testBU" | used when we need to test on ParentBU | + + + +## getActualFile(customerKey, type, subtype, ext) ⇒ string +gets file from Retrieve folder + +**Kind**: global function +**Returns**: string - file path + +| Param | Type | Description | +| --- | --- | --- | +| customerKey | string | of metadata | +| type | string | of metadata | +| subtype | string | of metadata | +| ext | string | file extension | + ## TypeKeyCombo : Object.<string, string> diff --git a/test/resources/9999999/asset/resolveId-1234-notFound-expected.json b/test/resources/9999999/asset/resolveId-1234-notFound-expected.json new file mode 100644 index 000000000..4d8a1e072 --- /dev/null +++ b/test/resources/9999999/asset/resolveId-1234-notFound-expected.json @@ -0,0 +1 @@ +{ "error": "id not found" } diff --git a/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json b/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json new file mode 100644 index 000000000..2f9ef8a28 --- /dev/null +++ b/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json @@ -0,0 +1,6 @@ +{ + "key": "mcdev-issue-1157", + "mid": 9999999, + "name": "mcdev-issue-1157-Mcdev-strips-content", + "error": "file not found on local disk" +} diff --git a/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json b/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json new file mode 100644 index 000000000..9a05a481c --- /dev/null +++ b/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json @@ -0,0 +1,6 @@ +{ + "key": "mcdev-issue-1157", + "mid": 9999999, + "name": "mcdev-issue-1157-Mcdev-strips-content", + "path": "./retrieve/testInstance/testBU/asset/block/mcdev-issue-1157.asset-block-meta.html" +} diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 6d7b26f83..308f21274 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -101,4 +101,65 @@ describe('type: asset', () => { return; }); }); + + describe('ResolveID ================', () => { + it('Should resolve the id of the item but NOT find the asset locally', async () => { + // WHEN + const resolveIdJson = await handler.resolveId( + 'testInstance/testBU', + 'asset', + '1295064' + ); + // THEN + assert.equal(process.exitCode, 0, 'resolveId should not have thrown an error'); + assert.deepEqual( + resolveIdJson, + await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1295064-noPath'), + 'returned response was not equal expected' + ); + return; + }); + + it('Should resolve the id with --json option enabled', async () => { + handler.setOptions({ json: true }); + // WHEN + await handler.resolveId('testInstance/testBU', 'asset', '1295064'); + // THEN + assert.equal(process.exitCode, 0, 'resolveId should not have thrown an error'); + return; + }); + + it('Should resolve the id of the item AND find the asset locally', async () => { + // prep test by retrieving the file + await handler.retrieve('testInstance/testBU', ['asset-block'], ['mcdev-issue-1157']); + // WHEN + const resolveIdJson = await handler.resolveId( + 'testInstance/testBU', + 'asset', + '1295064' + ); + // THEN + assert.equal(process.exitCode, 0, 'resolveId should not have thrown an error'); + assert.deepEqual( + resolveIdJson, + await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1295064-withPath'), + 'returned response was not equal expected' + ); + return; + }); + + it('Should NOT resolve the id of the item', async () => { + // WHEN + const resolveIdJson = await handler.resolveId('testInstance/testBU', 'asset', '-1234'); + // THEN + assert.equal(process.exitCode, 404, 'resolveId should have thrown an error'); + // IMPORTANT: this will throw a false "TEST-ERROR" but our testing framework currently needs to not find the file to throw a 404 + assert.deepEqual( + resolveIdJson, + await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1234-notFound'), + 'returned response was not equal expected' + ); + return; + }); + }); }); From 8ffe5fbaba7a80b034d402e17ed056b7f883334f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Mar 2024 20:55:05 +0000 Subject: [PATCH 063/359] Bump winston from 3.12.0 to 3.13.0 Bumps [winston](https://github.com/winstonjs/winston) from 3.12.0 to 3.13.0. - [Release notes](https://github.com/winstonjs/winston/releases) - [Changelog](https://github.com/winstonjs/winston/blob/master/CHANGELOG.md) - [Commits](https://github.com/winstonjs/winston/compare/v3.12.0...v3.13.0) --- updated-dependencies: - dependency-name: winston dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index ea22e1936..649ca77d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,7 +27,7 @@ "simple-git": "3.22.0", "toposort": "2.0.2", "update-notifier": "7.0.0", - "winston": "3.12.0", + "winston": "3.13.0", "yargs": "17.7.2" }, "bin": { @@ -8091,9 +8091,9 @@ } }, "node_modules/winston": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/winston/-/winston-3.12.0.tgz", - "integrity": "sha512-OwbxKaOlESDi01mC9rkM0dQqQt2I8DAUMRLZ/HpbwvDXm85IryEHgoogy5fziQy38PntgZsLlhAYHz//UPHZ5w==", + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/winston/-/winston-3.13.0.tgz", + "integrity": "sha512-rwidmA1w3SE4j0E5MuIufFhyJPBDG7Nu71RkZor1p2+qHvJSZ9GYDA81AyleQcZbh/+V6HjeBdfnTZJm9rSeQQ==", "dependencies": { "@colors/colors": "^1.6.0", "@dabh/diagnostics": "^2.0.2", diff --git a/package.json b/package.json index f1a3c0f0e..99bd126f4 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "simple-git": "3.22.0", "toposort": "2.0.2", "update-notifier": "7.0.0", - "winston": "3.12.0", + "winston": "3.13.0", "yargs": "17.7.2" }, "devDependencies": { From 058a305f54792eb63cc2dca14bc1638e103086e4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Apr 2024 20:21:08 +0000 Subject: [PATCH 064/359] Bump mocha from 10.3.0 to 10.4.0 Bumps [mocha](https://github.com/mochajs/mocha) from 10.3.0 to 10.4.0. - [Release notes](https://github.com/mochajs/mocha/releases) - [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md) - [Commits](https://github.com/mochajs/mocha/compare/v10.3.0...v10.4.0) --- updated-dependencies: - dependency-name: mocha dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 649ca77d4..69daffa48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "husky": "9.0.11", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", - "mocha": "10.3.0", + "mocha": "10.4.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", "prettier-eslint": "16.3.0" @@ -5562,9 +5562,9 @@ "dev": true }, "node_modules/mocha": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.3.0.tgz", - "integrity": "sha512-uF2XJs+7xSLsrmIvn37i/wnc91nw7XjOQB8ccyx5aEgdnohr7n+rEiZP23WkCYHjilR6+EboEnbq/ZQDz4LSbg==", + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", + "integrity": "sha512-eqhGB8JKapEYcC4ytX/xrzKforgEc3j1pGlAXVy3eRwrtAy5/nIfT1SvgGzfN0XZZxeLq0aQWkOUAmqIJiv+bA==", "dev": true, "dependencies": { "ansi-colors": "4.1.1", diff --git a/package.json b/package.json index 99bd126f4..be47fbd3a 100644 --- a/package.json +++ b/package.json @@ -101,7 +101,7 @@ "husky": "9.0.11", "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", - "mocha": "10.3.0", + "mocha": "10.4.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", "prettier-eslint": "16.3.0" From e49c58f43ba6bc49d7c7db6475c9a9f495a7bcfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:13:21 +0200 Subject: [PATCH 065/359] #1244: typedefs for util classes --- lib/util/auth.js | 28 ++++++++++++++++++---- lib/util/businessUnit.js | 23 ++++++++++++++++-- lib/util/cache.js | 42 +++++++++++++++++++++++--------- lib/util/cli.js | 44 ++++++++++++++++++++++++---------- lib/util/config.js | 28 ++++++++++++++++++---- lib/util/devops.js | 52 +++++++++++++++++++++++++++------------- lib/util/file.js | 26 +++++++++++++++++--- lib/util/init.config.js | 24 +++++++++++++++++-- lib/util/init.js | 28 ++++++++++++++++++---- lib/util/util.js | 44 +++++++++++++++++++++++++--------- 10 files changed, 270 insertions(+), 69 deletions(-) diff --git a/lib/util/auth.js b/lib/util/auth.js index 3bf665138..025f5c220 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -1,8 +1,28 @@ -import TYPE from '../../types/mcdev.d.js'; import { Util } from './util.js'; import File from './file.js'; import SDK from 'sfmc-sdk'; import Conf from 'conf'; + +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + const credentialStore = new Conf({ projectName: 'mcdev', configName: 'sessions', @@ -15,7 +35,7 @@ const Auth = { /** * For each business unit, set up base credentials to be used. * - * @param {TYPE.AuthObject} authObject details for + * @param {AuthObject} authObject details for * @param {string} credential of the instance * @returns {void} */ @@ -52,7 +72,7 @@ const Auth = { /** * Returns an SDK instance to be used for API calls * - * @param {TYPE.BuObject} buObject information about current context + * @param {BuObject} buObject information about current context * @returns {SDK} auth object */ getSDK(buObject) { @@ -88,7 +108,7 @@ const Auth = { * Returns an SDK instance to be used for API calls * * @param {string} sessionKey key for specific BU - * @param {TYPE.AuthObject} authObject credentials for specific BU + * @param {AuthObject} authObject credentials for specific BU * @returns {SDK} auth object */ function setupSDK(sessionKey, authObject) { diff --git a/lib/util/businessUnit.js b/lib/util/businessUnit.js index b26e010fc..befd82062 100644 --- a/lib/util/businessUnit.js +++ b/lib/util/businessUnit.js @@ -1,10 +1,29 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import { Util } from './util.js'; import File from './file.js'; import auth from './auth.js'; +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * Helper that handles retrieval of BU info */ @@ -12,7 +31,7 @@ const BusinessUnit = { /** * Refreshes BU names and ID's from MC instance * - * @param {TYPE.Mcdevrc} properties current properties that have to be refreshed + * @param {Mcdevrc} properties current properties that have to be refreshed * @param {string} credentialsName identifying name of the installed package / project * @returns {Promise.} success of refresh */ diff --git a/lib/util/cache.js b/lib/util/cache.js index f7a133f5b..bcbfb8443 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -1,7 +1,27 @@ -import TYPE from '../../types/mcdev.d.js'; import { Util } from './util.js'; -/** @type {TYPE.Cache} */ +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + +/** @type {Cache} */ const dataStore = {}; let currentMID = null; @@ -10,7 +30,7 @@ export default { * Method to setup buObject * NOTE: in future this may need to restore, rather than wipe the cache * - * @param {TYPE.BuObject} buObject for current Business unit + * @param {BuObject} buObject for current Business unit * @returns {void} */ initCache: (buObject) => { @@ -28,7 +48,7 @@ export default { /** * return entire cache for current MID * - * @returns {TYPE.MultiMetadataTypeMap} cache for one Business Unit + * @returns {MultiMetadataTypeMap} cache for one Business Unit */ getCache: () => dataStore[currentMID], @@ -48,16 +68,16 @@ export default { /** * return a specific item from cache * - * @param {TYPE.SupportedMetadataTypes} type of Metadata to retrieve from cache + * @param {SupportedMetadataTypes} type of Metadata to retrieve from cache * @param {string} key of the specific metadata - * @returns {TYPE.MetadataTypeItem} cached metadata item + * @returns {MetadataTypeItem} cached metadata item */ getByKey: (type, key) => dataStore[currentMID]?.[type]?.[key], /** * override cache for given metadata type with new data * - * @param {TYPE.SupportedMetadataTypes} type of Metadata to retrieve from cache - * @param {TYPE.MetadataTypeMap} metadataMap map to be set + * @param {SupportedMetadataTypes} type of Metadata to retrieve from cache + * @param {MetadataTypeMap} metadataMap map to be set * @returns {void} */ setMetadata: (type, metadataMap) => { @@ -66,8 +86,8 @@ export default { /** * merges entire metadata type with existing cache * - * @param {TYPE.SupportedMetadataTypes} type of Metadata to retrieve from cache - * @param {TYPE.MetadataTypeMap} metadataMap map to be merged + * @param {SupportedMetadataTypes} type of Metadata to retrieve from cache + * @param {MetadataTypeMap} metadataMap map to be merged * @param {number} overrideMID which should be used for merging * @returns {void} */ @@ -85,7 +105,7 @@ export default { /** * standardized method for getting data from cache. * - * @param {TYPE.SupportedMetadataTypes} metadataType metadata type ie. query + * @param {SupportedMetadataTypes} metadataType metadata type ie. query * @param {string|number|boolean} searchValue unique identifier of metadata being looked for * @param {string} searchField field name (key in object) which contains the unique identifer * @param {string} returnField field which should be returned diff --git a/lib/util/cli.js b/lib/util/cli.js index cceeb4616..fd2c4675b 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -1,6 +1,5 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import BuHelper from './businessUnit.js'; import File from './file.js'; import config from './config.js'; @@ -12,6 +11,27 @@ import 'console.table'; import MetadataTypeInfo from './../MetadataTypeInfo.js'; import TransactionalMessage from './../metadataTypes/TransactionalMessage.js'; +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * CLI helper class */ @@ -35,7 +55,7 @@ const Cli = { /** * Extends template file for properties.json * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @returns {Promise.} status */ async addExtraCredential(properties) { @@ -58,8 +78,8 @@ const Cli = { /** * - * @param {TYPE.SupportedMetadataTypes} type limit execution to given metadata type - * @param {TYPE.SupportedMetadataTypes[]} dependentTypes types that depent on type + * @param {SupportedMetadataTypes} type limit execution to given metadata type + * @param {SupportedMetadataTypes[]} dependentTypes types that depent on type * @returns {Promise.} true if user wants to continue with retrieve */ async postFixKeysReretrieve(type, dependentTypes) { @@ -98,7 +118,7 @@ const Cli = { /** * helper that logs to cli which credentials are already existing in our config file * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @returns {void} */ logExistingCredentials(properties) { @@ -113,7 +133,7 @@ const Cli = { * Extends template file for properties.json * update credentials * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @param {string} credName name of credential that needs updating * @returns {Promise.} success of update */ @@ -129,11 +149,11 @@ const Cli = { /** * Returns Object with parameters required for accessing API * - * @param {TYPE.Mcdevrc} properties object of all configuration including credentials + * @param {Mcdevrc} properties object of all configuration including credentials * @param {string} target code of BU to use * @param {boolean|string} [isCredentialOnly] true:don't ask for BU | string: name of BU * @param {boolean} [allowAll] Offer ALL as option in BU selection - * @returns {Promise.} credential to be used for Business Unit + * @returns {Promise.} credential to be used for Business Unit */ async getCredentialObject(properties, target, isCredentialOnly, allowAll) { try { @@ -196,7 +216,7 @@ const Cli = { /** * helps select the right credential in case of bad initial input * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @param {string} [credential] name of valid credential * @param {boolean} [isCredentialOnly] don't ask for BU if true * @param {boolean} [allowAll] Offer ALL as option in BU selection @@ -276,7 +296,7 @@ const Cli = { /** * helper around _askCredentials * - * @param {TYPE.Mcdevrc} properties from config file + * @param {Mcdevrc} properties from config file * @param {string} [credName] name of credential that needs updating * @returns {Promise.} success of refresh or credential name */ @@ -341,7 +361,7 @@ const Cli = { /** * helper for {@link Cli.addExtraCredential} * - * @param {TYPE.Mcdevrc} properties from config file + * @param {Mcdevrc} properties from config file * @param {string} [credName] name of credential that needs updating * @returns {Promise.} credential info */ @@ -432,7 +452,7 @@ const Cli = { /** * allows updating the metadata types that shall be retrieved * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @param {string[]} [setTypesArr] skip user prompt and overwrite with this list if given * @returns {Promise.} - */ diff --git a/lib/util/config.js b/lib/util/config.js index b5a33918d..e2db17b2b 100644 --- a/lib/util/config.js +++ b/lib/util/config.js @@ -1,4 +1,3 @@ -import TYPE from '../../types/mcdev.d.js'; import { Util } from './util.js'; import File from './file.js'; import inquirer from 'inquirer'; @@ -7,6 +6,27 @@ import path from 'node:path'; import { fileURLToPath } from 'node:url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * Central class for loading and validating properties from config and auth */ @@ -18,7 +38,7 @@ const config = { * * @param {boolean} [silent] omit throwing errors and print messages; assuming not silent if not set * @param {boolean} [isInit] don't tell the user to run init - * @returns {Promise.} central properties object + * @returns {Promise.} central properties object */ async getProperties(silent, isInit) { if (config.properties) { @@ -81,7 +101,7 @@ const config = { /** * check if the config file is correctly formatted and has values * - * @param {TYPE.Mcdevrc} properties javascript object in .mcdevrc.json + * @param {Mcdevrc} properties javascript object in .mcdevrc.json * @param {boolean} [silent] set to true for internal use w/o cli output * @returns {Promise.} file structure ok OR list of fields to be fixed */ @@ -285,7 +305,7 @@ const config = { * defines how the properties.json should look like * used for creating a template and for checking if variables are set * - * @returns {Promise.} default properties + * @returns {Promise.} default properties */ async getDefaultProperties() { const configFileName = path.resolve(__dirname, Util.boilerplateDirectory, 'config.json'); diff --git a/lib/util/devops.js b/lib/util/devops.js index 7589ad05b..a503fa0f2 100644 --- a/lib/util/devops.js +++ b/lib/util/devops.js @@ -1,4 +1,3 @@ -import TYPE from '../../types/mcdev.d.js'; import File from './file.js'; import path from 'node:path'; import inquirer from 'inquirer'; @@ -9,21 +8,42 @@ const git = gitFactory(); import Builder from '../Builder.js'; import MetadataType from '../MetadataTypeInfo.js'; import jsonToTable from 'json-to-table'; + /** - * DevOps helper class + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ +/** + * DevOps helper class + */ const DevOps = { /** * Extracts the delta between a commit and the current state for deployment. * Interactive commit selection if no commits are passed. * - * @param {TYPE.Mcdevrc} properties central properties object + * @param {Mcdevrc} properties central properties object * @param {string} [range] git commit range * @param {boolean} [saveToDeployDir] if true, copy metadata changes into deploy directory * @param {string} [filterPaths] filter file paths that start with any specified path (comma separated) * @param {number} [commitHistory] cli option to override default commit history value in config - * @returns {Promise.} - + * @returns {Promise.} - */ async getDeltaList(properties, range, saveToDeployDir, filterPaths, commitHistory) { const rangeUserInput = range; @@ -77,11 +97,11 @@ const DevOps = { move: 0, }; /** - * @type {TYPE.DeltaPkgItem[]} + * @type {DeltaPkgItem[]} */ const delta = (await git.diffSummary([range])).files // populate additional info for all changed files - .map((/** @type {TYPE.DeltaPkgItem} */ file) => { + .map((/** @type {DeltaPkgItem} */ file) => { // If file was moved it's path needs to be parsed file.moved = file.file.includes('=>'); if (file.moved) { @@ -117,7 +137,7 @@ const DevOps = { .filter((file) => !file.file.endsWith('.error.log')) .filter((file) => !file.file.endsWith('.md')) // ensure badly named files on unsupported metadata types are not in our subset - .filter((/** @type {TYPE.DeltaPkgItem} */ file) => { + .filter((/** @type {DeltaPkgItem} */ file) => { if (MetadataType[file.type]) { return true; } else { @@ -127,7 +147,7 @@ const DevOps = { return false; } }) - .map((/** @type {TYPE.DeltaPkgItem} */ file) => { + .map((/** @type {DeltaPkgItem} */ file) => { // Gets external key based on file name und the assumption that filename = externalKey if (file.type === 'folder') { file.externalKey = null; @@ -221,7 +241,7 @@ const DevOps = { if (saveToDeployDir) { // if templating is not used, we need to add related files to the delta package const typeKeysMap = {}; - /** @type {Object.} */ + /** @type {Object.} */ const buObjects = {}; for (const file of delta) { if (file.gitAction === 'delete' || file.type === 'folder') { @@ -293,7 +313,7 @@ const DevOps = { } } - /** @type {TYPE.DeltaPkgItem[]} */ + /** @type {DeltaPkgItem[]} */ const copied = delta .filter((file) => !file.file.endsWith('.md')) // filter documentation files .map((file) => @@ -337,11 +357,11 @@ const DevOps = { /** * wrapper around DevOps.getDeltaList, Builder.buildTemplate and M * - * @param {TYPE.Mcdevrc} properties project config file + * @param {Mcdevrc} properties project config file * @param {string} range git commit range - * @param {TYPE.DeltaPkgItem[]} [diffArr] instead of running git diff the method can also get a list of files to process + * @param {DeltaPkgItem[]} [diffArr] instead of running git diff the method can also get a list of files to process * @param {number} [commitHistory] cli option to override default commit history value in config - * @returns {Promise.} - + * @returns {Promise.} - */ async buildDeltaDefinitions(properties, range, diffArr, commitHistory) { const skipInteraction = Util.skipInteraction; @@ -354,7 +374,7 @@ const DevOps = { return; } const sourceMarketListArr = Object.keys(properties.options.deployment.sourceTargetMapping); - /** @type {TYPE.DeltaPkgItem[]} */ + /** @type {DeltaPkgItem[]} */ const deltaDeployAll = []; for (const sourceML of sourceMarketListArr) { // check if sourceTargetMapping has valid values @@ -558,8 +578,8 @@ const DevOps = { * should return only the json for all but asset, query and script that are saved as multiple files * additionally, the documentation for dataExtension and automation should be returned * - * @param {TYPE.Mcdevrc} properties central properties object - * @param {TYPE.BuObject} buObject references credentials + * @param {Mcdevrc} properties central properties object + * @param {BuObject} buObject references credentials * @param {string} metadataType metadata type to build * @param {string[]} keyArr customerkey of the metadata * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] diff --git a/lib/util/file.js b/lib/util/file.js index a3010350f..cdbd34186 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -1,7 +1,6 @@ /* eslint-disable no-control-regex */ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import fs from 'fs-extra'; import path from 'node:path'; @@ -10,6 +9,27 @@ import beautyAmp from 'beauty-amp-core2'; import { Util } from './util.js'; import updateNotifier from 'update-notifier'; +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + // inform user when there is an update const notifier = updateNotifier({ pkg: Util.packageJsonMcdev, @@ -165,7 +185,7 @@ const File = { * @param {string} filename name of the file without suffix * @param {string} filetype filetype ie. JSON or SSJS * @param {string} content filecontent - * @param {TYPE.TemplateMap} [templateVariables] templating variables to be replaced in the metadata + * @param {TemplateMap} [templateVariables] templating variables to be replaced in the metadata * @returns {Promise.} Promise */ writePrettyToFile: async function (directory, filename, filetype, content, templateVariables) { @@ -502,7 +522,7 @@ const File = { /** * helper that splits the config back into auth & config parts to save them separately * - * @param {TYPE.Mcdevrc} properties central properties object + * @param {Mcdevrc} properties central properties object * @returns {Promise.} - */ async saveConfigFile(properties) { diff --git a/lib/util/init.config.js b/lib/util/init.config.js index a8309d4d1..fde858d7e 100644 --- a/lib/util/init.config.js +++ b/lib/util/init.config.js @@ -1,6 +1,5 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import Cli from './cli.js'; import File from './file.js'; import config from './config.js'; @@ -11,6 +10,27 @@ import semver from 'semver'; import { fileURLToPath } from 'node:url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * CLI helper class */ @@ -19,7 +39,7 @@ const Init = { /** * helper method for this.upgradeProject that upgrades project config if needed * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @returns {Promise.} returns true if worked without errors */ async fixMcdevConfig(properties) { diff --git a/lib/util/init.js b/lib/util/init.js index 6ee716537..05d7b0100 100644 --- a/lib/util/init.js +++ b/lib/util/init.js @@ -1,5 +1,4 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import Cli from './cli.js'; import File from './file.js'; import config from './config.js'; @@ -11,6 +10,27 @@ import { Util } from './util.js'; import fs from 'node:fs'; import path from 'node:path'; +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * CLI helper class */ @@ -19,7 +39,7 @@ const Init = { /** * Creates template file for properties.json * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @param {string} credentialName identifying name of the installed package / project * @returns {Promise.} - */ @@ -374,7 +394,7 @@ const Init = { /** * wrapper around npm dependency & configuration file setup * - * @param {TYPE.Mcdevrc} properties config file's json + * @param {Mcdevrc} properties config file's json * @param {boolean} [initial] print message if not part of initial setup * @param {string} [repoName] if git URL was provided earlier, the repo name was extracted to use it for npm init * @returns {Promise.} success flag @@ -477,7 +497,7 @@ const Init = { * finds credentials that are set up in config but not in auth file * * @private - * @param {TYPE.Mcdevrc} properties javascript object in .mcdevrc.json + * @param {Mcdevrc} properties javascript object in .mcdevrc.json * @returns {string[]} list of credential names */ _getMissingCredentials(properties) { diff --git a/lib/util/util.js b/lib/util/util.js index 25dfe15c1..04caa2317 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -1,6 +1,5 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataDefinitions from './../MetadataTypeDefinitions.js'; import process from 'node:process'; import toposort from 'toposort'; @@ -12,6 +11,29 @@ import { readJsonSync } from 'fs-extra/esm'; import { fileURLToPath } from 'node:url'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').Logger} Logger + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').skipInteraction} skipInteraction + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * Util that contains logger and simple util methods */ @@ -21,7 +43,7 @@ export const Util = { configFileName: '.mcdevrc.json', parentBuName: '_ParentBU_', standardizedSplitChar: '/', - /** @type {TYPE.skipInteraction} */ + /** @type {skipInteraction} */ skipInteraction: false, packageJsonMcdev: readJsonSync(path.join(__dirname, '../../package.json')), OPTIONS: {}, @@ -68,7 +90,7 @@ export const Util = { * check if a market name exists in current mcdev config * * @param {string} market market localizations - * @param {TYPE.Mcdevrc} properties local mcdev config + * @param {Mcdevrc} properties local mcdev config * @returns {boolean} found market or not */ checkMarket(market, properties) { @@ -89,7 +111,7 @@ export const Util = { * ensure provided MarketList exists and it's content including markets and BUs checks out * * @param {string} mlName name of marketList - * @param {TYPE.Mcdevrc} properties General configuration to be used in retrieve + * @param {Mcdevrc} properties General configuration to be used in retrieve */ verifyMarketList(mlName, properties) { if (properties.marketList[mlName]) { @@ -162,7 +184,7 @@ export const Util = { /** * helper for Mcdev.retrieve, Mcdev.retrieveAsTemplate and Mcdev.deploy * - * @param {TYPE.SupportedMetadataTypes} selectedType type or type-subtype + * @param {SupportedMetadataTypes} selectedType type or type-subtype * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method * @returns {boolean} type ok or not */ @@ -206,7 +228,7 @@ export const Util = { /** * helper for getDefaultProperties() * - * @returns {TYPE.SupportedMetadataTypes[]} type choices + * @returns {SupportedMetadataTypes[]} type choices */ getRetrieveTypeChoices() { const typeChoices = []; @@ -311,7 +333,7 @@ export const Util = { /** * Logger that creates timestamped log file in 'logs/' directory * - * @type {TYPE.Logger} + * @type {Logger} */ logger: null, /** @@ -430,7 +452,7 @@ export const Util = { * key-value pairs (obj) * * @param {string | object} str JSON object or its stringified version, which has values to be replaced - * @param {TYPE.TemplateMap} obj key value object which contains keys to be replaced and values to be replaced with + * @param {TemplateMap} obj key value object which contains keys to be replaced and values to be replaced with * @returns {string | object} replaced version of str */ replaceByObject: function (str, obj) { @@ -632,10 +654,10 @@ export const Util = { /** * standardize check to ensure only one result is returned from template search * - * @param {TYPE.MetadataTypeItem[]} results array of metadata + * @param {MetadataTypeItem[]} results array of metadata * @param {string} keyToSearch the field which contains the searched value * @param {string} searchValue the value which is being looked for - * @returns {TYPE.MetadataTypeItem} metadata to be used in building template + * @returns {MetadataTypeItem} metadata to be used in building template */ templateSearchResult(results, keyToSearch, searchValue) { const matching = results.filter((item) => item[keyToSearch] === searchValue); @@ -851,7 +873,7 @@ export const Util = { /** * returns true if no LIKE filter is defined or if all filters match * - * @param {TYPE.MetadataTypeItem} metadata a single metadata item + * @param {MetadataTypeItem} metadata a single metadata item * @param {object} [filters] only used in recursive calls * @returns {boolean} true if no LIKE filter is defined or if all filters match */ From f764b57a8abb6dbc04d6a6492d8b91ff99082046 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:14:40 +0200 Subject: [PATCH 066/359] #1244: typedefs for type classes --- lib/metadataTypes/Asset.js | 103 +++++++------ lib/metadataTypes/AttributeGroup.js | 18 ++- lib/metadataTypes/AttributeSet.js | 17 ++- lib/metadataTypes/Automation.js | 94 +++++++----- lib/metadataTypes/Campaign.js | 20 ++- lib/metadataTypes/ContentArea.js | 24 ++- lib/metadataTypes/DataExtension.js | 112 +++++++------- lib/metadataTypes/DataExtensionField.js | 41 ++++-- lib/metadataTypes/DataExtensionTemplate.js | 18 ++- lib/metadataTypes/DataExtract.js | 34 +++-- lib/metadataTypes/DataExtractType.js | 18 ++- lib/metadataTypes/Discovery.js | 15 +- lib/metadataTypes/Email.js | 28 +++- lib/metadataTypes/EmailSend.js | 30 ++-- lib/metadataTypes/Event.js | 42 ++++-- lib/metadataTypes/FileLocation.js | 18 ++- lib/metadataTypes/FileTransfer.js | 32 ++-- lib/metadataTypes/Filter.js | 16 +- lib/metadataTypes/Folder.js | 30 ++-- lib/metadataTypes/ImportFile.js | 36 +++-- lib/metadataTypes/Journey.js | 50 ++++--- lib/metadataTypes/List.js | 34 +++-- lib/metadataTypes/MetadataType.js | 162 +++++++++++---------- lib/metadataTypes/MobileCode.js | 18 ++- lib/metadataTypes/MobileKeyword.js | 64 ++++---- lib/metadataTypes/MobileMessage.js | 48 +++--- lib/metadataTypes/Query.js | 54 ++++--- lib/metadataTypes/Role.js | 28 +++- lib/metadataTypes/Script.js | 53 ++++--- lib/metadataTypes/SendClassification.js | 18 ++- lib/metadataTypes/TransactionalEmail.js | 26 +++- lib/metadataTypes/TransactionalMessage.js | 22 ++- lib/metadataTypes/TransactionalPush.js | 22 ++- lib/metadataTypes/TransactionalSMS.js | 36 +++-- lib/metadataTypes/TriggeredSend.js | 38 +++-- lib/metadataTypes/User.js | 79 ++++++---- lib/metadataTypes/Verification.js | 39 +++-- 37 files changed, 1003 insertions(+), 534 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 210c63800..b7273831d 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1,7 +1,6 @@ 'use strict'; import MetadataType from './MetadataType.js'; -import TYPE from '../../types/mcdev.d.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import pLimit from 'p-limit'; @@ -9,6 +8,22 @@ import cliProgress from 'cli-progress'; import cache from '../util/cache.js'; import TriggeredSend from './TriggeredSend.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').AssetSubType} AssetSubType + * @typedef {import('../../types/mcdev.d.js').AssetMap} AssetMap + * @typedef {import('../../types/mcdev.d.js').AssetItem} AssetItem + */ + /** * FileTransfer MetadataType * @@ -20,9 +35,9 @@ class Asset extends MetadataType { * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {void} _ - - * @param {TYPE.AssetSubType[]} [subTypeArr] optionally limit to a single subtype + * @param {AssetSubType[]} [subTypeArr] optionally limit to a single subtype * @param {string} [key] customer key - * @returns {Promise.<{metadata: TYPE.AssetMap, type: string}>} Promise + * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ static async retrieve(retrieveDir, _, subTypeArr, key) { const items = []; @@ -51,7 +66,7 @@ class Asset extends MetadataType { * * @param {void} [_] parameter not used * @param {string[]} [subTypeArr] optionally limit to a single subtype - * @returns {Promise.<{metadata: TYPE.AssetMap, type: string}>} Promise + * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ static retrieveForCache(_, subTypeArr) { return this.retrieve(null, null, subTypeArr); @@ -62,9 +77,9 @@ class Asset extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @param {TYPE.AssetSubType} [selectedSubType] optionally limit to a single subtype - * @returns {Promise.<{metadata: TYPE.AssetItem, type: string}>} Promise + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {AssetSubType} [selectedSubType] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetItem, type: string}>} Promise */ static async retrieveAsTemplate(templateDir, name, templateVariables, selectedSubType) { const items = []; @@ -90,7 +105,7 @@ class Asset extends MetadataType { * helper for {@link Asset.retrieve} + {@link Asset.retrieveAsTemplate} * * @private - * @returns {TYPE.AssetSubType[]} subtype array + * @returns {AssetSubType[]} subtype array */ static _getSubTypes() { const selectedSubTypeArr = this.properties.metaDataTypes.retrieve.filter((type) => @@ -112,7 +127,7 @@ class Asset extends MetadataType { /** * Creates a single asset * - * @param {TYPE.AssetItem} metadata a single asset + * @param {AssetItem} metadata a single asset * @returns {Promise} Promise */ static create(metadata) { @@ -124,7 +139,7 @@ class Asset extends MetadataType { /** * Updates a single asset * - * @param {TYPE.AssetItem} metadata a single asset + * @param {AssetItem} metadata a single asset * @returns {Promise} Promise */ static update(metadata) { @@ -134,10 +149,10 @@ class Asset extends MetadataType { /** * Retrieves Metadata of a specific asset type * - * @param {TYPE.AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) * @param {string} [retrieveDir] target directory for saving assets * @param {string} [templateName] name of the metadata file - * @param {TYPE.TemplateMap} [templateVariables] variables to be replaced in the metadata + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata * @param {string} key customer key to filter by * @returns {Promise} Promise */ @@ -147,7 +162,7 @@ class Asset extends MetadataType { } else { Util.logger.info(` - Caching Subtype: ${subType}`); } - /** @type {TYPE.AssetSubType[]} */ + /** @type {AssetSubType[]} */ const extendedSubTypeArr = this.definition.extendedSubTypes[subType]; const subtypeIds = extendedSubTypeArr?.map( (subTypeItemName) => Asset.definition.typeMapping[subTypeItemName] @@ -278,9 +293,9 @@ class Asset extends MetadataType { * Retrieves extended metadata (files or extended content) of asset * * @param {Array} items array of items to retrieve - * @param {TYPE.AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) * @param {string} retrieveDir target directory for saving assets - * @param {TYPE.TemplateMap} [templateVariables] variables to be replaced in the metadata + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata * @returns {Promise} Promise */ static async requestAndSaveExtended(items, subType, retrieveDir, templateVariables) { @@ -428,8 +443,8 @@ class Asset extends MetadataType { * Some metadata types store their actual content as a separate file, e.g. images * This method retrieves these and saves them alongside the metadata json * - * @param {TYPE.AssetItem} metadata a single asset - * @param {TYPE.AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {AssetItem} metadata a single asset + * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) * @param {string} retrieveDir target directory for saving assets * @returns {Promise.} - */ @@ -453,8 +468,8 @@ class Asset extends MetadataType { * Some metadata types store their actual content as a separate file, e.g. images * This method reads these from the local FS stores them in the metadata object allowing to deploy it * - * @param {TYPE.AssetItem} metadata a single asset - * @param {TYPE.AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {AssetItem} metadata a single asset + * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) * @param {string} deployDir directory of deploy files * @param {boolean} [pathOnly] used by getFilesToCommit which does not need the binary file to be actually read * @returns {Promise.} if found will return the path of the binary file @@ -488,8 +503,8 @@ class Asset extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.AssetItem} metadata a single asset - * @returns {TYPE.CodeExtractItem} metadata + * @param {AssetItem} metadata a single asset + * @returns {CodeExtractItem} metadata */ static postRetrieveTasks(metadata) { // folder @@ -502,8 +517,8 @@ class Asset extends MetadataType { /** * Gets executed after deployment of metadata type * - * @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField - * @param {TYPE.MetadataTypeMap} _ originalMetadata to be updated (contains additioanl fields) + * @param {MetadataTypeMap} metadata metadata mapped by their keyField + * @param {MetadataTypeMap} _ originalMetadata to be updated (contains additioanl fields) * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates * @returns {Promise.} - */ @@ -524,7 +539,7 @@ class Asset extends MetadataType { * helper for {@link Asset.postDeployTasks}. triggers a refresh of active triggerredSendDefinitions associated with the updated asset-message items. Gets executed if refresh option has been set. * * @private - * @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField + * @param {MetadataTypeMap} metadata metadata mapped by their keyField * @returns {Promise.} - */ static async _refreshTriggeredSend(metadata) { @@ -572,9 +587,9 @@ class Asset extends MetadataType { /** * prepares an asset definition for deployment * - * @param {TYPE.AssetItem} metadata a single asset + * @param {AssetItem} metadata a single asset * @param {string} deployDir directory of deploy files - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async preDeployTasks(metadata, deployDir) { // additonalattributes fail where the value is "" so we need to remove them from deploy @@ -672,8 +687,8 @@ class Asset extends MetadataType { * determines the subtype of the current asset * * @private - * @param {TYPE.AssetItem} metadata a single asset - * @returns {TYPE.AssetSubType | void} subtype + * @param {AssetItem} metadata a single asset + * @returns {AssetSubType | void} subtype */ static _getSubtype(metadata) { for (const sub in this.definition.extendedSubTypes) { @@ -688,8 +703,8 @@ class Asset extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string} targetDir Directory where built definitions will be saved - * @param {TYPE.AssetItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {AssetItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} - */ @@ -716,8 +731,8 @@ class Asset extends MetadataType { * @example assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.AssetItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {AssetItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} - */ @@ -744,8 +759,8 @@ class Asset extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string} targetDir Directory where built definitions will be saved - * @param {TYPE.AssetItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {AssetItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @param {'definition'|'template'} mode defines what we use this helper for * @returns {Promise.} - @@ -834,7 +849,7 @@ class Asset extends MetadataType { /** * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve * - * @param {TYPE.MetadataTypeItem} metadata a single script activity definition + * @param {MetadataTypeItem} metadata a single script activity definition */ static setFolderPath(metadata) { try { @@ -856,7 +871,7 @@ class Asset extends MetadataType { /** * Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item */ static setFolderId(metadata) { metadata.category = { @@ -868,12 +883,12 @@ class Asset extends MetadataType { /** * helper for {@link Asset.preDeployTasks} that loads extracted code content back into JSON * - * @param {TYPE.AssetItem} metadata a single asset definition + * @param {AssetItem} metadata a single asset definition * @param {string} deployDir directory of deploy files - * @param {TYPE.AssetSubType} subType asset-subtype name + * @param {AssetSubType} subType asset-subtype name * @param {string} [templateName] name of the template used to built defintion (prior applying templating) * @param {boolean} [fileListOnly] does not read file contents nor update metadata if true - * @returns {Promise.} fileList for templating (disregarded during deployment) + * @returns {Promise.} fileList for templating (disregarded during deployment) */ static async _mergeCode(metadata, deployDir, subType, templateName, fileListOnly = false) { const subtypeExtension = `.${this.definition.type}-${subType}-meta`; @@ -1233,8 +1248,8 @@ class Asset extends MetadataType { * helper for {@link Asset.postRetrieveTasks} that finds code content in JSON and extracts it * to allow saving that separately and formatted * - * @param {TYPE.AssetItem} metadata a single asset definition - * @returns {TYPE.CodeExtractItem} { json: metadata, codeArr: object[], subFolder: string[] } + * @param {AssetItem} metadata a single asset definition + * @returns {CodeExtractItem} { json: metadata, codeArr: object[], subFolder: string[] } */ static _extractCode(metadata) { const codeArr = []; @@ -1431,7 +1446,7 @@ class Asset extends MetadataType { * @param {string} dir directory that contains '.json' files to be read * @param {void} [_] unused parameter * @param {string[]} selectedSubType asset, message, ... - * @returns {TYPE.MetadataTypeMap} fileName => fileContent map + * @returns {MetadataTypeMap} fileName => fileContent map */ static getJsonFromFS(dir, _, selectedSubType) { const fileName2FileContent = {}; @@ -1499,7 +1514,7 @@ class Asset extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string} templateName name of the metadata file - * @returns {Promise.} subtype name + * @returns {Promise.} subtype name */ static async findSubType(templateDir, templateName) { const typeDirArr = [this.definition.type]; @@ -1535,7 +1550,7 @@ class Asset extends MetadataType { * @param {string[]} typeDirArr current subdir for this type * @param {string} templateName name of the metadata template * @param {string} fileName name of the metadata template file w/o extension - * @returns {TYPE.AssetItem} metadata + * @returns {AssetItem} metadata */ static async readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) { // handles subtypes that create 1 folder per asset -> currently causes the below File.ReadFile to error out diff --git a/lib/metadataTypes/AttributeGroup.js b/lib/metadataTypes/AttributeGroup.js index bf17d44c7..0f18ac5d0 100644 --- a/lib/metadataTypes/AttributeGroup.js +++ b/lib/metadataTypes/AttributeGroup.js @@ -1,10 +1,14 @@ 'use strict'; import MetadataType from './MetadataType.js'; -import TYPE from '../../types/mcdev.d.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + */ + /** * AttributeGroup MetadataType * @@ -18,7 +22,7 @@ class AttributeGroup extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { return super.retrieveREST( @@ -31,7 +35,7 @@ class AttributeGroup extends MetadataType { /** * Retrieves Metadata of schema attribute groups for caching. * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache() { return super.retrieveREST(null, '/hub/v1/contacts/schema/attributeGroups'); @@ -40,8 +44,8 @@ class AttributeGroup extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single metadata - * @returns {TYPE.MetadataTypeItem} metadata + * @param {MetadataTypeItem} metadata a single metadata + * @returns {MetadataTypeItem} metadata */ static postRetrieveTasks(metadata) { // Member ID @@ -105,8 +109,8 @@ class AttributeGroup extends MetadataType { /** * prepares for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} Promise + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} Promise */ } diff --git a/lib/metadataTypes/AttributeSet.js b/lib/metadataTypes/AttributeSet.js index edd131c92..981afa9b3 100644 --- a/lib/metadataTypes/AttributeSet.js +++ b/lib/metadataTypes/AttributeSet.js @@ -2,10 +2,15 @@ import AttributeGroup from './AttributeGroup.js'; import MetadataType from './MetadataType.js'; -import TYPE from '../../types/mcdev.d.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + */ + /** * AttributeSet MetadataType * @@ -19,7 +24,7 @@ class AttributeSet extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { if (retrieveDir && !cache.getCache()?.attributeGroup) { @@ -36,7 +41,7 @@ class AttributeSet extends MetadataType { /** * Retrieves Metadata of schema set definitions for caching. * - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static retrieveForCache() { return super.retrieveREST(null, '/hub/v1/contacts/schema/setDefinitions'); @@ -151,7 +156,7 @@ class AttributeSet extends MetadataType { * * @param {object} body json of response body * @param {string|number} [singleRetrieve] key of single item to filter by - * @returns {TYPE.MetadataTypeMap} keyField => metadata map + * @returns {MetadataTypeMap} keyField => metadata map */ static parseResponseBody(body, singleRetrieve) { const metadataCache = super.parseResponseBody(body); @@ -167,8 +172,8 @@ class AttributeSet extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single metadata - * @returns {TYPE.MetadataTypeItem} metadata + * @param {MetadataTypeItem} metadata a single metadata + * @returns {MetadataTypeItem} metadata */ static postRetrieveTasks(metadata) { // folder diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 8c33bcee6..01566314a 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -1,13 +1,33 @@ 'use strict'; import MetadataType from './MetadataType.js'; -import TYPE from '../../types/mcdev.d.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import Definitions from '../MetadataTypeDefinitions.js'; import cache from '../util/cache.js'; import pLimit from 'p-limit'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').AutomationItem} AutomationItem + * @typedef {import('../../types/mcdev.d.js').AutomationItemObj} AutomationItemObj + * @typedef {import('../../types/mcdev.d.js').AutomationMap} AutomationMap + * @typedef {import('../../types/mcdev.d.js').AutomationMapObj} AutomationMapObj + * @typedef {import('../../types/mcdev.d.js').AutomationSchedule} AutomationSchedule + * @typedef {import('../../types/mcdev.d.js').AutomationScheduleSoap} AutomationScheduleSoap + */ + /** * Automation MetadataType * @@ -22,7 +42,7 @@ class Automation extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { let metadataMap; @@ -34,7 +54,7 @@ class Automation extends MetadataType { metadataMap = this._cachedMetadataMap; delete this._cachedMetadataMap; } else { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = null; if (key) { requestParams = { @@ -108,7 +128,7 @@ class Automation extends MetadataType { * helper for {@link Automation.retrieve} to get Automation Notifications * * @private - * @param {TYPE.MetadataTypeMap} metadataMap keyField => metadata map + * @param {MetadataTypeMap} metadataMap keyField => metadata map * @returns {Promise.} Promise of nothing */ static async #getAutomationNotificationsREST(metadataMap) { @@ -185,7 +205,7 @@ class Automation extends MetadataType { /** * Retrieves Metadata of Automation * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieveChangelog() { const results = await this.client.soap.retrieveBulk('Program', ['ObjectID']); @@ -230,7 +250,7 @@ class Automation extends MetadataType { /** * Retrieves automation metadata for caching * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieveForCache() { let results = {}; @@ -279,8 +299,8 @@ class Automation extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise of metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata */ static async retrieveAsTemplate(templateDir, name, templateVariables) { const results = await this.client.soap.retrieve('Program', ['ObjectID', 'Name'], { @@ -346,7 +366,7 @@ class Automation extends MetadataType { /** * helper for {@link Automation.postRetrieveTasks} and {@link Automation.execute} * - * @param {TYPE.AutomationItem} metadata a single automation + * @param {AutomationItem} metadata a single automation * @returns {boolean} true if the automation schedule is valid */ static #isValidSchedule(metadata) { @@ -369,8 +389,8 @@ class Automation extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.AutomationItem} metadata a single automation - * @returns {TYPE.AutomationItem | void} parsed item + * @param {AutomationItem} metadata a single automation + * @returns {AutomationItem | void} parsed item */ static postRetrieveTasks(metadata) { // folder @@ -558,7 +578,7 @@ class Automation extends MetadataType { /** * helper for {@link Automation.execute} * - * @param {TYPE.AutomationMap} metadataMap map of metadata + * @param {AutomationMap} metadataMap map of metadata * @param {string} key key of the metadata * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ @@ -575,7 +595,7 @@ class Automation extends MetadataType { /** * helper for {@link Automation.execute} * - * @param {TYPE.AutomationItem} metadataEntry metadata object + * @param {AutomationItem} metadataEntry metadata object * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ static async #runOnce(metadataEntry) { @@ -656,7 +676,7 @@ class Automation extends MetadataType { /** * helper for {@link Automation.pause} * - * @param {TYPE.AutomationItem} metadata automation metadata + * @param {AutomationItem} metadata automation metadata * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ static async #pauseItem(metadata) { @@ -688,10 +708,10 @@ class Automation extends MetadataType { /** * Deploys automation - the saved file is the original one due to large differences required for deployment * - * @param {TYPE.AutomationMap} metadata metadata mapped by their keyField + * @param {AutomationMap} metadata metadata mapped by their keyField * @param {string} targetBU name/shorthand of target businessUnit for mapping * @param {string} retrieveDir directory where metadata after deploy should be saved - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async deploy(metadata, targetBU, retrieveDir) { const upsertResults = await this.upsert(metadata, targetBU); @@ -710,7 +730,7 @@ class Automation extends MetadataType { /** * Creates a single automation * - * @param {TYPE.AutomationItem} metadata single metadata entry + * @param {AutomationItem} metadata single metadata entry * @returns {Promise} Promise */ static create(metadata) { @@ -721,8 +741,8 @@ class Automation extends MetadataType { /** * Updates a single automation * - * @param {TYPE.AutomationItem} metadata single metadata entry - * @param {TYPE.AutomationItem} metadataBefore metadata mapped by their keyField + * @param {AutomationItem} metadata single metadata entry + * @param {AutomationItem} metadataBefore metadata mapped by their keyField * @returns {Promise} Promise */ static update(metadata, metadataBefore) { @@ -743,7 +763,7 @@ class Automation extends MetadataType { /** * helper for {@link Automation.preDeployTasks} and {@link Automation.execute} * - * @param {TYPE.AutomationItem} metadata metadata mapped by their keyField + * @param {AutomationItem} metadata metadata mapped by their keyField */ static #preDeploySchedule(metadata) { delete metadata.schedule.rangeTypeId; @@ -770,8 +790,8 @@ class Automation extends MetadataType { /** * Gets executed before deploying metadata * - * @param {TYPE.AutomationItem} metadata metadata mapped by their keyField - * @returns {Promise.} Promise + * @param {AutomationItem} metadata metadata mapped by their keyField + * @returns {Promise.} Promise */ static async preDeployTasks(metadata) { if (metadata.notifications) { @@ -869,7 +889,7 @@ class Automation extends MetadataType { * Validates the automation to be sure it can be deployed. * Whitelisted Activites are deployed but require configuration * - * @param {TYPE.AutomationItem} metadata single automation record + * @param {AutomationItem} metadata single automation record * @returns {boolean} result if automation can be deployed based on steps */ static validateDeployMetadata(metadata) { @@ -915,7 +935,7 @@ class Automation extends MetadataType { * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed * * @private - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @returns {void} */ static async _postChangeKeyTasks(metadataEntry) { @@ -925,8 +945,8 @@ class Automation extends MetadataType { /** * Gets executed after deployment of metadata type * - * @param {TYPE.AutomationMap} metadataMap metadata mapped by their keyField - * @param {TYPE.AutomationMap} originalMetadataMap metadata to be updated (contains additioanl fields) + * @param {AutomationMap} metadataMap metadata mapped by their keyField + * @param {AutomationMap} originalMetadataMap metadata to be updated (contains additioanl fields) * @returns {Promise.} - */ static async postDeployTasks(metadataMap, originalMetadataMap) { @@ -982,7 +1002,7 @@ class Automation extends MetadataType { /** * helper for {@link Automation.postDeployTasks} * - * @param {TYPE.AutomationMap} metadataMap metadata mapped by their keyField + * @param {AutomationMap} metadataMap metadata mapped by their keyField * @param {string} key current customer key * @returns {Promise.} - */ @@ -1029,8 +1049,8 @@ class Automation extends MetadataType { /** * helper for {@link Automation.postDeployTasks} * - * @param {TYPE.AutomationMap} metadataMap metadata mapped by their keyField - * @param {TYPE.AutomationMap} originalMetadataMap metadata to be updated (contains additioanl fields) + * @param {AutomationMap} metadataMap metadata mapped by their keyField + * @param {AutomationMap} originalMetadataMap metadata to be updated (contains additioanl fields) * @param {string} key current customer key * @param {string} [oldKey] old customer key before fixKey / changeKeyValue / changeKeyField * @returns {Promise.<{key:string, response:object}>} metadata key and API response @@ -1113,7 +1133,7 @@ class Automation extends MetadataType { /** * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve * - * @param {TYPE.MetadataTypeItem} metadata a single script activity definition + * @param {MetadataTypeItem} metadata a single script activity definition */ static setFolderPath(metadata) { const folderIdField = metadata[this.definition.folderIdField] @@ -1148,7 +1168,7 @@ class Automation extends MetadataType { /** * automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item */ static setFolderId(metadata) { try { @@ -1179,12 +1199,12 @@ class Automation extends MetadataType { * Builds a schedule object to be used for scheduling an automation * based on combination of ical string and start/end dates. * - * @param {TYPE.AutomationSchedule} scheduleObject child of automation metadata used for scheduling - * @returns {TYPE.AutomationScheduleSoap} Schedulable object for soap API (currently not rest supported) + * @param {AutomationSchedule} scheduleObject child of automation metadata used for scheduling + * @returns {AutomationScheduleSoap} Schedulable object for soap API (currently not rest supported) */ static _buildSchedule(scheduleObject) { /** - * @type {TYPE.AutomationScheduleSoap} + * @type {AutomationScheduleSoap} */ const schedule = { Recurrence: {}, TimeZone: { IDSpecified: true } }; // build recurrence @@ -1339,7 +1359,7 @@ class Automation extends MetadataType { * The json's first level of keys must represent the rows and the secend level the columns * * @private - * @param {TYPE.AutomationItem} json dataextension + * @param {AutomationItem} json dataextension * @param {object[][]} tabled prepped array for output in tabular format * @returns {string} file content */ @@ -1455,7 +1475,7 @@ class Automation extends MetadataType { * @private * @param {string} directory directory the file will be written to * @param {string} filename name of the file without '.json' ending - * @param {TYPE.AutomationItem} json dataextension.columns + * @param {AutomationItem} json dataextension.columns * @param {'html'|'md'} mode html or md * @returns {Promise.} Promise of success of saving the file */ @@ -1504,7 +1524,7 @@ class Automation extends MetadataType { /** * Parses metadata into a readable Markdown/HTML format then saves it * - * @param {TYPE.AutomationMap} [metadata] a list of dataExtension definitions + * @param {AutomationMap} [metadata] a list of dataExtension definitions * @returns {Promise.} - */ static async document(metadata) { diff --git a/lib/metadataTypes/Campaign.js b/lib/metadataTypes/Campaign.js index 00032f1d7..b589489f3 100644 --- a/lib/metadataTypes/Campaign.js +++ b/lib/metadataTypes/Campaign.js @@ -1,10 +1,22 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * Campaign MetadataType * @@ -18,7 +30,7 @@ class Campaign extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { const res = await super.retrieveREST( @@ -43,7 +55,7 @@ class Campaign extends MetadataType { /** * Retrieves event definition metadata for caching * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache() { return super.retrieveREST(null, '/legacy/v1/beta2/data/campaign/'); @@ -55,7 +67,7 @@ class Campaign extends MetadataType { * @param {string} retrieveDir folder where to save * @param {string} campaignId of camapaign to retrieve * @param {string} name of camapaign for saving - * @returns {Promise.} Campaign Asset Object + * @returns {Promise.} Campaign Asset Object */ static async getAssetTags(retrieveDir, campaignId, name) { const res = await this.client.rest.getBulk(`/hub/v1/campaigns/${campaignId}/assets`); diff --git a/lib/metadataTypes/ContentArea.js b/lib/metadataTypes/ContentArea.js index f9d18edb7..8f4ff2363 100644 --- a/lib/metadataTypes/ContentArea.js +++ b/lib/metadataTypes/ContentArea.js @@ -1,10 +1,22 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * ContentArea MetadataType * @@ -18,13 +30,13 @@ class ContentArea extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { Util.logger.warn( ' - Classic Content Areas are deprecated and will be discontinued by SFMC in the near future. Ensure that you migrate any existing Content Areas to Content Builder as soon as possible.' ); - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = null; if (key) { requestParams = { @@ -41,7 +53,7 @@ class ContentArea extends MetadataType { /** * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve * - * @param {TYPE.MetadataTypeItem} metadata a single script activity definition + * @param {MetadataTypeItem} metadata a single script activity definition */ static setFolderPath(metadata) { try { @@ -67,8 +79,8 @@ class ContentArea extends MetadataType { /** * parses retrieved Metadata before saving * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} parsed item + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} parsed item */ static postRetrieveTasks(metadata) { // folder diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index 95e2771af..ae80de4fe 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -1,7 +1,6 @@ 'use strict'; import jsonToTable from 'json-to-table'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import AttributeSet from './AttributeSet.js'; import DataExtensionField from './DataExtensionField.js'; @@ -13,6 +12,21 @@ import cache from '../util/cache.js'; import pLimit from 'p-limit'; import inquirer from 'inquirer'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldItem} DataExtensionFieldItem + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldMap} DataExtensionFieldMap + * @typedef {import('../../types/mcdev.d.js').DataExtensionItem} DataExtensionItem + * @typedef {import('../../types/mcdev.d.js').DataExtensionMap} DataExtensionMap + */ + /** * DataExtension MetadataType * @@ -23,7 +37,7 @@ class DataExtension extends MetadataType { * Upserts dataExtensions after retrieving them from source and target to compare * if create or update operation is needed. * - * @param {TYPE.DataExtensionMap} metadataMap dataExtensions mapped by their customerKey + * @param {DataExtensionMap} metadataMap dataExtensions mapped by their customerKey * @returns {Promise} Promise */ static async upsert(metadataMap) { @@ -128,11 +142,11 @@ class DataExtension extends MetadataType { /** * helper for {@link MetadataType.upsert} * - * @param {TYPE.MetadataTypeMap} metadataMap list of metadata + * @param {MetadataTypeMap} metadataMap list of metadata * @param {string} metadataKey key of item we are looking at * @param {boolean} hasError error flag from previous code - * @param {TYPE.MetadataTypeItemDiff[]} metadataToUpdate list of items to update - * @param {TYPE.MetadataTypeItem[]} metadataToCreate list of items to create + * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {MetadataTypeItem[]} metadataToCreate list of items to create * @returns {'create' | 'update' | 'skip'} action to take */ static async createOrUpdate( @@ -230,7 +244,7 @@ class DataExtension extends MetadataType { /** * Create a single dataExtension. Also creates their columns in 'dataExtension.columns' * - * @param {TYPE.DataExtensionItem} metadata single metadata entry + * @param {DataExtensionItem} metadata single metadata entry * @returns {Promise} Promise */ static async create(metadata) { @@ -243,7 +257,7 @@ class DataExtension extends MetadataType { * during deployment, that extra value is not accepted by the APIs which is why it needs to be removed * * @private - * @param {TYPE.DataExtensionItem} metadata single metadata entry + * @param {DataExtensionItem} metadata single metadata entry * @returns {void} */ static #cleanupRetentionPolicyFields(metadata) { @@ -261,7 +275,7 @@ class DataExtension extends MetadataType { /** * Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' * - * @param {TYPE.DataExtensionItem} metadata single metadata entry + * @param {DataExtensionItem} metadata single metadata entry * @returns {Promise} Promise */ static async update(metadata) { @@ -270,8 +284,8 @@ class DataExtension extends MetadataType { /** * Gets executed after deployment of metadata type * - * @param {TYPE.DataExtensionMap} upsertedMetadata metadata mapped by their keyField - * @param {TYPE.DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) + * @param {DataExtensionMap} upsertedMetadata metadata mapped by their keyField + * @param {DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates * @returns {void} */ @@ -303,15 +317,15 @@ class DataExtension extends MetadataType { .sort((a, b) => a.Ordinal - b.Ordinal); } else if (existingFields) { // get list of updated fields - /** @type {TYPE.DataExtensionFieldItem[]} */ + /** @type {DataExtensionFieldItem[]} */ const updatedFieldsArr = originalMetadata[oldKey].Fields.Field.filter( (field) => field.ObjectID && field.ObjectID !== '' ); // convert existing fields obj into array and sort - /** @type {TYPE.DataExtensionFieldItem[]} */ + /** @type {DataExtensionFieldItem[]} */ const finalFieldsArr = Object.keys(existingFields) .map((el) => { - /** @type {TYPE.DataExtensionFieldItem} */ + /** @type {DataExtensionFieldItem} */ const existingField = existingFields[el]; // check if the current field was updated and then override with it. otherwise use existing value const field = @@ -327,7 +341,7 @@ class DataExtension extends MetadataType { .sort((a, b) => a.Ordinal - b.Ordinal); // get list of new fields - /** @type {TYPE.DataExtensionFieldItem[]} */ + /** @type {DataExtensionFieldItem[]} */ const newFieldsArr = originalMetadata[oldKey].Fields.Field.filter( (field) => !field.ObjectID ); @@ -354,8 +368,8 @@ class DataExtension extends MetadataType { * helper for {@link DataExtension.postDeployTasks} * fixes an issue where shared data extensions are not visible in data designer on child BU; SF known issue: https://issues.salesforce.com/#q=W-11031095 * - * @param {TYPE.DataExtensionMap} upsertedMetadata metadata mapped by their keyField - * @param {TYPE.DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) + * @param {DataExtensionMap} upsertedMetadata metadata mapped by their keyField + * @param {DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates * @returns {void} */ @@ -488,7 +502,7 @@ class DataExtension extends MetadataType { * helper for {@link DataExtension.#fixShared} * * @param {string} childBuName name of child BU to fix - * @param {TYPE.BuObject} buObjectParent bu object for parent BU + * @param {BuObject} buObjectParent bu object for parent BU * @param {object} clientParent SDK for parent BU * @param {Object.} sharedDataExtensionMap ID-Key relationship of shared data extensions * @returns {Promise.} updated shared DE keys on BU @@ -499,7 +513,7 @@ class DataExtension extends MetadataType { clientParent, sharedDataExtensionMap ) { - /** @type {TYPE.BuObject} */ + /** @type {BuObject} */ const buObjectChildBu = { eid: this.properties.credentials[buObjectParent.credential].eid, mid: this.properties.credentials[buObjectParent.credential].businessUnits[childBuName], @@ -571,9 +585,9 @@ class DataExtension extends MetadataType { * * @param {string} deId data extension ObjectID * @param {string} deKey dataExtension key - * @param {TYPE.BuObject} buObjectChildBu BU object for Child BU + * @param {BuObject} buObjectChildBu BU object for Child BU * @param {object} clientChildBu SDK for child BU - * @param {TYPE.BuObject} buObjectParent BU object for Parent BU + * @param {BuObject} buObjectParent BU object for Parent BU * @param {object} clientParent SDK for parent BU * @returns {Promise.} flag that signals if the fix was successful */ @@ -628,7 +642,7 @@ class DataExtension extends MetadataType { * add a new field to the shared DE to trigger an update to the data model * helper for {@link DataExtension.#fixShared_item} * - * @param {TYPE.BuObject} buObjectChildBu BU object for Child BU + * @param {BuObject} buObjectChildBu BU object for Child BU * @param {object} clientChildBu SDK for child BU * @param {string} deKey dataExtension key * @param {string} deId dataExtension ObjectID @@ -669,7 +683,7 @@ class DataExtension extends MetadataType { * helper for {@link DataExtension.#fixShared_item} * * @param {string} randomSuffix - - * @param {TYPE.BuObject} buObjectParent BU object for Parent BU + * @param {BuObject} buObjectParent BU object for Parent BU * @param {object} clientParent SDK for parent BU * @param {string} deKey dataExtension key * @returns {Promise.} fieldObjectID @@ -697,7 +711,7 @@ class DataExtension extends MetadataType { * helper for {@link DataExtension.#fixShared_item} * * @param {string} randomSuffix - - * @param {TYPE.BuObject} buObjectChildBu BU object for Child BU + * @param {BuObject} buObjectChildBu BU object for Child BU * @param {object} clientChildBu SDK for child BU * @param {string} deKey dataExtension key * @param {string} fieldObjectID field ObjectID @@ -725,12 +739,12 @@ class DataExtension extends MetadataType { * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @param {void} [_] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.<{metadata: TYPE.DataExtensionMap, type: string}>} Promise of item map + * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise of item map */ static async retrieve(retrieveDir, additionalFields, _, key) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = null; - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let fieldOptions = null; if (key) { requestParams = { @@ -776,14 +790,14 @@ class DataExtension extends MetadataType { * helper for {@link DataExtension.retrieve} and for AttributeSet.fixShared_retrieve * * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @returns {Promise.} keyField => metadata map + * @returns {Promise.} keyField => metadata map */ static async retrieveSharedForCache(additionalFields = []) { // for caching, we want to retrieve shared DEs as well from the instance parent BU Util.logger.info(' - Caching dependent Metadata: dataExtension (shared via _ParentBU_)'); const buObjectBak = this.buObject; const clientBak = this.client; - /** @type {TYPE.BuObject} */ + /** @type {BuObject} */ const buObjectParentBu = { eid: this.properties.credentials[this.buObject.credential].eid, mid: this.properties.credentials[this.buObject.credential].eid, @@ -850,8 +864,8 @@ class DataExtension extends MetadataType { * helper to retrieve all dataExtension fields and attach them to the dataExtension metadata * * @private - * @param {TYPE.DataExtensionMap} metadata already cached dataExtension metadata - * @param {TYPE.SoapRequestParams} [fieldOptions] optionally filter results + * @param {DataExtensionMap} metadata already cached dataExtension metadata + * @param {SoapRequestParams} [fieldOptions] optionally filter results * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @returns {Promise.} - */ @@ -885,7 +899,7 @@ class DataExtension extends MetadataType { * Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval * * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @returns {Promise.<{metadata: TYPE.DataExtensionMap, type: string}>} Promise of item map + * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise of item map */ static async retrieveChangelog(additionalFields) { const metadata = await this._retrieveAll(additionalFields); @@ -894,8 +908,8 @@ class DataExtension extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.DataExtensionItem} metadata a single dataExtension - * @returns {TYPE.DataExtensionItem} metadata + * @param {DataExtensionItem} metadata a single dataExtension + * @returns {DataExtensionItem} metadata */ static async postRetrieveTasks(metadata) { // Error during deploy if SendableSubscriberField.Name = '_SubscriberKey' even though it is retrieved like that @@ -939,9 +953,9 @@ class DataExtension extends MetadataType { * Helper to retrieve Data Extension Fields * * @private - * @param {TYPE.SoapRequestParams} [options] options (e.g. continueRequest) + * @param {SoapRequestParams} [options] options (e.g. continueRequest) * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @returns {Promise.} Promise of items + * @returns {Promise.} Promise of items */ static async _retrieveFields(options, additionalFields) { if (!options) { @@ -958,7 +972,7 @@ class DataExtension extends MetadataType { * helps retrieving fields during templating and deploy where we dont want the full list * * @private - * @param {TYPE.DataExtensionMap} metadata list of DEs + * @param {DataExtensionMap} metadata list of DEs * @param {string} customerKey external key of single DE * @returns {Promise.} - */ @@ -988,7 +1002,7 @@ class DataExtension extends MetadataType { * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed * * @private - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @returns {void} */ static async _postChangeKeyTasks(metadataEntry) { @@ -998,8 +1012,8 @@ class DataExtension extends MetadataType { /** * prepares a DataExtension for deployment * - * @param {TYPE.DataExtensionItem} metadata a single data Extension - * @returns {Promise.} Promise of updated single DE + * @param {DataExtensionItem} metadata a single data Extension + * @returns {Promise.} Promise of updated single DE */ static async preDeployTasks(metadata) { if (metadata.Name?.startsWith('_')) { @@ -1085,7 +1099,7 @@ class DataExtension extends MetadataType { * The json's first level of keys must represent the rows and the secend level the columns * * @private - * @param {TYPE.DataExtensionItem} json single dataextension + * @param {DataExtensionItem} json single dataextension * @param {object[][]} tabled prepped array for output in tabular format * @returns {string} file content */ @@ -1140,7 +1154,7 @@ class DataExtension extends MetadataType { * The json's first level of keys must represent the rows and the secend level the columns * * @private - * @param {TYPE.DataExtensionItem} json dataextension + * @param {DataExtensionItem} json dataextension * @param {object[][]} tabled prepped array for output in tabular format * @returns {string} file content */ @@ -1193,7 +1207,7 @@ class DataExtension extends MetadataType { * @private * @param {string} directory directory the file will be written to * @param {string} filename name of the file without '.json' ending - * @param {TYPE.DataExtensionItem} json dataextension.columns + * @param {DataExtensionItem} json dataextension.columns * @param {'html'|'md'} mode html or md * @param {string[]} [fieldsToKeep] list of keys(columns) to show. This will also specify * @returns {Promise.} Promise of success of saving the file @@ -1232,7 +1246,7 @@ class DataExtension extends MetadataType { /** * Parses metadata into a readable Markdown/HTML format then saves it * - * @param {TYPE.DataExtensionMap} [metadataMap] a list of dataExtension definitions + * @param {DataExtensionMap} [metadataMap] a list of dataExtension definitions * @returns {Promise.} - */ static async document(metadataMap) { @@ -1332,7 +1346,7 @@ class DataExtension extends MetadataType { /** * Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. * - * @returns {Promise.<{metadata: TYPE.DataExtensionMap, type: string}>} Promise + * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise */ static async retrieveForCache() { return this.retrieve(null, ['ObjectID', 'CustomerKey', 'Name'], this.buObject, null, null); @@ -1342,8 +1356,8 @@ class DataExtension extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata item - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.<{metadata: TYPE.DataExtensionMap, type: string}>} Promise of items + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise of items */ static async retrieveAsTemplate(templateDir, name, templateVariables) { const options = { @@ -1395,7 +1409,7 @@ class DataExtension extends MetadataType { * dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve * it also sets the content type which is basically the subtype * - * @param {TYPE.MetadataTypeItem} metadata a single script activity definition + * @param {MetadataTypeItem} metadata a single script activity definition */ static setFolderPath(metadata) { let error = false; @@ -1455,8 +1469,8 @@ class DataExtension extends MetadataType { * * @private * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @param {TYPE.SoapRequestParams} [options] e.g. filter - * @returns {Promise.} keyField => metadata map + * @param {SoapRequestParams} [options] e.g. filter + * @returns {Promise.} keyField => metadata map */ static async _retrieveAll(additionalFields, options) { const { metadata } = await super.retrieveSOAP(null, options, null, additionalFields); diff --git a/lib/metadataTypes/DataExtensionField.js b/lib/metadataTypes/DataExtensionField.js index c1f93fae7..747c01ca0 100644 --- a/lib/metadataTypes/DataExtensionField.js +++ b/lib/metadataTypes/DataExtensionField.js @@ -1,9 +1,24 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldMap} DataExtensionFieldMap + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldItem} DataExtensionFieldItem + */ /** * DataExtensionField MetadataType * @@ -15,7 +30,7 @@ class DataExtensionField extends MetadataType { * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @returns {Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}>} Promise of items + * @returns {Promise.<{metadata: DataExtensionFieldMap, type: string}>} Promise of items */ static async retrieve(retrieveDir, additionalFields) { return super.retrieveSOAP(retrieveDir, null, null, additionalFields); @@ -23,9 +38,9 @@ class DataExtensionField extends MetadataType { /** * Retrieves all records for caching * - * @param {TYPE.SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @returns {Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}>} Promise of items + * @returns {Promise.<{metadata: DataExtensionFieldMap, type: string}>} Promise of items */ static async retrieveForCache(requestParams, additionalFields) { return super.retrieveSOAP(null, requestParams, null, additionalFields); @@ -33,8 +48,8 @@ class DataExtensionField extends MetadataType { /** * helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array * - * @param {TYPE.DataExtensionFieldMap} fieldsObj customerKey-based list of fields for one dataExtension - * @returns {TYPE.DataExtensionFieldItem[]} sorted array of field objects + * @param {DataExtensionFieldMap} fieldsObj customerKey-based list of fields for one dataExtension + * @returns {DataExtensionFieldItem[]} sorted array of field objects */ static convertToSortedArray(fieldsObj) { return ( @@ -48,8 +63,8 @@ class DataExtensionField extends MetadataType { /** * sorting method to ensure `Ordinal` is respected * - * @param {TYPE.DataExtensionFieldItem} a - - * @param {TYPE.DataExtensionFieldItem} b - + * @param {DataExtensionFieldItem} a - + * @param {DataExtensionFieldItem} b - * @returns {boolean} sorting based on Ordinal */ static sortDeFields(a, b) { @@ -58,9 +73,9 @@ class DataExtensionField extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.DataExtensionFieldItem} metadata a single item + * @param {DataExtensionFieldItem} metadata a single item * @param {boolean} forDataExtension when used by DataExtension class we remove more fields - * @returns {TYPE.DataExtensionFieldItem} metadata + * @returns {DataExtensionFieldItem} metadata */ static postRetrieveTasks(metadata, forDataExtension) { if (forDataExtension) { @@ -82,9 +97,9 @@ class DataExtensionField extends MetadataType { * Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. * Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type * - * @param {TYPE.DataExtensionFieldItem[]} deployColumns Columns of data extension that will be deployed + * @param {DataExtensionFieldItem[]} deployColumns Columns of data extension that will be deployed * @param {string} deKey external/customer key of Data Extension - * @returns {Promise.>} existing fields by their original name to allow re-adding FieldType after update + * @returns {Promise.>} existing fields by their original name to allow re-adding FieldType after update */ static async prepareDeployColumnsOnUpdate(deployColumns, deKey) { // create list of DE keys that had changes to their fields to be able to use it as a filter in the --fixShared logic @@ -119,7 +134,7 @@ class DataExtensionField extends MetadataType { const fieldsObj = response.metadata; // ensure fields can be updated properly by their adding ObjectId based on Name-matching - /** @type {Object.} */ + /** @type {Object.} */ const existingFieldByName = {}; for (const key of Object.keys(fieldsObj)) { diff --git a/lib/metadataTypes/DataExtensionTemplate.js b/lib/metadataTypes/DataExtensionTemplate.js index edff5cb33..060f8ee71 100644 --- a/lib/metadataTypes/DataExtensionTemplate.js +++ b/lib/metadataTypes/DataExtensionTemplate.js @@ -1,8 +1,20 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * DataExtensionTemplate MetadataType * @@ -16,10 +28,10 @@ class DataExtensionTemplate extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = null; if (key) { requestParams = { diff --git a/lib/metadataTypes/DataExtract.js b/lib/metadataTypes/DataExtract.js index 1d50cd458..1d9a92dcc 100644 --- a/lib/metadataTypes/DataExtract.js +++ b/lib/metadataTypes/DataExtract.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * DataExtract MetadataType * @@ -20,7 +32,7 @@ class DataExtract extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { return super.retrieveREST(retrieveDir, '/automation/v1/dataextracts/', null, key); @@ -28,7 +40,7 @@ class DataExtract extends MetadataType { /** * Retrieves Metadata of Data Extract Activity for caching * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieveForCache() { return super.retrieveREST(null, '/automation/v1/dataextracts/'); @@ -39,8 +51,8 @@ class DataExtract extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise of metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata */ static async retrieveAsTemplate(templateDir, name, templateVariables) { const res = await this.client.rest.get( @@ -89,7 +101,7 @@ class DataExtract extends MetadataType { /** * Creates a single Data Extract * - * @param {TYPE.MetadataTypeItem} dataExtract a single Data Extract + * @param {MetadataTypeItem} dataExtract a single Data Extract * @returns {Promise} Promise */ static create(dataExtract) { @@ -99,7 +111,7 @@ class DataExtract extends MetadataType { /** * Updates a single Data Extract * - * @param {TYPE.MetadataTypeItem} dataExtract a single Data Extract + * @param {MetadataTypeItem} dataExtract a single Data Extract * @returns {Promise} Promise */ static update(dataExtract) { @@ -112,8 +124,8 @@ class DataExtract extends MetadataType { /** * prepares a dataExtract for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single dataExtract activity definition - * @returns {TYPE.MetadataTypeItem} metadata object + * @param {MetadataTypeItem} metadata a single dataExtract activity definition + * @returns {MetadataTypeItem} metadata object */ static preDeployTasks(metadata) { metadata.dataExtractTypeId = cache.searchForField( @@ -128,8 +140,8 @@ class DataExtract extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} metadata + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} metadata */ static postRetrieveTasks(metadata) { try { diff --git a/lib/metadataTypes/DataExtractType.js b/lib/metadataTypes/DataExtractType.js index 5f6185686..c66bf97fd 100644 --- a/lib/metadataTypes/DataExtractType.js +++ b/lib/metadataTypes/DataExtractType.js @@ -1,8 +1,20 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * DataExtractType MetadataType * Only for Caching No retrieve/upsert is required @@ -18,7 +30,7 @@ class DataExtractType extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { return super.retrieveREST(retrieveDir, '/automation/v1/dataextracttypes/', null, key); @@ -26,7 +38,7 @@ class DataExtractType extends MetadataType { /** * Retrieves Metadata of Data Extract Type for caching. * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache() { return super.retrieveREST(null, '/automation/v1/dataextracttypes/'); diff --git a/lib/metadataTypes/Discovery.js b/lib/metadataTypes/Discovery.js index 803c96e14..4c33ee5ea 100644 --- a/lib/metadataTypes/Discovery.js +++ b/lib/metadataTypes/Discovery.js @@ -1,9 +1,20 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ /** * ImportFile MetadataType * @@ -18,7 +29,7 @@ class Discovery extends MetadataType { * @param {void} [_] not used * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { if (key) { diff --git a/lib/metadataTypes/Email.js b/lib/metadataTypes/Email.js index 7c17111c6..81d33ef36 100644 --- a/lib/metadataTypes/Email.js +++ b/lib/metadataTypes/Email.js @@ -1,9 +1,21 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * Email MetadataType * @@ -17,10 +29,10 @@ class Email extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = null; if (key) { requestParams = { @@ -37,11 +49,11 @@ class Email extends MetadataType { /** * Helper for writing Metadata to disk, used for Retrieve and deploy * - * @param {TYPE.MetadataTypeMap} results metadata results from deploy + * @param {MetadataTypeMap} results metadata results from deploy * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) - * @param {TYPE.TemplateMap} [templateVariables] variables to be replaced in the metadata - * @returns {Promise.} Promise of saved metadata + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata */ static async saveResults(results, retrieveDir, overrideType, templateVariables) { if (Object.keys(results).length) { @@ -55,8 +67,8 @@ class Email extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single query - * @returns {TYPE.MetadataTypeItem} Array with one metadata object and one query string + * @param {MetadataTypeItem} metadata a single query + * @returns {MetadataTypeItem} Array with one metadata object and one query string */ static postRetrieveTasks(metadata) { // folder diff --git a/lib/metadataTypes/EmailSend.js b/lib/metadataTypes/EmailSend.js index e3c4a5cb2..2184d915d 100644 --- a/lib/metadataTypes/EmailSend.js +++ b/lib/metadataTypes/EmailSend.js @@ -1,10 +1,22 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * MessageSendActivity MetadataType * @@ -18,10 +30,10 @@ class EmailSend extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = { filter: { leftOperand: { @@ -58,7 +70,7 @@ class EmailSend extends MetadataType { /** * Updates a single item * - * @param {TYPE.MetadataTypeItem} metadataItem a single item + * @param {MetadataTypeItem} metadataItem a single item * @returns {Promise} Promise */ static update(metadataItem) { @@ -68,7 +80,7 @@ class EmailSend extends MetadataType { /** * Creates a single item * - * @param {TYPE.MetadataTypeItem} metadataItem a single item + * @param {MetadataTypeItem} metadataItem a single item * @returns {Promise} Promise */ static create(metadataItem) { @@ -88,8 +100,8 @@ class EmailSend extends MetadataType { /** * prepares a single item for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single script activity definition - * @returns {Promise.} Promise + * @param {MetadataTypeItem} metadata a single script activity definition + * @returns {Promise.} Promise */ static async preDeployTasks(metadata) { // re-add IsPlatformObject, required for visibility @@ -209,8 +221,8 @@ class EmailSend extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single query - * @returns {TYPE.MetadataTypeItem} Array with one metadata object and one query string + * @param {MetadataTypeItem} metadata a single query + * @returns {MetadataTypeItem} Array with one metadata object and one query string */ static postRetrieveTasks(metadata) { // remove IsPlatformObject, always has to be 'false' diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 8b4bd129d..28769e61f 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * Event MetadataType * @@ -21,7 +33,7 @@ class Event extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { Util.logBeta(this.definition.type); @@ -38,7 +50,7 @@ class Event extends MetadataType { /** * Retrieves event definition metadata for caching * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache() { return super.retrieveREST(null, '/interaction/v1/EventDefinitions/'); @@ -49,8 +61,8 @@ class Event extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise of metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata */ static async retrieveAsTemplate(templateDir, name, templateVariables) { Util.logBeta(this.definition.type); @@ -108,8 +120,8 @@ class Event extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} eventDef a single item of Event Definition - * @returns {TYPE.MetadataTypeItem} metadata + * @param {MetadataTypeItem} eventDef a single item of Event Definition + * @returns {MetadataTypeItem} metadata */ static postRetrieveTasks(eventDef) { const val = this.parseMetadata(eventDef); @@ -133,10 +145,10 @@ class Event extends MetadataType { /** * Deploys metadata - merely kept here to be able to print {@link Util.logBeta} once per deploy * - * @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField + * @param {MetadataTypeMap} metadata metadata mapped by their keyField * @param {string} deployDir directory where deploy metadata are saved * @param {string} retrieveDir directory where metadata after deploy should be saved - * @returns {Promise.} Promise of keyField => metadata map + * @returns {Promise.} Promise of keyField => metadata map */ static async deploy(metadata, deployDir, retrieveDir) { Util.logBeta(this.definition.type); @@ -146,7 +158,7 @@ class Event extends MetadataType { /** * Creates a single Event Definition * - * @param {TYPE.MetadataTypeItem} metadata a single Event Definition + * @param {MetadataTypeItem} metadata a single Event Definition * @returns {Promise} Promise */ static create(metadata) { @@ -156,7 +168,7 @@ class Event extends MetadataType { /** * Updates a single Event Definition (using PUT method since PATCH isn't supported) * - * @param {TYPE.MetadataTypeItem} metadataEntry a single Event Definition + * @param {MetadataTypeItem} metadataEntry a single Event Definition * @returns {Promise} Promise */ static async update(metadataEntry) { @@ -170,8 +182,8 @@ class Event extends MetadataType { /** * prepares an event definition for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single eventDefinition - * @returns {TYPE.MetadataTypeItem} parsed version + * @param {MetadataTypeItem} metadata a single eventDefinition + * @returns {MetadataTypeItem} parsed version */ static preDeployTasks(metadata) { metadata.dataExtensionId = cache.searchForField( @@ -187,8 +199,8 @@ class Event extends MetadataType { /** * parses retrieved Metadata before saving * - * @param {TYPE.MetadataTypeItem} metadata a single event definition - * @returns {TYPE.MetadataTypeItem} parsed metadata + * @param {MetadataTypeItem} metadata a single event definition + * @returns {MetadataTypeItem} parsed metadata */ static parseMetadata(metadata) { try { diff --git a/lib/metadataTypes/FileLocation.js b/lib/metadataTypes/FileLocation.js index 2b5927ba6..b1dbf6969 100644 --- a/lib/metadataTypes/FileLocation.js +++ b/lib/metadataTypes/FileLocation.js @@ -1,8 +1,20 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * ImportFile MetadataType * @@ -17,7 +29,7 @@ class FtpLocation extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static retrieve(retrieveDir, _, __, key) { return super.retrieveREST(retrieveDir, '/automation/v1/ftplocations/', null, key); @@ -26,7 +38,7 @@ class FtpLocation extends MetadataType { /** * Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. * - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieveForCache() { return super.retrieveREST(null, '/automation/v1/ftplocations/'); diff --git a/lib/metadataTypes/FileTransfer.js b/lib/metadataTypes/FileTransfer.js index 494f77fe9..5239945f0 100644 --- a/lib/metadataTypes/FileTransfer.js +++ b/lib/metadataTypes/FileTransfer.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * FileTransfer MetadataType * @@ -20,7 +32,7 @@ class FileTransfer extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { return super.retrieveREST(retrieveDir, '/automation/v1/filetransfers/', null, key); @@ -28,7 +40,7 @@ class FileTransfer extends MetadataType { /** * Retrieves Metadata of FileTransfer Activity for caching * - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieveForCache() { return super.retrieveREST(null, '/automation/v1/filetransfers/'); @@ -39,8 +51,8 @@ class FileTransfer extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise */ static async retrieveAsTemplate(templateDir, name, templateVariables) { const res = await this.client.rest.get( @@ -89,7 +101,7 @@ class FileTransfer extends MetadataType { /** * Creates a single File Transfer * - * @param {TYPE.MetadataTypeItem} fileTransfer a single File Transfer + * @param {MetadataTypeItem} fileTransfer a single File Transfer * @returns {Promise} Promise */ static create(fileTransfer) { @@ -99,7 +111,7 @@ class FileTransfer extends MetadataType { /** * Updates a single File Transfer * - * @param {TYPE.MetadataTypeItem} fileTransfer a single File Transfer + * @param {MetadataTypeItem} fileTransfer a single File Transfer * @returns {Promise} Promise */ static update(fileTransfer) { @@ -109,7 +121,7 @@ class FileTransfer extends MetadataType { /** * prepares a fileTransfer for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single fileTransfer activity definition + * @param {MetadataTypeItem} metadata a single fileTransfer activity definition * @returns {Promise} Promise */ static async preDeployTasks(metadata) { @@ -132,8 +144,8 @@ class FileTransfer extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single fileTransfer activity definition - * @returns {TYPE.MetadataTypeItem} parsed metadata + * @param {MetadataTypeItem} metadata a single fileTransfer activity definition + * @returns {MetadataTypeItem} parsed metadata */ static postRetrieveTasks(metadata) { try { diff --git a/lib/metadataTypes/Filter.js b/lib/metadataTypes/Filter.js index 6fc64079f..c24959523 100644 --- a/lib/metadataTypes/Filter.js +++ b/lib/metadataTypes/Filter.js @@ -1,8 +1,20 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * Filter MetadataType * @@ -19,7 +31,7 @@ class Filter extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { return super.retrieveREST(retrieveDir, '/automation/v1/filters/', null, key); diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index bdc026544..22ccea7b3 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -1,12 +1,24 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import toposort from 'toposort'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * Folder MetadataType * @@ -163,7 +175,7 @@ class Folder extends MetadataType { * and comparing to check if create or update operation is needed. * Copied due to having a dependency on itself, meaning the created need to be serial * - * @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField + * @param {MetadataTypeMap} metadata metadata mapped by their keyField * @returns {Promise.} Promise of saved metadata */ static async upsert(metadata) { @@ -329,7 +341,7 @@ class Folder extends MetadataType { /** * creates a folder based on metatadata * - * @param {TYPE.MetadataTypeItem} metadataEntry metadata of the folder + * @param {MetadataTypeItem} metadataEntry metadata of the folder * @returns {Promise} Promise */ static async create(metadataEntry) { @@ -367,7 +379,7 @@ class Folder extends MetadataType { /** * Updates a single Folder. * - * @param {TYPE.MetadataTypeItem} metadataEntry single metadata entry + * @param {MetadataTypeItem} metadataEntry single metadata entry * @returns {Promise} Promise */ static async update(metadataEntry) { @@ -397,8 +409,8 @@ class Folder extends MetadataType { /** * prepares a folder for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single folder definition - * @returns {Promise.} Promise of parsed folder metadata + * @param {MetadataTypeItem} metadata a single folder definition + * @returns {Promise.} Promise of parsed folder metadata */ static async preDeployTasks(metadata) { if (!this.definition.deployFolderTypes.includes(metadata.ContentType.toLowerCase())) { @@ -453,7 +465,7 @@ class Folder extends MetadataType { * * @param {string} dir directory that contains '.json' files to be read * @param {boolean} [listBadKeys] do not print errors, used for badKeys() - * @returns {TYPE.MetadataTypeMap} fileName => fileContent map + * @returns {MetadataTypeMap} fileName => fileContent map */ static getJsonFromFS(dir, listBadKeys) { try { @@ -558,8 +570,8 @@ class Folder extends MetadataType { /** * Gets executed after retreive of metadata type * - * @param {TYPE.MetadataTypeItem} metadata metadata mapped by their keyField - * @returns {TYPE.MetadataTypeItem} cloned metadata + * @param {MetadataTypeItem} metadata metadata mapped by their keyField + * @returns {MetadataTypeItem} cloned metadata */ static postRetrieveTasks(metadata) { return JSON.parse(JSON.stringify(metadata)); diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 22225a828..a4bb52116 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * ImportFile MetadataType * @@ -21,7 +33,7 @@ class ImportFile extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { let objectId = null; @@ -78,7 +90,7 @@ class ImportFile extends MetadataType { * @param {void} [_] parameter not used * @param {void} [__] parameter not used * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static retrieveForCache(_, __, key) { return this.retrieve(null, null, null, key); @@ -89,8 +101,8 @@ class ImportFile extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise */ static async retrieveAsTemplate(templateDir, name, templateVariables) { // using '?$filter=name%20eq%20' + encodeURIComponent(name) would also work but that just retrieves more data for no reason @@ -157,7 +169,7 @@ class ImportFile extends MetadataType { /** * Creates a single Import File * - * @param {TYPE.MetadataTypeItem} importFile a single Import File + * @param {MetadataTypeItem} importFile a single Import File * @returns {Promise} Promise */ static create(importFile) { @@ -167,7 +179,7 @@ class ImportFile extends MetadataType { /** * Updates a single Import File * - * @param {TYPE.MetadataTypeItem} importFile a single Import File + * @param {MetadataTypeItem} importFile a single Import File * @returns {Promise} Promise */ static update(importFile) { @@ -179,10 +191,10 @@ class ImportFile extends MetadataType { /** * Deploys metadata * - * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @param {MetadataTypeMap} metadataMap metadata mapped by their keyField * @param {string} deployDir directory where deploy metadata are saved * @param {string} retrieveDir directory where metadata after deploy should be saved - * @returns {Promise.} Promise of keyField => metadata map + * @returns {Promise.} Promise of keyField => metadata map */ static async deploy(metadataMap, deployDir, retrieveDir) { if ( @@ -209,7 +221,7 @@ class ImportFile extends MetadataType { /** * prepares a import definition for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single importDef + * @param {MetadataTypeItem} metadata a single importDef * @returns {Promise} Promise */ static async preDeployTasks(metadata) { @@ -321,8 +333,8 @@ class ImportFile extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} parsed metadata + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} parsed metadata */ static postRetrieveTasks(metadata) { metadata.r__fileLocation_name = cache.searchForField( diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 1c7b2ba3c..7d0752499 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -1,12 +1,24 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import TransactionalEmail from './TransactionalEmail.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; import File from '../util/file.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * Journey MetadataType * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! @@ -24,7 +36,7 @@ class Journey extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { const extrasDefault = 'activities'; @@ -220,10 +232,10 @@ class Journey extends MetadataType { /** * Deploys metadata - merely kept here to be able to print {@link Util.logBeta} once per deploy * - * @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField + * @param {MetadataTypeMap} metadata metadata mapped by their keyField * @param {string} deployDir directory where deploy metadata are saved * @param {string} retrieveDir directory where metadata after deploy should be saved - * @returns {Promise.} Promise of keyField => metadata map + * @returns {Promise.} Promise of keyField => metadata map */ static async deploy(metadata, deployDir, retrieveDir) { Util.logBeta(this.definition.type); @@ -233,7 +245,7 @@ class Journey extends MetadataType { /** * Updates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static update(metadata) { @@ -247,7 +259,7 @@ class Journey extends MetadataType { /** * Creates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static create(metadata) { @@ -256,11 +268,11 @@ class Journey extends MetadataType { /** * Helper for writing Metadata to disk, used for Retrieve and deploy * - * @param {TYPE.MetadataTypeMap} results metadata results from deploy + * @param {MetadataTypeMap} results metadata results from deploy * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) - * @param {TYPE.TemplateMap} [templateVariables] variables to be replaced in the metadata - * @returns {Promise.} Promise of saved metadata + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata */ static async saveResults(results, retrieveDir, overrideType, templateVariables) { if (Object.keys(results).length) { @@ -273,7 +285,7 @@ class Journey extends MetadataType { /** * helper for Journey's {@link Journey.saveResults}. Gets executed after retreive of metadata type and * - * @param {TYPE.MetadataTypeMap} metadataMap key=customer key, value=metadata + * @param {MetadataTypeMap} metadataMap key=customer key, value=metadata */ static async _postRetrieveTasksBulk(metadataMap) { let needTransactionalEmail = false; @@ -298,8 +310,8 @@ class Journey extends MetadataType { * manages post retrieve steps * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} Array with one metadata object + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} Array with one metadata object */ static postRetrieveTasks(metadata) { // folder @@ -487,7 +499,7 @@ class Journey extends MetadataType { * helper for {@link Journey.postRetrieveTasks} * * @private - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item */ static _postRetrieveTasks_activities(metadata) { for (const activity of metadata.activities) { @@ -647,8 +659,8 @@ class Journey extends MetadataType { * prepares a TSD for deployment * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! * - * @param {TYPE.MetadataTypeItem} metadata of a single TSD - * @returns {TYPE.MetadataTypeItem} metadata object + * @param {MetadataTypeItem} metadata of a single TSD + * @returns {MetadataTypeItem} metadata object */ static async preDeployTasks(metadata) { if (metadata.status !== 'Draft') { @@ -809,7 +821,7 @@ class Journey extends MetadataType { * helper for {@link Journey.preDeployTasks} * * @private - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item */ static _preDeployTasks_activities(metadata) { for (const activity of metadata.activities) { @@ -892,11 +904,11 @@ class Journey extends MetadataType { /** * helper for {@link MetadataType.upsert} * - * @param {TYPE.MetadataTypeMap} metadataMap list of metadata + * @param {MetadataTypeMap} metadataMap list of metadata * @param {string} metadataKey key of item we are looking at * @param {boolean} hasError error flag from previous code - * @param {TYPE.MetadataTypeItemDiff[]} metadataToUpdate list of items to update - * @param {TYPE.MetadataTypeItem[]} metadataToCreate list of items to create + * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {MetadataTypeItem[]} metadataToCreate list of items to create * @returns {'create' | 'update' | 'skip'} action to take */ static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { diff --git a/lib/metadataTypes/List.js b/lib/metadataTypes/List.js index 2c57375f7..63da05577 100644 --- a/lib/metadataTypes/List.js +++ b/lib/metadataTypes/List.js @@ -1,12 +1,24 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import Folder from './Folder.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; import auth from '../util/auth.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * List MetadataType * @@ -20,10 +32,10 @@ class List extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieve(retrieveDir, _, __, key) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = null; if (key) { requestParams = { @@ -49,7 +61,7 @@ class List extends MetadataType { /** * Gets metadata cache with limited fields and does not store value to disk * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieveForCache() { const results = await this.retrieve(); @@ -82,14 +94,14 @@ class List extends MetadataType { * helper for @link retrieveForCache and @link retrieve * * @private - * @param {TYPE.MetadataTypeMapObj} results metadata from retrieve for current BU - * @returns {Promise.} Promise + * @param {MetadataTypeMapObj} results metadata from retrieve for current BU + * @returns {Promise.} Promise */ static async _retrieveParentAllSubs(results) { if (this.buObject.eid !== this.buObject.mid) { // for caching, we want to get the All Subscriber List from the Parent Account Util.logger.debug(' - Checking MasterUnsubscribeBehavior for current BU'); - /** @type {TYPE.BuObject} */ + /** @type {BuObject} */ const buObjectParentBu = { eid: this.properties.credentials[this.buObject.credential].eid, mid: this.properties.credentials[this.buObject.credential].eid, @@ -169,8 +181,8 @@ class List extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} list a single list - * @returns {TYPE.MetadataTypeItem} metadata + * @param {MetadataTypeItem} list a single list + * @returns {MetadataTypeItem} metadata */ static postRetrieveTasks(list) { return this.parseMetadata(list); @@ -178,9 +190,9 @@ class List extends MetadataType { /** * parses retrieved Metadata before saving * - * @param {TYPE.MetadataTypeItem} metadata a single list definition + * @param {MetadataTypeItem} metadata a single list definition * @param {boolean} [parseForCache] if set to true, the Category ID is kept - * @returns {TYPE.MetadataTypeItem} Array with one metadata object and one sql string + * @returns {MetadataTypeItem} Array with one metadata object and one sql string */ static parseMetadata(metadata, parseForCache) { if (!metadata.r__folder_Path) { diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 055d87e5e..a67c03c11 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -7,14 +7,28 @@ * in the generic version of the method */ -import TYPE from '../../types/mcdev.d.js'; - import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; import deepEqual from 'deep-equal'; import pLimit from 'p-limit'; import Mustache from 'mustache'; + +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('sfmc-sdk')} SDK + */ + /** * ensure that Mustache does not escape any characters * @@ -36,7 +50,7 @@ class MetadataType { * * @param {string} dir directory that contains '.json' files to be read * @param {boolean} [listBadKeys] do not print errors, used for badKeys() - * @returns {TYPE.MetadataTypeMap} fileName => fileContent map + * @returns {MetadataTypeMap} fileName => fileContent map */ static getJsonFromFS(dir, listBadKeys) { const fileName2FileContent = {}; @@ -105,10 +119,10 @@ class MetadataType { /** * Deploys metadata * - * @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField + * @param {MetadataTypeMap} metadata metadata mapped by their keyField * @param {string} deployDir directory where deploy metadata are saved * @param {string} retrieveDir directory where metadata after deploy should be saved - * @returns {Promise.} Promise of keyField => metadata map + * @returns {Promise.} Promise of keyField => metadata map */ static async deploy(metadata, deployDir, retrieveDir) { const upsertResults = await this.upsert(metadata, deployDir); @@ -127,8 +141,8 @@ class MetadataType { /** * Gets executed after deployment of metadata type * - * @param {TYPE.MetadataTypeMap} upsertResults metadata mapped by their keyField as returned by update/create - * @param {TYPE.MetadataTypeMap} originalMetadata metadata to be updated (contains additioanl fields) + * @param {MetadataTypeMap} upsertResults metadata mapped by their keyField as returned by update/create + * @param {MetadataTypeMap} originalMetadata metadata to be updated (contains additioanl fields) * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates * @returns {void} */ @@ -137,9 +151,9 @@ class MetadataType { /** * helper for {@link MetadataType.createREST} * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call - * @param {TYPE.MetadataTypeItem} metadataEntryWithAllFields like metadataEntry but before non-creatable fields were stripped + * @param {MetadataTypeItem} metadataEntryWithAllFields like metadataEntry but before non-creatable fields were stripped * @returns {void} */ static postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) {} @@ -147,7 +161,7 @@ class MetadataType { /** * helper for {@link MetadataType.updateREST} * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call * @returns {void} */ @@ -156,7 +170,7 @@ class MetadataType { /** * helper for {@link MetadataType.createREST} when legacy API endpoints as these do not return the created item but only their new id * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call * @returns {Promise.} - */ @@ -185,10 +199,10 @@ class MetadataType { /** * Gets executed after retreive of metadata type * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @param {string} targetDir folder where retrieves should be saved * @param {boolean} [isTemplating] signals that we are retrieving templates - * @returns {TYPE.MetadataTypeItem} cloned metadata + * @returns {MetadataTypeItem} cloned metadata */ static postRetrieveTasks(metadata, targetDir, isTemplating) { return JSON.parse(JSON.stringify(metadata)); @@ -196,7 +210,7 @@ class MetadataType { /** * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item */ static setFolderPath(metadata) { if (!this.definition.folderIdField) { @@ -221,7 +235,7 @@ class MetadataType { /** * generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item */ static setFolderId(metadata) { if (!this.definition.folderIdField) { @@ -243,7 +257,7 @@ class MetadataType { * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @param {string[]} [subTypeArr] optionally limit to a single subtype * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} metadata + * @returns {Promise.} metadata */ static retrieve(retrieveDir, additionalFields, subTypeArr, key) { Util.metadataLogger('error', this.definition.type, 'retrieve', `Not Supported`); @@ -255,7 +269,7 @@ class MetadataType { * * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @param {string[]} [subTypeArr] optionally limit to a single subtype - * @returns {Promise.} metadata + * @returns {Promise.} metadata */ static retrieveChangelog(additionalFields, subTypeArr) { return this.retrieveForCache(additionalFields, subTypeArr); @@ -267,7 +281,7 @@ class MetadataType { * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @param {string[]} [subTypeArr] optionally limit to a single subtype * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} metadata + * @returns {Promise.} metadata */ static async retrieveForCache(additionalFields, subTypeArr, key) { return this.retrieve(null, additionalFields, subTypeArr, key); @@ -277,9 +291,9 @@ class MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} [subType] optionally limit to a single subtype - * @returns {Promise.} metadata + * @returns {Promise.} metadata */ static retrieveAsTemplate(templateDir, name, templateVariables, subType) { Util.logger.error('retrieveAsTemplate is not supported yet for ' + this.definition.type); @@ -296,9 +310,9 @@ class MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} uri rest endpoint for GET - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} name name (not key) of the metadata item - * @returns {Promise.<{metadata: TYPE.MetadataTypeItem, type: string}>} Promise + * @returns {Promise.<{metadata: MetadataTypeItem, type: string}>} Promise */ static async retrieveTemplateREST(templateDir, uri, templateVariables, name) { return this.retrieveREST(templateDir, uri, templateVariables, name); @@ -310,8 +324,8 @@ class MetadataType { * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {string} templateDir (List of) Directory where built definitions will be saved * @param {string} key name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} single metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} single metadata */ static async buildTemplate(retrieveDir, templateDir, key, templateVariables) { // retrieve metadata template @@ -402,9 +416,9 @@ class MetadataType { /** * Gets executed before deploying metadata * - * @param {TYPE.MetadataTypeItem} metadata a single metadata item + * @param {MetadataTypeItem} metadata a single metadata item * @param {string} deployDir folder where files for deployment are stored - * @returns {Promise.} Promise of a single metadata item + * @returns {Promise.} Promise of a single metadata item */ static async preDeployTasks(metadata, deployDir) { return metadata; @@ -413,7 +427,7 @@ class MetadataType { /** * Abstract create method that needs to be implemented in child metadata type * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} metadata single metadata entry * @param {string} deployDir directory where deploy metadata are saved * @returns {void} */ @@ -429,8 +443,8 @@ class MetadataType { /** * Abstract update method that needs to be implemented in child metadata type * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry - * @param {TYPE.MetadataTypeItem} [metadataBefore] metadata mapped by their keyField + * @param {MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} [metadataBefore] metadata mapped by their keyField * @returns {void} */ static update(metadata, metadataBefore) { @@ -479,8 +493,8 @@ class MetadataType { /** * test if metadata was actually changed or not to potentially skip it during deployment * - * @param {TYPE.MetadataTypeItem} cachedVersion cached version from the server - * @param {TYPE.MetadataTypeItem} metadata item to upload + * @param {MetadataTypeItem} cachedVersion cached version from the server + * @param {MetadataTypeItem} metadata item to upload * @param {string} [fieldName] optional field name to use for identifying the record in logs * @returns {boolean} true if metadata was changed */ @@ -491,8 +505,8 @@ class MetadataType { /** * test if metadata was actually changed or not to potentially skip it during deployment * - * @param {TYPE.MetadataTypeItem} cachedVersion cached version from the server - * @param {TYPE.MetadataTypeItem} metadata item to upload + * @param {MetadataTypeItem} cachedVersion cached version from the server + * @param {MetadataTypeItem} metadata item to upload * @param {string} [fieldName] optional field name to use for identifying the record in logs * @param {boolean} [silent] optionally suppress logging * @returns {boolean} true on first identified deviation or false if none are found @@ -545,9 +559,9 @@ class MetadataType { /** * MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. * - * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @param {MetadataTypeMap} metadataMap metadata mapped by their keyField * @param {string} deployDir directory where deploy metadata are saved - * @returns {Promise.} keyField => metadata map + * @returns {Promise.} keyField => metadata map */ static async upsert(metadataMap, deployDir) { const orignalMetadataMap = JSON.parse(JSON.stringify(metadataMap)); @@ -651,11 +665,11 @@ class MetadataType { /** * helper for {@link MetadataType.upsert} * - * @param {TYPE.MetadataTypeMap} metadataMap list of metadata + * @param {MetadataTypeMap} metadataMap list of metadata * @param {string} metadataKey key of item we are looking at * @param {boolean} hasError error flag from previous code - * @param {TYPE.MetadataTypeItemDiff[]} metadataToUpdate list of items to update - * @param {TYPE.MetadataTypeItem[]} metadataToCreate list of items to create + * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {MetadataTypeItem[]} metadataToCreate list of items to create * @returns {'create' | 'update' | 'skip'} action to take */ static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { @@ -804,7 +818,7 @@ class MetadataType { /** * Creates a single metadata entry via REST * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {string} uri rest endpoint for POST * @returns {Promise. | null} Promise of API response or null in case of an error */ @@ -844,7 +858,7 @@ class MetadataType { /** * Creates a single metadata entry via fuel-soap (generic lib not wrapper) * - * @param {TYPE.MetadataTypeItem} metadataEntry single metadata entry + * @param {MetadataTypeItem} metadataEntry single metadata entry * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method * @returns {Promise. | null} Promise of API response or null in case of an error */ @@ -875,7 +889,7 @@ class MetadataType { /** * Updates a single metadata entry via REST * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {string} uri rest endpoint for PATCH * @param {'patch'|'post'|'put'} [httpMethod] defaults to 'patch'; some update requests require PUT instead of PATCH * @returns {Promise. | null} Promise of API response or null in case of an error @@ -915,7 +929,7 @@ class MetadataType { * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed * * @private - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {boolean} [keepMap] some types require to check the old-key new-key relationship in their postDeployTasks; currently used by dataExtension only * @returns {void} */ @@ -949,7 +963,7 @@ class MetadataType { /** * Updates a single metadata entry via fuel-soap (generic lib not wrapper) * - * @param {TYPE.MetadataTypeItem} metadataEntry single metadata entry + * @param {MetadataTypeItem} metadataEntry single metadata entry * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method * @returns {Promise. | null} Promise of API response or null in case of an error */ @@ -980,7 +994,7 @@ class MetadataType { * * @param {Error} ex error that occured * @param {'creating'|'updating'} msg what to print in the log - * @param {TYPE.MetadataTypeItem} [metadataEntry] single metadata entry + * @param {MetadataTypeItem} [metadataEntry] single metadata entry * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method */ static _handleSOAPErrors(ex, msg, metadataEntry, handleOutside) { @@ -1012,10 +1026,10 @@ class MetadataType { * Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {TYPE.SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) * @param {string|number} [singleRetrieve] key of single item to filter by * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @returns {Promise.} Promise of item map + * @returns {Promise.} Promise of item map */ static async retrieveSOAP(retrieveDir, requestParams, singleRetrieve, additionalFields) { requestParams ||= {}; @@ -1050,9 +1064,9 @@ class MetadataType { * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {string} uri rest endpoint for GET - * @param {TYPE.TemplateMap} [templateVariables] variables to be replaced in the metadata + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata * @param {string|number} [singleRetrieve] key of single item to filter by - * @returns {Promise.<{metadata: (TYPE.MetadataTypeMap | TYPE.MetadataTypeItem), type: string}>} Promise of item map (single item for templated result) + * @returns {Promise.<{metadata: (MetadataTypeMap | MetadataTypeItem), type: string}>} Promise of item map (single item for templated result) */ static async retrieveREST(retrieveDir, uri, templateVariables, singleRetrieve) { const response = @@ -1102,7 +1116,7 @@ class MetadataType { * @param {object[]} urlArray {uri: string, id: string} combo of URL and ID/key of metadata * @param {number} [concurrentRequests] optionally set a different amount of concurrent requests * @param {boolean} [logAmountOfUrls] if true, prints an info message about to-be loaded amount of metadata - * @returns {Promise.<{metadata: (TYPE.MetadataTypeMap | TYPE.MetadataTypeItem), type: string}>} Promise of item map (single item for templated result) + * @returns {Promise.<{metadata: (MetadataTypeMap | MetadataTypeItem), type: string}>} Promise of item map (single item for templated result) */ static async retrieveRESTcollection(urlArray, concurrentRequests = 10, logAmountOfUrls = true) { if (logAmountOfUrls) { @@ -1177,7 +1191,7 @@ class MetadataType { /** * Used to execute a query/automation etc. * - * @param {TYPE.MetadataTypeItem} [metadataEntry] single metadata entry + * @param {MetadataTypeItem} [metadataEntry] single metadata entry * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ static async executeSOAP(metadataEntry) { @@ -1210,7 +1224,7 @@ class MetadataType { * helper for {@link MetadataType.retrieveREST} and {@link MetadataType.retrieveSOAP} * * @param {string|number} [singleRetrieve] key of single item to filter by - * @param {TYPE.MetadataTypeMap} metadataMap saved metadata + * @param {MetadataTypeMap} metadataMap saved metadata * @returns {Promise.} - */ static async runDocumentOnRetrieve(singleRetrieve, metadataMap) { @@ -1239,7 +1253,7 @@ class MetadataType { * * @param {object} body json of response body * @param {string|number} [singleRetrieve] key of single item to filter by - * @returns {TYPE.MetadataTypeMap} keyField => metadata map + * @returns {MetadataTypeMap} keyField => metadata map */ static parseResponseBody(body, singleRetrieve) { const bodyIteratorField = this.definition.bodyIteratorField; @@ -1287,7 +1301,7 @@ class MetadataType { * @example * Removes field (or nested fields childs) that are not updateable * deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); - * @param {TYPE.MetadataTypeItem} metadataEntry One entry of a metadataType + * @param {MetadataTypeItem} metadataEntry One entry of a metadataType * @param {string} fieldPath field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' * @param {'isCreateable'|'isUpdateable'|'retrieving'|'templating'} definitionProperty delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] * @param {string} origin string of parent object, required when using arrays as these are parsed slightly differently. @@ -1360,7 +1374,7 @@ class MetadataType { /** * Remove fields from metadata entry that are not createable * - * @param {TYPE.MetadataTypeItem} metadataEntry metadata entry + * @param {MetadataTypeItem} metadataEntry metadata entry * @returns {void} */ static removeNotCreateableFields(metadataEntry) { @@ -1372,7 +1386,7 @@ class MetadataType { /** * Remove fields from metadata entry that are not updateable * - * @param {TYPE.MetadataTypeItem} metadataEntry metadata entry + * @param {MetadataTypeItem} metadataEntry metadata entry * @returns {void} */ static removeNotUpdateableFields(metadataEntry) { @@ -1384,7 +1398,7 @@ class MetadataType { /** * Remove fields from metadata entry that are not needed in the template * - * @param {TYPE.MetadataTypeItem} metadataEntry metadata entry + * @param {MetadataTypeItem} metadataEntry metadata entry * @returns {void} */ static keepTemplateFields(metadataEntry) { @@ -1396,7 +1410,7 @@ class MetadataType { /** * Remove fields from metadata entry that are not needed in the stored metadata * - * @param {TYPE.MetadataTypeItem} metadataEntry metadata entry + * @param {MetadataTypeItem} metadataEntry metadata entry * @returns {void} */ static keepRetrieveFields(metadataEntry) { @@ -1409,7 +1423,7 @@ class MetadataType { * checks if the current metadata entry should be saved on retrieve or not * * @static - * @param {TYPE.MetadataTypeItem} metadataEntry metadata entry + * @param {MetadataTypeItem} metadataEntry metadata entry * @param {boolean} [include] true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude * @returns {boolean} true: skip saving == filtered; false: continue with saving * @memberof MetadataType @@ -1584,11 +1598,11 @@ class MetadataType { /** * Helper for writing Metadata to disk, used for Retrieve and deploy * - * @param {TYPE.MetadataTypeMap} results metadata results from deploy + * @param {MetadataTypeMap} results metadata results from deploy * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) - * @param {TYPE.TemplateMap} [templateVariables] variables to be replaced in the metadata - * @returns {Promise.} Promise of saved metadata + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata */ static async saveResults(results, retrieveDir, overrideType, templateVariables) { const savedResults = {}; @@ -1749,7 +1763,7 @@ class MetadataType { * searches extracted file for template variable names and applies the market values * * @param {string} code code from extracted code - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @returns {string} code with markets applied */ static applyTemplateValues(code, templateVariables) { @@ -1761,7 +1775,7 @@ class MetadataType { * searches extracted file for template variable values and applies the market variable names * * @param {string} code code from extracted code - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @returns {string} code with markets applied */ static applyTemplateNames(code, templateVariables) { @@ -1774,8 +1788,8 @@ class MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string} targetDir Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} variables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} variables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -1795,8 +1809,8 @@ class MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -1842,8 +1856,8 @@ class MetadataType { * @param {string} templateDir Directory where metadata templates are stored * @param {string | string[]} targetDir (List of) Directory where built definitions will be saved * @param {string} templateName name of the metadata file - * @param {TYPE.TemplateMap} variables variables to be replaced in the metadata - * @returns {Promise.} Promise of item map + * @param {TemplateMap} variables variables to be replaced in the metadata + * @returns {Promise.} Promise of item map */ static async buildDefinition(templateDir, targetDir, templateName, variables) { // retrieve metadata template @@ -1973,7 +1987,7 @@ class MetadataType { /** * Gets metadata cache with limited fields and does not store value to disk * - * @param {TYPE.MetadataTypeMap} [metadata] a list of type definitions + * @param {MetadataTypeMap} [metadata] a list of type definitions * @param {boolean} [isDeploy] used to skip non-supported message during deploy * @returns {void} */ @@ -2133,7 +2147,7 @@ class MetadataType { /** * - * @param {TYPE.MetadataTypeMap} metadataMap metadata mapped by their keyField + * @param {MetadataTypeMap} metadataMap metadata mapped by their keyField * @returns {string[]} list of keys */ static getKeysForFixing(metadataMap) { @@ -2194,11 +2208,11 @@ MetadataType.definition = { type: '', }; /** - * @type {TYPE.SDK} + * @type {SDK} */ MetadataType.client = undefined; /** - * @type {TYPE.Mcdevrc} + * @type {Mcdevrc} */ MetadataType.properties = null; /** @@ -2206,7 +2220,7 @@ MetadataType.properties = null; */ MetadataType.subType = null; /** - * @type {TYPE.BuObject} + * @type {BuObject} */ MetadataType.buObject = null; diff --git a/lib/metadataTypes/MobileCode.js b/lib/metadataTypes/MobileCode.js index 5101af3f8..93cf374d1 100644 --- a/lib/metadataTypes/MobileCode.js +++ b/lib/metadataTypes/MobileCode.js @@ -1,8 +1,20 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * MobileCode MetadataType * @@ -17,7 +29,7 @@ class MobileCode extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { return super.retrieveREST( @@ -31,7 +43,7 @@ class MobileCode extends MetadataType { /** * Retrieves event definition metadata for caching * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache() { return super.retrieveREST(null, '/legacy/v1/beta/mobile/code/'); diff --git a/lib/metadataTypes/MobileKeyword.js b/lib/metadataTypes/MobileKeyword.js index 547151f96..128b33744 100644 --- a/lib/metadataTypes/MobileKeyword.js +++ b/lib/metadataTypes/MobileKeyword.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * MobileKeyword MetadataType * @@ -20,7 +32,7 @@ class MobileKeyword extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise. | void} Promise of metadata + * @returns {Promise. | void} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { try { @@ -50,7 +62,7 @@ class MobileKeyword extends MetadataType { * * @param {object} body json of response body * @param {string|number} [singleRetrieve] key of single item to filter by - * @returns {TYPE.MetadataTypeMap} keyField => metadata map + * @returns {MetadataTypeMap} keyField => metadata map */ static parseResponseBody(body, singleRetrieve) { const bodyIteratorField = this.definition.bodyIteratorField; @@ -99,7 +111,7 @@ class MobileKeyword extends MetadataType { * helper for {@link MobileKeyword.parseResponseBody} that creates a custom key field for this type based on mobileCode and keyword * * @private - * @param {TYPE.MetadataType} metadata single item + * @param {MetadataType} metadata single item */ static #createCustomKeyField(metadata) { metadata.c__codeKeyword = metadata.code.code + '.' + metadata.keyword; @@ -109,7 +121,7 @@ class MobileKeyword extends MetadataType { * helper for {@link MobileKeyword.preDeployTasks} and {@link MobileKeyword.createOrUpdate} to ensure we have code & keyword properly set * * @private - * @param {TYPE.MetadataType} metadata single item + * @param {MetadataType} metadata single item */ static #setCodeAndKeyword(metadata) { const [code, keyword] = metadata.c__codeKeyword.split('.'); @@ -126,11 +138,11 @@ class MobileKeyword extends MetadataType { /** * helper for {@link MetadataType.upsert} * - * @param {TYPE.MetadataTypeMap} metadataMap list of metadata + * @param {MetadataTypeMap} metadataMap list of metadata * @param {string} metadataKey key of item we are looking at * @param {boolean} hasError error flag from previous code - * @param {TYPE.MetadataTypeItemDiff[]} metadataToUpdate list of items to update - * @param {TYPE.MetadataTypeItem[]} metadataToCreate list of items to create + * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {MetadataTypeItem[]} metadataToCreate list of items to create * @returns {'create' | 'update' | 'skip'} action to take */ static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { @@ -154,7 +166,7 @@ class MobileKeyword extends MetadataType { * @param {void} [_] parameter not used * @param {void} [__] parameter not used * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache(_, __, key) { return this.retrieve(null, null, null, key); @@ -165,8 +177,8 @@ class MobileKeyword extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} key name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise of metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata */ static async retrieveAsTemplate(templateDir, key, templateVariables) { try { @@ -224,7 +236,7 @@ class MobileKeyword extends MetadataType { /** * Creates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static create(metadata) { @@ -233,7 +245,7 @@ class MobileKeyword extends MetadataType { /** * Updates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static update(metadata) { @@ -247,8 +259,8 @@ class MobileKeyword extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.CodeExtractItem | TYPE.MetadataTypeItem | void} Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered + * @param {MetadataTypeItem} metadata a single item + * @returns {CodeExtractItem | MetadataTypeItem | void} Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered */ static postRetrieveTasks(metadata) { try { @@ -298,8 +310,8 @@ class MobileKeyword extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -326,8 +338,8 @@ class MobileKeyword extends MetadataType { * @example scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -354,8 +366,8 @@ class MobileKeyword extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @param {'definition'|'template'} mode defines what we use this helper for * @returns {Promise.} list of extracted files with path-parts provided as an array @@ -419,9 +431,9 @@ class MobileKeyword extends MetadataType { /** * prepares an event definition for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single MobileKeyword + * @param {MetadataTypeItem} metadata a single MobileKeyword * @param {string} deployDir directory of deploy files - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async preDeployTasks(metadata, deployDir) { // code @@ -447,7 +459,7 @@ class MobileKeyword extends MetadataType { /** * helper for {@link MetadataType.createREST} * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call * @returns {void} */ @@ -457,7 +469,7 @@ class MobileKeyword extends MetadataType { /** * helper for {@link MetadataType.updateREST} * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call * @returns {void} */ @@ -468,7 +480,7 @@ class MobileKeyword extends MetadataType { /** * helper for {@link MobileKeyword.preDeployTasks} that loads extracted code content back into JSON * - * @param {TYPE.MetadataTypeItem} metadata a single definition + * @param {MetadataTypeItem} metadata a single definition * @param {string} deployDir directory of deploy files * @param {string} [templateName] name of the template used to built defintion (prior applying templating) * @returns {Promise.} content for metadata.script diff --git a/lib/metadataTypes/MobileMessage.js b/lib/metadataTypes/MobileMessage.js index 492be105c..be3300cb9 100644 --- a/lib/metadataTypes/MobileMessage.js +++ b/lib/metadataTypes/MobileMessage.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * MobileMessage MetadataType * @@ -19,7 +31,7 @@ class MobileMessage extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise. | void} Promise of metadata + * @returns {Promise. | void} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { if (key && key.startsWith('id:')) { @@ -53,7 +65,7 @@ class MobileMessage extends MetadataType { * @param {void} [_] parameter not used * @param {void} [__] parameter not used * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache(_, __, key) { return this.retrieve(null, null, null, key); @@ -62,7 +74,7 @@ class MobileMessage extends MetadataType { /** * Updates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static update(metadata) { @@ -76,7 +88,7 @@ class MobileMessage extends MetadataType { /** * Creates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static create(metadata) { @@ -85,7 +97,7 @@ class MobileMessage extends MetadataType { /** * helper for {@link MobileMessage.preDeployTasks} that loads extracted code content back into JSON * - * @param {TYPE.MetadataTypeItem} metadata a single definition + * @param {MetadataTypeItem} metadata a single definition * @param {string} deployDir directory of deploy files * @param {string} [templateName] name of the template used to built defintion (prior applying templating) * @returns {Promise.} code @@ -146,8 +158,8 @@ class MobileMessage extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single query - * @returns {TYPE.CodeExtractItem} Array with one metadata object and one query string + * @param {MetadataTypeItem} metadata a single query + * @returns {CodeExtractItem} Array with one metadata object and one query string */ static postRetrieveTasks(metadata) { // mobileCode @@ -248,9 +260,9 @@ class MobileMessage extends MetadataType { /** * prepares an event definition for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single MobileMessage + * @param {MetadataTypeItem} metadata a single MobileMessage * @param {string} deployDir directory of deploy files - * @returns {TYPE.MetadataTypeItem} Promise + * @returns {MetadataTypeItem} Promise */ static async preDeployTasks(metadata, deployDir) { // mobileCode @@ -306,7 +318,7 @@ class MobileMessage extends MetadataType { /** * helper for {@link MetadataType.createREST} * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call * @returns {void} */ @@ -316,7 +328,7 @@ class MobileMessage extends MetadataType { /** * helper for {@link MetadataType.updateREST} * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call * @returns {void} */ @@ -329,8 +341,8 @@ class MobileMessage extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -357,8 +369,8 @@ class MobileMessage extends MetadataType { * @example scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -385,8 +397,8 @@ class MobileMessage extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @param {'definition'|'template'} mode defines what we use this helper for * @returns {Promise.} list of extracted files with path-parts provided as an array diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index 1fffc67d2..98ca1a786 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -1,11 +1,29 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import { Util } from '../util/util.js'; import MetadataType from './MetadataType.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; import Mustache from 'mustache'; + +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + +/** + * @typedef {import('../../types/mcdev.d.js').QueryItem} QueryItem + * @typedef {import('../../types/mcdev.d.js').QueryMap} QueryMap + */ + /** * ensure that Mustache does not escape any characters * @@ -29,7 +47,7 @@ class Query extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.<{metadata: TYPE.QueryMap, type: string}>} Promise of metadata + * @returns {Promise.<{metadata: QueryMap, type: string}>} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { await File.initPrettier('sql'); @@ -109,7 +127,7 @@ class Query extends MetadataType { /** * Retrieves query metadata for caching * - * @returns {Promise.<{metadata: TYPE.QueryMap, type: string}>} Promise of metadata + * @returns {Promise.<{metadata: QueryMap, type: string}>} Promise of metadata */ static async retrieveForCache() { return super.retrieveREST(null, '/automation/v1/queries/'); @@ -120,7 +138,7 @@ class Query extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @returns {Promise.<{metadata: Query, type: string}>} Promise of metadata */ static async retrieveAsTemplate(templateDir, name, templateVariables) { @@ -135,8 +153,8 @@ class Query extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.QueryItem} metadata a single query - * @returns {TYPE.CodeExtractItem} Array with one metadata object and one query string + * @param {QueryItem} metadata a single query + * @returns {CodeExtractItem} Array with one metadata object and one query string */ static postRetrieveTasks(metadata) { // folder @@ -196,7 +214,7 @@ class Query extends MetadataType { /** * Creates a single query * - * @param {TYPE.QueryItem} query a single query + * @param {QueryItem} query a single query * @returns {Promise} Promise */ static create(query) { @@ -207,7 +225,7 @@ class Query extends MetadataType { /** * Updates a single query * - * @param {TYPE.QueryItem} query a single query + * @param {QueryItem} query a single query * @returns {Promise} Promise */ static update(query) { @@ -218,9 +236,9 @@ class Query extends MetadataType { /** * prepares a Query for deployment * - * @param {TYPE.QueryItem} metadata a single query activity + * @param {QueryItem} metadata a single query activity * @param {string} deployDir directory of deploy files - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async preDeployTasks(metadata, deployDir) { // folder @@ -258,7 +276,7 @@ class Query extends MetadataType { * searches extracted SQL file for template variables and applies the market values * * @param {string} code code from extracted code - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @returns {string} code with markets applied */ static applyTemplateValues(code, templateVariables) { @@ -282,8 +300,8 @@ class Query extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.QueryItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {QueryItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -310,8 +328,8 @@ class Query extends MetadataType { * @example queries are saved as 1 json and 1 sql file. both files need to be run through templating * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.QueryItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {QueryItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -338,8 +356,8 @@ class Query extends MetadataType { * @private * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.QueryItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {QueryItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @param {'definition'|'template'} mode defines what we use this helper for * @returns {Promise.} list of extracted files with path-parts provided as an array @@ -460,7 +478,7 @@ class Query extends MetadataType { /** * Gets executed after deployment of metadata type * - * @param {TYPE.MetadataTypeMap} upsertResults metadata mapped by their keyField as returned by update/create + * @param {MetadataTypeMap} upsertResults metadata mapped by their keyField as returned by update/create */ static async postDeployTasks(upsertResults) { if (Util.OPTIONS.execute) { diff --git a/lib/metadataTypes/Role.js b/lib/metadataTypes/Role.js index effa95d40..407a3f670 100644 --- a/lib/metadataTypes/Role.js +++ b/lib/metadataTypes/Role.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * ImportFile MetadataType * @@ -19,7 +31,7 @@ class Role extends MetadataType { * @param {string[]} _ Returns specified fields even if their retrieve definition is not set to true * @param {void} [___] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Metadata store object + * @returns {Promise.} Metadata store object */ static async retrieve(retrieveDir, _, ___, key) { if (retrieveDir && this.buObject.eid !== this.buObject.mid) { @@ -39,7 +51,7 @@ class Role extends MetadataType { rightOperand: false, }, }; - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ if (key) { // move original filter down one level into rightOperand and add key filter into leftOperand const keyFilter = { @@ -110,8 +122,8 @@ class Role extends MetadataType { /** * Gets executed before deploying metadata * - * @param {TYPE.MetadataTypeItem} metadata a single metadata item - * @returns {TYPE.MetadataTypeItem} Promise of a single metadata item + * @param {MetadataTypeItem} metadata a single metadata item + * @returns {MetadataTypeItem} Promise of a single metadata item */ static preDeployTasks(metadata) { if (this.definition.deployBlacklist.includes(metadata.CustomerKey)) { @@ -125,7 +137,7 @@ class Role extends MetadataType { /** * Create a single Role. * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} metadata single metadata entry * @returns {Promise} Promise */ static create(metadata) { @@ -135,7 +147,7 @@ class Role extends MetadataType { /** * Updates a single Role. * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} metadata single metadata entry * @returns {Promise} Promise */ static update(metadata) { @@ -145,7 +157,7 @@ class Role extends MetadataType { /** * Creates markdown documentation of all roles * - * @param {TYPE.MetadataTypeMap} [metadata] role definitions + * @param {MetadataTypeMap} [metadata] role definitions * @returns {Promise.} - */ static async document(metadata) { diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index 702cdfb33..cac486f54 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -1,10 +1,27 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + +/** + * @typedef {import('../../types/mcdev.d.js').ScriptItem} ScriptItem + * @typedef {import('../../types/mcdev.d.js').ScriptMap} ScriptMap + */ + /** * Script MetadataType * @@ -19,7 +36,7 @@ class Script extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.<{metadata: TYPE.ScriptMap, type: string}>} Promise + * @returns {Promise.<{metadata: ScriptMap, type: string}>} Promise */ static async retrieve(retrieveDir, _, __, key) { await File.initPrettier('ssjs'); @@ -28,7 +45,7 @@ class Script extends MetadataType { /** * Retrieves script metadata for caching * - * @returns {Promise.<{metadata: TYPE.ScriptMap, type: string}>} Promise + * @returns {Promise.<{metadata: ScriptMap, type: string}>} Promise */ static async retrieveForCache() { return super.retrieveREST(null, '/automation/v1/scripts/'); @@ -39,8 +56,8 @@ class Script extends MetadataType { * * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata file - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.<{metadata: TYPE.Script, type: string}>} Promise + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.<{metadata: ScriptItem, type: string}>} Promise */ static async retrieveAsTemplate(templateDir, name, templateVariables) { await File.initPrettier('ssjs'); @@ -54,7 +71,7 @@ class Script extends MetadataType { /** * Updates a single Script * - * @param {TYPE.MetadataTypeItem} script a single Script + * @param {MetadataTypeItem} script a single Script * @returns {Promise} Promise */ static update(script) { @@ -64,7 +81,7 @@ class Script extends MetadataType { /** * Creates a single Script * - * @param {TYPE.MetadataTypeItem} script a single Script + * @param {MetadataTypeItem} script a single Script * @returns {Promise} Promise */ static create(script) { @@ -74,7 +91,7 @@ class Script extends MetadataType { /** * helper for {@link Script.preDeployTasks} that loads extracted code content back into JSON * - * @param {TYPE.ScriptItem} metadata a single asset definition + * @param {ScriptItem} metadata a single asset definition * @param {string} deployDir directory of deploy files * @param {string} [templateName] name of the template used to built defintion (prior applying templating) * @returns {Promise.} content for metadata.script @@ -109,9 +126,9 @@ class Script extends MetadataType { /** * prepares a Script for deployment * - * @param {TYPE.ScriptItem} metadata a single script activity definition + * @param {ScriptItem} metadata a single script activity definition * @param {string} dir directory of deploy files - * @returns {TYPE.ScriptItem} Promise + * @returns {ScriptItem} Promise */ static async preDeployTasks(metadata, dir) { // folder @@ -128,8 +145,8 @@ class Script extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.ScriptItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {ScriptItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -156,8 +173,8 @@ class Script extends MetadataType { * @example scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.ScriptItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {ScriptItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -184,8 +201,8 @@ class Script extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.ScriptItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {ScriptItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @param {'definition'|'template'} mode defines what we use this helper for * @returns {Promise.} list of extracted files with path-parts provided as an array @@ -247,8 +264,8 @@ class Script extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.ScriptItem} metadata a single item - * @returns {TYPE.CodeExtractItem} a single item with code parts extracted + * @param {ScriptItem} metadata a single item + * @returns {CodeExtractItem} a single item with code parts extracted */ static postRetrieveTasks(metadata) { // folder diff --git a/lib/metadataTypes/SendClassification.js b/lib/metadataTypes/SendClassification.js index d71c450e3..9bdc62bd3 100644 --- a/lib/metadataTypes/SendClassification.js +++ b/lib/metadataTypes/SendClassification.js @@ -1,8 +1,20 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * SendClassification MetadataType * @@ -16,10 +28,10 @@ class SendClassification extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = null; if (key) { requestParams = { diff --git a/lib/metadataTypes/TransactionalEmail.js b/lib/metadataTypes/TransactionalEmail.js index 079ccdc58..7f6952ae1 100644 --- a/lib/metadataTypes/TransactionalEmail.js +++ b/lib/metadataTypes/TransactionalEmail.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import TransactionalMessage from './TransactionalMessage.js'; import Journey from './Journey.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * TransactionalEmail MetadataType * @@ -17,7 +29,7 @@ class TransactionalEmail extends TransactionalMessage { /** * Updates a single item * - * @param {TYPE.MetadataTypeItem} metadata how the item shall look after the update + * @param {MetadataTypeItem} metadata how the item shall look after the update * @returns {Promise} Promise */ static update(metadata) { @@ -36,8 +48,8 @@ class TransactionalEmail extends TransactionalMessage { /** * prepares for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} Promise + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} Promise */ static async preDeployTasks(metadata) { // asset @@ -82,7 +94,7 @@ class TransactionalEmail extends TransactionalMessage { /** * helper for {@link TransactionalEmail.createREST} * - * @param {TYPE.MetadataTypeItem} _ not used + * @param {MetadataTypeItem} _ not used * @param {object} apiResponse varies depending on the API call * @returns {void} */ @@ -119,8 +131,8 @@ class TransactionalEmail extends TransactionalMessage { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} a single item + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} a single item */ static postRetrieveTasks(metadata) { // asset diff --git a/lib/metadataTypes/TransactionalMessage.js b/lib/metadataTypes/TransactionalMessage.js index 38ec53694..9f05f562f 100644 --- a/lib/metadataTypes/TransactionalMessage.js +++ b/lib/metadataTypes/TransactionalMessage.js @@ -1,9 +1,21 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * TransactionalMessage MetadataType * @@ -19,7 +31,7 @@ class TransactionalMessage extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { let keyList; @@ -70,7 +82,7 @@ class TransactionalMessage extends MetadataType { * @param {void} [_] parameter not used * @param {void} [__] parameter not used * @param {string} [key] customer key of single item to cache - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieveForCache(_, __, key) { // the call to /messaging/v1/email/definitions/ does not return definitionId @@ -81,7 +93,7 @@ class TransactionalMessage extends MetadataType { /** * Updates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static update(metadata) { @@ -94,7 +106,7 @@ class TransactionalMessage extends MetadataType { /** * Creates a single item * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @returns {Promise} Promise */ static create(metadata) { diff --git a/lib/metadataTypes/TransactionalPush.js b/lib/metadataTypes/TransactionalPush.js index 90930c6c5..08965b6a8 100644 --- a/lib/metadataTypes/TransactionalPush.js +++ b/lib/metadataTypes/TransactionalPush.js @@ -1,10 +1,22 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import TransactionalMessage from './TransactionalMessage.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * TransactionalPush TransactionalMessage * @@ -16,8 +28,8 @@ class TransactionalPush extends TransactionalMessage { /** * prepares for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} Promise + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} Promise */ static async preDeployTasks(metadata) { // asset @@ -40,8 +52,8 @@ class TransactionalPush extends TransactionalMessage { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem} a single item + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} a single item */ static postRetrieveTasks(metadata) { // asset diff --git a/lib/metadataTypes/TransactionalSMS.js b/lib/metadataTypes/TransactionalSMS.js index a7cb1adff..09ef81877 100644 --- a/lib/metadataTypes/TransactionalSMS.js +++ b/lib/metadataTypes/TransactionalSMS.js @@ -1,11 +1,23 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import TransactionalMessage from './TransactionalMessage.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * TransactionalSMS MetadataType * @@ -28,9 +40,9 @@ class TransactionalSMS extends TransactionalMessage { /** * prepares for deployment * - * @param {TYPE.MetadataTypeItem} metadata a single item + * @param {MetadataTypeItem} metadata a single item * @param {string} deployDir directory of deploy files - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async preDeployTasks(metadata, deployDir) { // code @@ -67,7 +79,7 @@ class TransactionalSMS extends TransactionalMessage { /** * helper for {@link TransactionalSMS.preDeployTasks} that loads extracted code content back into JSON * - * @param {TYPE.MetadataTypeItem} metadata a single definition + * @param {MetadataTypeItem} metadata a single definition * @param {string} deployDir directory of deploy files * @param {string} [templateName] name of the template used to built defintion (prior applying templating) * @returns {Promise.} content for metadata.script @@ -93,8 +105,8 @@ class TransactionalSMS extends TransactionalMessage { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {Promise.} Array with one metadata object and one ssjs string + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise.} Array with one metadata object and one ssjs string */ static async postRetrieveTasks(metadata) { // extract message body @@ -174,8 +186,8 @@ class TransactionalSMS extends TransactionalMessage { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -202,8 +214,8 @@ class TransactionalSMS extends TransactionalMessage { * @example scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @returns {Promise.} list of extracted files with path-parts provided as an array */ @@ -230,8 +242,8 @@ class TransactionalSMS extends TransactionalMessage { * * @param {string} templateDir Directory where metadata templates are stored * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved - * @param {TYPE.MetadataTypeItem} metadata main JSON file that was read from file system - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @param {'definition'|'template'} mode defines what we use this helper for * @returns {Promise.} list of extracted files with path-parts provided as an array diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 737360703..08d9914df 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -1,6 +1,5 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; @@ -8,6 +7,19 @@ import asset from './Asset.js'; import folder from './Folder.js'; import list from './List.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * MessageSendActivity MetadataType * @@ -21,10 +33,10 @@ class TriggeredSend extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ let requestParams = { filter: { leftOperand: 'TriggeredSendStatus', @@ -53,7 +65,7 @@ class TriggeredSend extends MetadataType { /** * Create a single TSD. * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} metadata single metadata entry * @returns {Promise} Promise */ static create(metadata) { @@ -63,7 +75,7 @@ class TriggeredSend extends MetadataType { /** * Updates a single TSD. * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} metadata single metadata entry * @returns {Promise} Promise */ static update(metadata) { @@ -85,8 +97,8 @@ class TriggeredSend extends MetadataType { /** * parses retrieved Metadata before saving * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem | void} Array with one metadata object and one sql string + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem | void} Array with one metadata object and one sql string */ static postRetrieveTasks(metadata) { // remove IsPlatformObject, always has to be 'false' @@ -151,8 +163,8 @@ class TriggeredSend extends MetadataType { /** * prepares a TSD for deployment * - * @param {TYPE.MetadataTypeItem} metadata of a single TSD - * @returns {TYPE.MetadataTypeItem} metadata object + * @param {MetadataTypeItem} metadata of a single TSD + * @returns {MetadataTypeItem} metadata object */ static async preDeployTasks(metadata) { const cachedVersion = cache.getByKey(this.definition.type, metadata.CustomerKey); @@ -235,7 +247,7 @@ class TriggeredSend extends MetadataType { /** * helper for {@link TriggeredSend.refresh} that extracts the keys from the TSD item map and eli * - * @param {TYPE.MetadataTypeMapObj} metadata TSD item map + * @param {MetadataTypeMapObj} metadata TSD item map * @returns {Promise.} keyArr */ static async getKeysForValidTSDs(metadata) { @@ -250,7 +262,7 @@ class TriggeredSend extends MetadataType { * helper for {@link TriggeredSend.refresh} that finds active TSDs on the server and filters it by the same rules that {@link TriggeredSend.retrieve} is using to avoid refreshing TSDs with broken dependencies * * @param {boolean} [assetLoaded] if run after Asset.deploy via --refresh option this will skip caching assets - * @returns {Promise.} Promise of TSD item map + * @returns {Promise.} Promise of TSD item map */ static async findRefreshableItems(assetLoaded = false) { Util.logger.info('Finding refreshable items...'); @@ -294,7 +306,7 @@ class TriggeredSend extends MetadataType { } } // cache ACTIVE triggeredSends from the server - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ const requestParams = { filter: { leftOperand: 'TriggeredSendStatus', @@ -318,7 +330,7 @@ class TriggeredSend extends MetadataType { item[this.definition.keyField] = key; // check triggeredSend-key exists on the server AND its status==ACTIVE if (checkKey) { - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ const requestParams = { filter: { leftOperand: 'CustomerKey', diff --git a/lib/metadataTypes/User.js b/lib/metadataTypes/User.js index 7674b2484..0c1c76040 100644 --- a/lib/metadataTypes/User.js +++ b/lib/metadataTypes/User.js @@ -1,11 +1,30 @@ 'use strict'; -import TYPE from '../../types/mcdev.d.js'; import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + +/** + * @typedef {import('../../types/mcdev.d.js').UserDocument} UserDocument + * @typedef {import('../../types/mcdev.d.js').UserDocumentDiff} UserDocumentDiff + * @typedef {import('../../types/mcdev.d.js').UserDocumentMap} UserDocumentMap + * @typedef {import('../../types/mcdev.d.js').UserConfiguration} UserConfiguration + */ + /** * MetadataType * @@ -19,7 +38,7 @@ class User extends MetadataType { * @param {void} _ unused parameter * @param {void} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { if (this.buObject.eid !== this.buObject.mid) { @@ -31,7 +50,7 @@ class User extends MetadataType { /** * Retrieves import definition metadata for caching * - * @returns {Promise.} Promise + * @returns {Promise.} Promise */ static async retrieveForCache() { return this.retrieve(null); @@ -40,7 +59,7 @@ class User extends MetadataType { /** * Create a single item. * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} metadata single metadata entry * @returns {Promise} Promise */ static async create(metadata) { @@ -54,7 +73,7 @@ class User extends MetadataType { /** * Updates a single item. * - * @param {TYPE.MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} metadata single metadata entry * @returns {Promise} Promise */ static async update(metadata) { @@ -67,8 +86,8 @@ class User extends MetadataType { /** * prepares a item for deployment * - * @param {TYPE.UserDocument} metadata of a single item - * @returns {TYPE.UserDocument} metadata object + * @param {UserDocument} metadata of a single item + * @returns {UserDocument} metadata object */ static async preDeployTasks(metadata) { metadata.Client = { @@ -198,11 +217,11 @@ class User extends MetadataType { /** * helper for {@link MetadataType.upsert} * - * @param {TYPE.MetadataTypeMap} metadata list of metadata + * @param {MetadataTypeMap} metadata list of metadata * @param {string} metadataKey key of item we are looking at * @param {boolean} hasError error flag from previous code - * @param {TYPE.UserDocumentDiff[]} metadataToUpdate list of items to update - * @param {TYPE.UserDocument[]} metadataToCreate list of items to create + * @param {UserDocumentDiff[]} metadataToUpdate list of items to update + * @param {UserDocument[]} metadataToCreate list of items to create * @returns {void} */ static createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) { @@ -229,9 +248,9 @@ class User extends MetadataType { /** * * @private - * @param {TYPE.MetadataTypeItem} metadata single metadata itme - * @param {TYPE.UserDocumentDiff} [updateItem] item to update - * @param {TYPE.UserDocument} [createItem] item to create + * @param {MetadataTypeItem} metadata single metadata itme + * @param {UserDocumentDiff} [updateItem] item to update + * @param {UserDocument} [createItem] item to create */ static _prepareBuAssignments(metadata, updateItem, createItem) { this.userBUassignments ||= { add: {}, delete: {} }; @@ -274,7 +293,7 @@ class User extends MetadataType { /** * Gets executed after deployment of metadata type * - * @param {TYPE.UserDocumentMap} upsertResults metadata mapped by their keyField + * @param {UserDocumentMap} upsertResults metadata mapped by their keyField * @returns {Promise.} promise */ static async postDeployTasks(upsertResults) { @@ -286,11 +305,11 @@ class User extends MetadataType { * create/update business unit assignments * * @private - * @param {TYPE.UserDocumentMap} upsertResults metadata mapped by their keyField + * @param {UserDocumentMap} upsertResults metadata mapped by their keyField * @returns {void} */ static async _handleBuAssignments(upsertResults) { - /** @type {TYPE.UserConfiguration[]} */ + /** @type {UserConfiguration[]} */ const configs = []; for (const action in this.userBUassignments) { for (const data of Object.entries(this.userBUassignments[action])) { @@ -301,7 +320,7 @@ class User extends MetadataType { } userId = userId.startsWith('key:') ? upsertResults[userId.slice(4)].ID : userId; configs.push( - /** @type {TYPE.UserConfiguration} */ { + /** @type {UserConfiguration} */ { Client: { ID: this.buObject.eid }, ID: userId, BusinessUnitAssignmentConfiguration: { @@ -337,7 +356,7 @@ class User extends MetadataType { const userBUresults = {}; for (const result of configureResults) { if (result.StatusCode === 'OK') { - /** @type {TYPE.UserConfiguration} */ + /** @type {UserConfiguration} */ const config = result.Object; const buArr = config.BusinessUnitAssignmentConfiguration.BusinessUnitIds @@ -395,7 +414,7 @@ class User extends MetadataType { * helper for {@link User.createOrUpdate} * * @private - * @param {TYPE.UserDocument} metadata single created user + * @param {UserDocument} metadata single created user * @returns {void} */ static _setPasswordForNewUser(metadata) { @@ -418,7 +437,7 @@ class User extends MetadataType { * Adding roles works automatically for roles listed on the user * * @private - * @param {TYPE.UserDocumentDiff} item updated user with before and after state + * @param {UserDocumentDiff} item updated user with before and after state * @returns {void} */ static _prepareRoleAssignments(item) { @@ -544,7 +563,7 @@ class User extends MetadataType { /** * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieveChangelog() { return this._retrieve(); @@ -555,11 +574,11 @@ class User extends MetadataType { * @private * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async _retrieve(retrieveDir, key) { this.userIdBuMap = {}; - /** @type {TYPE.SoapRequestParams} */ + /** @type {SoapRequestParams} */ const requestParams = { QueryAllAccounts: true, @@ -594,10 +613,10 @@ class User extends MetadataType { * Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {TYPE.SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) * @param {string|number} [singleRetrieve] key of single item to filter by * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @returns {Promise.} Promise of item map + * @returns {Promise.} Promise of item map */ static async retrieveSOAP(retrieveDir, requestParams, singleRetrieve, additionalFields) { // to avoid not retrieving roles and userPermissions for users above the 2500 records limit we need to retrieve users twice, once with ActiveFlag=true and once with ActiveFlag=false @@ -743,7 +762,7 @@ class User extends MetadataType { * helper for {@link User.retrieveSOAP} * * @private - * @param {TYPE.SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) * @param {string} soapType e.g. AccountUser * @param {string[]} fields list of fields to retrieve * @param {object} resultsBulk actual return value of this method @@ -930,7 +949,7 @@ class User extends MetadataType { /** * Creates markdown documentation of all roles * - * @param {TYPE.MetadataTypeMap} [metadata] user list + * @param {MetadataTypeMap} [metadata] user list * @returns {Promise.} - */ static async document(metadata) { @@ -962,7 +981,7 @@ class User extends MetadataType { this._getBuNames(); /** - * @type {TYPE.UserDocument[]} + * @type {UserDocument[]} */ const users = []; @@ -1096,8 +1115,8 @@ class User extends MetadataType { /** * manages post retrieve steps * - * @param {TYPE.MetadataTypeItem} metadata a single item - * @returns {TYPE.MetadataTypeItem | void} a single item + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem | void} a single item */ static postRetrieveTasks(metadata) { metadata.c__type = 'Installed Package'; diff --git a/lib/metadataTypes/Verification.js b/lib/metadataTypes/Verification.js index 28cfc5ab3..3afa3d979 100644 --- a/lib/metadataTypes/Verification.js +++ b/lib/metadataTypes/Verification.js @@ -2,9 +2,26 @@ import Automation from './Automation.js'; import MetadataType from './MetadataType.js'; -import TYPE from '../../types/mcdev.d.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; + +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + +/** + * @typedef {import('../../types/mcdev.d.js').VerificationItem} VerificationItem + */ + /** * Verification MetadataType * @@ -18,7 +35,7 @@ class Verification extends MetadataType { * @param {void} [_] unused parameter * @param {void} [__] unused parameter * @param {string} key customer key of single item to retrieve - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { let paramArr = []; @@ -114,7 +131,7 @@ class Verification extends MetadataType { /** * Retrieves Metadata of Data Extract Activity for caching * - * @returns {Promise.} Promise of metadata + * @returns {Promise.} Promise of metadata */ static async retrieveForCache() { return this.retrieve(); @@ -123,7 +140,7 @@ class Verification extends MetadataType { /** * Creates a single Data Extract * - * @param {TYPE.VerificationItem} metadata a single Data Extract + * @param {VerificationItem} metadata a single Data Extract * @returns {Promise} Promise */ static create(metadata) { @@ -133,9 +150,9 @@ class Verification extends MetadataType { /** * helper for {@link MetadataType.createREST} * - * @param {TYPE.MetadataTypeItem} metadataEntry a single metadata Entry + * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call - * @param {TYPE.MetadataTypeItem} metadataEntryWithAllFields like metadataEntry but before non-creatable fields were stripped + * @param {MetadataTypeItem} metadataEntryWithAllFields like metadataEntry but before non-creatable fields were stripped * @returns {void} */ static async postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) { @@ -164,7 +181,7 @@ class Verification extends MetadataType { /** * Updates a single Data Extract * - * @param {TYPE.VerificationItem} metadata a single Data Extract + * @param {VerificationItem} metadata a single Data Extract * @returns {Promise} Promise */ static update(metadata) { @@ -177,8 +194,8 @@ class Verification extends MetadataType { /** * prepares a verification for deployment * - * @param {TYPE.VerificationItem} metadata a single verification activity definition - * @returns {TYPE.VerificationItem} metadata object + * @param {VerificationItem} metadata a single verification activity definition + * @returns {VerificationItem} metadata object */ static preDeployTasks(metadata) { metadata.targetObjectId = cache.searchForField( @@ -193,8 +210,8 @@ class Verification extends MetadataType { /** * parses retrieved Metadata before saving * - * @param {TYPE.VerificationItem} metadata a single verification activity definition - * @returns {TYPE.VerificationItem} Array with one metadata object and one sql string + * @param {VerificationItem} metadata a single verification activity definition + * @returns {VerificationItem} Array with one metadata object and one sql string */ static postRetrieveTasks(metadata) { try { From ff72eadf7c75b0f085918fbe7412d5b1553f9a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:16:42 +0200 Subject: [PATCH 067/359] #1244: typedefs for main classes --- lib/Builder.js | 40 +++++++++++++++++++++++----------- lib/Deployer.js | 48 +++++++++++++++++++++++++++-------------- lib/Retriever.js | 40 ++++++++++++++++++++++++---------- lib/index.js | 56 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 125 insertions(+), 59 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index 2d0e382a8..e8f24562d 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -1,6 +1,5 @@ 'use strict'; -import TYPE from '../types/mcdev.d.js'; import { Util } from './util/util.js'; import File from './util/file.js'; import config from './util/config.js'; @@ -9,6 +8,21 @@ import auth from './util/auth.js'; import MetadataTypeInfo from './MetadataTypeInfo.js'; // @ts-ignore +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** * Builds metadata from a template using market specific customisation */ @@ -16,9 +30,9 @@ class Builder { /** * Creates a Builder, uses v2 auth if v2AuthOptions are passed. * - * @param {TYPE.Mcdevrc} properties properties for auth + * @param {Mcdevrc} properties properties for auth saved - * @param {TYPE.BuObject} buObject properties for auth + * @param {BuObject} buObject properties for auth */ constructor(properties, buObject) { this.properties = properties; @@ -40,7 +54,7 @@ saved ); /** - * @type {TYPE.MultiMetadataTypeList} + * @type {MultiMetadataTypeList} */ this.metadata = {}; } @@ -50,8 +64,8 @@ saved * * @param {string} metadataType metadata type to build * @param {string} name name of metadata to build - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise */ async _buildDefinition(metadataType, name, templateVariables) { let nameArr; @@ -103,7 +117,7 @@ saved * @param {string} selectedType supported metadata type * @param {string[]} keyArr customerkey of the metadata * @param {string} market market localizations - * @returns {Promise.} - + * @returns {Promise.} - */ static async buildTemplate(businessUnit, selectedType, keyArr, market) { const properties = await config.getProperties(); @@ -132,20 +146,20 @@ saved * * @param {string} metadataType metadata type to create a template of * @param {string[]} keyArr customerkey of metadata to create a template of - * @param {TYPE.TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.} Promise + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise */ async _buildTemplate(metadataType, keyArr, templateVariables) { const type = metadataType; try { - /** @type {TYPE.MetadataTypeItemObj[]} */ + /** @type {MetadataTypeItemObj[]} */ const result = await Promise.all( keyArr.map((key) => { MetadataTypeInfo[type].client = this.client; MetadataTypeInfo[type].properties = this.properties; MetadataTypeInfo[type].buObject = this.buObject; - /** @type {TYPE.MetadataTypeItemObj} */ + /** @type {MetadataTypeItemObj} */ return MetadataTypeInfo[type].buildTemplate( this.retrieveDir, this.templateDir, @@ -169,7 +183,7 @@ saved * @param {string} selectedType supported metadata type * @param {string} name name of the metadata * @param {string} market market localizations - * @returns {Promise.} - + * @returns {Promise.} - */ static async buildDefinition(businessUnit, selectedType, name, market) { const properties = await config.getProperties(); @@ -199,7 +213,7 @@ saved * @param {string} listName name of list of BU-market combos * @param {string} type supported metadata type * @param {string} name name of the metadata - * @returns {Promise.} - + * @returns {Promise.} - */ static async buildDefinitionBulk(listName, type, name) { const properties = await config.getProperties(); diff --git a/lib/Deployer.js b/lib/Deployer.js index 2f304617e..67ddab538 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -1,6 +1,5 @@ 'use strict'; -import TYPE from '../types/mcdev.d.js'; import MetadataTypeInfo from './MetadataTypeInfo.js'; import path from 'node:path'; import Cli from './util/cli.js'; @@ -10,6 +9,23 @@ import config from './util/config.js'; import cache from './util/cache.js'; import auth from './util/auth.js'; +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + */ + /** * Reads metadata from local directory and deploys it to specified target business unit. * Source and target business units are also compared before the deployment to apply metadata specific patches. @@ -18,8 +34,8 @@ class Deployer { /** * Creates a Deployer, uses v2 auth if v2AuthOptions are passed. * - * @param {TYPE.Mcdevrc} properties General configuration to be used in retrieve - * @param {TYPE.BuObject} buObject properties for auth + * @param {Mcdevrc} properties General configuration to be used in retrieve + * @param {BuObject} buObject properties for auth */ constructor(properties, buObject) { this.buObject = buObject; @@ -42,9 +58,9 @@ class Deployer { * Deploys all metadata located in the 'deploy' directory to the specified business unit * * @param {string} businessUnit references credentials from properties.json - * @param {TYPE.SupportedMetadataTypes[]} [selectedTypesArr] limit deployment to given metadata type + * @param {SupportedMetadataTypes[]} [selectedTypesArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys - * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) + * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) */ static async deploy(businessUnit, selectedTypesArr, keyArr) { Util.logger.info('mcdev:: Deploy'); @@ -184,10 +200,10 @@ class Deployer { * * @param {string} cred name of Credential * @param {string} bu name of BU - * @param {TYPE.Mcdevrc} properties General configuration to be used in retrieve - * @param {TYPE.SupportedMetadataTypes[]} [typeArr] limit deployment to given metadata type + * @param {Mcdevrc} properties General configuration to be used in retrieve + * @param {SupportedMetadataTypes[]} [typeArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys - * @returns {Promise.} ensure that BUs are worked on sequentially + * @returns {Promise.} ensure that BUs are worked on sequentially */ static async _deployBU(cred, bu, properties, typeArr, keyArr) { const buPath = `${cred}/${bu}`; @@ -211,13 +227,13 @@ class Deployer { /** * Deploy all metadata that is located in the deployDir * - * @param {TYPE.SupportedMetadataTypes[]} [typeArr] limit deployment to given metadata type (can include subtype) + * @param {SupportedMetadataTypes[]} [typeArr] limit deployment to given metadata type (can include subtype) * @param {string[]} [keyArr] limit deployment to given metadata keys - * @returns {Promise.} Promise of all deployed metadata + * @returns {Promise.} Promise of all deployed metadata */ async _deploy(typeArr, keyArr) { if (await File.pathExists(this.deployDir)) { - /** @type {TYPE.MultiMetadataTypeMap} */ + /** @type {MultiMetadataTypeMap} */ this.metadata = Deployer.readBUMetadata(this.deployDir, typeArr); // filter found metadata by key if given @@ -282,7 +298,7 @@ class Deployer { const result = await MetadataTypeInfo[type].retrieveForCache(null, subTypeArr); cache.setMetadata(type, result.metadata); } - /** @type {TYPE.MultiMetadataTypeMap} */ + /** @type {MultiMetadataTypeMap} */ const multiMetadataTypeMap = {}; // deploy metadata files, extending cache once deploys for (const metadataType in deployOrder) { @@ -313,10 +329,10 @@ class Deployer { * @param {string} deployDir root directory of metadata. * @param {string[]} [typeArr] limit deployment to given metadata type * @param {boolean} [listBadKeys] do not print errors, used for badKeys() - * @returns {TYPE.MultiMetadataTypeMap} Metadata of BU in local directory + * @returns {MultiMetadataTypeMap} Metadata of BU in local directory */ static readBUMetadata(deployDir, typeArr, listBadKeys) { - /** @type {TYPE.MultiMetadataTypeMap} */ + /** @type {MultiMetadataTypeMap} */ const buMetadata = {}; try { File.ensureDirSync(deployDir); @@ -347,8 +363,8 @@ class Deployer { * parses asset metadata to auto-create folders in target folder * * @param {string} deployDir root directory of metadata. - * @param {TYPE.MultiMetadataTypeMap} metadata list of metadata - * @param {TYPE.SupportedMetadataTypes[]} metadataTypeArr list of metadata types + * @param {MultiMetadataTypeMap} metadata list of metadata + * @param {SupportedMetadataTypes[]} metadataTypeArr list of metadata types * @returns {void} */ static async createFolderDefinitions(deployDir, metadata, metadataTypeArr) { diff --git a/lib/Retriever.js b/lib/Retriever.js index 11e54ceae..25889fb52 100644 --- a/lib/Retriever.js +++ b/lib/Retriever.js @@ -1,12 +1,30 @@ 'use strict'; -import TYPE from '../types/mcdev.d.js'; import MetadataTypeInfo from './MetadataTypeInfo.js'; import MetadataDefinitions from './MetadataTypeDefinitions.js'; import { Util } from './util/util.js'; import File from './util/file.js'; import cache from './util/cache.js'; import auth from './util/auth.js'; + +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * Retrieves metadata from a business unit and saves it to the local filesystem. */ @@ -14,8 +32,8 @@ class Retriever { /** * Creates a Retriever, uses v2 auth if v2AuthOptions are passed. * - * @param {TYPE.Mcdevrc} properties General configuration to be used in retrieve - * @param {TYPE.BuObject} buObject properties for auth + * @param {Mcdevrc} properties General configuration to be used in retrieve + * @param {BuObject} buObject properties for auth */ constructor(properties, buObject) { this.buObject = buObject; @@ -32,22 +50,22 @@ class Retriever { /** * Retrieve metadata of specified types into local file system and Retriever.metadata * - * @param {TYPE.SupportedMetadataTypes[]} metadataTypes list of metadata types to retrieve; can include subtypes! - * @param {string[]|TYPE.TypeKeyCombo} [namesOrKeys] name of Metadata to retrieveAsTemplate or list of keys for normal retrieval - * @param {TYPE.TemplateMap} [templateVariables] Object of values which can be replaced (in case of templating) + * @param {SupportedMetadataTypes[]} metadataTypes list of metadata types to retrieve; can include subtypes! + * @param {string[] | TypeKeyCombo} [namesOrKeys] name of Metadata to retrieveAsTemplate or list of keys for normal retrieval + * @param {TemplateMap} [templateVariables] Object of values which can be replaced (in case of templating) * @param {boolean} [changelogOnly] skip saving, only create json in memory - * @returns {Promise.} Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} + * @returns {Promise.} Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} */ async retrieve(metadataTypes, namesOrKeys, templateVariables, changelogOnly) { /** - * @type {TYPE.MultiMetadataTypeList} + * @type {MultiMetadataTypeList} */ const retrieveChangelog = {}; if (!namesOrKeys || (Array.isArray(namesOrKeys) && !namesOrKeys.length)) { // no keys were provided, ensure we retrieve all namesOrKeys = [null]; } - /** @type {TYPE.TypeKeyCombo} */ + /** @type {TypeKeyCombo} */ let typeKeyMap = {}; if (Array.isArray(namesOrKeys)) { // no keys or array of keys was provided (likely called via CLI or to retrieve all) @@ -192,8 +210,8 @@ class Retriever { /** * helper for {@link Retriever.retrieve} to get all dependencies of the given types * - * @param {TYPE.SupportedMetadataTypes[]} metadataTypes list of metadata types to retrieve; can include subtypes! - * @returns {TYPE.SupportedMetadataTypes[]} unique list dependent metadata types + * @param {SupportedMetadataTypes[]} metadataTypes list of metadata types to retrieve; can include subtypes! + * @returns {SupportedMetadataTypes[]} unique list dependent metadata types */ _getTypeDependencies(metadataTypes) { let dependencies = []; diff --git a/lib/index.js b/lib/index.js index 22b5cd53e..5bf29a0c6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,6 +1,5 @@ 'use strict'; -import TYPE from '../types/mcdev.d.js'; import { Util } from './util/util.js'; import auth from './util/auth.js'; import File from './util/file.js'; @@ -17,6 +16,25 @@ import MetadataTypeDefinitions from './MetadataTypeDefinitions.js'; import Retriever from './Retriever.js'; import cache from './util/cache.js'; +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ + /** * main class */ @@ -31,7 +49,7 @@ class Mcdev { /** * helper method to use unattended mode when including mcdev as a package * - * @param {boolean | TYPE.skipInteraction} [skipInteraction] signals what to insert automatically for things usually asked via wizard + * @param {boolean | skipInteraction} [skipInteraction] signals what to insert automatically for things usually asked via wizard * @returns {void} */ static setSkipInteraction(skipInteraction) { @@ -99,8 +117,8 @@ class Mcdev { * @param {string} [argv.range] git commit range into deploy directory * @param {string} [argv.filter] filter file paths that start with any - * @param {TYPE.DeltaPkgItem[]} [argv.diffArr] list of files to include in delta package (skips git diff when provided) - * @returns {Promise.} list of changed items + * @param {DeltaPkgItem[]} [argv.diffArr] list of files to include in delta package (skips git diff when provided) + * @returns {Promise.} list of changed items */ static async createDeltaPkg(argv) { Util.startLogger(); @@ -160,7 +178,7 @@ class Mcdev { * Retrieve all metadata from the specified business unit into the local file system. * * @param {string} businessUnit references credentials from properties.json - * @param {TYPE.SupportedMetadataTypes[]|TYPE.TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type + * @param {SupportedMetadataTypes[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type * @param {string[]} [keys] limit retrieval to given metadata key * @param {boolean} [changelogOnly] skip saving, only create json in memory * @returns {Promise.} - @@ -288,7 +306,7 @@ class Mcdev { * @private * @param {string} cred name of Credential * @param {string} bu name of BU - * @param {TYPE.SupportedMetadataTypes[]|TYPE.TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type/subtype + * @param {SupportedMetadataTypes[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type/subtype * @param {string[]} [keys] limit retrieval to given metadata key * @param {boolean} [changelogOnly] skip saving, only create json in memory * @returns {Promise.} ensure that BUs are worked on sequentially @@ -398,9 +416,9 @@ class Mcdev { * Deploys all metadata located in the 'deploy' directory to the specified business unit * * @param {string} businessUnit references credentials from properties.json - * @param {TYPE.SupportedMetadataTypes[]} [selectedTypesArr] limit deployment to given metadata type + * @param {SupportedMetadataTypes[]} [selectedTypesArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys - * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) + * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) */ static async deploy(businessUnit, selectedTypesArr, keyArr) { console.time('Time'); // eslint-disable-line no-console @@ -688,7 +706,7 @@ class Mcdev { * @param {string} selectedType supported metadata type * @param {string[]} name name of the metadata * @param {string} market market which should be used to revert template - * @returns {Promise.} - + * @returns {Promise.} - */ static async retrieveAsTemplate(businessUnit, selectedType, name, market) { Util.startLogger(); @@ -730,7 +748,7 @@ class Mcdev { * @param {string} selectedType supported metadata type * @param {string[]} keyArr customerkey of the metadata * @param {string} market market localizations - * @returns {Promise.} - + * @returns {Promise.} - */ static async buildTemplate(businessUnit, selectedType, keyArr, market) { Util.startLogger(); @@ -797,7 +815,7 @@ class Mcdev { * Schedule an item (shortcut for execute --schedule) * * @param {string} businessUnit name of BU - * @param {TYPE.SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of scheduled item keys */ @@ -809,7 +827,7 @@ class Mcdev { * Start/execute an item * * @param {string} businessUnit name of BU - * @param {TYPE.SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of executed item keys */ @@ -820,7 +838,7 @@ class Mcdev { * pause an item * * @param {string} businessUnit name of BU - * @param {TYPE.SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of paused item keys */ @@ -831,7 +849,7 @@ class Mcdev { * Updates the key to match the name field * * @param {string} businessUnit name of BU - * @param {TYPE.SupportedMetadataTypes} selectedType limit to given metadata types + * @param {SupportedMetadataTypes} selectedType limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of paused item keys */ @@ -843,7 +861,7 @@ class Mcdev { * * @param {'execute'|'pause'|'fixKeys'} methodName what to run * @param {string} businessUnit name of BU - * @param {TYPE.SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of affected item keys */ @@ -1007,7 +1025,7 @@ class Mcdev { * @param {'execute'|'pause'|'fixKeys'} methodName what to run * @param {string} cred name of Credential * @param {string} bu name of BU - * @param {TYPE.SupportedMetadataTypes} [type] limit execution to given metadata type + * @param {SupportedMetadataTypes} [type] limit execution to given metadata type * @param {string[]} keyArr customerkey of the metadata * @returns {Promise.} list of keys that were affected */ @@ -1062,8 +1080,8 @@ class Mcdev { /** * helper for {@link Mcdev.#runOnBU} * - * @param {TYPE.SupportedMetadataTypes} selectedType limit execution to given metadata type - * @param {TYPE.BuObject} buObject properties for auth + * @param {SupportedMetadataTypes} selectedType limit execution to given metadata type + * @param {BuObject} buObject properties for auth * @returns {string[]} keyArr */ static async #retrieveKeysWithLike(selectedType, buObject) { @@ -1128,7 +1146,7 @@ class Mcdev { * * @param {string} cred name of Credential * @param {string} bu name of BU - * @param {TYPE.SupportedMetadataTypes} type limit execution to given metadata type + * @param {SupportedMetadataTypes} type limit execution to given metadata type * @param {string[]} [keyArr] customerkey of the metadata * @returns {Promise.} list of keys that were affected */ From 4c7a75c2c482b64fcfc538e7afdbee91a85fe0f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:18:57 +0200 Subject: [PATCH 068/359] #1244: remove jsdoc2md not compatible with how vscode imports types --- .husky/pre-commit | 2 - docs/dist/documentation.md | 8992 ------------------------------------ package-lock.json | 881 ---- package.json | 5 +- 4 files changed, 1 insertion(+), 9879 deletions(-) delete mode 100644 docs/dist/documentation.md diff --git a/.husky/pre-commit b/.husky/pre-commit index 11e9a358a..718da8a9c 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,3 +1 @@ -#npm run docs -#git update-index --add docs/dist/documentation.md npx --no lint-staged diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md deleted file mode 100644 index e5895a01f..000000000 --- a/docs/dist/documentation.md +++ /dev/null @@ -1,8992 +0,0 @@ -## Classes - -
-
Builder
-

Builds metadata from a template using market specific customisation

-
-
Deployer
-

Reads metadata from local directory and deploys it to specified target business unit. -Source and target business units are also compared before the deployment to apply metadata specific patches.

-
-
Mcdev
-

main class

-
-
AssetMetadataType
-

FileTransfer MetadataType

-
-
AttributeGroupMetadataType
-

AttributeGroup MetadataType

-
-
AttributeSetMetadataType
-

AttributeSet MetadataType

-
-
AutomationMetadataType
-

Automation MetadataType

-
-
CampaignMetadataType
-

Campaign MetadataType

-
-
ContentAreaMetadataType
-

ContentArea MetadataType

-
-
DataExtensionMetadataType
-

DataExtension MetadataType

-
-
DataExtensionFieldMetadataType
-

DataExtensionField MetadataType

-
-
DataExtensionTemplateMetadataType
-

DataExtensionTemplate MetadataType

-
-
DataExtractMetadataType
-

DataExtract MetadataType

-
-
DataExtractTypeMetadataType
-

DataExtractType MetadataType -Only for Caching No retrieve/upsert is required -as this is a configuration in the EID

-
-
DiscoveryMetadataType
-

ImportFile MetadataType

-
-
EmailMetadataType
-

Email MetadataType

-
-
EmailSendMetadataType
-

MessageSendActivity MetadataType

-
-
EventMetadataType
-

Event MetadataType

-
-
FtpLocationMetadataType
-

ImportFile MetadataType

-
-
FileTransferMetadataType
-

FileTransfer MetadataType

-
-
FilterMetadataType
-

Filter MetadataType

-
-
FolderMetadataType
-

Folder MetadataType

-
-
ImportFileMetadataType
-

ImportFile MetadataType

-
-
JourneyMetadataType
-

Journey MetadataType -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -id: A unique id of the journey assigned by the journey’s API during its creation -key: A unique id of the journey within the MID. Can be generated by the developer -definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId

-
-
ListMetadataType
-

List MetadataType

-
-
MetadataType
-

MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes

-
-
MobileCodeMetadataType
-

MobileCode MetadataType

-
-
MobileKeywordMetadataType
-

MobileKeyword MetadataType

-
-
MobileMessageMetadataType
-

MobileMessage MetadataType

-
-
QueryMetadataType
-

Query MetadataType

-
-
RoleMetadataType
-

ImportFile MetadataType

-
-
ScriptMetadataType
-

Script MetadataType

-
-
SendClassificationMetadataType
-

SendClassification MetadataType

-
-
TransactionalEmailTransactionalMessage
-

TransactionalEmail MetadataType

-
-
TransactionalMessageMetadataType
-

TransactionalMessage MetadataType

-
-
TransactionalPushTransactionalMessage
-

TransactionalPush TransactionalMessage

-
-
TransactionalSMSTransactionalMessage
-

TransactionalSMS MetadataType

-
-
TriggeredSendMetadataType
-

MessageSendActivity MetadataType

-
-
UserMetadataType
-

MetadataType

-
-
VerificationMetadataType
-

Verification MetadataType

-
-
Retriever
-

Retrieves metadata from a business unit and saves it to the local filesystem.

-
-
- -## Constants - -
-
BusinessUnit
-

Helper that handles retrieval of BU info

-
-
dataStore : TYPE.Cache
-
-
Cli
-

CLI helper class

-
-
config
-

Central class for loading and validating properties from config and auth

-
-
DevOps
-

DevOps helper class

-
-
File
-

File extends fs-extra. It adds logger and util methods for file handling

-
-
Init
-

CLI helper class

-
-
Init
-

CLI helper class

-
-
Init
-

CLI helper class

-
-
Init
-

CLI helper class

-
-
Util
-

Util that contains logger and simple util methods

-
-
- -## Functions - -
-
csvToArray(csv)Array.<string>
-

helper to convert CSVs into an array. if only one value was given, it's also returned as an array

-
-
Mcdev.(methodName, businessUnit, [selectedType], [keys])Promise.<Object.<string, Array.<string>>>
-

run a method across BUs

-
-
Mcdev.(methodName, cred, bu, [type], keyArr)Promise.<Array.<string>>
-

helper for Mcdev.#runMethod

-
-
Mcdev.(selectedType, buObject)Array.<string>
-

helper for Mcdev.#runOnBU

-
-
Mcdev.(cred, bu, type, [keyArr])Promise.<Array.<string>>
-

Updates the key to match the name field

-
-
Automation.(metadata)boolean
-

helper for postRetrieveTasks and execute

-
-
Automation.(metadataMap, key)Promise.<{key:string, response:object}>
-

helper for execute

-
-
Automation.(metadataEntry)Promise.<{key:string, response:object}>
-

helper for execute

-
-
Automation.(metadata)Promise.<{key:string, response:object}>
-

helper for pause

-
-
Automation.(metadata)
-

helper for preDeployTasks and execute

-
-
Automation.(metadataMap, key)Promise.<void>
-

helper for postDeployTasks

-
-
Automation.(metadataMap, originalMetadataMap, key, [oldKey])Promise.<{key:string, response:object}>
-

helper for postDeployTasks

-
-
DataExtension.(upsertedMetadata, originalMetadata, createdUpdated)void
-

takes care of updating attribute groups on child BUs after an update to Shared DataExtensions -helper for postDeployTasks -fixes an issue where shared data extensions are not visible in data designer on child BU; SF known issue: https://issues.salesforce.com/#q=W-11031095

-
-
DataExtension.()Array.<string>
-

helper for DataExtension.#fixShared

-
-
DataExtension.(childBuName, buObjectParent, clientParent, sharedDataExtensionMap)Promise.<Array.<string>>
-

helper for DataExtension.#fixShared

-
-
DataExtension.(deId, deKey, buObjectChildBu, clientChildBu, buObjectParent, clientParent)Promise.<boolean>
-

method that actually takes care of triggering the update for a particular BU-sharedDe combo -helper for DataExtension.#fixShared_onBU

-
-
DataExtension.(buObjectChildBu, clientChildBu, deKey, deId)Promise.<string>
-

add a new field to the shared DE to trigger an update to the data model -helper for DataExtension.#fixShared_item

-
-
DataExtension.(randomSuffix, buObjectParent, clientParent, deKey)Promise.<string>
-

get ID of the field added by DataExtension.#fixShared_item_addField on the shared DE via parent BU -helper for DataExtension.#fixShared_item

-
-
DataExtension.(randomSuffix, buObjectChildBu, clientChildBu, deKey, fieldObjectID)Promise
-

delete the field added by DataExtension.#fixShared_item_addField -helper for DataExtension.#fixShared_item

-
-
getUserName(userList, item, fieldname)string
-
-
setupSDK(sessionKey, authObject)SDK
-

Returns an SDK instance to be used for API calls

-
-
getActualJson(customerKey, type, subtype, [buName])Promise.<string>
-

gets file from Retrieve folder

-
-
getActualFile(customerKey, type, subtype, ext)string
-

gets file from Retrieve folder

-
-
- -## Typedefs - -
-
TypeKeyCombo : Object.<string, string>
-

object-key=metadata type, value=array of external keys

-
-
MetadataTypeItemDiff : Object.<string, any>
-

key=customer key

-
-
CodeExtractItem : object
-
-
CodeExtract : object
-
-
CodeExtractItem : object
-
-
ScriptMap : object
-
-
AssetSubType : Object.<string, any>
-
-
DataExtensionFieldMap : object
-
-
DataExtensionMap : object
-
-
UserDocumentMap : object
-

key=customer key

-
-
BusinessUnitAssignmentConfiguration : object
-
-
AutomationActivity : object
-
-
AutomationStep : object
-
-
AutomationSchedule : object
-

REST format

-
-
AutomationScheduleSoap : object
-

SOAP format

-
-
AutomationItem : object
-
-
VerificationItem : object
-
-
SDK : Object.<string, AutomationItem>
-
-
skipInteraction : object
-

signals what to insert automatically for things usually asked via wizard

-
-
AuthObject : object
-
-
SoapFilter : object
-
-
Mcdevrc : object
-
-
Logger : object
-
-
- - - -## Builder -Builds metadata from a template using market specific customisation - -**Kind**: global class - -* [Builder](#Builder) - * [new Builder(properties, buObject)](#new_Builder_new) - * _instance_ - * [.metadata](#Builder+metadata) : TYPE.MultiMetadataTypeList - * [._buildDefinition(metadataType, name, templateVariables)](#Builder+_buildDefinition) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [._buildTemplate(metadataType, keyArr, templateVariables)](#Builder+_buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * _static_ - * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Builder.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildDefinition(businessUnit, selectedType, name, market)](#Builder.buildDefinition) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildDefinitionBulk(listName, type, name)](#Builder.buildDefinitionBulk) ⇒ Promise.<Array.<TYPE.MultiMetadataTypeList>> - - - -### new Builder(properties, buObject) -Creates a Builder, uses v2 auth if v2AuthOptions are passed. - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | properties for auth saved | -| buObject | TYPE.BuObject | properties for auth | - - - -### builder.metadata : TYPE.MultiMetadataTypeList -**Kind**: instance property of [Builder](#Builder) - - -### builder.\_buildDefinition(metadataType, name, templateVariables) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Builds a specific metadata file by name - -**Kind**: instance method of [Builder](#Builder) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataType | string | metadata type to build | -| name | string | name of metadata to build | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### builder.\_buildTemplate(metadataType, keyArr, templateVariables) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Build a template based on a list of metadata files in the retrieve folder. - -**Kind**: instance method of [Builder](#Builder) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataType | string | metadata type to create a template of | -| keyArr | Array.<string> | customerkey of metadata to create a template of | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Builder.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Build a template based on a list of metadata files in the retrieve folder. - -**Kind**: static method of [Builder](#Builder) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | -| market | string | market localizations | - - - -### Builder.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Build a specific metadata file based on a template. - -**Kind**: static method of [Builder](#Builder) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | string | name of the metadata | -| market | string | market localizations | - - - -### Builder.buildDefinitionBulk(listName, type, name) ⇒ Promise.<Array.<TYPE.MultiMetadataTypeList>> -Build a specific metadata file based on a template using a list of bu-market combos - -**Kind**: static method of [Builder](#Builder) -**Returns**: Promise.<Array.<TYPE.MultiMetadataTypeList>> - - - -| Param | Type | Description | -| --- | --- | --- | -| listName | string | name of list of BU-market combos | -| type | string | supported metadata type | -| name | string | name of the metadata | - - - -## Deployer -Reads metadata from local directory and deploys it to specified target business unit. -Source and target business units are also compared before the deployment to apply metadata specific patches. - -**Kind**: global class - -* [Deployer](#Deployer) - * [new Deployer(properties, buObject)](#new_Deployer_new) - * _instance_ - * [.metadata](#Deployer+metadata) : TYPE.MultiMetadataTypeMap - * [._deploy([typeArr], [keyArr])](#Deployer+_deploy) ⇒ Promise.<TYPE.MultiMetadataTypeMap> - * _static_ - * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Deployer.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - * [._deployBU(cred, bu, properties, [typeArr], [keyArr])](#Deployer._deployBU) ⇒ Promise.<TYPE.MultiMetadataTypeMap> - * [.readBUMetadata(deployDir, [typeArr], [listBadKeys])](#Deployer.readBUMetadata) ⇒ TYPE.MultiMetadataTypeMap - * [.createFolderDefinitions(deployDir, metadata, metadataTypeArr)](#Deployer.createFolderDefinitions) ⇒ void - - - -### new Deployer(properties, buObject) -Creates a Deployer, uses v2 auth if v2AuthOptions are passed. - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | -| buObject | TYPE.BuObject | properties for auth | - - - -### deployer.metadata : TYPE.MultiMetadataTypeMap -**Kind**: instance property of [Deployer](#Deployer) - - -### deployer.\_deploy([typeArr], [keyArr]) ⇒ Promise.<TYPE.MultiMetadataTypeMap> -Deploy all metadata that is located in the deployDir - -**Kind**: instance method of [Deployer](#Deployer) -**Returns**: Promise.<TYPE.MultiMetadataTypeMap> - Promise of all deployed metadata - -| Param | Type | Description | -| --- | --- | --- | -| [typeArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type (can include subtype) | -| [keyArr] | Array.<string> | limit deployment to given metadata keys | - - - -### Deployer.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> -Deploys all metadata located in the 'deploy' directory to the specified business unit - -**Kind**: static method of [Deployer](#Deployer) -**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | -| [keyArr] | Array.<string> | limit deployment to given metadata keys | - - - -### Deployer.\_deployBU(cred, bu, properties, [typeArr], [keyArr]) ⇒ Promise.<TYPE.MultiMetadataTypeMap> -helper for [deploy](#Deployer.deploy) - -**Kind**: static method of [Deployer](#Deployer) -**Returns**: Promise.<TYPE.MultiMetadataTypeMap> - ensure that BUs are worked on sequentially - -| Param | Type | Description | -| --- | --- | --- | -| cred | string | name of Credential | -| bu | string | name of BU | -| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | -| [typeArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | -| [keyArr] | Array.<string> | limit deployment to given metadata keys | - - - -### Deployer.readBUMetadata(deployDir, [typeArr], [listBadKeys]) ⇒ TYPE.MultiMetadataTypeMap -Returns metadata of a business unit that is saved locally - -**Kind**: static method of [Deployer](#Deployer) -**Returns**: TYPE.MultiMetadataTypeMap - Metadata of BU in local directory - -| Param | Type | Description | -| --- | --- | --- | -| deployDir | string | root directory of metadata. | -| [typeArr] | Array.<string> | limit deployment to given metadata type | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | - - - -### Deployer.createFolderDefinitions(deployDir, metadata, metadataTypeArr) ⇒ void -parses asset metadata to auto-create folders in target folder - -**Kind**: static method of [Deployer](#Deployer) - -| Param | Type | Description | -| --- | --- | --- | -| deployDir | string | root directory of metadata. | -| metadata | TYPE.MultiMetadataTypeMap | list of metadata | -| metadataTypeArr | Array.<TYPE.SupportedMetadataTypes> | list of metadata types | - - - -## Mcdev -main class - -**Kind**: global class - -* [Mcdev](#Mcdev) - * [.version()](#Mcdev.version) ⇒ string - * [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ void - * [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ void - * [.setOptions(argv)](#Mcdev.setOptions) ⇒ void - * [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> - * [.selectTypes()](#Mcdev.selectTypes) ⇒ Promise - * [.explainTypes()](#Mcdev.explainTypes) ⇒ Array.<object> - * [.upgrade()](#Mcdev.upgrade) ⇒ Promise.<boolean> - * [.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly])](#Mcdev.retrieve) ⇒ Promise.<object> - * [.deploy(businessUnit, [selectedTypesArr], [keyArr])](#Mcdev.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - * [.initProject([credentialsName])](#Mcdev.initProject) ⇒ Promise.<void> - * [.joinProject()](#Mcdev.joinProject) ⇒ Promise.<void> - * [.findBUs(credentialsName)](#Mcdev.findBUs) ⇒ Promise.<void> - * [.document(businessUnit, type)](#Mcdev.document) ⇒ Promise.<void> - * [.deleteByKey(businessUnit, type, customerKey)](#Mcdev.deleteByKey) ⇒ Promise.<boolean> - * [.resolveId(businessUnit, type, id)](#Mcdev.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - * [.refresh(businessUnit, type, [keyArr])](#Mcdev.refresh) ⇒ Promise.<void> - * [.badKeys(businessUnit)](#Mcdev.badKeys) ⇒ Promise.<void> - * [.retrieveAsTemplate(businessUnit, selectedType, name, market)](#Mcdev.retrieveAsTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildTemplate(businessUnit, selectedType, keyArr, market)](#Mcdev.buildTemplate) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [.buildDefinition(businessUnit, selectedType, name, market)](#Mcdev.buildDefinition) ⇒ Promise.<void> - * [.buildDefinitionBulk(listName, type, name)](#Mcdev.buildDefinitionBulk) ⇒ Promise.<void> - * [.getFilesToCommit(businessUnit, selectedType, keyArr)](#Mcdev.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.schedule(businessUnit, [selectedType], [keys])](#Mcdev.schedule) ⇒ Promise.<Object.<string, Array.<string>>> - * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<Object.<string, Array.<string>>> - * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<Object.<string, Array.<string>>> - * [.fixKeys(businessUnit, selectedType, [keys])](#Mcdev.fixKeys) ⇒ Promise.<Object.<string, Array.<string>>> - - - -### Mcdev.version() ⇒ string -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: string - current version of mcdev - - -### Mcdev.setSkipInteraction([skipInteraction]) ⇒ void -helper method to use unattended mode when including mcdev as a package - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| [skipInteraction] | boolean \| TYPE.skipInteraction | signals what to insert automatically for things usually asked via wizard | - - - -### Mcdev.setLoggingLevel(argv) ⇒ void -configures what is displayed in the console - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | list of command line parameters given by user | -| [argv.silent] | boolean | only errors printed to CLI | -| [argv.verbose] | boolean | chatty user CLI output | -| [argv.debug] | boolean | enables developer output & features | - - - -### Mcdev.setOptions(argv) ⇒ void -allows setting system wide / command related options - -**Kind**: static method of [Mcdev](#Mcdev) - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | list of command line parameters given by user | - - - -### Mcdev.createDeltaPkg(argv) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> -handler for 'mcdev createDeltaPkg - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - list of changed items - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | yargs parameters | -| [argv.range] | string | git commit range into deploy directory | -| [argv.filter] | string | filter file paths that start with any | -| [argv.diffArr] | Array.<TYPE.DeltaPkgItem> | list of files to include in delta package (skips git diff when provided) | - - - -### Mcdev.selectTypes() ⇒ Promise -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise - . - - -### Mcdev.explainTypes() ⇒ Array.<object> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Array.<object> - list of supported types with their apiNames - - -### Mcdev.upgrade() ⇒ Promise.<boolean> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - success flag - - -### Mcdev.retrieve(businessUnit, [selectedTypesArr], [keys], [changelogOnly]) ⇒ Promise.<object> -Retrieve all metadata from the specified business unit into the local file system. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<object> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> \| TYPE.TypeKeyCombo | limit retrieval to given metadata type | -| [keys] | Array.<string> | limit retrieval to given metadata key | -| [changelogOnly] | boolean | skip saving, only create json in memory | - - - -### Mcdev.deploy(businessUnit, [selectedTypesArr], [keyArr]) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> -Deploys all metadata located in the 'deploy' directory to the specified business unit - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, TYPE.MultiMetadataTypeMap>> - deployed metadata per BU (first key: bu name, second key: metadata type) - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type | -| [keyArr] | Array.<string> | limit deployment to given metadata keys | - - - -### Mcdev.initProject([credentialsName]) ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [credentialsName] | string | identifying name of the installed package / project | - - - -### Mcdev.joinProject() ⇒ Promise.<void> -Clones an existing project from git repository and installs it - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - - -### Mcdev.findBUs(credentialsName) ⇒ Promise.<void> -Refreshes BU names and ID's from MC instance - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| credentialsName | string | identifying name of the installed package / project | - - - -### Mcdev.document(businessUnit, type) ⇒ Promise.<void> -Creates docs for supported metadata types in Markdown and/or HTML format - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | metadata type | - - - -### Mcdev.deleteByKey(businessUnit, type, customerKey) ⇒ Promise.<boolean> -deletes metadata from MC instance by key - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<boolean> - true if successful, false otherwise - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| customerKey | string | Identifier of metadata | - - - -### Mcdev.resolveId(businessUnit, type, id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | supported metadata type | -| id | string | Identifier of metadata | - - - -### Mcdev.refresh(businessUnit, type, [keyArr]) ⇒ Promise.<void> -ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| type | string | references credentials from properties.json | -| [keyArr] | Array.<string> | metadata keys | - - - -### Mcdev.badKeys(businessUnit) ⇒ Promise.<void> -Converts metadata to legacy format. Output is saved in 'converted' directory - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | - - - -### Mcdev.retrieveAsTemplate(businessUnit, selectedType, name, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve a specific metadata file and templatise. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | Array.<string> | name of the metadata | -| market | string | market which should be used to revert template | - - - -### Mcdev.buildTemplate(businessUnit, selectedType, keyArr, market) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Build a template based on a list of metadata files in the retrieve folder. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | -| market | string | market localizations | - - - -### Mcdev.buildDefinition(businessUnit, selectedType, name, market) ⇒ Promise.<void> -Build a specific metadata file based on a template. - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| name | string | name of the metadata | -| market | string | market localizations | - - - -### Mcdev.buildDefinitionBulk(listName, type, name) ⇒ Promise.<void> -Build a specific metadata file based on a template using a list of bu-market combos - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| listName | string | name of list of BU-market combos | -| type | string | supported metadata type | -| name | string | name of the metadata | - - - -### Mcdev.getFilesToCommit(businessUnit, selectedType, keyArr) ⇒ Promise.<Array.<string>> -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | references credentials from properties.json | -| selectedType | string | supported metadata type | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Mcdev.schedule(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Schedule an item (shortcut for execute --schedule) - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of scheduled item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Start/execute an item - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of executed item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -pause an item - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -### Mcdev.fixKeys(businessUnit, selectedType, [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -Updates the key to match the name field - -**Kind**: static method of [Mcdev](#Mcdev) -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of paused item keys - -| Param | Type | Description | -| --- | --- | --- | -| businessUnit | string | name of BU | -| selectedType | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -## Asset ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Asset](#Asset) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [subTypeArr], [key])](#Asset.retrieve) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveForCache([_], [subTypeArr])](#Asset.retrieveForCache) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType])](#Asset.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> - * [.create(metadata)](#Asset.create) ⇒ Promise - * [.update(metadata)](#Asset.update) ⇒ Promise - * [.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key)](#Asset.requestSubType) ⇒ Promise - * [.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables])](#Asset.requestAndSaveExtended) ⇒ Promise - * [._retrieveExtendedFile(metadata, subType, retrieveDir)](#Asset._retrieveExtendedFile) ⇒ Promise.<void> - * [._readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly])](#Asset._readExtendedFileFromFS) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#Asset.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.postDeployTasks(metadata, _, createdUpdated)](#Asset.postDeployTasks) ⇒ Promise.<void> - * [.preDeployTasks(metadata, deployDir)](#Asset.preDeployTasks) ⇒ Promise.<TYPE.AssetItem> - * [._getMainSubtype(extendedSubType)](#Asset._getMainSubtype) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildDefinitionForNested) ⇒ Promise.<void> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Asset.buildTemplateForNested) ⇒ Promise.<void> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Asset._buildForNested) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Asset.setFolderPath) - * [.setFolderId(metadata)](#Asset.setFolderId) - * [._mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly])](#Asset._mergeCode) ⇒ Promise.<Array.<TYPE.CodeExtract>> - * [._mergeCode_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly])](#Asset._mergeCode_slots) ⇒ Promise.<void> - * [._extractCode(metadata)](#Asset._extractCode) ⇒ TYPE.CodeExtractItem - * [._extractCode_slots(prefix, metadataSlots, codeArr)](#Asset._extractCode_slots) ⇒ void - * [.getJsonFromFS(dir, [_], selectedSubType)](#Asset.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.findSubType(templateDir, templateName)](#Asset.findSubType) ⇒ Promise.<TYPE.AssetSubType> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName)](#Asset.readSecondaryFolder) ⇒ TYPE.AssetItem - * [.getFilesToCommit(keyArr)](#Asset.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Asset.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Asset.postDeleteTasks) ⇒ void - * [.resolveId(id)](#Asset.resolveId) ⇒ Promise.<{key:string, name:string, path:string}> - - - -### Asset.retrieve(retrieveDir, _, [subTypeArr], [key]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves Metadata of Asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | - | -| [subTypeArr] | Array.<TYPE.AssetSubType> | optionally limit to a single subtype | -| [key] | string | customer key | - - - -### Asset.retrieveForCache([_], [subTypeArr]) ⇒ Promise.<{metadata: TYPE.AssetMap, type: string}> -Retrieves asset metadata for caching - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - - - -### Asset.retrieveAsTemplate(templateDir, name, templateVariables, [selectedSubType]) ⇒ Promise.<{metadata: TYPE.AssetItem, type: string}> -Retrieves asset metadata for templating - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{metadata: TYPE.AssetItem, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [selectedSubType] | TYPE.AssetSubType | optionally limit to a single subtype | - - - -### Asset.create(metadata) ⇒ Promise -Creates a single asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.update(metadata) ⇒ Promise -Updates a single asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.requestSubType(subType, [retrieveDir], [templateName], [templateVariables], key) ⇒ Promise -Retrieves Metadata of a specific asset type - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| [retrieveDir] | string | target directory for saving assets | -| [templateName] | string | name of the metadata file | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| key | string | customer key to filter by | - - - -### Asset.requestAndSaveExtended(items, subType, retrieveDir, [templateVariables]) ⇒ Promise -Retrieves extended metadata (files or extended content) of asset - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| items | Array | array of items to retrieve | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Asset.\_retrieveExtendedFile(metadata, subType, retrieveDir) ⇒ Promise.<void> -Some metadata types store their actual content as a separate file, e.g. images -This method retrieves these and saves them alongside the metadata json - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| subType | TYPE.AssetSubType | group of similar assets to put in a folder (ie. images) | -| retrieveDir | string | target directory for saving assets | - - - -### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string> -helper for [preDeployTasks](#Asset.preDeployTasks) -Some metadata types store their actual content as a separate file, e.g. images -This method reads these from the local FS stores them in the metadata object allowing to deploy it - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<string> - if found will return the path of the binary file - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset | -| subType | TYPE.AssetSubType | | group of similar assets to put in a folder (ie. images) | -| deployDir | string | | directory of deploy files | -| [pathOnly] | boolean | false | used by getFilesToCommit which does not need the binary file to be actually read | - - - -### Asset.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | - - - -### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void> -Gets executed after deployment of metadata type - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### Asset.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.AssetItem> -prepares an asset definition for deployment - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset | -| deployDir | string | directory of deploy files | - - - -### Asset.\_getMainSubtype(extendedSubType) ⇒ string -find the subType matching the extendedSubType - -**Kind**: static method of [Asset](#Asset) -**Returns**: string - subType: block, message, other, etc - -| Param | Type | Description | -| --- | --- | --- | -| extendedSubType | string | webpage, htmlblock, etc | - - - -### Asset.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### Asset.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<void> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating -``` - - -### Asset.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<void> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.AssetItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### Asset.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - - -### Asset.setFolderId(metadata) -Asset-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<Array.<TYPE.CodeExtract>> - fileList for templating (disregarded during deployment) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadata | TYPE.AssetItem | | a single asset definition | -| deployDir | string | | directory of deploy files | -| subType | TYPE.AssetSubType | | asset-subtype name | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void> -helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<void> - - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| prefix | string | | usually the customerkey | -| metadataSlots | object | | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| readDirArr | Array.<string> | | directory of deploy files | -| subtypeExtension | string | | asset-subtype name ending on -meta | -| subDirArr | Array.<string> | | directory of files w/o leading deploy dir | -| fileList | Array.<object> | | directory of files w/o leading deploy dir | -| customerKey | string | | external key of template (could have been changed if used during templating) | -| [templateName] | string | | name of the template used to built defintion (prior applying templating) | -| [fileListOnly] | boolean | false | does not read file contents nor update metadata if true | - - - -### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem -helper for [postRetrieveTasks](#Asset.postRetrieveTasks) that finds code content in JSON and extracts it -to allow saving that separately and formatted - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.CodeExtractItem - { json: metadata, codeArr: object[], subFolder: string[] } - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AssetItem | a single asset definition | - - - -### Asset.\_extractCode\_slots(prefix, metadataSlots, codeArr) ⇒ void -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| prefix | string | usually the customerkey | -| metadataSlots | object | metadata.views.html.slots or deeper slots.<>.blocks.<>.slots | -| codeArr | Array.<object> | to be extended array for extracted code | - - - -### Asset.getJsonFromFS(dir, [_], selectedSubType) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their fileName without '.json' ending - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map - -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [_] | void | unused parameter | -| selectedSubType | Array.<string> | asset, message, ... | - - - -### Asset.findSubType(templateDir, templateName) ⇒ Promise.<TYPE.AssetSubType> -check template directory for complex types that open subfolders for their subtypes - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<TYPE.AssetSubType> - subtype name - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | - - - -### Asset.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) ⇒ TYPE.AssetItem -optional method used for some types to try a different folder structure - -**Kind**: static method of [Asset](#Asset) -**Returns**: TYPE.AssetItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | - - - -### Asset.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Asset](#Asset) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Asset.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Asset.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item -cannot use the generic method due to the complexity of how assets are saved to disk - -**Kind**: static method of [Asset](#Asset) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### Asset.resolveId(id) ⇒ Promise.<{key:string, name:string, path:string}> -get name & key for provided id - -**Kind**: static method of [Asset](#Asset) -**Returns**: Promise.<{key:string, name:string, path:string}> - key, name and path of metadata; null if not found - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | - - - -## AttributeGroup ⇐ [MetadataType](#MetadataType) -AttributeGroup MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [AttributeGroup](#AttributeGroup) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeGroup.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeGroup.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.postRetrieveTasks(metadata)](#AttributeGroup.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - - - -### AttributeGroup.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups. - -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### AttributeGroup.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema attribute groups for caching. - -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### AttributeGroup.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [AttributeGroup](#AttributeGroup) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | - - - -## AttributeSet ⇐ [MetadataType](#MetadataType) -AttributeSet MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [AttributeSet](#AttributeSet) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#AttributeSet.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#AttributeSet.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.fixShared_retrieve(sharedDataExtensionMap, fixShared_fields)](#AttributeSet.fixShared_retrieve) ⇒ Promise.<Array.<string>> - * [.parseResponseBody(body, [singleRetrieve])](#AttributeSet.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.postRetrieveTasks(metadata)](#AttributeSet.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [._getSystemValueDefinitions()](#AttributeSet._getSystemValueDefinitions) ⇒ Array.<object> - - - -### AttributeSet.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set Definitions. - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### AttributeSet.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of schema set definitions for caching. - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - - -### AttributeSet.fixShared\_retrieve(sharedDataExtensionMap, fixShared_fields) ⇒ Promise.<Array.<string>> -used to identify updated shared data extensions that are used in attributeSets. -helper for DataExtension.#fixShared_onBU - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Promise.<Array.<string>> - Promise of list of shared dataExtension IDs - -| Param | Type | Description | -| --- | --- | --- | -| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | -| fixShared_fields | object | DataExtensionField.fixShared_fields | - - - -### AttributeSet.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### AttributeSet.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata | - - - -### AttributeSet.\_getSystemValueDefinitions() ⇒ Array.<object> -helper for [postRetrieveTasks](#AttributeSet.postRetrieveTasks) - -**Kind**: static method of [AttributeSet](#AttributeSet) -**Returns**: Array.<object> - all system value definitions - - -## Automation ⇐ [MetadataType](#MetadataType) -Automation MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Automation](#Automation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Automation.retrieve) ⇒ Promise.<TYPE.AutomationMapObj> - * [.handleRESTErrors(ex, id)](#Automation.handleRESTErrors) ⇒ null - * [.retrieveChangelog()](#Automation.retrieveChangelog) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj> - * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void - * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<Array.<string>> - * [.getErrorsREST(ex)](#Automation.getErrorsREST) ⇒ Array.<string> \| void - * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<Array.<string>> - * [.deploy(metadata, targetBU, retrieveDir)](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap> - * [.create(metadata)](#Automation.create) ⇒ Promise - * [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ Promise.<TYPE.AutomationItem> - * [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ boolean - * [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void> - * [.setFolderPath(metadata)](#Automation.setFolderPath) - * [.setFolderId(metadata)](#Automation.setFolderId) - * [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap - * [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string - * [.document([metadata])](#Automation.document) ⇒ Promise.<void> - * [.getFilesToCommit(keyArr)](#Automation.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Automation.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey)](#Automation.postDeleteTasks) ⇒ void - - - -### Automation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Automation.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) - -**Kind**: static method of [Automation](#Automation) -**Returns**: null - - - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | - - - -### Automation.retrieveChangelog() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves Metadata of Automation - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - - -### Automation.retrieveForCache() ⇒ Promise.<TYPE.AutomationMapObj> -Retrieves automation metadata for caching - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMapObj> - Promise of metadata - - -### Automation.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.AutomationItemObj> -Retrieve a specific Automation Definition by Name - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItemObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem \| void -manages post retrieve steps - -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationItem \| void - parsed item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | a single automation | - - - -### Automation.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Automation.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts - -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> \| void - formatted Error Message - -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | - - - -### Automation.pause(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were paused - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Automation.deploy(metadata, targetBU, retrieveDir) ⇒ Promise.<TYPE.AutomationMap> -Deploys automation - the saved file is the original one due to large differences required for deployment - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationMap> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationMap | metadata mapped by their keyField | -| targetBU | string | name/shorthand of target businessUnit for mapping | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### Automation.create(metadata) ⇒ Promise -Creates a single automation - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | - - - -### Automation.update(metadata, metadataBefore) ⇒ Promise -Updates a single automation - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | single metadata entry | -| metadataBefore | TYPE.AutomationItem | metadata mapped by their keyField | - - - -### Automation.preDeployTasks(metadata) ⇒ Promise.<TYPE.AutomationItem> -Gets executed before deploying metadata - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<TYPE.AutomationItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | metadata mapped by their keyField | - - - -### Automation.validateDeployMetadata(metadata) ⇒ boolean -Validates the automation to be sure it can be deployed. -Whitelisted Activites are deployed but require configuration - -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - result if automation can be deployed based on steps - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | single automation record | - - - -### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ Promise.<void> -Gets executed after deployment of metadata type - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | -| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | - - - -### Automation.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve - -**Kind**: static method of [Automation](#Automation) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - - -### Automation.setFolderId(metadata) -automation-specific script that retrieves the folder ID from cache and updates the given metadata with it before deploy - -**Kind**: static method of [Automation](#Automation) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap -Builds a schedule object to be used for scheduling an automation -based on combination of ical string and start/end dates. - -**Kind**: static method of [Automation](#Automation) -**Returns**: TYPE.AutomationScheduleSoap - Schedulable object for soap API (currently not rest supported) - -| Param | Type | Description | -| --- | --- | --- | -| scheduleObject | TYPE.AutomationSchedule | child of automation metadata used for scheduling | - - - -### Automation.\_calcTime(offsetServer, dateInput, [offsetInput]) ⇒ string -used to convert dates to the system timezone required for startDate - -**Kind**: static method of [Automation](#Automation) -**Returns**: string - date in server - -| Param | Type | Description | -| --- | --- | --- | -| offsetServer | number | stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) | -| dateInput | string \| Date | date in ISO format (2021-12-05T20:00:00.983) | -| [offsetInput] | string | timzone difference (+02:00) | - - - -### Automation.document([metadata]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it - -**Kind**: static method of [Automation](#Automation) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.AutomationMap | a list of dataExtension definitions | - - - -### Automation.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Automation](#Automation) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Automation.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit - -**Kind**: static method of [Automation](#Automation) -**Returns**: boolean - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Automation.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [Automation](#Automation) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -## Campaign ⇐ [MetadataType](#MetadataType) -Campaign MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Campaign](#Campaign) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Campaign.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Campaign.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getAssetTags(retrieveDir, campaignId, name)](#Campaign.getAssetTags) ⇒ Promise.<TYPE.MetadataTypeMapObj> - - - -### Campaign.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets - -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Campaign.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### Campaign.getAssetTags(retrieveDir, campaignId, name) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Parses campaign asset response body and returns metadata entries mapped to their id - -**Kind**: static method of [Campaign](#Campaign) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Campaign Asset Object - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | folder where to save | -| campaignId | string | of camapaign to retrieve | -| name | string | of camapaign for saving | - - - -## ContentArea ⇐ [MetadataType](#MetadataType) -ContentArea MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [ContentArea](#ContentArea) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ContentArea.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.setFolderPath(metadata)](#ContentArea.setFolderPath) - * [.postRetrieveTasks(metadata)](#ContentArea.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - - - -### ContentArea.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### ContentArea.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve - -**Kind**: static method of [ContentArea](#ContentArea) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - - -### ContentArea.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving - -**Kind**: static method of [ContentArea](#ContentArea) -**Returns**: TYPE.MetadataTypeItem - parsed item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -## DataExtension ⇐ [MetadataType](#MetadataType) -DataExtension MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [DataExtension](#DataExtension) ⇐ [MetadataType](#MetadataType) - * [.upsert(metadataMap)](#DataExtension.upsert) ⇒ Promise - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#DataExtension.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.create(metadata)](#DataExtension.create) ⇒ Promise - * [.update(metadata)](#DataExtension.update) ⇒ Promise - * [.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated)](#DataExtension.postDeployTasks) ⇒ void - * [.retrieve(retrieveDir, [additionalFields], [_], [key])](#DataExtension.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveSharedForCache([additionalFields])](#DataExtension.retrieveSharedForCache) ⇒ Promise.<TYPE.DataExtensionMap> - * [.retrieveChangelog([additionalFields])](#DataExtension.retrieveChangelog) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.postRetrieveTasks(metadata)](#DataExtension.postRetrieveTasks) ⇒ TYPE.DataExtensionItem - * [.preDeployTasks(metadata)](#DataExtension.preDeployTasks) ⇒ Promise.<TYPE.DataExtensionItem> - * [.document([metadataMap])](#DataExtension.document) ⇒ Promise.<void> - * [.deleteByKey(customerKey)](#DataExtension.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#DataExtension.postDeleteTasks) ⇒ Promise.<void> - * [.retrieveForCache()](#DataExtension.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtension.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - * [.setFolderPath(metadata)](#DataExtension.setFolderPath) - * [.getFilesToCommit(keyArr)](#DataExtension.getFilesToCommit) ⇒ Array.<string> - - - -### DataExtension.upsert(metadataMap) ⇒ Promise -Upserts dataExtensions after retrieving them from source and target to compare -if create or update operation is needed. - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.DataExtensionMap | dataExtensions mapped by their customerKey | - - - -### DataExtension.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: 'create' \| 'update' \| 'skip' - action to take - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -### DataExtension.create(metadata) ⇒ Promise -Create a single dataExtension. Also creates their columns in 'dataExtension.columns' - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | - - - -### DataExtension.update(metadata) ⇒ Promise -Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.DataExtensionItem | single metadata entry | - - - -### DataExtension.postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type - -**Kind**: static method of [DataExtension](#DataExtension) - -| Param | Type | Description | -| --- | --- | --- | -| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | -| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### DataExtension.retrieve(retrieveDir, [additionalFields], [_], [key]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [_] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### DataExtension.retrieveSharedForCache([additionalFields]) ⇒ Promise.<TYPE.DataExtensionMap> -get shared dataExtensions from parent BU and merge them into the cache -helper for [retrieve](#DataExtension.retrieve) and for AttributeSet.fixShared_retrieve - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionMap> - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### DataExtension.retrieveChangelog([additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### DataExtension.postRetrieveTasks(metadata) ⇒ TYPE.DataExtensionItem -manages post retrieve steps - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: TYPE.DataExtensionItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single dataExtension | - - - -### DataExtension.preDeployTasks(metadata) ⇒ Promise.<TYPE.DataExtensionItem> -prepares a DataExtension for deployment - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<TYPE.DataExtensionItem> - Promise of updated single DE - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.DataExtensionItem | a single data Extension | - - - -### DataExtension.document([metadataMap]) ⇒ Promise.<void> -Parses metadata into a readable Markdown/HTML format then saves it - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [metadataMap] | TYPE.DataExtensionMap | a list of dataExtension definitions | - - - -### DataExtension.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### DataExtension.postDeleteTasks(customerKey) ⇒ Promise.<void> -clean up after deleting a metadata item - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<void> - - promise - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### DataExtension.retrieveForCache() ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise - - -### DataExtension.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.DataExtensionMap, type: string}> -Retrieves dataExtension metadata in template format. - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Promise.<{metadata: TYPE.DataExtensionMap, type: string}> - Promise of items - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata item | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### DataExtension.setFolderPath(metadata) -dataExtension logic that retrieves the folder path from cache and updates the given metadata with it after retrieve -it also sets the content type which is basically the subtype - -**Kind**: static method of [DataExtension](#DataExtension) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - - -### DataExtension.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [DataExtension](#DataExtension) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## DataExtensionField ⇐ [MetadataType](#MetadataType) -DataExtensionField MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [DataExtensionField](#DataExtensionField) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields])](#DataExtensionField.retrieve) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.retrieveForCache([requestParams], [additionalFields])](#DataExtensionField.retrieveForCache) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - * [.convertToSortedArray(fieldsObj)](#DataExtensionField.convertToSortedArray) ⇒ Array.<TYPE.DataExtensionFieldItem> - * [.sortDeFields(a, b)](#DataExtensionField.sortDeFields) ⇒ boolean - * [.postRetrieveTasks(metadata, forDataExtension)](#DataExtensionField.postRetrieveTasks) ⇒ TYPE.DataExtensionFieldItem - * [.prepareDeployColumnsOnUpdate(deployColumns, deKey)](#DataExtensionField.prepareDeployColumnsOnUpdate) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - * [.deleteByKey(customerKey)](#DataExtensionField.deleteByKey) ⇒ Promise.<boolean> - * [.deleteByKeySOAP(customerKey, [fieldId])](#DataExtensionField.deleteByKeySOAP) ⇒ boolean - * [.postDeleteTasks(customerKey)](#DataExtensionField.postDeleteTasks) ⇒ void - - - -### DataExtensionField.retrieve(retrieveDir, [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records and saves it to disk - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### DataExtensionField.retrieveForCache([requestParams], [additionalFields]) ⇒ Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> -Retrieves all records for caching - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<{metadata: TYPE.DataExtensionFieldMap, type: string}> - Promise of items - -| Param | Type | Description | -| --- | --- | --- | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### DataExtensionField.convertToSortedArray(fieldsObj) ⇒ Array.<TYPE.DataExtensionFieldItem> -helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Array.<TYPE.DataExtensionFieldItem> - sorted array of field objects - -| Param | Type | Description | -| --- | --- | --- | -| fieldsObj | TYPE.DataExtensionFieldMap | customerKey-based list of fields for one dataExtension | - - - -### DataExtensionField.sortDeFields(a, b) ⇒ boolean -sorting method to ensure `Ordinal` is respected - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - sorting based on Ordinal - -| Param | Type | Description | -| --- | --- | --- | -| a | TYPE.DataExtensionFieldItem | - | -| b | TYPE.DataExtensionFieldItem | - | - - - -### DataExtensionField.postRetrieveTasks(metadata, forDataExtension) ⇒ TYPE.DataExtensionFieldItem -manages post retrieve steps - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: TYPE.DataExtensionFieldItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.DataExtensionFieldItem | a single item | -| forDataExtension | boolean | when used by DataExtension class we remove more fields | - - - -### DataExtensionField.prepareDeployColumnsOnUpdate(deployColumns, deKey) ⇒ Promise.<Object.<string, TYPE.DataExtensionFieldItem>> -Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. -Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<Object.<string, TYPE.DataExtensionFieldItem>> - existing fields by their original name to allow re-adding FieldType after update - -| Param | Type | Description | -| --- | --- | --- | -| deployColumns | Array.<TYPE.DataExtensionFieldItem> | Columns of data extension that will be deployed | -| deKey | string | external/customer key of Data Extension | - - - -### DataExtensionField.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### DataExtensionField.deleteByKeySOAP(customerKey, [fieldId]) ⇒ boolean -Delete a data extension from the specified business unit - -**Kind**: static method of [DataExtensionField](#DataExtensionField) -**Returns**: boolean - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [fieldId] | string | for programmatic deletes only one can pass in the ID directly | - - - -### DataExtensionField.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [DataExtensionField](#DataExtensionField) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -## DataExtensionTemplate ⇐ [MetadataType](#MetadataType) -DataExtensionTemplate MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - - -### DataExtensionTemplate.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [DataExtensionTemplate](#DataExtensionTemplate) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -## DataExtract ⇐ [MetadataType](#MetadataType) -DataExtract MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [DataExtract](#DataExtract) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtract.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtract.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#DataExtract.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(dataExtract)](#DataExtract.create) ⇒ Promise - * [.update(dataExtract)](#DataExtract.update) ⇒ Promise - * [.preDeployTasks(metadata)](#DataExtract.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#DataExtract.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#DataExtract.deleteByKey) ⇒ Promise.<boolean> - - - -### DataExtract.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity. -Endpoint /automation/v1/dataextracts/ returns all Data Extracts - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### DataExtract.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### DataExtract.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific dataExtract Definition by Name - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### DataExtract.create(dataExtract) ⇒ Promise -Creates a single Data Extract - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - - - -### DataExtract.update(dataExtract) ⇒ Promise -Updates a single Data Extract - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| dataExtract | TYPE.MetadataTypeItem | a single Data Extract | - - - -### DataExtract.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a dataExtract for deployment - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single dataExtract activity definition | - - - -### DataExtract.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### DataExtract.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [DataExtract](#DataExtract) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -## DataExtractType ⇐ [MetadataType](#MetadataType) -DataExtractType MetadataType -Only for Caching No retrieve/upsert is required -as this is a configuration in the EID - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [DataExtractType](#DataExtractType) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#DataExtractType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#DataExtractType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - - - -### DataExtractType.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type. - -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### DataExtractType.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Type for caching. - -**Kind**: static method of [DataExtractType](#DataExtractType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -## Discovery ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - - -### Discovery.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves API endpoint -documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm - -**Kind**: static method of [Discovery](#Discovery) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | not used | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -## Email ⇐ [MetadataType](#MetadataType) -Email MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Email](#Email) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Email.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Email.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postRetrieveTasks(metadata)](#Email.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - - - -### Email.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Email.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy - -**Kind**: static method of [Email](#Email) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Email.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [Email](#Email) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | - - - -## EmailSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [EmailSend](#EmailSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#EmailSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadataItem)](#EmailSend.update) ⇒ Promise - * [.create(metadataItem)](#EmailSend.create) ⇒ Promise - * [.deleteByKey(customerKey)](#EmailSend.deleteByKey) ⇒ Promise.<boolean> - * [.preDeployTasks(metadata)](#EmailSend.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postRetrieveTasks(metadata)](#EmailSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - - - -### EmailSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### EmailSend.update(metadataItem) ⇒ Promise -Updates a single item - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | - - - -### EmailSend.create(metadataItem) ⇒ Promise -Creates a single item - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataItem | TYPE.MetadataTypeItem | a single item | - - - -### EmailSend.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### EmailSend.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a single item for deployment - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single script activity definition | - - - -### EmailSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [EmailSend](#EmailSend) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | - - - -## Event ⇐ [MetadataType](#MetadataType) -Event MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Event](#Event) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Event.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#Event.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Event.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.postRetrieveTasks(eventDef)](#Event.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#Event.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.create(metadata)](#Event.create) ⇒ Promise - * [.update(metadataEntry)](#Event.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Event.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata)](#Event.parseMetadata) ⇒ TYPE.MetadataTypeItem - - - -### Event.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Event Definition. -Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. -Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} - -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Event.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### Event.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Event Definition by Name - -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Event.postRetrieveTasks(eventDef) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| eventDef | TYPE.MetadataTypeItem | a single item of Event Definition | - - - -### Event.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -### Event.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy - -**Kind**: static method of [Event](#Event) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### Event.create(metadata) ⇒ Promise -Creates a single Event Definition - -**Kind**: static method of [Event](#Event) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single Event Definition | - - - -### Event.update(metadataEntry) ⇒ Promise -Updates a single Event Definition (using PUT method since PATCH isn't supported) - -**Kind**: static method of [Event](#Event) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single Event Definition | - - - -### Event.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment - -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed version - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single eventDefinition | - - - -### Event.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving - -**Kind**: static method of [Event](#Event) -**Returns**: TYPE.MetadataTypeItem - parsed metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single event definition | - - - -## FtpLocation ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [FtpLocation](#FtpLocation) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FtpLocation.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FtpLocation.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - - - -### FtpLocation.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FtpLocation -Endpoint /automation/v1/ftplocations/ return all FtpLocations - -**Kind**: static method of [FtpLocation](#FtpLocation) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### FtpLocation.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. - -**Kind**: static method of [FtpLocation](#FtpLocation) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - - -## FileTransfer ⇐ [MetadataType](#MetadataType) -FileTransfer MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [FileTransfer](#FileTransfer) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#FileTransfer.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#FileTransfer.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#FileTransfer.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(fileTransfer)](#FileTransfer.create) ⇒ Promise - * [.update(fileTransfer)](#FileTransfer.update) ⇒ Promise - * [.preDeployTasks(metadata)](#FileTransfer.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#FileTransfer.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#FileTransfer.deleteByKey) ⇒ Promise.<boolean> - - - -### FileTransfer.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity. -Endpoint /automation/v1/filetransfers/ returns all File Transfers - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### FileTransfer.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of FileTransfer Activity for caching - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - - -### FileTransfer.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific File Transfer Definition by Name - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### FileTransfer.create(fileTransfer) ⇒ Promise -Creates a single File Transfer - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - - - -### FileTransfer.update(fileTransfer) ⇒ Promise -Updates a single File Transfer - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| fileTransfer | TYPE.MetadataTypeItem | a single File Transfer | - - - -### FileTransfer.preDeployTasks(metadata) ⇒ Promise -prepares a fileTransfer for deployment - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - - - -### FileTransfer.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: TYPE.MetadataTypeItem - parsed metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single fileTransfer activity definition | - - - -### FileTransfer.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [FileTransfer](#FileTransfer) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -## Filter ⇐ [MetadataType](#MetadataType) -Filter MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - - -### Filter.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Filter. -Endpoint /automation/v1/filters/ returns all Filters, -but only with some of the fields. So it is needed to loop over -Filters with the endpoint /automation/v1/filters/{id} - -**Kind**: static method of [Filter](#Filter) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -## Folder ⇐ [MetadataType](#MetadataType) -Folder MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Folder](#Folder) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#Folder.retrieve) ⇒ Promise - * [.retrieveForCache([_], [subTypeArr])](#Folder.retrieveForCache) ⇒ Promise - * [.upsert(metadata)](#Folder.upsert) ⇒ Promise.<object> - * [.create(metadataEntry)](#Folder.create) ⇒ Promise - * [.update(metadataEntry)](#Folder.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Folder.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.getJsonFromFS(dir, [listBadKeys])](#Folder.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList])](#Folder.retrieveHelper) ⇒ Promise.<object> - * [.postRetrieveTasks(metadata)](#Folder.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.saveResults(results, retrieveDir, mid)](#Folder.saveResults) ⇒ Promise.<object> - - - -### Folder.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise -Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | content type of folder | -| [key] | string | customer key of single item to retrieve | - - - -### Folder.retrieveForCache([_], [subTypeArr]) ⇒ Promise -Retrieves folder metadata for caching - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [subTypeArr] | Array.<string> | content type of folder | - - - -### Folder.upsert(metadata) ⇒ Promise.<object> -Folder upsert (copied from Metadata Upsert), after retrieving from target -and comparing to check if create or update operation is needed. -Copied due to having a dependency on itself, meaning the created need to be serial - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | - - - -### Folder.create(metadataEntry) ⇒ Promise -creates a folder based on metatadata - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata of the folder | - - - -### Folder.update(metadataEntry) ⇒ Promise -Updates a single Folder. - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | - - - -### Folder.preDeployTasks(metadata) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares a folder for deployment - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of parsed folder metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single folder definition | - - - -### Folder.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending - -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map - -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | - - - -### Folder.retrieveHelper([additionalFields], [queryAllAccounts], [contentTypeList]) ⇒ Promise.<object> -Helper to retrieve the folders as promise - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - soap object - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [queryAllAccounts] | boolean | which queryAllAccounts setting to use | -| [contentTypeList] | Array.<string> | content type of folder | - - - -### Folder.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type - -**Kind**: static method of [Folder](#Folder) -**Returns**: TYPE.MetadataTypeItem - cloned metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | metadata mapped by their keyField | - - - -### Folder.saveResults(results, retrieveDir, mid) ⇒ Promise.<object> -Helper for writing Metadata to disk, used for Retrieve and deploy - -**Kind**: static method of [Folder](#Folder) -**Returns**: Promise.<object> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| results | object | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| mid | number | current mid for this credential / business unit | - - - -## ImportFile ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [ImportFile](#ImportFile) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#ImportFile.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#ImportFile.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#ImportFile.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(importFile)](#ImportFile.create) ⇒ Promise - * [.update(importFile)](#ImportFile.update) ⇒ Promise - * [.deploy(metadataMap, deployDir, retrieveDir)](#ImportFile.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.preDeployTasks(metadata)](#ImportFile.preDeployTasks) ⇒ Promise - * [.postRetrieveTasks(metadata)](#ImportFile.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(customerKey)](#ImportFile.deleteByKey) ⇒ Promise.<boolean> - - - -### ImportFile.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Import File. -Endpoint /automation/v1/imports/ return all Import Files with all details. -Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### ImportFile.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Retrieve a specific Import Definition by Name - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### ImportFile.create(importFile) ⇒ Promise -Creates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.update(importFile) ⇒ Promise -Updates a single Import File - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| importFile | TYPE.MetadataTypeItem | a single Import File | - - - -### ImportFile.deploy(metadataMap, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### ImportFile.preDeployTasks(metadata) ⇒ Promise -prepares a import definition for deployment - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single importDef | - - - -### ImportFile.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: TYPE.MetadataTypeItem - parsed metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### ImportFile.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [ImportFile](#ImportFile) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -## Journey ⇐ [MetadataType](#MetadataType) -Journey MetadataType -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! -id: A unique id of the journey assigned by the journey’s API during its creation -key: A unique id of the journey within the MID. Can be generated by the developer -definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Journey](#Journey) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean> - * [.deploy(metadata, deployDir, retrieveDir)](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.update(metadata)](#Journey.update) ⇒ Promise - * [.create(metadata)](#Journey.create) ⇒ Promise - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#Journey.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [._postRetrieveTasksBulk(metadataMap)](#Journey._postRetrieveTasksBulk) - * [.postRetrieveTasks(metadata)](#Journey.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.preDeployTasks(metadata)](#Journey.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#Journey.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - - - -### Journey.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Journey - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Journey.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -### Journey.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta) once per deploy - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### Journey.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Journey.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Journey.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy - -**Kind**: static method of [Journey](#Journey) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Journey.\_postRetrieveTasksBulk(metadataMap) -helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and - -**Kind**: static method of [Journey](#Journey) - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | key=customer key, value=metadata | - - - -### Journey.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! - -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### Journey.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment -! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! - -**Kind**: static method of [Journey](#Journey) -**Returns**: TYPE.MetadataTypeItem - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | - - - -### Journey.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [Journey](#Journey) -**Returns**: 'create' \| 'update' \| 'skip' - action to take - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -## List ⇐ [MetadataType](#MetadataType) -List MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [List](#List) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#List.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#List.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.deleteByKey(customerKey)](#List.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(list)](#List.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.parseMetadata(metadata, [parseForCache])](#List.parseMetadata) ⇒ TYPE.MetadataTypeItem - - - -### List.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Lists - -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### List.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [List](#List) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### List.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [List](#List) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### List.postRetrieveTasks(list) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - metadata - -| Param | Type | Description | -| --- | --- | --- | -| list | TYPE.MetadataTypeItem | a single list | - - - -### List.parseMetadata(metadata, [parseForCache]) ⇒ TYPE.MetadataTypeItem -parses retrieved Metadata before saving - -**Kind**: static method of [List](#List) -**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one sql string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single list definition | -| [parseForCache] | boolean | if set to true, the Category ID is kept | - - - -## MetadataType -MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes - -**Kind**: global class - -* [MetadataType](#MetadataType) - * [.client](#MetadataType.client) : TYPE.SDK - * [.properties](#MetadataType.properties) : TYPE.Mcdevrc - * [.subType](#MetadataType.subType) : string - * [.buObject](#MetadataType.buObject) : TYPE.BuObject - * [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap - * [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string> - * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#MetadataType.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void - * [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata, targetDir, [isTemplating])](#MetadataType.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.setFolderPath(metadata)](#MetadataType.setFolderPath) - * [.setFolderId(metadata)](#MetadataType.setFolderId) - * [.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key])](#MetadataType.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveChangelog([additionalFields], [subTypeArr])](#MetadataType.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([additionalFields], [subTypeArr], [key])](#MetadataType.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, name, templateVariables, [subType])](#MetadataType.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.retrieveTemplateREST(templateDir, uri, templateVariables, name)](#MetadataType.retrieveTemplateREST) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - * [.buildTemplate(retrieveDir, templateDir, key, templateVariables)](#MetadataType.buildTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.preDeployTasks(metadata, deployDir)](#MetadataType.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.create(metadata, deployDir)](#MetadataType.create) ⇒ void - * [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void - * [.refresh()](#MetadataType.refresh) ⇒ void - * [.execute()](#MetadataType.execute) ⇒ void - * [.pause()](#MetadataType.pause) ⇒ void - * [.hasChanged(cachedVersion, metadata, [fieldName])](#MetadataType.hasChanged) ⇒ boolean - * [.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent])](#MetadataType.hasChangedGeneric) ⇒ boolean - * [.upsert(metadataMap, deployDir)](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MetadataType.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.createREST(metadataEntry, uri)](#MetadataType.createREST) ⇒ Promise.<object> \| null - * [.createSOAP(metadataEntry, [handleOutside])](#MetadataType.createSOAP) ⇒ Promise.<object> \| null - * [.updateREST(metadataEntry, uri, [httpMethod])](#MetadataType.updateREST) ⇒ Promise.<object> \| null - * [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ Promise.<object> \| null - * [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors) - * [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ string - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls])](#MetadataType.retrieveRESTcollection) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - * [.handleRESTErrors(ex, id)](#MetadataType.handleRESTErrors) ⇒ null - * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<{key:string, response:string}> - * [.executeSOAP([metadataEntry])](#MetadataType.executeSOAP) ⇒ Promise.<{key:string, response:object}> - * [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void> - * [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void - * [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ void - * [.removeNotUpdateableFields(metadataEntry)](#MetadataType.removeNotUpdateableFields) ⇒ void - * [.keepTemplateFields(metadataEntry)](#MetadataType.keepTemplateFields) ⇒ void - * [.keepRetrieveFields(metadataEntry)](#MetadataType.keepRetrieveFields) ⇒ void - * [.isFiltered(metadataEntry, [include])](#MetadataType.isFiltered) ⇒ boolean - * [.isFilteredFolder(metadataEntry, [include])](#MetadataType.isFilteredFolder) ⇒ boolean - * [.saveResults(results, retrieveDir, [overrideType], [templateVariables])](#MetadataType.saveResults) ⇒ Promise.<TYPE.MetadataTypeMap> - * [.applyTemplateValues(code, templateVariables)](#MetadataType.applyTemplateValues) ⇒ string - * [.applyTemplateNames(code, templateVariables)](#MetadataType.applyTemplateNames) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName)](#MetadataType.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MetadataType.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.findSubType(templateDir, templateName)](#MetadataType.findSubType) ⇒ Promise.<string> - * [.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex)](#MetadataType.readSecondaryFolder) ⇒ object - * [.buildDefinition(templateDir, targetDir, templateName, variables)](#MetadataType.buildDefinition) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.getErrorsREST(ex)](#MetadataType.getErrorsREST) ⇒ Array.<string> \| void - * [.document([metadata], [isDeploy])](#MetadataType.document) ⇒ void - * [.resolveId(id)](#MetadataType.resolveId) ⇒ Promise.<string> - * [.deleteByKey(customerKey)](#MetadataType.deleteByKey) ⇒ boolean - * [.postDeleteTasks(customerKey, [additionalExtensions])](#MetadataType.postDeleteTasks) ⇒ Promise.<void> - * [.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside])](#MetadataType.deleteByKeySOAP) ⇒ Promise.<boolean> - * [.deleteByKeyREST(url, key, [handleOutside])](#MetadataType.deleteByKeyREST) ⇒ Promise.<boolean> - * [.readBUMetadataForType(readDir, [listBadKeys], [buMetadata])](#MetadataType.readBUMetadataForType) ⇒ object - * [.getFilesToCommit(keyArr)](#MetadataType.getFilesToCommit) ⇒ Promise.<Array.<string>> - * [.getKeysForFixing(metadataMap)](#MetadataType.getKeysForFixing) ⇒ Array.<string> - - - -### MetadataType.client : TYPE.SDK -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.properties : TYPE.Mcdevrc -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.subType : string -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.buObject : TYPE.BuObject -**Kind**: static property of [MetadataType](#MetadataType) - - -### MetadataType.getJsonFromFS(dir, [listBadKeys]) ⇒ TYPE.MetadataTypeMap -Returns file contents mapped to their filename without '.json' ending - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map - -| Param | Type | Description | -| --- | --- | --- | -| dir | string | directory that contains '.json' files to be read | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | - - - -### MetadataType.getFieldNamesToRetrieve([additionalFields], [isCaching]) ⇒ Array.<string> -Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - Fieldnames - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [isCaching] | boolean | if true, then check if field should be skipped for caching | - - - -### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap> -Deploys metadata - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | -| retrieveDir | string | directory where metadata after deploy should be saved | - - - -### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void -Gets executed after deployment of metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | -| originalMetadata | TYPE.MetadataTypeMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -### MetadataType.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - - - -### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void> -helper for [createREST](#MetadataType.createREST) when legacy API endpoints as these do not return the created item but only their new id - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MetadataType.postRetrieveTasks(metadata, targetDir, [isTemplating]) ⇒ TYPE.MetadataTypeItem -Gets executed after retreive of metadata type - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeItem - cloned metadata - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| targetDir | string | folder where retrieves should be saved | -| [isTemplating] | boolean | signals that we are retrieving templates | - - - -### MetadataType.setFolderPath(metadata) -generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MetadataType.setFolderId(metadata) -generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MetadataType.retrieve(retrieveDir, [additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | - - - -### MetadataType.retrieveChangelog([additionalFields], [subTypeArr]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | - - - -### MetadataType.retrieveForCache([additionalFields], [subTypeArr], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [subTypeArr] | Array.<string> | optionally limit to a single subtype | -| [key] | string | customer key of single item to retrieve | - - - -### MetadataType.retrieveAsTemplate(templateDir, name, templateVariables, [subType]) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| [subType] | string | optionally limit to a single subtype | - - - -### MetadataType.retrieveTemplateREST(templateDir, uri, templateVariables, name) ⇒ Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> -Retrieve a specific Script by Name - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: TYPE.MetadataTypeItem, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| name | string | name (not key) of the metadata item | - - - -### MetadataType.buildTemplate(retrieveDir, templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - single metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| templateDir | string | (List of) Directory where built definitions will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -Gets executed before deploying metadata - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise of a single metadata item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| deployDir | string | folder where files for deployment are stored | - - - -### MetadataType.create(metadata, deployDir) ⇒ void -Abstract create method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| deployDir | string | directory where deploy metadata are saved | - - - -### MetadataType.update(metadata, [metadataBefore]) ⇒ void -Abstract update method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | -| [metadataBefore] | TYPE.MetadataTypeItem | metadata mapped by their keyField | - - - -### MetadataType.refresh() ⇒ void -Abstract refresh method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.execute() ⇒ void -Abstract execute method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.pause() ⇒ void -Abstract pause method that needs to be implemented in child metadata type - -**Kind**: static method of [MetadataType](#MetadataType) - - -### MetadataType.hasChanged(cachedVersion, metadata, [fieldName]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true if metadata was changed - -| Param | Type | Description | -| --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | - - - -### MetadataType.hasChangedGeneric(cachedVersion, metadata, [fieldName], [silent]) ⇒ boolean -test if metadata was actually changed or not to potentially skip it during deployment - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true on first identified deviation or false if none are found - -| Param | Type | Description | -| --- | --- | --- | -| cachedVersion | TYPE.MetadataTypeItem | cached version from the server | -| metadata | TYPE.MetadataTypeItem | item to upload | -| [fieldName] | string | optional field name to use for identifying the record in logs | -| [silent] | boolean | optionally suppress logging | - - - -### MetadataType.upsert(metadataMap, deployDir) ⇒ Promise.<TYPE.MetadataTypeMap> -MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | -| deployDir | string | directory where deploy metadata are saved | - - - -### MetadataType.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: 'create' \| 'update' \| 'skip' - action to take - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -### MetadataType.createREST(metadataEntry, uri) ⇒ Promise.<object> \| null -Creates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| uri | string | rest endpoint for POST | - - - -### MetadataType.createSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Creates a single metadata entry via fuel-soap (generic lib not wrapper) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.updateREST(metadataEntry, uri, [httpMethod]) ⇒ Promise.<object> \| null -Updates a single metadata entry via REST - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | | a single metadata Entry | -| uri | string | | rest endpoint for PATCH | -| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH | - - - -### MetadataType.updateSOAP(metadataEntry, [handleOutside]) ⇒ Promise.<object> \| null -Updates a single metadata entry via fuel-soap (generic lib not wrapper) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<object> \| null - Promise of API response or null in case of an error - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.\_handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside]) -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | error that occured | -| msg | 'creating' \| 'updating' | what to print in the log | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.getSOAPErrorMsg(ex) ⇒ string -helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - error message - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | error that occured | - - - -### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### MetadataType.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -Retrieves Metadata for Rest Types - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| uri | string | rest endpoint for GET | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MetadataType.retrieveRESTcollection(urlArray, [concurrentRequests], [logAmountOfUrls]) ⇒ Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}> - Promise of item map (single item for templated result) - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| urlArray | Array.<object> | | {uri: string, id: string} combo of URL and ID/key of metadata | -| [concurrentRequests] | number | 10 | optionally set a different amount of concurrent requests | -| [logAmountOfUrls] | boolean | true | if true, prints an info message about to-be loaded amount of metadata | - - - -### MetadataType.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: null - - - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | - - - -### MetadataType.executeREST(uri, key) ⇒ Promise.<{key:string, response:string}> -Used to execute a query/automation etc. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:string}> - metadata key and API response (OK or error) - -| Param | Type | Description | -| --- | --- | --- | -| uri | string | REST endpoint where the POST request should be sent | -| key | string | item key | - - - -### MetadataType.executeSOAP([metadataEntry]) ⇒ Promise.<{key:string, response:object}> -Used to execute a query/automation etc. - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response - -| Param | Type | Description | -| --- | --- | --- | -| [metadataEntry] | TYPE.MetadataTypeItem | single metadata entry | - - - -### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void> -helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [singleRetrieve] | string \| number | key of single item to filter by | -| metadataMap | TYPE.MetadataTypeMap | saved metadata | - - - -### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MetadataType.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin) ⇒ void -Deletes a field in a metadata entry if the selected definition property equals false. - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | One entry of a metadataType | -| fieldPath | string | field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' | -| definitionProperty | 'isCreateable' \| 'isUpdateable' \| 'retrieving' \| 'templating' | delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] | -| origin | string | string of parent object, required when using arrays as these are parsed slightly differently. | - -**Example** -```js -Removes field (or nested fields childs) that are not updateable -deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); -``` - - -### MetadataType.removeNotCreateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not createable - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.removeNotUpdateableFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not updateable - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.keepTemplateFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the template - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.keepRetrieveFields(metadataEntry) ⇒ void -Remove fields from metadata entry that are not needed in the stored metadata - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | - - - -### MetadataType.isFiltered(metadataEntry, [include]) ⇒ boolean -checks if the current metadata entry should be saved on retrieve or not - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: skip saving == filtered; false: continue with saving - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - - - -### MetadataType.isFilteredFolder(metadataEntry, [include]) ⇒ boolean -optionally filter by what folder something is in - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - true: filtered == do NOT save; false: not filtered == do save - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | object | metadata entry | -| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude | - - - -### MetadataType.saveResults(results, retrieveDir, [overrideType], [templateVariables]) ⇒ Promise.<TYPE.MetadataTypeMap> -Helper for writing Metadata to disk, used for Retrieve and deploy - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMap> - Promise of saved metadata - -| Param | Type | Description | -| --- | --- | --- | -| results | TYPE.MetadataTypeMap | metadata results from deploy | -| retrieveDir | string | directory where metadata should be stored after deploy/retrieve | -| [overrideType] | string | for use when there is a subtype (such as folder-queries) | -| [templateVariables] | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested) -searches extracted file for template variable names and applies the market values - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string -helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested) -searches extracted file for template variable values and applies the market variable names - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types (e.g script, asset, query) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string | Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MetadataType.findSubType(templateDir, templateName) ⇒ Promise.<string> -check template directory for complex types that open subfolders for their subtypes - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - subtype name - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| templateName | string | name of the metadata file | - - - -### MetadataType.readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) ⇒ object -optional method used for some types to try a different folder structure - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| typeDirArr | Array.<string> | current subdir for this type | -| templateName | string | name of the metadata template | -| fileName | string | name of the metadata template file w/o extension | -| ex | Error | error from first attempt | - - - -### MetadataType.buildDefinition(templateDir, targetDir, templateName, variables) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Builds definition based on template -NOTE: Most metadata files should use this generic method, unless custom -parsing is required (for example scripts & queries) - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| templateName | string | name of the metadata file | -| variables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MetadataType.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> \| void - formatted Error Message - -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | - - - -### MetadataType.document([metadata], [isDeploy]) ⇒ void -Gets metadata cache with limited fields and does not store value to disk - -**Kind**: static method of [MetadataType](#MetadataType) - -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | a list of type definitions | -| [isDeploy] | boolean | used to skip non-supported message during deploy | - - - -### MetadataType.resolveId(id) ⇒ Promise.<string> -get name & key for provided id - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<string> - key of metadata - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of metadata | - - - -### MetadataType.deleteByKey(customerKey) ⇒ boolean -Delete a metadata item from the specified business unit - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: boolean - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### MetadataType.postDeleteTasks(customerKey, [additionalExtensions]) ⇒ Promise.<void> -clean up after deleting a metadata item - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<void> - - Promise - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | -| [additionalExtensions] | Array.<string> | additional file extensions to delete on top of `${this.definition.type}-meta.json` | - - - -### MetadataType.deleteByKeySOAP(customerKey, [overrideKeyField], [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata | -| [overrideKeyField] | string | optionally change the name of the key field if the api uses a different name | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.deleteByKeyREST(url, key, [handleOutside]) ⇒ Promise.<boolean> -Delete a data extension from the specified business unit - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| url | string | endpoint | -| key | string | Identifier of metadata | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### MetadataType.readBUMetadataForType(readDir, [listBadKeys], [buMetadata]) ⇒ object -Returns metadata of a business unit that is saved locally - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: object - Metadata of BU in local directory - -| Param | Type | Description | -| --- | --- | --- | -| readDir | string | root directory of metadata. | -| [listBadKeys] | boolean | do not print errors, used for badKeys() | -| [buMetadata] | object | Metadata of BU in local directory | - - - -### MetadataType.getFilesToCommit(keyArr) ⇒ Promise.<Array.<string>> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### MetadataType.getKeysForFixing(metadataMap) ⇒ Array.<string> -**Kind**: static method of [MetadataType](#MetadataType) -**Returns**: Array.<string> - list of keys - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField | - - - -## MobileCode ⇐ [MetadataType](#MetadataType) -MobileCode MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [MobileCode](#MobileCode) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileCode.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#MobileCode.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - - - -### MobileCode.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. - -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### MobileCode.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [MobileCode](#MobileCode) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -## MobileKeyword ⇐ [MetadataType](#MetadataType) -MobileKeyword MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [MobileKeyword](#MobileKeyword) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ TYPE.MetadataTypeMap - * [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ 'create' \| 'update' \| 'skip' - * [.retrieveForCache([_], [__], [key])](#MobileKeyword.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ Promise.<TYPE.MetadataTypeItemObj> - * [.create(metadata)](#MobileKeyword.create) ⇒ Promise - * [.update(metadata)](#MobileKeyword.update) ⇒ Promise - * [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - * [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ Object - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileKeyword._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.preDeployTasks(metadata, deployDir)](#MobileKeyword.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileKeyword.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileKeyword.postUpdateTasks) ⇒ void - * [._mergeCode(metadata, deployDir, [templateName])](#MobileKeyword._mergeCode) ⇒ Promise.<string> - * [.deleteByKey(key)](#MobileKeyword.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#MobileKeyword.postDeleteTasks) ⇒ void - * [.getFilesToCommit(keyArr)](#MobileKeyword.getFilesToCommit) ⇒ Array.<string> - - - -### MobileKeyword.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords -Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ TYPE.MetadataTypeMap -Builds map of metadata entries mapped to their keyfields - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.MetadataTypeMap - keyField => metadata map - -| Param | Type | Description | -| --- | --- | --- | -| body | object | json of response body | -| [singleRetrieve] | string \| number | key of single item to filter by | - - - -### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ 'create' \| 'update' \| 'skip' -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: 'create' \| 'update' \| 'skip' - action to take - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.MetadataTypeItemDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.MetadataTypeItem> | list of items to create | - - - -### MobileKeyword.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ Promise.<TYPE.MetadataTypeItemObj> -retrieve an item and create a template from it - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItemObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| key | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### MobileKeyword.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileKeyword.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileKeyword.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void -manages post retrieve steps - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: TYPE.CodeExtractItem \| TYPE.MetadataTypeItem \| void - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object -helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Object - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| metadataScript | string | the code of the file | - - - -### MobileKeyword.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MobileKeyword.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### MobileKeyword.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares an event definition for deployment - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileKeyword | -| deployDir | string | directory of deploy files | - - - -### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) - -**Kind**: static method of [MobileKeyword](#MobileKeyword) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileKeyword.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<string> - content for metadata.script - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### MobileKeyword.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -### MobileKeyword.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [MobileKeyword](#MobileKeyword) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### MobileKeyword.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [MobileKeyword](#MobileKeyword) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## MobileMessage ⇐ [MetadataType](#MetadataType) -MobileMessage MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [MobileMessage](#MobileMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#MobileMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void - * [.retrieveForCache([_], [__], [key])](#MobileMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#MobileMessage.update) ⇒ Promise - * [.create(metadata)](#MobileMessage.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#MobileMessage._mergeCode) ⇒ Promise.<string> - * [.prepExtractedCode(code)](#MobileMessage.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#MobileMessage.getFilesToCommit) ⇒ Array.<string> - * [.postRetrieveTasks(metadata)](#MobileMessage.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.preDeployTasks(metadata, deployDir)](#MobileMessage.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(metadataEntry, apiResponse)](#MobileMessage.postCreateTasks) ⇒ void - * [.postUpdateTasks(metadataEntry, apiResponse)](#MobileMessage.postUpdateTasks) ⇒ void - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileMessage.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#MobileMessage._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.deleteByKey(id)](#MobileMessage.deleteByKey) ⇒ Promise.<boolean> - - - -### MobileMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> \| void -Retrieves Metadata of Mobile Keywords - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> \| void - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### MobileMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to retrieve | - - - -### MobileMessage.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileMessage.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<string> - code - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### MobileMessage.prepExtractedCode(code) ⇒ Object -helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested) - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Object - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| code | string | the code of the file | - - - -### MobileMessage.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### MobileMessage.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single query | - - - -### MobileMessage.preDeployTasks(metadata, deployDir) ⇒ TYPE.MetadataTypeItem -prepares an event definition for deployment - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: TYPE.MetadataTypeItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single MobileMessage | -| deployDir | string | directory of deploy files | - - - -### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [MobileMessage](#MobileMessage) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void -helper for [updateREST](#MetadataType.updateREST) - -**Kind**: static method of [MobileMessage](#MobileMessage) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | - - - -### MobileMessage.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### MobileMessage.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### MobileMessage.deleteByKey(id) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit -! the endpoint expects the ID and not a key but for mcdev in this case key==id - -**Kind**: static method of [MobileMessage](#MobileMessage) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| id | string | Identifier of item | - - - -## Query ⇐ [MetadataType](#MetadataType) -Query MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Query](#Query) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.execute(keyArr)](#Query.execute) ⇒ Promise.<Array.<string>> - * [.retrieveForCache()](#Query.retrieveForCache) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Query.retrieveAsTemplate) ⇒ Promise.<{metadata: Query, type: string}> - * [.postRetrieveTasks(metadata)](#Query.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.create(query)](#Query.create) ⇒ Promise - * [.update(query)](#Query.update) ⇒ Promise - * [.preDeployTasks(metadata, deployDir)](#Query.preDeployTasks) ⇒ Promise.<TYPE.QueryItem> - * [.applyTemplateValues(code, templateVariables)](#Query.applyTemplateValues) ⇒ string - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Query.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.getFilesToCommit(keyArr)](#Query.getFilesToCommit) ⇒ Array.<string> - * [.getErrorsREST(ex)](#Query.getErrorsREST) ⇒ Array.<string> \| void - * [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void - * [.postDeployTasks(upsertResults)](#Query.postDeployTasks) - - - -### Query.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves Metadata of queries - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Query.execute(keyArr) ⇒ Promise.<Array.<string>> -a function to start query execution via API - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<string>> - Returns list of keys that were executed successfully - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}> -Retrieves query metadata for caching - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: TYPE.QueryMap, type: string}> - Promise of metadata - - -### Query.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: Query, type: string}> -Retrieve a specific Query by Name - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<{metadata: Query, type: string}> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Query.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Query](#Query) -**Returns**: TYPE.CodeExtractItem - Array with one metadata object and one query string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.QueryItem | a single query | - - - -### Query.create(query) ⇒ Promise -Creates a single query - -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| query | TYPE.QueryItem | a single query | - - - -### Query.update(query) ⇒ Promise -Updates a single query - -**Kind**: static method of [Query](#Query) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| query | TYPE.QueryItem | a single query | - - - -### Query.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.QueryItem> -prepares a Query for deployment - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<TYPE.QueryItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.QueryItem | a single query activity | -| deployDir | string | directory of deploy files | - - - -### Query.applyTemplateValues(code, templateVariables) ⇒ string -helper for [buildDefinitionForNested](#Query.buildDefinitionForNested) -searches extracted SQL file for template variables and applies the market values - -**Kind**: static method of [Query](#Query) -**Returns**: string - code with markets applied - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code from extracted code | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Query.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### Query.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.QueryItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -queries are saved as 1 json and 1 sql file. both files need to be run through templating -``` - - -### Query.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Query.getErrorsREST(ex) ⇒ Array.<string> \| void -Standardizes a check for multiple messages but adds query specific filters to error texts - -**Kind**: static method of [Query](#Query) -**Returns**: Array.<string> \| void - formatted Error Message - -| Param | Type | Description | -| --- | --- | --- | -| ex | object | response payload from REST API | - - - -### Query.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Query](#Query) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Query.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [Query](#Query) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### Query.postDeployTasks(upsertResults) -Gets executed after deployment of metadata type - -**Kind**: static method of [Query](#Query) - -| Param | Type | Description | -| --- | --- | --- | -| upsertResults | TYPE.MetadataTypeMap | metadata mapped by their keyField as returned by update/create | - - - -## Role ⇐ [MetadataType](#MetadataType) -ImportFile MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Role](#Role) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [___], [key])](#Role.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.preDeployTasks(metadata)](#Role.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.create(metadata)](#Role.create) ⇒ Promise - * [.update(metadata)](#Role.update) ⇒ Promise - * [.document([metadata])](#Role.document) ⇒ Promise.<void> - * [._traverseRoles(role, element, [permission], [isAllowed])](#Role._traverseRoles) ⇒ void - - - -### Role.retrieve(retrieveDir, _, [___], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Gets metadata from Marketing Cloud - -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Metadata store object - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | -| [___] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Role.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -Gets executed before deploying metadata - -**Kind**: static method of [Role](#Role) -**Returns**: TYPE.MetadataTypeItem - Promise of a single metadata item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | - - - -### Role.create(metadata) ⇒ Promise -Create a single Role. - -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### Role.update(metadata) ⇒ Promise -Updates a single Role. - -**Kind**: static method of [Role](#Role) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### Role.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles - -**Kind**: static method of [Role](#Role) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | role definitions | - - - -### Role.\_traverseRoles(role, element, [permission], [isAllowed]) ⇒ void -iterates through permissions to output proper row-names for nested permissionss - -**Kind**: static method of [Role](#Role) - -| Param | Type | Description | -| --- | --- | --- | -| role | string | name of the user role | -| element | object | data of the permission | -| [permission] | string | name of the permission | -| [isAllowed] | string | "true" / "false" from the | - - - -## Script ⇐ [MetadataType](#MetadataType) -Script MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Script](#Script) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#Script.retrieve) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveForCache()](#Script.retrieveForCache) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> - * [.retrieveAsTemplate(templateDir, name, templateVariables)](#Script.retrieveAsTemplate) ⇒ Promise.<{metadata: TYPE.Script, type: string}> - * [.update(script)](#Script.update) ⇒ Promise - * [.create(script)](#Script.create) ⇒ Promise - * [._mergeCode(metadata, deployDir, [templateName])](#Script._mergeCode) ⇒ Promise.<string> - * [.preDeployTasks(metadata, dir)](#Script.preDeployTasks) ⇒ TYPE.ScriptItem - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#Script.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#Script._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.postRetrieveTasks(metadata)](#Script.postRetrieveTasks) ⇒ TYPE.CodeExtractItem - * [.prepExtractedCode(metadataScript, metadataName)](#Script.prepExtractedCode) ⇒ Object - * [.getFilesToCommit(keyArr)](#Script.getFilesToCommit) ⇒ Array.<string> - * [.deleteByKey(customerKey)](#Script.deleteByKey) ⇒ Promise.<boolean> - * [.postDeleteTasks(customerKey)](#Script.postDeleteTasks) ⇒ void - - - -### Script.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves Metadata of Script -Endpoint /automation/v1/scripts/ return all Scripts with all details. - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### Script.retrieveForCache() ⇒ Promise.<{metadata: TYPE.ScriptMap, type: string}> -Retrieves script metadata for caching - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.ScriptMap, type: string}> - Promise - - -### Script.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ Promise.<{metadata: TYPE.Script, type: string}> -Retrieve a specific Script by Name - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<{metadata: TYPE.Script, type: string}> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where retrieved metadata directory will be saved | -| name | string | name of the metadata file | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | - - - -### Script.update(script) ⇒ Promise -Updates a single Script - -**Kind**: static method of [Script](#Script) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | - - - -### Script.create(script) ⇒ Promise -Creates a single Script - -**Kind**: static method of [Script](#Script) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| script | TYPE.MetadataTypeItem | a single Script | - - - -### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#Script.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<string> - content for metadata.script - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.ScriptItem | a single asset definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### Script.preDeployTasks(metadata, dir) ⇒ TYPE.ScriptItem -prepares a Script for deployment - -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.ScriptItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.ScriptItem | a single script activity definition | -| dir | string | directory of deploy files | - - - -### Script.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildDefinition](#MetadataType.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### Script.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplate](#MetadataType.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.ScriptItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### Script.postRetrieveTasks(metadata) ⇒ TYPE.CodeExtractItem -manages post retrieve steps - -**Kind**: static method of [Script](#Script) -**Returns**: TYPE.CodeExtractItem - a single item with code parts extracted - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.ScriptItem | a single item | - - - -### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object -helper for [postRetrieveTasks](#Script.postRetrieveTasks) and [_buildForNested](#Script._buildForNested) - -**Kind**: static method of [Script](#Script) -**Returns**: Object - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| metadataScript | string | the code of the file | -| metadataName | string | the name of the metadata | - - - -### Script.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [Script](#Script) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -### Script.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Script](#Script) -**Returns**: Promise.<boolean> - deletion success flag - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### Script.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [Script](#Script) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -## SendClassification ⇐ [MetadataType](#MetadataType) -SendClassification MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - - -### SendClassification.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [SendClassification](#SendClassification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -## TransactionalEmail ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalEmail MetadataType - -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) - -* [TransactionalEmail](#TransactionalEmail) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.update(metadata)](#TransactionalEmail.update) ⇒ Promise - * [.preDeployTasks(metadata)](#TransactionalEmail.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postCreateTasks(_, apiResponse)](#TransactionalEmail.postCreateTasks) ⇒ void - * [.postDeployTasks()](#TransactionalEmail.postDeployTasks) ⇒ void - * [.postRetrieveTasks(metadata)](#TransactionalEmail.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - * [.deleteByKey(key)](#TransactionalEmail.deleteByKey) ⇒ Promise.<boolean> - - - -### TransactionalEmail.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | how the item shall look after the update | - - - -### TransactionalEmail.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalEmail.postCreateTasks(_, apiResponse) ⇒ void -helper for [TransactionalEmail.createREST](TransactionalEmail.createREST) - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) - -| Param | Type | Description | -| --- | --- | --- | -| _ | TYPE.MetadataTypeItem | not used | -| apiResponse | object | varies depending on the API call | - - - -### TransactionalEmail.postDeployTasks() ⇒ void -Gets executed after deployment of metadata type - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) - - -### TransactionalEmail.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: TYPE.MetadataTypeItem - a single item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalEmail.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [TransactionalEmail](#TransactionalEmail) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -## TransactionalMessage ⇐ [MetadataType](#MetadataType) -TransactionalMessage MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [TransactionalMessage](#TransactionalMessage) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TransactionalMessage.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache([_], [__], [key])](#TransactionalMessage.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.update(metadata)](#TransactionalMessage.update) ⇒ Promise - * [.create(metadata)](#TransactionalMessage.create) ⇒ Promise - * [.deleteByKey(key)](#TransactionalMessage.deleteByKey) ⇒ Promise.<boolean> - - - -### TransactionalMessage.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### TransactionalMessage.retrieveForCache([_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves event definition metadata for caching - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| [_] | void | parameter not used | -| [__] | void | parameter not used | -| [key] | string | customer key of single item to cache | - - - -### TransactionalMessage.update(metadata) ⇒ Promise -Updates a single item - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalMessage.create(metadata) ⇒ Promise -Creates a single item - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalMessage.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [TransactionalMessage](#TransactionalMessage) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -## TransactionalPush ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalPush TransactionalMessage - -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) - -* [TransactionalPush](#TransactionalPush) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.preDeployTasks(metadata)](#TransactionalPush.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.postRetrieveTasks(metadata)](#TransactionalPush.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem - - - -### TransactionalPush.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares for deployment - -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalPush.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem -manages post retrieve steps - -**Kind**: static method of [TransactionalPush](#TransactionalPush) -**Returns**: TYPE.MetadataTypeItem - a single item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -## TransactionalSMS ⇐ [TransactionalMessage](#TransactionalMessage) -TransactionalSMS MetadataType - -**Kind**: global class -**Extends**: [TransactionalMessage](#TransactionalMessage) - -* [TransactionalSMS](#TransactionalSMS) ⇐ [TransactionalMessage](#TransactionalMessage) - * [.postDeleteTasks(customerKey)](#TransactionalSMS.postDeleteTasks) ⇒ void - * [.preDeployTasks(metadata, deployDir)](#TransactionalSMS.preDeployTasks) ⇒ Promise.<TYPE.MetadataTypeItem> - * [._mergeCode(metadata, deployDir, [templateName])](#TransactionalSMS._mergeCode) ⇒ Promise.<string> - * [.postRetrieveTasks(metadata)](#TransactionalSMS.postRetrieveTasks) ⇒ Promise.<TYPE.CodeExtractItem> - * [.prepExtractedCode(metadataScript)](#TransactionalSMS.prepExtractedCode) ⇒ Promise.<{fileExt:string, code:string}> - * [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildDefinitionForNested) ⇒ Promise.<Array.<Array.<string>>> - * [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#TransactionalSMS.buildTemplateForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode)](#TransactionalSMS._buildForNested) ⇒ Promise.<Array.<Array.<string>>> - * [._isHTML(code)](#TransactionalSMS._isHTML) ⇒ boolean - * [.getFilesToCommit(keyArr)](#TransactionalSMS.getFilesToCommit) ⇒ Array.<string> - - - -### TransactionalSMS.postDeleteTasks(customerKey) ⇒ void -clean up after deleting a metadata item - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of metadata item | - - - -### TransactionalSMS.preDeployTasks(metadata, deployDir) ⇒ Promise.<TYPE.MetadataTypeItem> -prepares for deployment - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.MetadataTypeItem> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | -| deployDir | string | directory of deploy files | - - - -### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string> -helper for [preDeployTasks](#TransactionalSMS.preDeployTasks) that loads extracted code content back into JSON - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<string> - content for metadata.script - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single definition | -| deployDir | string | directory of deploy files | -| [templateName] | string | name of the template used to built defintion (prior applying templating) | - - - -### TransactionalSMS.postRetrieveTasks(metadata) ⇒ Promise.<TYPE.CodeExtractItem> -manages post retrieve steps - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<TYPE.CodeExtractItem> - Array with one metadata object and one ssjs string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Promise.<{fileExt:string, code:string}> -helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested) - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<{fileExt:string, code:string}> - returns found extension and file content - -| Param | Type | Description | -| --- | --- | --- | -| metadataScript | string | the code of the file | - - - -### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition) -handles extracted code if any are found for complex types - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - - - -### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>> -helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate) -handles extracted code if any are found for complex types - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | - -**Example** -```js -scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating -``` - - -### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>> -helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested) -handles extracted code if any are found for complex types - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Promise.<Array.<Array.<string>>> - list of extracted files with path-parts provided as an array - -| Param | Type | Description | -| --- | --- | --- | -| templateDir | string | Directory where metadata templates are stored | -| targetDir | string \| Array.<string> | (List of) Directory where built definitions will be saved | -| metadata | TYPE.MetadataTypeItem | main JSON file that was read from file system | -| templateVariables | TYPE.TemplateMap | variables to be replaced in the metadata | -| templateName | string | name of the template to be built | -| mode | 'definition' \| 'template' | defines what we use this helper for | - - - -### TransactionalSMS.\_isHTML(code) ⇒ boolean -very simplified test for HTML code in our SMS - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: boolean - true if HTML is found - -| Param | Type | Description | -| --- | --- | --- | -| code | string | sms source code | - - - -### TransactionalSMS.getFilesToCommit(keyArr) ⇒ Array.<string> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [TransactionalSMS](#TransactionalSMS) -**Returns**: Array.<string> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## TriggeredSend ⇐ [MetadataType](#MetadataType) -MessageSendActivity MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#TriggeredSend.create) ⇒ Promise - * [.update(metadata)](#TriggeredSend.update) ⇒ Promise - * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean> - * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem - * [.refresh([keyArr], [checkKey])](#TriggeredSend.refresh) ⇒ Promise.<void> - * [.getKeysForValidTSDs(metadata)](#TriggeredSend.getKeysForValidTSDs) ⇒ Promise.<Array.<string>> - * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean> - - - -### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### TriggeredSend.create(metadata) ⇒ Promise -Create a single TSD. - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### TriggeredSend.update(metadata) ⇒ Promise -Updates a single TSD. - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | Identifier of data extension | - - - -### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -parses retrieved Metadata before saving - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem \| void - Array with one metadata object and one sql string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem -prepares a TSD for deployment - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: TYPE.MetadataTypeItem - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | of a single TSD | - - - -### TriggeredSend.refresh([keyArr], [checkKey]) ⇒ Promise.<void> -TSD-specific refresh method that finds active TSDs and refreshes them - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<void> - - - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [keyArr] | Array.<string> | | metadata keys | -| [checkKey] | boolean | true | whether to check if the key is valid | - - - -### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>> -helper for [refresh](#TriggeredSend.refresh) that extracts the keys from the TSD item map and eli - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<Array.<string>> - keyArr - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMapObj | TSD item map | - - - -### TriggeredSend.findRefreshableItems([assetLoaded]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -helper for [refresh](#TriggeredSend.refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](#TriggeredSend.retrieve) is using to avoid refreshing TSDs with broken dependencies - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of TSD item map - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| [assetLoaded] | boolean | false | if run after Asset.deploy via --refresh option this will skip caching assets | - - - -### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean> -helper for [refresh](#TriggeredSend.refresh) that pauses, publishes and starts a triggered send - -**Kind**: static method of [TriggeredSend](#TriggeredSend) -**Returns**: Promise.<boolean> - true if refresh was successful - -| Param | Type | Description | -| --- | --- | --- | -| key | string | external key of triggered send item | -| checkKey | boolean | whether to check if key exists on the server | - - - -## User ⇐ [MetadataType](#MetadataType) -MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [User](#User) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, _, [__], [key])](#User.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveForCache()](#User.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#User.create) ⇒ Promise - * [.update(metadata)](#User.update) ⇒ Promise - * [.preDeployTasks(metadata)](#User.preDeployTasks) ⇒ TYPE.UserDocument - * [.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#User.createOrUpdate) ⇒ void - * [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ Promise.<void> - * [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ object - * [.retrieveChangelog()](#User.retrieveChangelog) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.document([metadata])](#User.document) ⇒ Promise.<void> - * [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem \| void - - - -### User.retrieve(retrieveDir, _, [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| _ | void | unused parameter | -| [__] | void | unused parameter | -| [key] | string | customer key of single item to retrieve | - - - -### User.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves import definition metadata for caching - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise - - -### User.create(metadata) ⇒ Promise -Create a single item. - -**Kind**: static method of [User](#User) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### User.update(metadata) ⇒ Promise -Updates a single item. - -**Kind**: static method of [User](#User) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | single metadata entry | - - - -### User.preDeployTasks(metadata) ⇒ TYPE.UserDocument -prepares a item for deployment - -**Kind**: static method of [User](#User) -**Returns**: TYPE.UserDocument - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.UserDocument | of a single item | - - - -### User.createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ void -helper for [upsert](#MetadataType.upsert) - -**Kind**: static method of [User](#User) - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeMap | list of metadata | -| metadataKey | string | key of item we are looking at | -| hasError | boolean | error flag from previous code | -| metadataToUpdate | Array.<TYPE.UserDocumentDiff> | list of items to update | -| metadataToCreate | Array.<TYPE.UserDocument> | list of items to create | - - - -### User.postDeployTasks(upsertResults) ⇒ Promise.<void> -Gets executed after deployment of metadata type - -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - promise - -| Param | Type | Description | -| --- | --- | --- | -| upsertResults | TYPE.UserDocumentMap | metadata mapped by their keyField | - - - -### User.\_getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale]) ⇒ object -helper for [User._prepareRoleAssignments](User._prepareRoleAssignments) - -**Kind**: static method of [User](#User) -**Returns**: object - format needed by API - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| roleId | string | | role.ObjectID | -| roleName | string | | role.Name | -| userId | number | | user.AccountUserID | -| assignmentOnly | boolean | | if true, only assignment configuration will be returned | -| [isRoleRemovale] | boolean | false | if true, role will be removed from user; otherwise added | - - - -### User.retrieveChangelog() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata - -**Kind**: static method of [User](#User) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of item map - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [requestParams] | TYPE.SoapRequestParams | required for the specific request (filter for example) | -| [singleRetrieve] | string \| number | key of single item to filter by | -| [additionalFields] | Array.<string> | Returns specified fields even if their retrieve definition is not set to true | - - - -### User.document([metadata]) ⇒ Promise.<void> -Creates markdown documentation of all roles - -**Kind**: static method of [User](#User) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| [metadata] | TYPE.MetadataTypeMap | user list | - - - -### User.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void -manages post retrieve steps - -**Kind**: static method of [User](#User) -**Returns**: TYPE.MetadataTypeItem \| void - a single item - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single item | - - - -## Verification ⇐ [MetadataType](#MetadataType) -Verification MetadataType - -**Kind**: global class -**Extends**: [MetadataType](#MetadataType) - -* [Verification](#Verification) ⇐ [MetadataType](#MetadataType) - * [.retrieve(retrieveDir, [_], [__], key)](#Verification.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.handleRESTErrors(ex, id)](#Verification.handleRESTErrors) ⇒ null - * [.retrieveForCache()](#Verification.retrieveForCache) ⇒ Promise.<TYPE.MetadataTypeMapObj> - * [.create(metadata)](#Verification.create) ⇒ Promise - * [.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields)](#Verification.postCreateTasks) ⇒ void - * [.update(metadata)](#Verification.update) ⇒ Promise - * [.preDeployTasks(metadata)](#Verification.preDeployTasks) ⇒ TYPE.VerificationItem - * [.postRetrieveTasks(metadata)](#Verification.postRetrieveTasks) ⇒ TYPE.VerificationItem - * [.deleteByKey(key)](#Verification.deleteByKey) ⇒ Promise.<boolean> - - - -### Verification.retrieve(retrieveDir, [_], [__], key) ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Verification Activity. - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - -| Param | Type | Description | -| --- | --- | --- | -| retrieveDir | string | Directory where retrieved metadata directory will be saved | -| [_] | void | unused parameter | -| [__] | void | unused parameter | -| key | string | customer key of single item to retrieve | - - - -### Verification.handleRESTErrors(ex, id) ⇒ null -helper for [this.retrieveRESTcollection](this.retrieveRESTcollection) - -**Kind**: static method of [Verification](#Verification) -**Returns**: null - - - -| Param | Type | Description | -| --- | --- | --- | -| ex | Error | exception | -| id | string | id or key of item | - - - -### Verification.retrieveForCache() ⇒ Promise.<TYPE.MetadataTypeMapObj> -Retrieves Metadata of Data Extract Activity for caching - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<TYPE.MetadataTypeMapObj> - Promise of metadata - - -### Verification.create(metadata) ⇒ Promise -Creates a single Data Extract - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | - - - -### Verification.postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) ⇒ void -helper for [createREST](#MetadataType.createREST) - -**Kind**: static method of [Verification](#Verification) - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.MetadataTypeItem | a single metadata Entry | -| apiResponse | object | varies depending on the API call | -| metadataEntryWithAllFields | TYPE.MetadataTypeItem | like metadataEntry but before non-creatable fields were stripped | - - - -### Verification.update(metadata) ⇒ Promise -Updates a single Data Extract - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single Data Extract | - - - -### Verification.preDeployTasks(metadata) ⇒ TYPE.VerificationItem -prepares a verification for deployment - -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - metadata object - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | - - - -### Verification.postRetrieveTasks(metadata) ⇒ TYPE.VerificationItem -parses retrieved Metadata before saving - -**Kind**: static method of [Verification](#Verification) -**Returns**: TYPE.VerificationItem - Array with one metadata object and one sql string - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.VerificationItem | a single verification activity definition | - - - -### Verification.deleteByKey(key) ⇒ Promise.<boolean> -Delete a metadata item from the specified business unit - -**Kind**: static method of [Verification](#Verification) -**Returns**: Promise.<boolean> - deletion success status - -| Param | Type | Description | -| --- | --- | --- | -| key | string | Identifier of item | - - - -## Retriever -Retrieves metadata from a business unit and saves it to the local filesystem. - -**Kind**: global class - -* [Retriever](#Retriever) - * [new Retriever(properties, buObject)](#new_Retriever_new) - * [.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly])](#Retriever+retrieve) ⇒ Promise.<TYPE.MultiMetadataTypeList> - * [._getTypeDependencies(metadataTypes)](#Retriever+_getTypeDependencies) ⇒ Array.<TYPE.SupportedMetadataTypes> - - - -### new Retriever(properties, buObject) -Creates a Retriever, uses v2 auth if v2AuthOptions are passed. - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | -| buObject | TYPE.BuObject | properties for auth | - - - -### retriever.retrieve(metadataTypes, [namesOrKeys], [templateVariables], [changelogOnly]) ⇒ Promise.<TYPE.MultiMetadataTypeList> -Retrieve metadata of specified types into local file system and Retriever.metadata - -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Promise.<TYPE.MultiMetadataTypeList> - Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} - -| Param | Type | Description | -| --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | -| [namesOrKeys] | Array.<string> \| TYPE.TypeKeyCombo | name of Metadata to retrieveAsTemplate or list of keys for normal retrieval | -| [templateVariables] | TYPE.TemplateMap | Object of values which can be replaced (in case of templating) | -| [changelogOnly] | boolean | skip saving, only create json in memory | - - - -### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes> -helper for [Retriever.retrieve](Retriever.retrieve) to get all dependencies of the given types - -**Kind**: instance method of [Retriever](#Retriever) -**Returns**: Array.<TYPE.SupportedMetadataTypes> - unique list dependent metadata types - -| Param | Type | Description | -| --- | --- | --- | -| metadataTypes | Array.<TYPE.SupportedMetadataTypes> | list of metadata types to retrieve; can include subtypes! | - - - -## BusinessUnit -Helper that handles retrieval of BU info - -**Kind**: global constant - - -### BusinessUnit.refreshBUProperties(properties, credentialsName) ⇒ Promise.<boolean> -Refreshes BU names and ID's from MC instance - -**Kind**: static method of [BusinessUnit](#BusinessUnit) -**Returns**: Promise.<boolean> - success of refresh - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | current properties that have to be refreshed | -| credentialsName | string | identifying name of the installed package / project | - - - -## dataStore : TYPE.Cache -**Kind**: global constant - - -## Cli -CLI helper class - -**Kind**: global constant - -* [Cli](#Cli) - * [.initMcdevConfig()](#Cli.initMcdevConfig) ⇒ Promise.<boolean> - * [.addExtraCredential(properties)](#Cli.addExtraCredential) ⇒ Promise.<(boolean\|string)> - * [.postFixKeysReretrieve(type, dependentTypes)](#Cli.postFixKeysReretrieve) ⇒ Promise.<boolean> - * [.logExistingCredentials(properties)](#Cli.logExistingCredentials) ⇒ void - * [.updateCredential(properties, credName)](#Cli.updateCredential) ⇒ Promise.<boolean> - * [.getCredentialObject(properties, target, [isCredentialOnly], [allowAll])](#Cli.getCredentialObject) ⇒ Promise.<TYPE.BuObject> - * [._selectBU(properties, [credential], [isCredentialOnly], [allowAll])](#Cli._selectBU) ⇒ Promise.<Array> - * [._setCredential(properties, [credName])](#Cli._setCredential) ⇒ Promise.<(boolean\|string)> - * [._askCredentials(properties, [credName])](#Cli._askCredentials) ⇒ Promise.<object> - * [.selectTypes(properties, [setTypesArr])](#Cli.selectTypes) ⇒ Promise.<void> - * [._summarizeSubtypes(responses, type)](#Cli._summarizeSubtypes) ⇒ void - * [.explainTypes()](#Cli.explainTypes) ⇒ Array.<object> - - - -### Cli.initMcdevConfig() ⇒ Promise.<boolean> -used when initially setting up a project. -loads default config and adds first credential - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<boolean> - success of init - - -### Cli.addExtraCredential(properties) ⇒ Promise.<(boolean\|string)> -Extends template file for properties.json - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<(boolean\|string)> - status - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | - - - -### Cli.postFixKeysReretrieve(type, dependentTypes) ⇒ Promise.<boolean> -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<boolean> - true if user wants to continue with retrieve - -| Param | Type | Description | -| --- | --- | --- | -| type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | -| dependentTypes | Array.<TYPE.SupportedMetadataTypes> | types that depent on type | - - - -### Cli.logExistingCredentials(properties) ⇒ void -helper that logs to cli which credentials are already existing in our config file - -**Kind**: static method of [Cli](#Cli) - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | - - - -### Cli.updateCredential(properties, credName) ⇒ Promise.<boolean> -Extends template file for properties.json -update credentials - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<boolean> - success of update - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| credName | string | name of credential that needs updating | - - - -### Cli.getCredentialObject(properties, target, [isCredentialOnly], [allowAll]) ⇒ Promise.<TYPE.BuObject> -Returns Object with parameters required for accessing API - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<TYPE.BuObject> - credential to be used for Business Unit - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | object of all configuration including credentials | -| target | string | code of BU to use | -| [isCredentialOnly] | boolean \| string | true:don't ask for BU | string: name of BU | -| [allowAll] | boolean | Offer ALL as option in BU selection | - - - -### Cli.\_selectBU(properties, [credential], [isCredentialOnly], [allowAll]) ⇒ Promise.<Array> -helps select the right credential in case of bad initial input - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<Array> - selected credential/BU combo - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| [credential] | string | name of valid credential | -| [isCredentialOnly] | boolean | don't ask for BU if true | -| [allowAll] | boolean | Offer ALL as option in BU selection | - - - -### Cli.\_setCredential(properties, [credName]) ⇒ Promise.<(boolean\|string)> -helper around _askCredentials - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<(boolean\|string)> - success of refresh or credential name - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | from config file | -| [credName] | string | name of credential that needs updating | - - - -### Cli.\_askCredentials(properties, [credName]) ⇒ Promise.<object> -helper for [addExtraCredential](#Cli.addExtraCredential) - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<object> - credential info - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | from config file | -| [credName] | string | name of credential that needs updating | - - - -### Cli.selectTypes(properties, [setTypesArr]) ⇒ Promise.<void> -allows updating the metadata types that shall be retrieved - -**Kind**: static method of [Cli](#Cli) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| [setTypesArr] | Array.<string> | skip user prompt and overwrite with this list if given | - - - -### Cli.\_summarizeSubtypes(responses, type) ⇒ void -helper for [selectTypes](#Cli.selectTypes) that converts subtypes back to main type if all and only defaults were selected -this keeps the config automatically upgradable when we add new subtypes or change what is selected by default - -**Kind**: static method of [Cli](#Cli) - -| Param | Type | Description | -| --- | --- | --- | -| responses | object | wrapper object for respones | -| responses.selectedTypes | Array.<string> | what types the user selected | -| type | string | metadata type | - - - -### Cli.explainTypes() ⇒ Array.<object> -shows metadata type descriptions - -**Kind**: static method of [Cli](#Cli) -**Returns**: Array.<object> - list of supported types with their apiNames - - -## config -Central class for loading and validating properties from config and auth - -**Kind**: global constant - -* [config](#config) - * [.getProperties([silent], [isInit])](#config.getProperties) ⇒ Promise.<TYPE.Mcdevrc> - * [.checkProperties(properties, [silent])](#config.checkProperties) ⇒ Promise.<(boolean\|Array.<string>)> - * [.getDefaultProperties()](#config.getDefaultProperties) ⇒ Promise.<TYPE.Mcdevrc> - - - -### config.getProperties([silent], [isInit]) ⇒ Promise.<TYPE.Mcdevrc> -loads central properties from config file - -**Kind**: static method of [config](#config) -**Returns**: Promise.<TYPE.Mcdevrc> - central properties object - -| Param | Type | Description | -| --- | --- | --- | -| [silent] | boolean | omit throwing errors and print messages; assuming not silent if not set | -| [isInit] | boolean | don't tell the user to run init | - - - -### config.checkProperties(properties, [silent]) ⇒ Promise.<(boolean\|Array.<string>)> -check if the config file is correctly formatted and has values - -**Kind**: static method of [config](#config) -**Returns**: Promise.<(boolean\|Array.<string>)> - file structure ok OR list of fields to be fixed - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | javascript object in .mcdevrc.json | -| [silent] | boolean | set to true for internal use w/o cli output | - - - -### config.getDefaultProperties() ⇒ Promise.<TYPE.Mcdevrc> -defines how the properties.json should look like -used for creating a template and for checking if variables are set - -**Kind**: static method of [config](#config) -**Returns**: Promise.<TYPE.Mcdevrc> - default properties - - -## DevOps -DevOps helper class - -**Kind**: global constant - -* [DevOps](#DevOps) - * [.getDeltaList(properties, [range], [saveToDeployDir], [filterPaths], [commitHistory])](#DevOps.getDeltaList) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> - * [~delta](#DevOps.getDeltaList..delta) : Array.<TYPE.DeltaPkgItem> - * [~buObjects](#DevOps.getDeltaList..buObjects) : Object.<string, TYPE.BuObject> - * [~copied](#DevOps.getDeltaList..copied) : Array.<TYPE.DeltaPkgItem> - * [.buildDeltaDefinitions(properties, range, [diffArr], [commitHistory])](#DevOps.buildDeltaDefinitions) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> - * [~deltaDeployAll](#DevOps.buildDeltaDefinitions..deltaDeployAll) : Array.<TYPE.DeltaPkgItem> - * [.document(directory, jsonReport)](#DevOps.document) ⇒ void - * [.getFilesToCommit(properties, buObject, metadataType, keyArr)](#DevOps.getFilesToCommit) ⇒ Promise.<Array.<string>> - - - -### DevOps.getDeltaList(properties, [range], [saveToDeployDir], [filterPaths], [commitHistory]) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> -Extracts the delta between a commit and the current state for deployment. -Interactive commit selection if no commits are passed. - -**Kind**: static method of [DevOps](#DevOps) -**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | central properties object | -| [range] | string | git commit range | -| [saveToDeployDir] | boolean | if true, copy metadata changes into deploy directory | -| [filterPaths] | string | filter file paths that start with any specified path (comma separated) | -| [commitHistory] | number | cli option to override default commit history value in config | - - -* [.getDeltaList(properties, [range], [saveToDeployDir], [filterPaths], [commitHistory])](#DevOps.getDeltaList) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> - * [~delta](#DevOps.getDeltaList..delta) : Array.<TYPE.DeltaPkgItem> - * [~buObjects](#DevOps.getDeltaList..buObjects) : Object.<string, TYPE.BuObject> - * [~copied](#DevOps.getDeltaList..copied) : Array.<TYPE.DeltaPkgItem> - - - -#### getDeltaList~delta : Array.<TYPE.DeltaPkgItem> -**Kind**: inner constant of [getDeltaList](#DevOps.getDeltaList) - - -#### getDeltaList~buObjects : Object.<string, TYPE.BuObject> -**Kind**: inner constant of [getDeltaList](#DevOps.getDeltaList) - - -#### getDeltaList~copied : Array.<TYPE.DeltaPkgItem> -**Kind**: inner constant of [getDeltaList](#DevOps.getDeltaList) - - -### DevOps.buildDeltaDefinitions(properties, range, [diffArr], [commitHistory]) ⇒ Promise.<Array.<TYPE.DeltaPkgItem>> -wrapper around DevOps.getDeltaList, Builder.buildTemplate and M - -**Kind**: static method of [DevOps](#DevOps) -**Returns**: Promise.<Array.<TYPE.DeltaPkgItem>> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | project config file | -| range | string | git commit range | -| [diffArr] | Array.<TYPE.DeltaPkgItem> | instead of running git diff the method can also get a list of files to process | -| [commitHistory] | number | cli option to override default commit history value in config | - - - -#### buildDeltaDefinitions~deltaDeployAll : Array.<TYPE.DeltaPkgItem> -**Kind**: inner constant of [buildDeltaDefinitions](#DevOps.buildDeltaDefinitions) - - -### DevOps.document(directory, jsonReport) ⇒ void -create markdown file for deployment listing - -**Kind**: static method of [DevOps](#DevOps) - -| Param | Type | Description | -| --- | --- | --- | -| directory | string | - | -| jsonReport | object | - | - - - -### DevOps.getFilesToCommit(properties, buObject, metadataType, keyArr) ⇒ Promise.<Array.<string>> -should return only the json for all but asset, query and script that are saved as multiple files -additionally, the documentation for dataExtension and automation should be returned - -**Kind**: static method of [DevOps](#DevOps) -**Returns**: Promise.<Array.<string>> - list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | central properties object | -| buObject | TYPE.BuObject | references credentials | -| metadataType | string | metadata type to build | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## File -File extends fs-extra. It adds logger and util methods for file handling - -**Kind**: global constant - -* [File](#File) - * [.copyFile(from, to)](#File.copyFile) ⇒ object - * [.filterIllegalPathChars(path)](#File.filterIllegalPathChars) ⇒ string - * [.filterIllegalFilenames(filename)](#File.filterIllegalFilenames) ⇒ string - * [.reverseFilterIllegalFilenames(filename)](#File.reverseFilterIllegalFilenames) ⇒ string - * [.normalizePath(denormalizedPath)](#File.normalizePath) ⇒ string - * [.writeJSONToFile(directory, filename, content)](#File.writeJSONToFile) ⇒ Promise - * [.writePrettyToFile(directory, filename, filetype, content, [templateVariables])](#File.writePrettyToFile) ⇒ Promise.<boolean> - * [.beautify_beautyAmp(content, formatHTML)](#File.beautify_beautyAmp) ⇒ Promise.<string> - * [._beautify_prettier(directory, filename, filetype, content)](#File._beautify_prettier) ⇒ Promise.<string> - * [.writeToFile(directory, filename, filetype, content, [encoding])](#File.writeToFile) ⇒ Promise.<boolean> - * [.readJSONFile(directory, filename, sync, cleanPath)](#File.readJSONFile) ⇒ Promise.<object> \| object \| void - * [.readFilteredFilename(directory, filename, filetype, [encoding])](#File.readFilteredFilename) ⇒ Promise.<string> \| void - * [.readDirectories(directory, depth, [includeStem], [_stemLength])](#File.readDirectories) ⇒ Promise.<Array.<string>> - * [.readDirectoriesSync(directory, [depth], [includeStem], [_stemLength])](#File.readDirectoriesSync) ⇒ Array.<string> \| void - * [.saveConfigFile(properties)](#File.saveConfigFile) ⇒ Promise.<void> - * [.initPrettier([filetype])](#File.initPrettier) ⇒ Promise.<boolean> - - - -### File.copyFile(from, to) ⇒ object -copies a file from one path to another - -**Kind**: static method of [File](#File) -**Returns**: object - - results object - -| Param | Type | Description | -| --- | --- | --- | -| from | string | full filepath including name of existing file | -| to | string | full filepath including name where file should go | - - - -### File.filterIllegalPathChars(path) ⇒ string -makes sure Windows accepts path names - -**Kind**: static method of [File](#File) -**Returns**: string - - corrected string - -| Param | Type | Description | -| --- | --- | --- | -| path | string | filename or path | - - - -### File.filterIllegalFilenames(filename) ⇒ string -makes sure Windows accepts file names - -**Kind**: static method of [File](#File) -**Returns**: string - - corrected string - -| Param | Type | Description | -| --- | --- | --- | -| filename | string | filename or path | - - - -### File.reverseFilterIllegalFilenames(filename) ⇒ string -makes sure Windows accepts file names - -**Kind**: static method of [File](#File) -**Returns**: string - - corrected string - -| Param | Type | Description | -| --- | --- | --- | -| filename | string | filename or path | - - - -### File.normalizePath(denormalizedPath) ⇒ string -Takes various types of path strings and formats into a platform specific path - -**Kind**: static method of [File](#File) -**Returns**: string - Path strings - -| Param | Type | Description | -| --- | --- | --- | -| denormalizedPath | string \| Array.<string> | directory the file will be written to | - - - -### File.writeJSONToFile(directory, filename, content) ⇒ Promise -Saves json content to a file in the local file system. Will create the parent directory if it does not exist - -**Kind**: static method of [File](#File) -**Returns**: Promise - Promise - -| Param | Type | Description | -| --- | --- | --- | -| directory | string \| Array.<string> | directory the file will be written to | -| filename | string | name of the file without '.json' ending | -| content | object | filecontent | - - - -### File.writePrettyToFile(directory, filename, filetype, content, [templateVariables]) ⇒ Promise.<boolean> -Saves beautified files in the local file system. Will create the parent directory if it does not exist -! Important: run 'await File.initPrettier()' in your MetadataType.retrieve() once before hitting this - -**Kind**: static method of [File](#File) -**Returns**: Promise.<boolean> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| directory | string \| Array.<string> | directory the file will be written to | -| filename | string | name of the file without suffix | -| filetype | string | filetype ie. JSON or SSJS | -| content | string | filecontent | -| [templateVariables] | TYPE.TemplateMap | templating variables to be replaced in the metadata | - - - -### File.beautify\_beautyAmp(content, formatHTML) ⇒ Promise.<string> -helper for [writePrettyToFile](#File.writePrettyToFile), applying beautyAmp onto given stringified content - -**Kind**: static method of [File](#File) -**Returns**: Promise.<string> - original string on error; formatted string on success - -| Param | Type | Description | -| --- | --- | --- | -| content | string | filecontent | -| formatHTML | boolean | should we format HTML or not via prettier included in beautyAmp | - - - -### File.\_beautify\_prettier(directory, filename, filetype, content) ⇒ Promise.<string> -helper for [writePrettyToFile](#File.writePrettyToFile), applying prettier onto given stringified content -! Important: run 'await File.initPrettier()' in your MetadataType.retrieve() once before hitting this - -**Kind**: static method of [File](#File) -**Returns**: Promise.<string> - original string on error; formatted string on success - -| Param | Type | Description | -| --- | --- | --- | -| directory | string \| Array.<string> | directory the file will be written to | -| filename | string | name of the file without suffix | -| filetype | string | filetype ie. JSON or SSJS | -| content | string | filecontent | - - - -### File.writeToFile(directory, filename, filetype, content, [encoding]) ⇒ Promise.<boolean> -Saves text content to a file in the local file system. Will create the parent directory if it does not exist - -**Kind**: static method of [File](#File) -**Returns**: Promise.<boolean> - Promise - -| Param | Type | Description | -| --- | --- | --- | -| directory | string \| Array.<string> | directory the file will be written to | -| filename | string | name of the file without '.json' ending | -| filetype | string | filetype suffix | -| content | string | filecontent | -| [encoding] | object | added for certain file types (like images) | - - - -### File.readJSONFile(directory, filename, sync, cleanPath) ⇒ Promise.<object> \| object \| void -Saves json content to a file in the local file system. Will create the parent directory if it does not exist - -**Kind**: static method of [File](#File) -**Returns**: Promise.<object> \| object \| void - Promise or JSON object depending on if async or not; void on error - -| Param | Type | Description | -| --- | --- | --- | -| directory | string \| Array.<string> | directory where the file is stored | -| filename | string | name of the file without '.json' ending | -| sync | boolean | should execute sync (default is async) | -| cleanPath | boolean | should execute sync (default is true) | - - - -### File.readFilteredFilename(directory, filename, filetype, [encoding]) ⇒ Promise.<string> \| void -reads file from local file system. - -**Kind**: static method of [File](#File) -**Returns**: Promise.<string> \| void - file contents; void on error - -| Param | Type | Description | -| --- | --- | --- | -| directory | string \| Array.<string> | directory where the file is stored | -| filename | string | name of the file without '.json' ending | -| filetype | string | filetype suffix | -| [encoding] | string | read file with encoding (defaults to utf-8) | - - - -### File.readDirectories(directory, depth, [includeStem], [_stemLength]) ⇒ Promise.<Array.<string>> -reads directories to a specific depth returning an array -of file paths to be iterated over - -**Kind**: static method of [File](#File) -**Returns**: Promise.<Array.<string>> - array of fully defined file paths - -| Param | Type | Description | -| --- | --- | --- | -| directory | string | directory to checkin | -| depth | number | how many levels to check (1 base) | -| [includeStem] | boolean | include the parent directory in the response | -| [_stemLength] | number | set recursively for subfolders. do not set manually! | - -**Example** -```js -['deploy/mcdev/bu1'] -``` - - -### File.readDirectoriesSync(directory, [depth], [includeStem], [_stemLength]) ⇒ Array.<string> \| void -reads directories to a specific depth returning an array -of file paths to be iterated over using sync api (required in constructors) -TODO - merge with readDirectories. so far the logic is really different - -**Kind**: static method of [File](#File) -**Returns**: Array.<string> \| void - array of fully defined file paths; void on error - -| Param | Type | Description | -| --- | --- | --- | -| directory | string | directory to checkin | -| [depth] | number | how many levels to check (1 base) | -| [includeStem] | boolean | include the parent directory in the response | -| [_stemLength] | number | set recursively for subfolders. do not set manually! | - -**Example** -```js -['deploy/mcdev/bu1'] -``` - - -### File.saveConfigFile(properties) ⇒ Promise.<void> -helper that splits the config back into auth & config parts to save them separately - -**Kind**: static method of [File](#File) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | central properties object | - - - -### File.initPrettier([filetype]) ⇒ Promise.<boolean> -Initalises Prettier formatting lib async. - -**Kind**: static method of [File](#File) -**Returns**: Promise.<boolean> - success of config load - -| Param | Type | Description | -| --- | --- | --- | -| [filetype] | string | filetype ie. JSON or SSJS | - - - -## Init -CLI helper class - -**Kind**: global constant - -* [Init](#Init) - * [.fixMcdevConfig(properties)](#Init.fixMcdevConfig) ⇒ Promise.<boolean> - * [.createIdeConfigFiles(versionBeforeUpgrade)](#Init.createIdeConfigFiles) ⇒ Promise.<boolean> - * [._updateLeaf(propertiersCur, defaultPropsCur, fieldName)](#Init._updateLeaf) ⇒ void - * [._getForcedUpdateList(projectVersion)](#Init._getForcedUpdateList) ⇒ Promise.<Array.<string>> - * [._createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent])](#Init._createIdeConfigFile) ⇒ Promise.<boolean> - * [.upgradeAuthFile()](#Init.upgradeAuthFile) ⇒ Promise.<boolean> - * [.initGitRepo()](#Init.initGitRepo) ⇒ Promise.<{status: string, repoName: string}> - * [.gitPush()](#Init.gitPush) ⇒ void - * [._addGitRemote()](#Init._addGitRemote) ⇒ string - * [._updateGitConfigUser()](#Init._updateGitConfigUser) ⇒ void - * [._getGitConfigUser()](#Init._getGitConfigUser) ⇒ Promise.<{'user.name': string, 'user.email': string}> - * [.initProject(properties, credentialName)](#Init.initProject) ⇒ Promise.<void> - * [.joinProject()](#Init.joinProject) ⇒ Promise.<void> - * [._initMarkets()](#Init._initMarkets) - * [._downloadAllBUs(bu, gitStatus)](#Init._downloadAllBUs) ⇒ Promise.<void> - * [.upgradeProject(properties, [initial], [repoName])](#Init.upgradeProject) ⇒ Promise.<boolean> - * [.installDependencies([repoName])](#Init.installDependencies) ⇒ Promise.<boolean> - * [._getDefaultPackageJson([currentContent])](#Init._getDefaultPackageJson) ⇒ Promise.<{script: object, author: string, license: string}> - - - -### Init.fixMcdevConfig(properties) ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | - - - -### Init.createIdeConfigFiles(versionBeforeUpgrade) ⇒ Promise.<boolean> -handles creation/update of all config file from the boilerplate - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - status of config file creation - -| Param | Type | Description | -| --- | --- | --- | -| versionBeforeUpgrade | string | 'x.y.z' | - - - -### Init.\_updateLeaf(propertiersCur, defaultPropsCur, fieldName) ⇒ void -recursive helper for [fixMcdevConfig](#Init.fixMcdevConfig) that adds missing settings - -**Kind**: static method of [Init](#Init) - -| Param | Type | Description | -| --- | --- | --- | -| propertiersCur | object | current sub-object of project settings | -| defaultPropsCur | object | current sub-object of default settings | -| fieldName | string | dot-concatenated object-path that needs adding | - - - -### Init.\_getForcedUpdateList(projectVersion) ⇒ Promise.<Array.<string>> -returns list of files that need to be updated - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<Array.<string>> - relevant files with path that need to be updated - -| Param | Type | Description | -| --- | --- | --- | -| projectVersion | string | version found in config file of the current project | - - - -### Init.\_createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent]) ⇒ Promise.<boolean> -handles creation/update of one config file from the boilerplate at a time - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| fileNameArr | Array.<string> | 0: path, 1: filename, 2: extension with dot | -| relevantForcedUpdates | Array.<string> | if fileNameArr is in this list we require an override | -| [boilerplateFileContent] | string | in case we cannot copy files 1:1 this can be used to pass in content | - - - -### Init.upgradeAuthFile() ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - - -### Init.initGitRepo() ⇒ Promise.<{status: string, repoName: string}> -check if git repo exists and otherwise create one - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{status: string, repoName: string}> - success flag - - -### Init.gitPush() ⇒ void -offer to push the new repo straight to the server - -**Kind**: static method of [Init](#Init) - - -### Init.\_addGitRemote() ⇒ string -offers to add the git remote origin - -**Kind**: static method of [Init](#Init) -**Returns**: string - repo name (optionally) - - -### Init.\_updateGitConfigUser() ⇒ void -checks global config and ask to config the user info and then store it locally - -**Kind**: static method of [Init](#Init) - - -### Init.\_getGitConfigUser() ⇒ Promise.<{'user.name': string, 'user.email': string}> -retrieves the global user.name and user.email values - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{'user.name': string, 'user.email': string}> - user.name and user.email - - -### Init.initProject(properties, credentialName) ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| credentialName | string | identifying name of the installed package / project | - - - -### Init.joinProject() ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - - -### Init.\_initMarkets() -helper for @initProject that optionally creates markets and market lists for all BUs - -**Kind**: static method of [Init](#Init) - - -### Init.\_downloadAllBUs(bu, gitStatus) ⇒ Promise.<void> -helper for [initProject](#Init.initProject) - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| bu | string | cred/bu or cred/* or * | -| gitStatus | string | signals what state the git repo is in | - - - -### Init.upgradeProject(properties, [initial], [repoName]) ⇒ Promise.<boolean> -wrapper around npm dependency & configuration file setup - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - success flag - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| [initial] | boolean | print message if not part of initial setup | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.installDependencies([repoName]) ⇒ Promise.<boolean> -initiates npm project and then -takes care of loading the pre-configured dependency list -from the boilerplate directory to them as dev-dependencies - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.\_getDefaultPackageJson([currentContent]) ⇒ Promise.<{script: object, author: string, license: string}> -ensure we have certain default values in our config - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{script: object, author: string, license: string}> - extended currentContent - -| Param | Type | Description | -| --- | --- | --- | -| [currentContent] | object | what was read from existing package.json file | - - - -## Init -CLI helper class - -**Kind**: global constant - -* [Init](#Init) - * [.fixMcdevConfig(properties)](#Init.fixMcdevConfig) ⇒ Promise.<boolean> - * [.createIdeConfigFiles(versionBeforeUpgrade)](#Init.createIdeConfigFiles) ⇒ Promise.<boolean> - * [._updateLeaf(propertiersCur, defaultPropsCur, fieldName)](#Init._updateLeaf) ⇒ void - * [._getForcedUpdateList(projectVersion)](#Init._getForcedUpdateList) ⇒ Promise.<Array.<string>> - * [._createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent])](#Init._createIdeConfigFile) ⇒ Promise.<boolean> - * [.upgradeAuthFile()](#Init.upgradeAuthFile) ⇒ Promise.<boolean> - * [.initGitRepo()](#Init.initGitRepo) ⇒ Promise.<{status: string, repoName: string}> - * [.gitPush()](#Init.gitPush) ⇒ void - * [._addGitRemote()](#Init._addGitRemote) ⇒ string - * [._updateGitConfigUser()](#Init._updateGitConfigUser) ⇒ void - * [._getGitConfigUser()](#Init._getGitConfigUser) ⇒ Promise.<{'user.name': string, 'user.email': string}> - * [.initProject(properties, credentialName)](#Init.initProject) ⇒ Promise.<void> - * [.joinProject()](#Init.joinProject) ⇒ Promise.<void> - * [._initMarkets()](#Init._initMarkets) - * [._downloadAllBUs(bu, gitStatus)](#Init._downloadAllBUs) ⇒ Promise.<void> - * [.upgradeProject(properties, [initial], [repoName])](#Init.upgradeProject) ⇒ Promise.<boolean> - * [.installDependencies([repoName])](#Init.installDependencies) ⇒ Promise.<boolean> - * [._getDefaultPackageJson([currentContent])](#Init._getDefaultPackageJson) ⇒ Promise.<{script: object, author: string, license: string}> - - - -### Init.fixMcdevConfig(properties) ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | - - - -### Init.createIdeConfigFiles(versionBeforeUpgrade) ⇒ Promise.<boolean> -handles creation/update of all config file from the boilerplate - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - status of config file creation - -| Param | Type | Description | -| --- | --- | --- | -| versionBeforeUpgrade | string | 'x.y.z' | - - - -### Init.\_updateLeaf(propertiersCur, defaultPropsCur, fieldName) ⇒ void -recursive helper for [fixMcdevConfig](#Init.fixMcdevConfig) that adds missing settings - -**Kind**: static method of [Init](#Init) - -| Param | Type | Description | -| --- | --- | --- | -| propertiersCur | object | current sub-object of project settings | -| defaultPropsCur | object | current sub-object of default settings | -| fieldName | string | dot-concatenated object-path that needs adding | - - - -### Init.\_getForcedUpdateList(projectVersion) ⇒ Promise.<Array.<string>> -returns list of files that need to be updated - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<Array.<string>> - relevant files with path that need to be updated - -| Param | Type | Description | -| --- | --- | --- | -| projectVersion | string | version found in config file of the current project | - - - -### Init.\_createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent]) ⇒ Promise.<boolean> -handles creation/update of one config file from the boilerplate at a time - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| fileNameArr | Array.<string> | 0: path, 1: filename, 2: extension with dot | -| relevantForcedUpdates | Array.<string> | if fileNameArr is in this list we require an override | -| [boilerplateFileContent] | string | in case we cannot copy files 1:1 this can be used to pass in content | - - - -### Init.upgradeAuthFile() ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - - -### Init.initGitRepo() ⇒ Promise.<{status: string, repoName: string}> -check if git repo exists and otherwise create one - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{status: string, repoName: string}> - success flag - - -### Init.gitPush() ⇒ void -offer to push the new repo straight to the server - -**Kind**: static method of [Init](#Init) - - -### Init.\_addGitRemote() ⇒ string -offers to add the git remote origin - -**Kind**: static method of [Init](#Init) -**Returns**: string - repo name (optionally) - - -### Init.\_updateGitConfigUser() ⇒ void -checks global config and ask to config the user info and then store it locally - -**Kind**: static method of [Init](#Init) - - -### Init.\_getGitConfigUser() ⇒ Promise.<{'user.name': string, 'user.email': string}> -retrieves the global user.name and user.email values - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{'user.name': string, 'user.email': string}> - user.name and user.email - - -### Init.initProject(properties, credentialName) ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| credentialName | string | identifying name of the installed package / project | - - - -### Init.joinProject() ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - - -### Init.\_initMarkets() -helper for @initProject that optionally creates markets and market lists for all BUs - -**Kind**: static method of [Init](#Init) - - -### Init.\_downloadAllBUs(bu, gitStatus) ⇒ Promise.<void> -helper for [initProject](#Init.initProject) - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| bu | string | cred/bu or cred/* or * | -| gitStatus | string | signals what state the git repo is in | - - - -### Init.upgradeProject(properties, [initial], [repoName]) ⇒ Promise.<boolean> -wrapper around npm dependency & configuration file setup - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - success flag - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| [initial] | boolean | print message if not part of initial setup | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.installDependencies([repoName]) ⇒ Promise.<boolean> -initiates npm project and then -takes care of loading the pre-configured dependency list -from the boilerplate directory to them as dev-dependencies - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.\_getDefaultPackageJson([currentContent]) ⇒ Promise.<{script: object, author: string, license: string}> -ensure we have certain default values in our config - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{script: object, author: string, license: string}> - extended currentContent - -| Param | Type | Description | -| --- | --- | --- | -| [currentContent] | object | what was read from existing package.json file | - - - -## Init -CLI helper class - -**Kind**: global constant - -* [Init](#Init) - * [.fixMcdevConfig(properties)](#Init.fixMcdevConfig) ⇒ Promise.<boolean> - * [.createIdeConfigFiles(versionBeforeUpgrade)](#Init.createIdeConfigFiles) ⇒ Promise.<boolean> - * [._updateLeaf(propertiersCur, defaultPropsCur, fieldName)](#Init._updateLeaf) ⇒ void - * [._getForcedUpdateList(projectVersion)](#Init._getForcedUpdateList) ⇒ Promise.<Array.<string>> - * [._createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent])](#Init._createIdeConfigFile) ⇒ Promise.<boolean> - * [.upgradeAuthFile()](#Init.upgradeAuthFile) ⇒ Promise.<boolean> - * [.initGitRepo()](#Init.initGitRepo) ⇒ Promise.<{status: string, repoName: string}> - * [.gitPush()](#Init.gitPush) ⇒ void - * [._addGitRemote()](#Init._addGitRemote) ⇒ string - * [._updateGitConfigUser()](#Init._updateGitConfigUser) ⇒ void - * [._getGitConfigUser()](#Init._getGitConfigUser) ⇒ Promise.<{'user.name': string, 'user.email': string}> - * [.initProject(properties, credentialName)](#Init.initProject) ⇒ Promise.<void> - * [.joinProject()](#Init.joinProject) ⇒ Promise.<void> - * [._initMarkets()](#Init._initMarkets) - * [._downloadAllBUs(bu, gitStatus)](#Init._downloadAllBUs) ⇒ Promise.<void> - * [.upgradeProject(properties, [initial], [repoName])](#Init.upgradeProject) ⇒ Promise.<boolean> - * [.installDependencies([repoName])](#Init.installDependencies) ⇒ Promise.<boolean> - * [._getDefaultPackageJson([currentContent])](#Init._getDefaultPackageJson) ⇒ Promise.<{script: object, author: string, license: string}> - - - -### Init.fixMcdevConfig(properties) ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | - - - -### Init.createIdeConfigFiles(versionBeforeUpgrade) ⇒ Promise.<boolean> -handles creation/update of all config file from the boilerplate - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - status of config file creation - -| Param | Type | Description | -| --- | --- | --- | -| versionBeforeUpgrade | string | 'x.y.z' | - - - -### Init.\_updateLeaf(propertiersCur, defaultPropsCur, fieldName) ⇒ void -recursive helper for [fixMcdevConfig](#Init.fixMcdevConfig) that adds missing settings - -**Kind**: static method of [Init](#Init) - -| Param | Type | Description | -| --- | --- | --- | -| propertiersCur | object | current sub-object of project settings | -| defaultPropsCur | object | current sub-object of default settings | -| fieldName | string | dot-concatenated object-path that needs adding | - - - -### Init.\_getForcedUpdateList(projectVersion) ⇒ Promise.<Array.<string>> -returns list of files that need to be updated - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<Array.<string>> - relevant files with path that need to be updated - -| Param | Type | Description | -| --- | --- | --- | -| projectVersion | string | version found in config file of the current project | - - - -### Init.\_createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent]) ⇒ Promise.<boolean> -handles creation/update of one config file from the boilerplate at a time - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| fileNameArr | Array.<string> | 0: path, 1: filename, 2: extension with dot | -| relevantForcedUpdates | Array.<string> | if fileNameArr is in this list we require an override | -| [boilerplateFileContent] | string | in case we cannot copy files 1:1 this can be used to pass in content | - - - -### Init.upgradeAuthFile() ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - - -### Init.initGitRepo() ⇒ Promise.<{status: string, repoName: string}> -check if git repo exists and otherwise create one - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{status: string, repoName: string}> - success flag - - -### Init.gitPush() ⇒ void -offer to push the new repo straight to the server - -**Kind**: static method of [Init](#Init) - - -### Init.\_addGitRemote() ⇒ string -offers to add the git remote origin - -**Kind**: static method of [Init](#Init) -**Returns**: string - repo name (optionally) - - -### Init.\_updateGitConfigUser() ⇒ void -checks global config and ask to config the user info and then store it locally - -**Kind**: static method of [Init](#Init) - - -### Init.\_getGitConfigUser() ⇒ Promise.<{'user.name': string, 'user.email': string}> -retrieves the global user.name and user.email values - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{'user.name': string, 'user.email': string}> - user.name and user.email - - -### Init.initProject(properties, credentialName) ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| credentialName | string | identifying name of the installed package / project | - - - -### Init.joinProject() ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - - -### Init.\_initMarkets() -helper for @initProject that optionally creates markets and market lists for all BUs - -**Kind**: static method of [Init](#Init) - - -### Init.\_downloadAllBUs(bu, gitStatus) ⇒ Promise.<void> -helper for [initProject](#Init.initProject) - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| bu | string | cred/bu or cred/* or * | -| gitStatus | string | signals what state the git repo is in | - - - -### Init.upgradeProject(properties, [initial], [repoName]) ⇒ Promise.<boolean> -wrapper around npm dependency & configuration file setup - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - success flag - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| [initial] | boolean | print message if not part of initial setup | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.installDependencies([repoName]) ⇒ Promise.<boolean> -initiates npm project and then -takes care of loading the pre-configured dependency list -from the boilerplate directory to them as dev-dependencies - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.\_getDefaultPackageJson([currentContent]) ⇒ Promise.<{script: object, author: string, license: string}> -ensure we have certain default values in our config - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{script: object, author: string, license: string}> - extended currentContent - -| Param | Type | Description | -| --- | --- | --- | -| [currentContent] | object | what was read from existing package.json file | - - - -## Init -CLI helper class - -**Kind**: global constant - -* [Init](#Init) - * [.fixMcdevConfig(properties)](#Init.fixMcdevConfig) ⇒ Promise.<boolean> - * [.createIdeConfigFiles(versionBeforeUpgrade)](#Init.createIdeConfigFiles) ⇒ Promise.<boolean> - * [._updateLeaf(propertiersCur, defaultPropsCur, fieldName)](#Init._updateLeaf) ⇒ void - * [._getForcedUpdateList(projectVersion)](#Init._getForcedUpdateList) ⇒ Promise.<Array.<string>> - * [._createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent])](#Init._createIdeConfigFile) ⇒ Promise.<boolean> - * [.upgradeAuthFile()](#Init.upgradeAuthFile) ⇒ Promise.<boolean> - * [.initGitRepo()](#Init.initGitRepo) ⇒ Promise.<{status: string, repoName: string}> - * [.gitPush()](#Init.gitPush) ⇒ void - * [._addGitRemote()](#Init._addGitRemote) ⇒ string - * [._updateGitConfigUser()](#Init._updateGitConfigUser) ⇒ void - * [._getGitConfigUser()](#Init._getGitConfigUser) ⇒ Promise.<{'user.name': string, 'user.email': string}> - * [.initProject(properties, credentialName)](#Init.initProject) ⇒ Promise.<void> - * [.joinProject()](#Init.joinProject) ⇒ Promise.<void> - * [._initMarkets()](#Init._initMarkets) - * [._downloadAllBUs(bu, gitStatus)](#Init._downloadAllBUs) ⇒ Promise.<void> - * [.upgradeProject(properties, [initial], [repoName])](#Init.upgradeProject) ⇒ Promise.<boolean> - * [.installDependencies([repoName])](#Init.installDependencies) ⇒ Promise.<boolean> - * [._getDefaultPackageJson([currentContent])](#Init._getDefaultPackageJson) ⇒ Promise.<{script: object, author: string, license: string}> - - - -### Init.fixMcdevConfig(properties) ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | - - - -### Init.createIdeConfigFiles(versionBeforeUpgrade) ⇒ Promise.<boolean> -handles creation/update of all config file from the boilerplate - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - status of config file creation - -| Param | Type | Description | -| --- | --- | --- | -| versionBeforeUpgrade | string | 'x.y.z' | - - - -### Init.\_updateLeaf(propertiersCur, defaultPropsCur, fieldName) ⇒ void -recursive helper for [fixMcdevConfig](#Init.fixMcdevConfig) that adds missing settings - -**Kind**: static method of [Init](#Init) - -| Param | Type | Description | -| --- | --- | --- | -| propertiersCur | object | current sub-object of project settings | -| defaultPropsCur | object | current sub-object of default settings | -| fieldName | string | dot-concatenated object-path that needs adding | - - - -### Init.\_getForcedUpdateList(projectVersion) ⇒ Promise.<Array.<string>> -returns list of files that need to be updated - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<Array.<string>> - relevant files with path that need to be updated - -| Param | Type | Description | -| --- | --- | --- | -| projectVersion | string | version found in config file of the current project | - - - -### Init.\_createIdeConfigFile(fileNameArr, relevantForcedUpdates, [boilerplateFileContent]) ⇒ Promise.<boolean> -handles creation/update of one config file from the boilerplate at a time - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| fileNameArr | Array.<string> | 0: path, 1: filename, 2: extension with dot | -| relevantForcedUpdates | Array.<string> | if fileNameArr is in this list we require an override | -| [boilerplateFileContent] | string | in case we cannot copy files 1:1 this can be used to pass in content | - - - -### Init.upgradeAuthFile() ⇒ Promise.<boolean> -helper method for this.upgradeProject that upgrades project config if needed - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - returns true if worked without errors - - -### Init.initGitRepo() ⇒ Promise.<{status: string, repoName: string}> -check if git repo exists and otherwise create one - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{status: string, repoName: string}> - success flag - - -### Init.gitPush() ⇒ void -offer to push the new repo straight to the server - -**Kind**: static method of [Init](#Init) - - -### Init.\_addGitRemote() ⇒ string -offers to add the git remote origin - -**Kind**: static method of [Init](#Init) -**Returns**: string - repo name (optionally) - - -### Init.\_updateGitConfigUser() ⇒ void -checks global config and ask to config the user info and then store it locally - -**Kind**: static method of [Init](#Init) - - -### Init.\_getGitConfigUser() ⇒ Promise.<{'user.name': string, 'user.email': string}> -retrieves the global user.name and user.email values - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{'user.name': string, 'user.email': string}> - user.name and user.email - - -### Init.initProject(properties, credentialName) ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| credentialName | string | identifying name of the installed package / project | - - - -### Init.joinProject() ⇒ Promise.<void> -Creates template file for properties.json - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - - -### Init.\_initMarkets() -helper for @initProject that optionally creates markets and market lists for all BUs - -**Kind**: static method of [Init](#Init) - - -### Init.\_downloadAllBUs(bu, gitStatus) ⇒ Promise.<void> -helper for [initProject](#Init.initProject) - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| bu | string | cred/bu or cred/* or * | -| gitStatus | string | signals what state the git repo is in | - - - -### Init.upgradeProject(properties, [initial], [repoName]) ⇒ Promise.<boolean> -wrapper around npm dependency & configuration file setup - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - success flag - -| Param | Type | Description | -| --- | --- | --- | -| properties | TYPE.Mcdevrc | config file's json | -| [initial] | boolean | print message if not part of initial setup | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.installDependencies([repoName]) ⇒ Promise.<boolean> -initiates npm project and then -takes care of loading the pre-configured dependency list -from the boilerplate directory to them as dev-dependencies - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<boolean> - install successful or error occured - -| Param | Type | Description | -| --- | --- | --- | -| [repoName] | string | if git URL was provided earlier, the repo name was extracted to use it for npm init | - - - -### Init.\_getDefaultPackageJson([currentContent]) ⇒ Promise.<{script: object, author: string, license: string}> -ensure we have certain default values in our config - -**Kind**: static method of [Init](#Init) -**Returns**: Promise.<{script: object, author: string, license: string}> - extended currentContent - -| Param | Type | Description | -| --- | --- | --- | -| [currentContent] | object | what was read from existing package.json file | - - - -## Util -Util that contains logger and simple util methods - -**Kind**: global constant - -* [Util](#Util) - * [.skipInteraction](#Util.skipInteraction) : TYPE.skipInteraction - * [.logger](#Util.logger) : TYPE.Logger - * [.filterObjByKeys(originalObj, [whitelistArr])](#Util.filterObjByKeys) ⇒ Object.<string, \*> - * [.includesStartsWith(arr, search)](#Util.includesStartsWith) ⇒ boolean - * [.includesStartsWithIndex(arr, search)](#Util.includesStartsWithIndex) ⇒ number - * [.checkMarket(market, properties)](#Util.checkMarket) ⇒ boolean - * [.verifyMarketList(mlName, properties)](#Util.verifyMarketList) - * [.signalFatalError()](#Util.signalFatalError) ⇒ void - * [.isTrue(attrValue)](#Util.isTrue) ⇒ boolean - * [.isFalse(attrValue)](#Util.isFalse) ⇒ boolean - * [._isValidType(selectedType, [handleOutside])](#Util._isValidType) ⇒ boolean - * [.getTypeAndSubType(selectedType)](#Util.getTypeAndSubType) ⇒ Array.<string> - * [.getRetrieveTypeChoices()](#Util.getRetrieveTypeChoices) ⇒ Array.<TYPE.SupportedMetadataTypes> - * [._createNewLoggerTransport([noLogFile])](#Util._createNewLoggerTransport) ⇒ object - * [.startLogger([restart], [noLogFile])](#Util.startLogger) ⇒ void - * [.metadataLogger(level, type, method, payload, [source])](#Util.metadataLogger) ⇒ void - * [.replaceByObject(str, obj)](#Util.replaceByObject) ⇒ string \| object - * [.inverseGet(objs, val)](#Util.inverseGet) ⇒ string - * [.getDependentMetadata(fixedType)](#Util.getDependentMetadata) ⇒ Array.<string> - * [.getMetadataHierachy(metadataTypes)](#Util.getMetadataHierachy) ⇒ Object.<string, Array.<string>> - * [.resolveObjPath(path, obj)](#Util.resolveObjPath) ⇒ any - * [.execSync(cmd, [args], [hideOutput])](#Util.execSync) ⇒ string \| void - * [.templateSearchResult(results, keyToSearch, searchValue)](#Util.templateSearchResult) ⇒ TYPE.MetadataTypeItem - * [.setLoggingLevel(argv)](#Util.setLoggingLevel) ⇒ void - * [.logBeta(type)](#Util.logBeta) - * [.getGrayMsg(msg)](#Util.getGrayMsg) ⇒ string - * [.logSubtypes(subTypeArr)](#Util.logSubtypes) ⇒ void - * [.getKeysString(keyArr, [isId])](#Util.getKeysString) ⇒ string - * [.sleep(ms)](#Util.sleep) ⇒ Promise.<void> - * [.getSsjs(code)](#Util.getSsjs) ⇒ string - * [.stringLike(testString, search)](#Util.stringLike) ⇒ boolean - * [.fieldsLike(metadata, [filters])](#Util.fieldsLike) ⇒ boolean - * [.capitalizeFirstLetter(str)](#Util.capitalizeFirstLetter) ⇒ string - - - -### Util.skipInteraction : TYPE.skipInteraction -**Kind**: static property of [Util](#Util) - - -### Util.logger : TYPE.Logger -Logger that creates timestamped log file in 'logs/' directory - -**Kind**: static property of [Util](#Util) - - -### Util.filterObjByKeys(originalObj, [whitelistArr]) ⇒ Object.<string, \*> -helper that allows filtering an object by its keys - -**Kind**: static method of [Util](#Util) -**Returns**: Object.<string, \*> - filtered object that only contains keys you provided - -| Param | Type | Description | -| --- | --- | --- | -| originalObj | Object.<string, \*> | object that you want to filter | -| [whitelistArr] | Array.<string> | positive filter. if not provided, returns originalObj without filter | - - - -### Util.includesStartsWith(arr, search) ⇒ boolean -extended Array.includes method that allows check if an array-element starts with a certain string - -**Kind**: static method of [Util](#Util) -**Returns**: boolean - found / not found - -| Param | Type | Description | -| --- | --- | --- | -| arr | Array.<string> | your array of strigns | -| search | string | the string you are looking for | - - - -### Util.includesStartsWithIndex(arr, search) ⇒ number -extended Array.includes method that allows check if an array-element starts with a certain string - -**Kind**: static method of [Util](#Util) -**Returns**: number - array index 0..n or -1 of not found - -| Param | Type | Description | -| --- | --- | --- | -| arr | Array.<string> | your array of strigns | -| search | string | the string you are looking for | - - - -### Util.checkMarket(market, properties) ⇒ boolean -check if a market name exists in current mcdev config - -**Kind**: static method of [Util](#Util) -**Returns**: boolean - found market or not - -| Param | Type | Description | -| --- | --- | --- | -| market | string | market localizations | -| properties | TYPE.Mcdevrc | local mcdev config | - - - -### Util.verifyMarketList(mlName, properties) -ensure provided MarketList exists and it's content including markets and BUs checks out - -**Kind**: static method of [Util](#Util) - -| Param | Type | Description | -| --- | --- | --- | -| mlName | string | name of marketList | -| properties | TYPE.Mcdevrc | General configuration to be used in retrieve | - - - -### Util.signalFatalError() ⇒ void -used to ensure the program tells surrounding software that an unrecoverable error occured - -**Kind**: static method of [Util](#Util) - - -### Util.isTrue(attrValue) ⇒ boolean -SFMC accepts multiple true values for Boolean attributes for which we are checking here. -The same problem occurs when evaluating boolean CLI flags - -**Kind**: static method of [Util](#Util) -**Returns**: boolean - attribute value == true ? true : false - -| Param | Type | Description | -| --- | --- | --- | -| attrValue | \* | value | - - - -### Util.isFalse(attrValue) ⇒ boolean -SFMC accepts multiple false values for Boolean attributes for which we are checking here. -The same problem occurs when evaluating boolean CLI flags - -**Kind**: static method of [Util](#Util) -**Returns**: boolean - attribute value == false ? true : false - -| Param | Type | Description | -| --- | --- | --- | -| attrValue | \* | value | - - - -### Util.\_isValidType(selectedType, [handleOutside]) ⇒ boolean -helper for Mcdev.retrieve, Mcdev.retrieveAsTemplate and Mcdev.deploy - -**Kind**: static method of [Util](#Util) -**Returns**: boolean - type ok or not - -| Param | Type | Description | -| --- | --- | --- | -| selectedType | TYPE.SupportedMetadataTypes | type or type-subtype | -| [handleOutside] | boolean | if the API reponse is irregular this allows you to handle it outside of this generic method | - - - -### Util.getTypeAndSubType(selectedType) ⇒ Array.<string> -helper that deals with extracting type and subtype - -**Kind**: static method of [Util](#Util) -**Returns**: Array.<string> - first elem is type, second elem is subType - -| Param | Type | Description | -| --- | --- | --- | -| selectedType | string | "type" or "type-subtype" | - - - -### Util.getRetrieveTypeChoices() ⇒ Array.<TYPE.SupportedMetadataTypes> -helper for getDefaultProperties() - -**Kind**: static method of [Util](#Util) -**Returns**: Array.<TYPE.SupportedMetadataTypes> - type choices - - -### Util.\_createNewLoggerTransport([noLogFile]) ⇒ object -wrapper around our standard winston logging to console and logfile - -**Kind**: static method of [Util](#Util) -**Returns**: object - initiated logger for console and file - -| Param | Type | Description | -| --- | --- | --- | -| [noLogFile] | boolean | optional flag to indicate if we should log to file; CLI logs are always on | - - - -### Util.startLogger([restart], [noLogFile]) ⇒ void -initiate winston logger - -**Kind**: static method of [Util](#Util) - -| Param | Type | Description | -| --- | --- | --- | -| [restart] | boolean | if true, logger will be restarted; otherwise, an existing logger will be used | -| [noLogFile] | boolean | if false, logger will log to file; otherwise, only to console | - - - -### Util.metadataLogger(level, type, method, payload, [source]) ⇒ void -Logger helper for Metadata functions - -**Kind**: static method of [Util](#Util) - -| Param | Type | Description | -| --- | --- | --- | -| level | string | of log (error, info, warn) | -| type | string | of metadata being referenced | -| method | string | name which log was called from | -| payload | \* | generic object which details the error | -| [source] | string | key/id of metadata which relates to error | - - - -### Util.replaceByObject(str, obj) ⇒ string \| object -replaces values in a JSON object string, based on a series of -key-value pairs (obj) - -**Kind**: static method of [Util](#Util) -**Returns**: string \| object - replaced version of str - -| Param | Type | Description | -| --- | --- | --- | -| str | string \| object | JSON object or its stringified version, which has values to be replaced | -| obj | TYPE.TemplateMap | key value object which contains keys to be replaced and values to be replaced with | - - - -### Util.inverseGet(objs, val) ⇒ string -get key of an object based on the first matching value - -**Kind**: static method of [Util](#Util) -**Returns**: string - key - -| Param | Type | Description | -| --- | --- | --- | -| objs | object | object of objects to be searched | -| val | string | value to be searched for | - - - -### Util.getDependentMetadata(fixedType) ⇒ Array.<string> -helper for Mcdev.fixKeys. Retrieve dependent metadata - -**Kind**: static method of [Util](#Util) -**Returns**: Array.<string> - array of types that depend on the given type - -| Param | Type | Description | -| --- | --- | --- | -| fixedType | string | type of the metadata passed as a parameter to fixKeys function | - - - -### Util.getMetadataHierachy(metadataTypes) ⇒ Object.<string, Array.<string>> -Returns Order in which metadata needs to be retrieved/deployed - -**Kind**: static method of [Util](#Util) -**Returns**: Object.<string, Array.<string>> - retrieve/deploy order as array - -| Param | Type | Description | -| --- | --- | --- | -| metadataTypes | Array.<string> | which should be retrieved/deployed | - - - -### Util.resolveObjPath(path, obj) ⇒ any -let's you dynamically walk down an object and get a value - -**Kind**: static method of [Util](#Util) -**Returns**: any - value of obj.path - -| Param | Type | Description | -| --- | --- | --- | -| path | string | 'fieldA.fieldB.fieldC' | -| obj | object | some parent object | - - - -### Util.execSync(cmd, [args], [hideOutput]) ⇒ string \| void -helper to run other commands as if run manually by user - -**Kind**: static method of [Util](#Util) -**Returns**: string \| void - output of command if hideOutput is true - -| Param | Type | Description | -| --- | --- | --- | -| cmd | string | to be executed command | -| [args] | Array.<string> | list of arguments | -| [hideOutput] | boolean | if true, output of command will be hidden from CLI | - - - -### Util.templateSearchResult(results, keyToSearch, searchValue) ⇒ TYPE.MetadataTypeItem -standardize check to ensure only one result is returned from template search - -**Kind**: static method of [Util](#Util) -**Returns**: TYPE.MetadataTypeItem - metadata to be used in building template - -| Param | Type | Description | -| --- | --- | --- | -| results | Array.<TYPE.MetadataTypeItem> | array of metadata | -| keyToSearch | string | the field which contains the searched value | -| searchValue | string | the value which is being looked for | - - - -### Util.setLoggingLevel(argv) ⇒ void -configures what is displayed in the console - -**Kind**: static method of [Util](#Util) - -| Param | Type | Description | -| --- | --- | --- | -| argv | object | list of command line parameters given by user | -| [argv.silent] | boolean | only errors printed to CLI | -| [argv.verbose] | boolean | chatty user CLI output | -| [argv.debug] | boolean | enables developer output & features | - - - -### Util.logBeta(type) -outputs a warning that the given type is still in beta - -**Kind**: static method of [Util](#Util) - -| Param | Type | Description | -| --- | --- | --- | -| type | string | api name of the type thats in beta | - - - -### Util.getGrayMsg(msg) ⇒ string -helper that wraps a message in the correct color codes to have them printed gray - -**Kind**: static method of [Util](#Util) -**Returns**: string - gray msg - -| Param | Type | Description | -| --- | --- | --- | -| msg | string | log message that should be wrapped with color codes | - - - -### Util.logSubtypes(subTypeArr) ⇒ void -helper to print the subtypes we filtered by - -**Kind**: static method of [Util](#Util) - -| Param | Type | Description | -| --- | --- | --- | -| subTypeArr | Array.<string> | list of subtypes to be printed | - - - -### Util.getKeysString(keyArr, [isId]) ⇒ string -helper to print the subtypes we filtered by - -**Kind**: static method of [Util](#Util) -**Returns**: string - string to be appended to log message - -| Param | Type | Description | -| --- | --- | --- | -| keyArr | Array.<string> \| string | list of subtypes to be printed | -| [isId] | boolean | optional flag to indicate if key is an id | - - - -### Util.sleep(ms) ⇒ Promise.<void> -pause execution of code; useful when multiple server calls are dependent on each other and might not be executed right away - -**Kind**: static method of [Util](#Util) -**Returns**: Promise.<void> - - promise to wait for - -| Param | Type | Description | -| --- | --- | --- | -| ms | number | time in miliseconds to wait | - - - -### Util.getSsjs(code) ⇒ string -helper for Asset.extractCode and Script.prepExtractedCode to determine if a code block is a valid SSJS block - -**Kind**: static method of [Util](#Util) -**Returns**: string - the SSJS code if code block is a valid SSJS block, otherwise null - -| Param | Type | Description | -| --- | --- | --- | -| code | string | code block to check | - -**Example** -```js -the following is invalid: - - - - the following is valid: - -``` - - -### Util.stringLike(testString, search) ⇒ boolean -allows us to filter just like with SQL's LIKE operator - -**Kind**: static method of [Util](#Util) -**Returns**: boolean - true if testString matches search - -| Param | Type | Description | -| --- | --- | --- | -| testString | string | field value to test | -| search | string | search string in SQL LIKE format | - - - -### Util.fieldsLike(metadata, [filters]) ⇒ boolean -returns true if no LIKE filter is defined or if all filters match - -**Kind**: static method of [Util](#Util) -**Returns**: boolean - true if no LIKE filter is defined or if all filters match - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.MetadataTypeItem | a single metadata item | -| [filters] | object | only used in recursive calls | - - - -### Util.capitalizeFirstLetter(str) ⇒ string -helper used by SOAP methods to ensure the type always uses an upper-cased first letter - -**Kind**: static method of [Util](#Util) -**Returns**: string - str with first letter capitalized - -| Param | Type | Description | -| --- | --- | --- | -| str | string | string to capitalize | - - - -## csvToArray(csv) ⇒ Array.<string> -helper to convert CSVs into an array. if only one value was given, it's also returned as an array - -**Kind**: global function -**Returns**: Array.<string> - values split into an array. - -| Param | Type | Description | -| --- | --- | --- | -| csv | string | potentially comma-separated value or null | - - - -## Mcdev.(methodName, businessUnit, [selectedType], [keys]) ⇒ Promise.<Object.<string, Array.<string>>> -run a method across BUs - -**Kind**: global function -**Returns**: Promise.<Object.<string, Array.<string>>> - key: business unit name, value: list of affected item keys - -| Param | Type | Description | -| --- | --- | --- | -| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | -| businessUnit | string | name of BU | -| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types | -| [keys] | Array.<string> | customerkey of the metadata | - - - -## Mcdev.(methodName, cred, bu, [type], keyArr) ⇒ Promise.<Array.<string>> -helper for [Mcdev.#runMethod](Mcdev.#runMethod) - -**Kind**: global function -**Returns**: Promise.<Array.<string>> - list of keys that were affected - -| Param | Type | Description | -| --- | --- | --- | -| methodName | 'execute' \| 'pause' \| 'fixKeys' | what to run | -| cred | string | name of Credential | -| bu | string | name of BU | -| [type] | TYPE.SupportedMetadataTypes | limit execution to given metadata type | -| keyArr | Array.<string> | customerkey of the metadata | - - - -## Mcdev.(selectedType, buObject) ⇒ Array.<string> -helper for [Mcdev.#runOnBU](Mcdev.#runOnBU) - -**Kind**: global function -**Returns**: Array.<string> - keyArr - -| Param | Type | Description | -| --- | --- | --- | -| selectedType | TYPE.SupportedMetadataTypes | limit execution to given metadata type | -| buObject | TYPE.BuObject | properties for auth | - - - -## Mcdev.(cred, bu, type, [keyArr]) ⇒ Promise.<Array.<string>> -Updates the key to match the name field - -**Kind**: global function -**Returns**: Promise.<Array.<string>> - list of keys that were affected - -| Param | Type | Description | -| --- | --- | --- | -| cred | string | name of Credential | -| bu | string | name of BU | -| type | TYPE.SupportedMetadataTypes | limit execution to given metadata type | -| [keyArr] | Array.<string> | customerkey of the metadata | - - - -## Automation.(metadata) ⇒ boolean -helper for [postRetrieveTasks](#Automation.postRetrieveTasks) and [execute](#Automation.execute) - -**Kind**: global function -**Returns**: boolean - true if the automation schedule is valid - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | a single automation | - - - -## Automation.(metadataMap, key) ⇒ Promise.<{key:string, response:object}> -helper for [execute](#Automation.execute) - -**Kind**: global function -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.AutomationMap | map of metadata | -| key | string | key of the metadata | - - - -## Automation.(metadataEntry) ⇒ Promise.<{key:string, response:object}> -helper for [execute](#Automation.execute) - -**Kind**: global function -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response - -| Param | Type | Description | -| --- | --- | --- | -| metadataEntry | TYPE.AutomationItem | metadata object | - - - -## Automation.(metadata) ⇒ Promise.<{key:string, response:object}> -helper for [pause](#Automation.pause) - -**Kind**: global function -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | automation metadata | - - - -## Automation.(metadata) -helper for [preDeployTasks](#Automation.preDeployTasks) and [execute](#Automation.execute) - -**Kind**: global function - -| Param | Type | Description | -| --- | --- | --- | -| metadata | TYPE.AutomationItem | metadata mapped by their keyField | - - - -## Automation.(metadataMap, key) ⇒ Promise.<void> -helper for [postDeployTasks](#Automation.postDeployTasks) - -**Kind**: global function -**Returns**: Promise.<void> - - - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | -| key | string | current customer key | - - - -## Automation.(metadataMap, originalMetadataMap, key, [oldKey]) ⇒ Promise.<{key:string, response:object}> -helper for [postDeployTasks](#Automation.postDeployTasks) - -**Kind**: global function -**Returns**: Promise.<{key:string, response:object}> - metadata key and API response - -| Param | Type | Description | -| --- | --- | --- | -| metadataMap | TYPE.AutomationMap | metadata mapped by their keyField | -| originalMetadataMap | TYPE.AutomationMap | metadata to be updated (contains additioanl fields) | -| key | string | current customer key | -| [oldKey] | string | old customer key before fixKey / changeKeyValue / changeKeyField | - - - -## DataExtension.(upsertedMetadata, originalMetadata, createdUpdated) ⇒ void -takes care of updating attribute groups on child BUs after an update to Shared DataExtensions -helper for [postDeployTasks](#DataExtension.postDeployTasks) -fixes an issue where shared data extensions are not visible in data designer on child BU; SF known issue: https://issues.salesforce.com/#q=W-11031095 - -**Kind**: global function - -| Param | Type | Description | -| --- | --- | --- | -| upsertedMetadata | TYPE.DataExtensionMap | metadata mapped by their keyField | -| originalMetadata | TYPE.DataExtensionMap | metadata to be updated (contains additioanl fields) | -| createdUpdated | Object | counter representing successful creates/updates | - - - -## DataExtension.() ⇒ Array.<string> -helper for [DataExtension.#fixShared](DataExtension.#fixShared) - -**Kind**: global function -**Returns**: Array.<string> - list of selected BU names - - -## DataExtension.(childBuName, buObjectParent, clientParent, sharedDataExtensionMap) ⇒ Promise.<Array.<string>> -helper for [DataExtension.#fixShared](DataExtension.#fixShared) - -**Kind**: global function -**Returns**: Promise.<Array.<string>> - updated shared DE keys on BU - -| Param | Type | Description | -| --- | --- | --- | -| childBuName | string | name of child BU to fix | -| buObjectParent | TYPE.BuObject | bu object for parent BU | -| clientParent | object | SDK for parent BU | -| sharedDataExtensionMap | Object.<string, string> | ID-Key relationship of shared data extensions | - - - -## DataExtension.(deId, deKey, buObjectChildBu, clientChildBu, buObjectParent, clientParent) ⇒ Promise.<boolean> -method that actually takes care of triggering the update for a particular BU-sharedDe combo -helper for [DataExtension.#fixShared_onBU](DataExtension.#fixShared_onBU) - -**Kind**: global function -**Returns**: Promise.<boolean> - flag that signals if the fix was successful - -| Param | Type | Description | -| --- | --- | --- | -| deId | string | data extension ObjectID | -| deKey | string | dataExtension key | -| buObjectChildBu | TYPE.BuObject | BU object for Child BU | -| clientChildBu | object | SDK for child BU | -| buObjectParent | TYPE.BuObject | BU object for Parent BU | -| clientParent | object | SDK for parent BU | - - - -## DataExtension.(buObjectChildBu, clientChildBu, deKey, deId) ⇒ Promise.<string> -add a new field to the shared DE to trigger an update to the data model -helper for [DataExtension.#fixShared_item](DataExtension.#fixShared_item) - -**Kind**: global function -**Returns**: Promise.<string> - randomSuffix - -| Param | Type | Description | -| --- | --- | --- | -| buObjectChildBu | TYPE.BuObject | BU object for Child BU | -| clientChildBu | object | SDK for child BU | -| deKey | string | dataExtension key | -| deId | string | dataExtension ObjectID | - - - -## DataExtension.(randomSuffix, buObjectParent, clientParent, deKey) ⇒ Promise.<string> -get ID of the field added by [DataExtension.#fixShared_item_addField](DataExtension.#fixShared_item_addField) on the shared DE via parent BU -helper for [DataExtension.#fixShared_item](DataExtension.#fixShared_item) - -**Kind**: global function -**Returns**: Promise.<string> - fieldObjectID - -| Param | Type | Description | -| --- | --- | --- | -| randomSuffix | string | - | -| buObjectParent | TYPE.BuObject | BU object for Parent BU | -| clientParent | object | SDK for parent BU | -| deKey | string | dataExtension key | - - - -## DataExtension.(randomSuffix, buObjectChildBu, clientChildBu, deKey, fieldObjectID) ⇒ Promise -delete the field added by [DataExtension.#fixShared_item_addField](DataExtension.#fixShared_item_addField) -helper for [DataExtension.#fixShared_item](DataExtension.#fixShared_item) - -**Kind**: global function -**Returns**: Promise - - - -| Param | Type | Description | -| --- | --- | --- | -| randomSuffix | string | - | -| buObjectChildBu | TYPE.BuObject | BU object for Child BU | -| clientChildBu | object | SDK for child BU | -| deKey | string | dataExtension key | -| fieldObjectID | string | field ObjectID | - - - -## getUserName(userList, item, fieldname) ⇒ string -**Kind**: global function -**Returns**: string - username or user id or 'n/a' - -| Param | Type | Description | -| --- | --- | --- | -| userList | Object.<string, string> | user-id > user-name map | -| item | Object.<string, string> | single metadata item | -| fieldname | string | name of field containing the info | - - - -## setupSDK(sessionKey, authObject) ⇒ [SDK](#SDK) -Returns an SDK instance to be used for API calls - -**Kind**: global function -**Returns**: [SDK](#SDK) - auth object - -| Param | Type | Description | -| --- | --- | --- | -| sessionKey | string | key for specific BU | -| authObject | TYPE.AuthObject | credentials for specific BU | - - - -## getActualJson(customerKey, type, subtype, [buName]) ⇒ Promise.<string> -gets file from Retrieve folder - -**Kind**: global function -**Returns**: Promise.<string> - file in string form - -| Param | Type | Default | Description | -| --- | --- | --- | --- | -| customerKey | string | | of metadata | -| type | string | | of metadata | -| subtype | string | | of metadata | -| [buName] | string | "testBU" | used when we need to test on ParentBU | - - - -## getActualFile(customerKey, type, subtype, ext) ⇒ string -gets file from Retrieve folder - -**Kind**: global function -**Returns**: string - file path - -| Param | Type | Description | -| --- | --- | --- | -| customerKey | string | of metadata | -| type | string | of metadata | -| subtype | string | of metadata | -| ext | string | file extension | - - - -## TypeKeyCombo : Object.<string, string> -object-key=metadata type, value=array of external keys - -**Kind**: global typedef - - -## MetadataTypeItemDiff : Object.<string, any> -key=customer key - -**Kind**: global typedef - - -## CodeExtractItem : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| json | MetadataTypeItem | metadata of one item w/o code | -| codeArr | [Array.<CodeExtract>](#CodeExtract) | list of code snippets in this item | -| subFolder | Array.<string> | mostly set to null, otherwise list of subfolders | - - - -## CodeExtract : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| subFolder | Array.<string> | mostly set to null, otherwise subfolders path split into elements | -| fileName | string | name of file w/o extension | -| fileExt | string | file extension | -| content | string | file content | -| [encoding] | 'base64' | optional for binary files | - - - -## CodeExtractItem : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| name | string | name | -| key | string | key | -| description | string | - | -| targetKey | string | key of target data extension | -| createdDate | string | e.g. "2020-09-14T01:42:03.017" | -| modifiedDate | string | e.g. "2020-09-14T01:42:03.017" | -| targetUpdateTypeName | 'Overwrite' \| 'Update' \| 'Append' | defines how the query writes into the target data extension | -| [targetUpdateTypeId] | 0 \| 1 \| 2 | mapped to targetUpdateTypeName via this.definition.targetUpdateTypeMapping | -| [targetId] | string | Object ID of DE (removed before save) | -| [targetDescription] | string | Description DE (removed before save) | -| isFrozen | boolean | looks like this is always set to false | -| [queryText] | string | contains SQL query with line breaks converted to '\n'. The content is extracted during retrieval and written into a separate *.sql file | -| [categoryId] | string | holds folder ID, replaced with r__folder_Path during retrieve | -| r__folder_Path | string | folder path in which this DE is saved | -| json | QueryItem | metadata of one item w/o code | -| codeArr | [Array.<CodeExtract>](#CodeExtract) | list of code snippets in this item | -| subFolder | Array.<string> | mostly set to null, otherwise list of subfolders | - - - -## ScriptMap : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| name | string | name | -| key | string | key | -| description | string | - | -| createdDate | string | e.g. "2020-09-14T01:42:03.017" | -| modifiedDate | string | e.g. "2020-09-14T01:42:03.017" | -| [script] | string | contains script with line breaks converted to '\n'. The content is extracted during retrieval and written into a separate *.ssjs file | -| [categoryId] | string | holds folder ID, replaced with r__folder_Path during retrieve | -| r__folder_Path | string | folder path in which this DE is saved | - - - -## AssetSubType : Object.<string, any> -**Kind**: global typedef - - -## DataExtensionFieldMap : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| [ObjectID] | string | id | -| [CustomerKey] | string | key in format [DEkey].[FieldName] | -| [DataExtension] | object | - | -| DataExtension.CustomerKey | string | key of DE | -| Name | string | name of field | -| [Name_new] | string | custom attribute that is only used when trying to rename a field from Name to Name_new | -| DefaultValue | string | empty string for not set | -| IsRequired | true \| false | - | -| IsPrimaryKey | true \| false | - | -| Ordinal | string | 1, 2, 3, ... | -| FieldType | 'Text' \| 'Number' \| 'Date' \| 'Boolean' \| 'Decimal' \| 'EmailAddress' \| 'Phone' \| 'Locale' | can only be set on create | -| Scale | string | the number of places after the decimal that the field can hold; example: "0","1", ... | - - - -## DataExtensionMap : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| CustomerKey | string | key | -| Name | string | name | -| Description | string | - | -| [CreatedDate] | string | iso format | -| [ModifiedDate] | string | iso format | -| IsSendable | true \| false | - | -| IsTestable | true \| false | - | -| SendableDataExtensionField | object | - | -| SendableDataExtensionField.Name | string | - | -| SendableSubscriberField | object | - | -| SendableSubscriberField.Name | string | - | -| Fields | Array.<DataExtensionFieldItem> | list of DE fields | -| r__folder_ContentType | 'dataextension' \| 'salesforcedataextension' \| 'synchronizeddataextension' \| 'shared\_dataextension' \| 'shared\_salesforcedataextension' | retrieved from associated folder | -| r__folder_Path | string | folder path in which this DE is saved | -| [CategoryID] | string | holds folder ID, replaced with r__folder_Path during retrieve | -| [r__dataExtensionTemplate_Name] | string | name of optionally associated DE template | -| [Template] | object | - | -| [Template.CustomerKey] | string | key of optionally associated DE teplate | - - - -## UserDocumentMap : object -key=customer key - -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| [ID] | string | equal to UserID; optional in update/create calls | -| UserID | string | equal to ID; required in update/create calls | -| [AccountUserID] | number | user.AccountUserID | -| c__AccountUserID | number | copy of AccountUserID | -| CustomerKey | string | user.CustomerKey | -| Name | string | user.Name | -| Email | string | user.Email | -| NotificationEmailAddress | string | user.NotificationEmailAddress | -| ActiveFlag | boolean | user.ActiveFlag === true ? '✓' : '-' | -| IsAPIUser | boolean | user.IsAPIUser === true ? '✓' : '-' | -| MustChangePassword | boolean | user.MustChangePassword === true ? '✓' : '-' | -| DefaultBusinessUnit | number | defaultBUName | -| c__AssociatedBusinessUnits | Array.<number> | associatedBus | -| [Roles] | object | (API only) | -| [Roles.Role] | Array.<object> | roles (API only) | -| c__RoleNamesGlobal | Array.<string> | roles | -| UserPermissions | Array.<string> | userPermissions | -| LastSuccessfulLogin | string | this.timeSinceDate(user.LastSuccessfulLogin) | -| CreatedDate | string | user.CreatedDate | -| ModifiedDate | string | user.ModifiedDate | -| Client | object | - | -| [Client.ID] | number | EID e.g:7281698 | -| Client.ModifiedBy | number | AccountUserID of user who last modified this user | -| c__type | 'User' \| 'Installed Package' | - | -| [IsLocked] | boolean | (API only) | -| [Unlock] | boolean | used to unlock a user that has IsLocked === true | -| c__IsLocked_readOnly | boolean | copy of IsLocked | -| c__TimeZoneName | string | name of timezone | -| [TimeZone] | object | (API only) | -| [TimeZone.Name] | string | (API only) | -| [TimeZone.ID] | string | (API only) | -| c__LocaleCode | 'en-US' \| 'fr-CA' \| 'fr-FR' \| 'de-DE' \| 'it-IT' \| 'ja-JP' \| 'pt-BR' \| 'es-419' \| 'es-ES' | fr-CA, en-US, ... | -| [Locale] | object | (API only) | -| [Locale.LocaleCode] | 'en-US' \| 'fr-CA' \| 'fr-FR' \| 'de-DE' \| 'it-IT' \| 'ja-JP' \| 'pt-BR' \| 'es-419' \| 'es-ES' | (API only) | - - - -## BusinessUnitAssignmentConfiguration : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| Client | object | wrapper | -| Client.ID | number | EID e.g:7281698 | -| [PartnerKey] | string | empty string | -| ID | number | User ID e.g:717133502 | -| [ObjectID] | string | empty string | -| [Delete] | number | 0,1 | -| BusinessUnitAssignmentConfiguration | [BusinessUnitAssignmentConfiguration](#BusinessUnitAssignmentConfiguration) | - | -| BusinessUnitIds | object | wrapper | -| BusinessUnitIds.BusinessUnitId | Array.<number> \| number | e.g:[518003624] | -| IsDelete | boolean | assign BU if false, remove assignment if true | - - - -## AutomationActivity : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| name | string | name (not key) of activity | -| [objectTypeId] | string | Id of assoicated activity type; see this.definition.activityTypeMapping | -| [activityObjectId] | string | Object Id of assoicated metadata item | -| [displayOrder] | number | order within step; starts with 1 or higher number | -| r__type | string | see this.definition.activityTypeMapping | - - - -## AutomationStep : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| name | string | description | -| [annotation] | string | equals AutomationStep.name | -| [step] | number | step iterator; starts with 1 | -| [stepNumber] | number | step iterator, automatically set during deployment | -| activities | [Array.<AutomationActivity>](#AutomationActivity) | - | - - - -## AutomationSchedule : object -REST format - -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| typeId | number | ? | -| startDate | string | example: '2021-05-07T09:00:00' | -| endDate | string | example: '2021-05-07T09:00:00' | -| icalRecur | string | example: 'FREQ=DAILY;UNTIL=20790606T160000;INTERVAL=1' | -| timezoneName | string | example: 'W. Europe Standard Time'; see this.definition.timeZoneMapping | -| [timezoneId] | number | see this.definition.timeZoneMapping | - - - -## AutomationScheduleSoap : object -SOAP format - -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| Recurrence | object | - | -| Recurrence.$ | object | {'xsi:type': keyStem + 'lyRecurrence'} | -| [Recurrence.YearlyRecurrencePatternType] | 'ByYear' | * currently not supported by tool * | -| [Recurrence.MonthlyRecurrencePatternType] | 'ByMonth' | * currently not supported by tool * | -| [Recurrence.WeeklyRecurrencePatternType] | 'ByWeek' | * currently not supported by tool * | -| [Recurrence.DailyRecurrencePatternType] | 'ByDay' | - | -| [Recurrence.MinutelyRecurrencePatternType] | 'Interval' | - | -| [Recurrence.HourlyRecurrencePatternType] | 'Interval' | - | -| [Recurrence.YearInterval] | number | 1..n * currently not supported by tool * | -| [Recurrence.MonthInterval] | number | 1..n * currently not supported by tool * | -| [Recurrence.WeekInterval] | number | 1..n * currently not supported by tool * | -| [Recurrence.DayInterval] | number | 1..n | -| [Recurrence.HourInterval] | number | 1..n | -| [Recurrence.MinuteInterval] | number | 1..n | -| _interval | number | internal variable for CLI output only | -| TimeZone | object | - | -| TimeZone.ID | number | AutomationSchedule.timezoneId | -| _timezoneString | string | internal variable for CLI output only | -| StartDateTime | string | AutomationSchedule.startDate | -| EndDateTime | string | AutomationSchedule.endDate | -| _StartDateTime | string | AutomationSchedule.startDate; internal variable for CLI output only | -| RecurrenceRangeType | 'EndOn' \| 'EndAfter' | set to 'EndOn' if AutomationSchedule.icalRecur contains 'UNTIL'; otherwise to 'EndAfter' | -| Occurrences | number | only exists if RecurrenceRangeType=='EndAfter' | - - - -## AutomationItem : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| [id] | string | Object Id | -| key | string | key | -| name | string | name | -| description | string | - | -| type | 'scheduled' \| 'triggered' | Starting Source = Schedule / File Drop | -| status | 'Scheduled' \| 'Running' \| 'Ready' \| 'Building' \| 'PausedSchedule' \| 'InactiveTrigger' | - | -| [schedule] | [AutomationSchedule](#AutomationSchedule) | only existing if type=scheduled | -| [fileTrigger] | object | only existing if type=triggered | -| fileTrigger.fileNamingPattern | string | file name with placeholders | -| fileTrigger.fileNamePatternTypeId | number | - | -| fileTrigger.folderLocationText | string | where to look for the fileNamingPattern | -| fileTrigger.isPublished | boolean | ? | -| fileTrigger.queueFiles | boolean | ? | -| fileTrigger.triggerActive | boolean | - | -| [startSource] | object | - | -| [startSource.schedule] | [AutomationSchedule](#AutomationSchedule) | rewritten to AutomationItem.schedule | -| [startSource.fileDrop] | object | rewritten to AutomationItem.fileTrigger | -| startSource.fileDrop.fileNamingPattern | string | file name with placeholders | -| startSource.fileDrop.fileNamePatternTypeId | string | - | -| startSource.fileDrop.folderLocation | string | - | -| startSource.fileDrop.queueFiles | boolean | - | -| startSource.typeId | number | - | -| steps | [Array.<AutomationStep>](#AutomationStep) | - | -| r__folder_Path | string | folder path | -| [categoryId] | string | holds folder ID, replaced with r__folder_Path during retrieve | - - - -## VerificationItem : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| dataVerificationDefinitionId | string | ID / Key | -| verificationType | 'IsEqualTo' \| 'IsLessThan' \| 'IsGreaterThan' \| 'IsOutsideRange' \| 'IsInsideRange' \| 'IsNotEqualTo' \| 'IsNotLessThan' \| 'IsNotGreaterThan' \| 'IsNotOutsideRange' \| 'IsNotInsideRange' | key | -| value1 | number | used for all verificationTypes; lower value for IsOutsideRange, IsInsideRange, IsNotOutsideRange, IsNotInsideRange | -| value2 | number | only used for IsOutsideRange, IsInsideRange, IsNotOutsideRange, IsNotInsideRange; otherwise set to 0 | -| shouldStopOnFailure | boolean | flag to stop automation if verification fails | -| shouldEmailOnFailure | boolean | flag to send email if verification fails | -| notificationEmailAddress | string | email address to send notification to; empty string if shouldEmailOnFailure=false | -| notificationEmailMessage | string | email message to send; empty string if shouldEmailOnFailure=false | -| createdBy | number | user id of creator | -| r__dataExtension_CustomerKey | string | key of target data extension | - - - -## SDK : Object.<string, AutomationItem> -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| file | string | relative path to file | -| changes | number | changed lines | -| insertions | number | added lines | -| deletions | number | deleted lines | -| binary | boolean | is a binary file | -| moved | boolean | git thinks this file was moved | -| [fromPath] | string | git thinks this relative path is where the file was before | -| type | SupportedMetadataTypes | metadata type | -| externalKey | string | key | -| name | string | name | -| gitAction | 'move' \| 'add/update' \| 'delete' | what git recognized as an action | -| _credential | string | mcdev credential name | -| _businessUnit | string | mcdev business unit name inside of _credential | - - - -## skipInteraction : object -signals what to insert automatically for things usually asked via wizard - -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| client_id | string | client id of installed package | -| client_secret | string | client secret of installed package | -| auth_url | string | tenant specific auth url of installed package | -| account_id | number | MID of the Parent Business Unit | -| credentialName | string | how you would like the credential to be named | -| gitRemoteUrl | string | URL of Git remote server | - - - -## AuthObject : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| client_id | string | client_id client_id for sfmc-sdk auth | -| client_secret | string | client_secret for sfmc-sdk auth | -| account_id | number | mid of business unit to auth against | -| auth_url | string | authentication base url | - - - -## SoapFilter : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| [continueRequest] | string | request id | -| [options] | object | additional options (CallsInConversation, Client, ConversationID, Priority, RequestType, SaveOptions, ScheduledTime, SendResponseTo, SequenceCode) | -| clientIDs | \* | ? | -| [filter] | [SoapFilter](#SoapFilter) | simple or complex complex | -| [QueryAllAccounts] | boolean | all BUs or just one | -| leftOperand | string \| [SoapFilter](#SoapFilter) | string for simple or a new filter-object for complex | -| operator | 'AND' \| 'OR' \| 'equals' \| 'notEquals' \| 'isNull' \| 'isNotNull' \| 'greaterThan' \| 'lessThan' \| 'greaterThanOrEqual' \| 'lessThanOrEqual' \| 'between' \| 'IN' \| 'like' | various options | -| [rightOperand] | string \| number \| boolean \| Array \| [SoapFilter](#SoapFilter) | string for simple or a new filter-object for complex; omit for isNull and isNotNull | - - - -## Mcdevrc : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| credentials | object | list of credentials | -| options | object | configure options for mcdev | -| directories | object | configure directories for mcdev to read/write to | -| directories.businessUnits | string | "businessUnits/" | -| directories.deploy | string | "deploy/" | -| directories.docs | string | "docs/" | -| directories.retrieve | string | "retrieve/" | -| directories.template | string | "template/" | -| directories.templateBuilds | string | ["retrieve/", "deploy/"] | -| markets | Object.<string, object> | templating variables grouped by markets | -| marketList | object | combination of markets and BUs for streamlined deployments | -| metaDataTypes | object | templating variables grouped by markets | -| metaDataTypes.retrieve | Array.<string> | define what types shall be downloaded by default during retrieve | -| metaDataTypes.documentOnRetrieve | Array.<string> | which types should be parsed & documented after retrieve | -| version | string | mcdev version that last updated the config file | - - - -## Logger : object -**Kind**: global typedef -**Properties** - -| Name | Type | Description | -| --- | --- | --- | -| info | function | (msg) print info message | -| warn | function | (msg) print warning message | -| verbose | function | (msg) additional messages that are not important | -| debug | function | (msg) print debug message | -| error | function | (msg) print error message | -| errorStack | function | (ex, msg) print error with trace message | - diff --git a/package-lock.json b/package-lock.json index 69daffa48..992acc09b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,6 @@ "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.6", "husky": "9.0.11", - "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", "mocha": "10.4.0", "mock-fs": "5.2.0", @@ -253,18 +252,6 @@ "node": ">=4" } }, - "node_modules/@babel/parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.5.tgz", - "integrity": "sha512-DFZMC9LJUG9PLOclRC32G63UXwzqS2koQC8dkx+PLdmt1xSePYpbT/NbsrJy8Q/muXz7o/h/d4A7Fuyixm559Q==", - "dev": true, - "bin": { - "parser": "bin/babel-parser.js" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", @@ -460,18 +447,6 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, - "node_modules/@jsdoc/salty": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@jsdoc/salty/-/salty-0.2.1.tgz", - "integrity": "sha512-JXwylDNSHa549N9uceDYu8D4GMXwSo3H8CCPYEQqxhhHpxD28+lRl2b3bS/caaPj5w1YD3SWtrficJNTnUjGpg==", - "dev": true, - "dependencies": { - "lodash": "^4.17.21" - }, - "engines": { - "node": ">=v12.0.0" - } - }, "node_modules/@kwsites/file-exists": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", @@ -609,28 +584,6 @@ "optional": true, "peer": true }, - "node_modules/@types/linkify-it": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-3.0.2.tgz", - "integrity": "sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==", - "dev": true - }, - "node_modules/@types/markdown-it": { - "version": "12.2.3", - "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", - "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", - "dev": true, - "dependencies": { - "@types/linkify-it": "*", - "@types/mdurl": "*" - } - }, - "node_modules/@types/mdurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-1.0.2.tgz", - "integrity": "sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==", - "dev": true - }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -844,27 +797,6 @@ "node": ">=6" } }, - "node_modules/ansi-escape-sequences": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz", - "integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==", - "dev": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=8.0.0" - } - }, - "node_modules/ansi-escape-sequences/node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/ansi-escapes": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", @@ -942,15 +874,6 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" }, - "node_modules/array-back": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-6.2.2.tgz", - "integrity": "sha512-gUAZ7HPyb4SJczXAMUXMGAvI976JoK3qEx9v1FTmeYuJj0IBiaKttG1ydtGKdkfqWkIkouke7nG8ufGy77+Cvw==", - "dev": true, - "engines": { - "node": ">=12.17" - } - }, "node_modules/array-buffer-byte-length": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", @@ -1122,12 +1045,6 @@ "readable-stream": "^3.4.0" } }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, "node_modules/boxen": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/boxen/-/boxen-7.1.1.tgz", @@ -1364,29 +1281,6 @@ "node": ">=14.14.0" } }, - "node_modules/cache-point": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/cache-point/-/cache-point-2.0.0.tgz", - "integrity": "sha512-4gkeHlFpSKgm3vm2gJN5sPqfmijYRFYCQ6tv5cLw0xVmT6r1z1vd4FNnpuOREco3cBs1G709sZ72LdgddKvL5w==", - "dev": true, - "dependencies": { - "array-back": "^4.0.1", - "fs-then-native": "^2.0.0", - "mkdirp2": "^1.0.4" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/cache-point/node_modules/array-back": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", - "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/cacheable-lookup": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz", @@ -1449,18 +1343,6 @@ } ] }, - "node_modules/catharsis": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.9.0.tgz", - "integrity": "sha512-prMTQVpcns/tzFgFVkVp6ak6RykZyWb3gu8ckUpd6YkTlacOd3DXGJjIpD4Q6zJirizvaiAjSSHlOsA+6sNh2A==", - "dev": true, - "dependencies": { - "lodash": "^4.17.15" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/chai": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.0.tgz", @@ -1716,19 +1598,6 @@ "node": ">=0.8" } }, - "node_modules/collect-all": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/collect-all/-/collect-all-1.0.4.tgz", - "integrity": "sha512-RKZhRwJtJEP5FWul+gkSMEnaK6H3AGPTTWOiRimCcs+rc/OmQE3Yhy1Q7A7KsdkG3ZXVdZq68Y6ONSdvkeEcKA==", - "dev": true, - "dependencies": { - "stream-connect": "^1.0.2", - "stream-via": "^1.0.4" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/color": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/color/-/color-3.2.1.tgz", @@ -1807,94 +1676,6 @@ "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" }, - "node_modules/command-line-args": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", - "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", - "dev": true, - "dependencies": { - "array-back": "^3.1.0", - "find-replace": "^3.0.0", - "lodash.camelcase": "^4.3.0", - "typical": "^4.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-args/node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/command-line-args/node_modules/typical": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", - "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/command-line-tool": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/command-line-tool/-/command-line-tool-0.8.0.tgz", - "integrity": "sha512-Xw18HVx/QzQV3Sc5k1vy3kgtOeGmsKIqwtFFoyjI4bbcpSgnw2CWVULvtakyw4s6fhyAdI6soQQhXc2OzJy62g==", - "dev": true, - "dependencies": { - "ansi-escape-sequences": "^4.0.0", - "array-back": "^2.0.0", - "command-line-args": "^5.0.0", - "command-line-usage": "^4.1.0", - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-tool/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/command-line-usage": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-4.1.0.tgz", - "integrity": "sha512-MxS8Ad995KpdAC0Jopo/ovGIroV/m0KHwzKfXxKag6FHOkGsH8/lv5yjgablcRxCJJC0oJeUMuO/gmaq+Wq46g==", - "dev": true, - "dependencies": { - "ansi-escape-sequences": "^4.0.0", - "array-back": "^2.0.0", - "table-layout": "^0.4.2", - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/command-line-usage/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/commander": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", @@ -1913,15 +1694,6 @@ "node": ">= 12.0.0" } }, - "node_modules/common-sequence": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/common-sequence/-/common-sequence-2.0.2.tgz", - "integrity": "sha512-jAg09gkdkrDO9EWTdXfv80WWH3yeZl5oT69fGfedBNS9pXUKYInVJ1bJ+/ht2+Moeei48TmSbQDYMc8EOx9G0g==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/common-tags": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", @@ -1968,24 +1740,6 @@ "proto-list": "~1.2.1" } }, - "node_modules/config-master": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/config-master/-/config-master-3.1.0.tgz", - "integrity": "sha1-ZnZjWQUFooO/JqSE1oSJ10xUhdo=", - "dev": true, - "dependencies": { - "walk-back": "^2.0.1" - } - }, - "node_modules/config-master/node_modules/walk-back": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-2.0.1.tgz", - "integrity": "sha1-VU4qnYdPrEeoywBr9EwvDEmYoKQ=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/configstore": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-6.0.0.tgz", @@ -2256,29 +2010,6 @@ "integrity": "sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==", "dev": true }, - "node_modules/dmd": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/dmd/-/dmd-6.2.0.tgz", - "integrity": "sha512-uXWxLF1H7TkUAuoHK59/h/ts5cKavm2LnhrIgJWisip4BVzPoXavlwyoprFFn2CzcahKYgvkfaebS6oxzgflkg==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "cache-point": "^2.0.0", - "common-sequence": "^2.0.2", - "file-set": "^4.0.2", - "handlebars": "^4.7.7", - "marked": "^4.2.3", - "object-get": "^2.1.1", - "reduce-flatten": "^3.0.1", - "reduce-unique": "^2.0.1", - "reduce-without": "^1.0.1", - "test-value": "^3.0.0", - "walk-back": "^5.1.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -2345,15 +2076,6 @@ "resolved": "https://registry.npmjs.org/enabled/-/enabled-2.0.0.tgz", "integrity": "sha512-AKrN98kuwOzMIdAizXGI86UFBoo26CL21UM763y1h/GMSJ4/OHU9k2YlsmBpyScFo/wbLzWQJBMCW4+IO3/+OQ==" }, - "node_modules/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" - } - }, "node_modules/env-paths": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-3.0.0.tgz", @@ -3010,28 +2732,6 @@ "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/file-set": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/file-set/-/file-set-4.0.2.tgz", - "integrity": "sha512-fuxEgzk4L8waGXaAkd8cMr73Pm0FxOVkn8hztzUW7BAHhOGH90viQNXbiOsnecCWmfInqU6YmAMwxRMdKETceQ==", - "dev": true, - "dependencies": { - "array-back": "^5.0.0", - "glob": "^7.1.6" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/file-set/node_modules/array-back": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -3044,27 +2744,6 @@ "node": ">=8" } }, - "node_modules/find-replace": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", - "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", - "dev": true, - "dependencies": { - "array-back": "^3.0.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/find-replace/node_modules/array-back": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", - "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", - "dev": true, - "engines": { - "node": ">=6" - } - }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -3260,15 +2939,6 @@ "node": ">=14.14" } }, - "node_modules/fs-then-native": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/fs-then-native/-/fs-then-native-2.0.0.tgz", - "integrity": "sha512-X712jAOaWXkemQCAmWeg5rOT2i+KOpWz1Z/txk/cW0qlOu2oQ9H61vc5w3X/iyuUEfq/OyaFJ78/cZAQD1/bgA==", - "dev": true, - "engines": { - "node": ">=4.0.0" - } - }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3496,27 +3166,6 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/handlebars": { - "version": "4.7.7", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.7.tgz", - "integrity": "sha512-aAcXm5OAfE/8IXkcZvCepKU3VzW1/39Fb5ZuqMtgI/hT8X2YgoMvBY5dLhq/cpOvw7Lk1nK/UF71aLG/ZnVYRA==", - "dev": true, - "dependencies": { - "minimist": "^1.2.5", - "neo-async": "^2.6.0", - "source-map": "^0.6.1", - "wordwrap": "^1.0.0" - }, - "bin": { - "handlebars": "bin/handlebars" - }, - "engines": { - "node": ">=0.4.7" - }, - "optionalDependencies": { - "uglify-js": "^3.1.4" - } - }, "node_modules/has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", @@ -4450,101 +4099,6 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/js2xmlparser": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.2.tgz", - "integrity": "sha512-6n4D8gLlLf1n5mNLQPRfViYzu9RATblzPEtm1SthMX1Pjao0r9YI9nw7ZIfRxQMERS87mcswrg+r/OYrPRX6jA==", - "dev": true, - "dependencies": { - "xmlcreate": "^2.0.4" - } - }, - "node_modules/jsdoc": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.0.tgz", - "integrity": "sha512-tzTgkklbWKrlaQL2+e3NNgLcZu3NaK2vsHRx7tyHQ+H5jcB9Gx0txSd2eJWlMC/xU1+7LQu4s58Ry0RkuaEQVg==", - "dev": true, - "dependencies": { - "@babel/parser": "^7.9.4", - "@jsdoc/salty": "^0.2.1", - "@types/markdown-it": "^12.2.3", - "bluebird": "^3.7.2", - "catharsis": "^0.9.0", - "escape-string-regexp": "^2.0.0", - "js2xmlparser": "^4.0.2", - "klaw": "^3.0.0", - "markdown-it": "^12.3.2", - "markdown-it-anchor": "^8.4.1", - "marked": "^4.0.10", - "mkdirp": "^1.0.4", - "requizzle": "^0.2.3", - "strip-json-comments": "^3.1.0", - "underscore": "~1.13.2" - }, - "bin": { - "jsdoc": "jsdoc.js" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/jsdoc-api": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-8.0.0.tgz", - "integrity": "sha512-Rnhor0suB1Ds1abjmFkFfKeD+kSMRN9oHMTMZoJVUrmtCGDwXty+sWMA9sa4xbe4UyxuPjhC7tavZ40mDKK6QQ==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "cache-point": "^2.0.0", - "collect-all": "^1.0.4", - "file-set": "^4.0.2", - "fs-then-native": "^2.0.0", - "jsdoc": "^4.0.0", - "object-to-spawn-args": "^2.0.1", - "temp-path": "^1.0.0", - "walk-back": "^5.1.0" - }, - "engines": { - "node": ">=12.17" - } - }, - "node_modules/jsdoc-parse": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/jsdoc-parse/-/jsdoc-parse-6.2.1.tgz", - "integrity": "sha512-9viGRUUtWOk/G4V0+nQ6rfLucz5plxh5I74WbNSNm9h9NWugCDVX4jbG8hZP9QqKGpdTPDE+qJXzaYNos3wqTA==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "lodash.omit": "^4.5.0", - "reduce-extract": "^1.0.0", - "sort-array": "^4.1.5", - "test-value": "^3.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/jsdoc-to-markdown": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-8.0.1.tgz", - "integrity": "sha512-qJfNJhkq2C26UYoOdj8L1yheTJlk1veCsxwRejRmj07XZKCn7oSkuPErx6+JoNi8afCaUKdIM5oUu0uF2/T8iw==", - "dev": true, - "dependencies": { - "array-back": "^6.2.2", - "command-line-tool": "^0.8.0", - "config-master": "^3.1.0", - "dmd": "^6.2.0", - "jsdoc-api": "^8.0.0", - "jsdoc-parse": "^6.2.1", - "walk-back": "^5.1.0" - }, - "bin": { - "jsdoc2md": "bin/cli.js" - }, - "engines": { - "node": ">=12.17" - } - }, "node_modules/jsdoc-type-pratt-parser": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", @@ -4554,15 +4108,6 @@ "node": ">=12.0.0" } }, - "node_modules/jsdoc/node_modules/escape-string-regexp": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", - "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", @@ -4619,15 +4164,6 @@ "jsox": "lib/cli.js" } }, - "node_modules/klaw": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", - "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.1.9" - } - }, "node_modules/kuler": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/kuler/-/kuler-2.0.0.tgz", @@ -4881,15 +4417,6 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "dev": true }, - "node_modules/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", - "dev": true, - "dependencies": { - "uc.micro": "^1.0.1" - } - }, "node_modules/lint-staged": { "version": "15.2.2", "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", @@ -5054,30 +4581,12 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" }, - "node_modules/lodash.camelcase": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", - "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", - "dev": true - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.omit": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", - "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==", - "dev": true - }, - "node_modules/lodash.padend": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.6.1.tgz", - "integrity": "sha1-U8y6BH0G4VjTEfRdpiX05J5vFm4=", - "dev": true - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -5406,50 +4915,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" - }, - "bin": { - "markdown-it": "bin/markdown-it.js" - } - }, - "node_modules/markdown-it-anchor": { - "version": "8.6.5", - "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-8.6.5.tgz", - "integrity": "sha512-PI1qEHHkTNWT+X6Ip9w+paonfIQ+QZP9sCeMYi47oqhH+EsW8CrJ8J7CzV19QVOj6il8ATGbK2nTECj22ZHGvQ==", - "dev": true, - "peerDependencies": { - "@types/markdown-it": "*", - "markdown-it": "*" - } - }, - "node_modules/marked": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/marked/-/marked-4.2.3.tgz", - "integrity": "sha512-slWRdJkbTZ+PjkyJnE30Uid64eHwbwa1Q25INCAYfZlK4o6ylagBy/Le9eWntqJFoFT93ikUKMv47GZ4gTwHkw==", - "dev": true, - "bin": { - "marked": "bin/marked.js" - }, - "engines": { - "node": ">= 12" - } - }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==", - "dev": true - }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -5543,24 +5008,6 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" }, - "node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/mkdirp2": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/mkdirp2/-/mkdirp2-1.0.5.tgz", - "integrity": "sha512-xOE9xbICroUDmG1ye2h4bZ8WBie9EGmACaco8K8cx6RlkJJrxGIqjGqztAI+NMhexXBcdGbSEzI6N3EJPevxZw==", - "dev": true - }, "node_modules/mocha": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.4.0.tgz", @@ -5743,12 +5190,6 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" }, - "node_modules/neo-async": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", - "dev": true - }, "node_modules/nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -6004,12 +5445,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/object-get": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/object-get/-/object-get-2.1.1.tgz", - "integrity": "sha512-7n4IpLMzGGcLEMiQKsNR7vCe+N5E9LORFrtNUVy4sO3dj9a3HedZCxEL2T7QuLhcHN1NBuBsMOKaOsAYI9IIvg==", - "dev": true - }, "node_modules/object-inspect": { "version": "1.12.3", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", @@ -6041,15 +5476,6 @@ "node": ">= 0.4" } }, - "node_modules/object-to-spawn-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/object-to-spawn-args/-/object-to-spawn-args-2.0.1.tgz", - "integrity": "sha512-6FuKFQ39cOID+BMZ3QaphcC8Y4cw6LXBLyIgPU+OhIYwviJamPAn+4mITapnSBQrejB+NNp+FMskhD8Cq+Ys3w==", - "dev": true, - "engines": { - "node": ">=8.0.0" - } - }, "node_modules/object.assign": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", @@ -6678,98 +6104,6 @@ "node": ">=8.10.0" } }, - "node_modules/reduce-extract": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/reduce-extract/-/reduce-extract-1.0.0.tgz", - "integrity": "sha512-QF8vjWx3wnRSL5uFMyCjDeDc5EBMiryoT9tz94VvgjKfzecHAVnqmXAwQDcr7X4JmLc2cjkjFGCVzhMqDjgR9g==", - "dev": true, - "dependencies": { - "test-value": "^1.0.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reduce-extract/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/reduce-extract/node_modules/test-value": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-1.1.0.tgz", - "integrity": "sha512-wrsbRo7qP+2Je8x8DsK8ovCGyxe3sYfQwOraIY/09A2gFXU9DYKiTF14W4ki/01AEh56kMzAmlj9CaHGDDUBJA==", - "dev": true, - "dependencies": { - "array-back": "^1.0.2", - "typical": "^2.4.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reduce-flatten": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-3.0.1.tgz", - "integrity": "sha512-bYo+97BmUUOzg09XwfkwALt4PQH1M5L0wzKerBt6WLm3Fhdd43mMS89HiT1B9pJIqko/6lWx3OnV4J9f2Kqp5Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/reduce-unique": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/reduce-unique/-/reduce-unique-2.0.1.tgz", - "integrity": "sha512-x4jH/8L1eyZGR785WY+ePtyMNhycl1N2XOLxhCbzZFaqF4AXjLzqSxa2UHgJ2ZVR/HHyPOvl1L7xRnW8ye5MdA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/reduce-without": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-without/-/reduce-without-1.0.1.tgz", - "integrity": "sha512-zQv5y/cf85sxvdrKPlfcRzlDn/OqKFThNimYmsS3flmkioKvkUGn2Qg9cJVoQiEvdxFGLE0MQER/9fZ9sUqdxg==", - "dev": true, - "dependencies": { - "test-value": "^2.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/reduce-without/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/reduce-without/node_modules/test-value": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-2.1.0.tgz", - "integrity": "sha512-+1epbAxtKeXttkGFMTX9H42oqzOTufR1ceCF+GYA5aOmvaPq9wd4PUS8329fn2RRLGNeUkgRLnVpycjx8DsO2w==", - "dev": true, - "dependencies": { - "array-back": "^1.0.3", - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/regexp-tree": { "version": "0.1.27", "resolved": "https://registry.npmjs.org/regexp-tree/-/regexp-tree-0.1.27.tgz", @@ -6838,15 +6172,6 @@ "integrity": "sha1-eZlTn8ngR6N5KPoZb44VY9q9Nt4=", "dev": true }, - "node_modules/requizzle": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.4.tgz", - "integrity": "sha512-JRrFk1D4OQ4SqovXOgdav+K8EAhSB/LJZqCz8tbX0KObcdeM15Ss59ozWMBWmmINMagCwmqn4ZNryUGpBsl6Jw==", - "dev": true, - "dependencies": { - "lodash": "^4.17.21" - } - }, "node_modules/resolve": { "version": "1.22.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", @@ -7201,46 +6526,6 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/sort-array": { - "version": "4.1.5", - "resolved": "https://registry.npmjs.org/sort-array/-/sort-array-4.1.5.tgz", - "integrity": "sha512-Ya4peoS1fgFN42RN1REk2FgdNOeLIEMKFGJvs7VTP3OklF8+kl2SkpVliZ4tk/PurWsrWRsdNdU+tgyOBkB9sA==", - "dev": true, - "dependencies": { - "array-back": "^5.0.0", - "typical": "^6.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/sort-array/node_modules/array-back": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-5.0.0.tgz", - "integrity": "sha512-kgVWwJReZWmVuWOQKEOohXKJX+nD02JAZ54D1RRWlv8L0NebauKAaFxACKzB74RTclt1+WNz5KHaLRDAPZbDEw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/sort-array/node_modules/typical": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-6.0.1.tgz", - "integrity": "sha512-+g3NEp7fJLe9DPa1TArHm9QAA7YciZmWnfAqEaFrBihQ7epOv9i99rjtgb6Iz0wh3WuQDjsCTDfgRoGnmHN81A==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", @@ -7305,39 +6590,6 @@ "node": ">= 0.4" } }, - "node_modules/stream-connect": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/stream-connect/-/stream-connect-1.0.2.tgz", - "integrity": "sha512-68Kl+79cE0RGKemKkhxTSg8+6AGrqBt+cbZAXevg2iJ6Y3zX4JhA/sZeGzLpxW9cXhmqAcE7KnJCisUmIUfnFQ==", - "dev": true, - "dependencies": { - "array-back": "^1.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/stream-connect/node_modules/array-back": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-1.0.4.tgz", - "integrity": "sha512-1WxbZvrmyhkNoeYcizokbmh5oiOCIfyvGtcqbK3Ls1v1fKcquzxnQSceOx6tzq7jmai2kFLWIpGND2cLhH6TPw==", - "dev": true, - "dependencies": { - "typical": "^2.6.0" - }, - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/stream-via": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/stream-via/-/stream-via-1.0.4.tgz", - "integrity": "sha512-DBp0lSvX5G9KGRDTkR/R+a29H+Wk2xItOF+MpZLLNDWbEV9tGPnqLPxHEYjmiz8xGtJHRIqmI+hCjmNzqoA4nQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -7532,40 +6784,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/table-layout": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-0.4.5.tgz", - "integrity": "sha512-zTvf0mcggrGeTe/2jJ6ECkJHAQPIYEwDoqsiqBjI24mvRmQbInK5jq33fyypaCBxX08hMkfmdOqj6haT33EqWw==", - "dev": true, - "dependencies": { - "array-back": "^2.0.0", - "deep-extend": "~0.6.0", - "lodash.padend": "^4.6.1", - "typical": "^2.6.1", - "wordwrapjs": "^3.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/table-layout/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/temp-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/temp-path/-/temp-path-1.0.0.tgz", - "integrity": "sha512-TvmyH7kC6ZVTYkqCODjJIbgvu0FKiwQpZ4D1aknE7xpcDf/qEOB8KZEK5ef2pfbVoiBhNWs3yx4y+ESMtNYmlg==", - "dev": true - }, "node_modules/test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", @@ -7580,31 +6798,6 @@ "node": ">=8" } }, - "node_modules/test-value": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/test-value/-/test-value-3.0.0.tgz", - "integrity": "sha512-sVACdAWcZkSU9x7AOmJo5TqE+GyNJknHaHsMrR6ZnhjVlVN9Yx6FjHrsKZ3BjIpPCT68zYesPWkakrNupwfOTQ==", - "dev": true, - "dependencies": { - "array-back": "^2.0.0", - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/test-value/node_modules/array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "dependencies": { - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", @@ -7724,31 +6917,6 @@ "node": ">=14.17" } }, - "node_modules/typical": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/typical/-/typical-2.6.1.tgz", - "integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=", - "dev": true - }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "node_modules/uglify-js": { - "version": "3.17.4", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.17.4.tgz", - "integrity": "sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==", - "dev": true, - "optional": true, - "bin": { - "uglifyjs": "bin/uglifyjs" - }, - "engines": { - "node": ">=0.8.0" - } - }, "node_modules/uint8array-extras": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/uint8array-extras/-/uint8array-extras-0.3.0.tgz", @@ -7775,12 +6943,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/underscore": { - "version": "1.13.6", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz", - "integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A==", - "dev": true - }, "node_modules/unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", @@ -7957,15 +7119,6 @@ "eslint": ">=6.0.0" } }, - "node_modules/walk-back": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-5.1.0.tgz", - "integrity": "sha512-Uhxps5yZcVNbLEAnb+xaEEMdgTXl9qAQDzKYejG2AZ7qPwRQ81lozY9ECDbjLPNWm7YsO1IK5rsP1KoQzXAcGA==", - "dev": true, - "engines": { - "node": ">=12.17" - } - }, "node_modules/wcwidth": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", @@ -8124,34 +7277,6 @@ "node": ">= 12.0.0" } }, - "node_modules/wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", - "dev": true - }, - "node_modules/wordwrapjs": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-3.0.0.tgz", - "integrity": "sha512-mO8XtqyPvykVCsrwj5MlOVWvSnCdT+C+QVbm6blradR7JExAhbkZ7hZ9A+9NUtwzSqrlUo9a67ws0EiILrvRpw==", - "dev": true, - "dependencies": { - "reduce-flatten": "^1.0.1", - "typical": "^2.6.1" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/wordwrapjs/node_modules/reduce-flatten": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-1.0.1.tgz", - "integrity": "sha1-JYx479FT3fk8tWEjf2EYTzaW4yc=", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, "node_modules/workerpool": { "version": "6.2.1", "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", @@ -8202,12 +7327,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/xmlcreate": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.4.tgz", - "integrity": "sha512-nquOebG4sngPmGPICTS5EnxqhKbCmz5Ox5hsszI2T6U5qdrJizBc+0ilYSEjTSzU0yZcmvppztXe/5Al5fUwdg==", - "dev": true - }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index be47fbd3a..26f2918d2 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "mcdev": "node lib/cli.js", "build": "run-s lint:fix docs test", "debug": "node --nolazy --inspect-brk=9229 lib/cli.js", - "docs": "jsdoc2md --files lib/**/*.js types/**/*.js > docs/dist/documentation.md", "lint:fix": "eslint --fix lib/**/*.js && eslint --fix types/*.js && eslint --fix test/**/*.js", "lint": "run-p -c lint-type lint-lib lint-test", "lint-lib": "eslint lib/**/*.js", @@ -111,9 +110,7 @@ }, "lint-staged": { "*.{js,jsx,ts,tsx}": [ - "eslint --fix", - "npm run docs", - "git update-index --add docs/dist/documentation.md" + "eslint --fix" ] }, "type": "module" From cd6bfe794af0a201eecac3acb9fbd422459e2a32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:37:11 +0200 Subject: [PATCH 069/359] #1244: explicit jsdoc config --- .eslintrc.json | 4 +++- jsconfig.json | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 5edc0fc77..ef51e1ec5 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -22,7 +22,7 @@ "root": true, "settings": { "jsdoc": { - "mode": "jsdoc", + "mode": "typescript", "preferredTypes": { "array": "Array", "array.<>": "[]", @@ -84,6 +84,8 @@ ], "jsdoc/require-param-type": "error", "jsdoc/tag-lines": ["warn", "any", { "startLines": 1 }], + "jsdoc/no-undefined-types": "error", + "valid-jsdoc": "off", "spaced-comment": ["warn", "always", { "block": { "exceptions": ["*"], "balanced": true } }] }, "overrides": [ diff --git a/jsconfig.json b/jsconfig.json index 55b6aa9c4..2a45291e2 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -2,6 +2,7 @@ "include": ["lib/**/*.js", "types/**/*.js", "test/**/*.js"], "compilerOptions": { "module": "es6", - "target": "esnext" + "target": "es2022", + "checkJs": false } } From 51d9439d61f193ec09a4a1bf74cbd2a4f5b567eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:42:11 +0200 Subject: [PATCH 070/359] #1244: jsdoc fixes --- lib/index.js | 14 ++++++++------ types/mcdev.d.js | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/index.js b/lib/index.js index 5bf29a0c6..ceeb4e78d 100644 --- a/lib/index.js +++ b/lib/index.js @@ -29,6 +29,7 @@ import cache from './util/cache.js'; * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../types/mcdev.d.js').SkipInteraction} SkipInteraction * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap @@ -49,7 +50,7 @@ class Mcdev { /** * helper method to use unattended mode when including mcdev as a package * - * @param {boolean | skipInteraction} [skipInteraction] signals what to insert automatically for things usually asked via wizard + * @param {boolean | SkipInteraction} [skipInteraction] signals what to insert automatically for things usually asked via wizard * @returns {void} */ static setSkipInteraction(skipInteraction) { @@ -117,6 +118,7 @@ class Mcdev { * @param {string} [argv.range] git commit range into deploy directory * @param {string} [argv.filter] filter file paths that start with any + * @param {number} [argv.commitHistory] filter file paths that start with any * @param {DeltaPkgItem[]} [argv.diffArr] list of files to include in delta package (skips git diff when provided) * @returns {Promise.} list of changed items */ @@ -513,7 +515,7 @@ class Mcdev { * deletes metadata from MC instance by key * * @param {string} businessUnit references credentials from properties.json - * @param {string} type supported metadata type + * @param {SupportedMetadataTypes} type supported metadata type * @param {string} customerKey Identifier of metadata * @returns {Promise.} true if successful, false otherwise */ @@ -551,7 +553,7 @@ class Mcdev { * get name & key for provided id * * @param {string} businessUnit references credentials from properties.json - * @param {string} type supported metadata type + * @param {SupportedMetadataTypes} type supported metadata type * @param {string} id Identifier of metadata * @returns {Promise.<{key:string, name:string, path:string}>} key, name and path of metadata; null if not found */ @@ -594,7 +596,7 @@ class Mcdev { * ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails * * @param {string} businessUnit references credentials from properties.json - * @param {string} type references credentials from properties.json + * @param {SupportedMetadataTypes} type references credentials from properties.json * @param {string[]} [keyArr] metadata keys * @returns {Promise.} - */ @@ -703,7 +705,7 @@ class Mcdev { * Retrieve a specific metadata file and templatise. * * @param {string} businessUnit references credentials from properties.json - * @param {string} selectedType supported metadata type + * @param {SupportedMetadataTypes} selectedType supported metadata type * @param {string[]} name name of the metadata * @param {string} market market which should be used to revert template * @returns {Promise.} - @@ -762,7 +764,7 @@ class Mcdev { * @param {string} selectedType supported metadata type * @param {string} name name of the metadata * @param {string} market market localizations - * @returns {Promise.} - + * @returns {Promise.} - */ static async buildDefinition(businessUnit, selectedType, name, market) { Util.startLogger(); diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 073d5e714..e4d637906 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -287,7 +287,7 @@ import SDK from 'sfmc-sdk'; */ /** - * @typedef {object} skipInteraction signals what to insert automatically for things usually asked via wizard + * @typedef {object} SkipInteraction signals what to insert automatically for things usually asked via wizard * @property {string} client_id client id of installed package * @property {string} client_secret client secret of installed package * @property {string} auth_url tenant specific auth url of installed package From c265d183e55dba0ba215ad0859e5d7f62b059c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:55:43 +0200 Subject: [PATCH 071/359] #1244: remove jsdoc-to-markdown --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 26f2918d2..c93bfc630 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,6 @@ "eslint-plugin-unicorn": "51.0.1", "fast-xml-parser": "4.3.6", "husky": "9.0.11", - "jsdoc-to-markdown": "8.0.1", "lint-staged": "15.2.2", "mocha": "10.4.0", "mock-fs": "5.2.0", From 24cb22d3db78c76a9f25839f69a707e91bddd6fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 2 Apr 2024 23:58:22 +0200 Subject: [PATCH 072/359] #1244: upgrade workflows to use node:version 18.16 --- .github/workflows/code-test.yml | 2 +- .github/workflows/coverage-develop-branch.yml | 2 +- .github/workflows/coverage-main-branch.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/npm-publish.yml | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/code-test.yml b/.github/workflows/code-test.yml index f6184ecc0..2021742ac 100644 --- a/.github/workflows/code-test.yml +++ b/.github/workflows/code-test.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18.16 registry-url: https://registry.npmjs.org/ - run: npm ci --ignore-scripts diff --git a/.github/workflows/coverage-develop-branch.yml b/.github/workflows/coverage-develop-branch.yml index 61da0b184..daa1bd57c 100644 --- a/.github/workflows/coverage-develop-branch.yml +++ b/.github/workflows/coverage-develop-branch.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18.16 - run: npm ci --ignore-scripts diff --git a/.github/workflows/coverage-main-branch.yml b/.github/workflows/coverage-main-branch.yml index 078da7979..bd8aa2cdb 100644 --- a/.github/workflows/coverage-main-branch.yml +++ b/.github/workflows/coverage-main-branch.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18.16 - run: npm ci --ignore-scripts diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index a1f679d4c..8ee186b82 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18.16 - run: npm ci --ignore-scripts diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 8d02b8017..7c43db805 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18.16 - run: npm ci - run: npm test @@ -25,7 +25,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18.16 registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm publish From 65db3aeb3389db41e94294d4c80753ef76fb1f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 3 Apr 2024 00:12:01 +0200 Subject: [PATCH 073/359] #1244: remove outdated comment --- types/mcdev.d.js | 1 - 1 file changed, 1 deletion(-) diff --git a/types/mcdev.d.js b/types/mcdev.d.js index e4d637906..b8248717d 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -1,6 +1,5 @@ import SDK from 'sfmc-sdk'; /** - * @ignore * @typedef {object} BuObject * @property {string} clientId installed package client id * @property {string} clientSecret installed package client secret From 15a226c0b0ca9409834bf68cc5c6a576c715663c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 3 Apr 2024 11:09:46 +0200 Subject: [PATCH 074/359] #1246: enable enhanced validation --- .vscode/settings.json | 2 +- jsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3abf1f935..95c678797 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ }, "files.eol": "\n", "js/ts.implicitProjectConfig.checkJs": true, - "javascript.validate.enable": false, + "javascript.validate.enable": true, "markdown.extension.italic.indicator": "_", "markdown.extension.list.indentationSize": "adaptive", "markdown.extension.toc.levels": "2..6", diff --git a/jsconfig.json b/jsconfig.json index 2a45291e2..f6fa033da 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -2,7 +2,8 @@ "include": ["lib/**/*.js", "types/**/*.js", "test/**/*.js"], "compilerOptions": { "module": "es6", + "moduleResolution": "node", "target": "es2022", - "checkJs": false + "checkJs": true } } From f9ef1effa51fd75618d9befc4a7d78ea65513782 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 3 Apr 2024 11:13:06 +0200 Subject: [PATCH 075/359] #1246: first batch of fixes based on enhanced validation --- .eslintrc.json | 4 ++++ lib/util/auth.js | 2 +- lib/util/cache.js | 6 +++--- lib/util/cli.js | 16 +++++++++++----- lib/util/config.js | 2 +- lib/util/devops.js | 9 +++++---- lib/util/file.js | 23 +++++++++++++++++++---- lib/util/util.js | 36 +++++++++++++++++++++-------------- types/mcdev.d.js | 47 +++++++++++++++++++++++++--------------------- 9 files changed, 92 insertions(+), 53 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index ef51e1ec5..f5cdfe6a6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -33,6 +33,10 @@ "object.<>": "Object.<>", "object<>": "Object.<>", "Object<>": "Object.<>", + "set": "Set", + "set.<>": "Set.<>", + "set<>": "Set.<>", + "Set<>": "Set.<>", "promise": "Promise", "promise.<>": "Promise.<>", "promise<>": "Promise.<>", diff --git a/lib/util/auth.js b/lib/util/auth.js index 025f5c220..e1424042c 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -37,7 +37,7 @@ const Auth = { * * @param {AuthObject} authObject details for * @param {string} credential of the instance - * @returns {void} + * @returns {Promise.} - */ async saveCredential(authObject, credential) { const sdk = setupSDK(credential, authObject); diff --git a/lib/util/cache.js b/lib/util/cache.js index bcbfb8443..d2cf0cf8a 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -191,9 +191,9 @@ export default { * @returns {string} unique ObjectId of list */ getListObjectId(listPathName, returnField) { - let folderPath = listPathName.split('/'); - const listName = folderPath.pop(); - folderPath = folderPath.join('/'); + const folderPathArr = listPathName.split('/'); + const listName = folderPathArr.pop(); + const folderPath = folderPathArr.join('/'); for (const key in dataStore[currentMID]['list']) { if ( dataStore[currentMID]['list'][key].ListName === listName && diff --git a/lib/util/cli.js b/lib/util/cli.js index fd2c4675b..d0718d37e 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -41,7 +41,7 @@ const Cli = { * used when initially setting up a project. * loads default config and adds first credential * - * @returns {Promise.} success of init + * @returns {Promise.} success of init */ async initMcdevConfig() { Util.logger.info('-- Initialising server connection --'); @@ -135,7 +135,7 @@ const Cli = { * * @param {Mcdevrc} properties config file's json * @param {string} credName name of credential that needs updating - * @returns {Promise.} success of update + * @returns {Promise.} success of update */ async updateCredential(properties, credName) { const skipInteraction = Util.skipInteraction; @@ -151,7 +151,7 @@ const Cli = { * * @param {Mcdevrc} properties object of all configuration including credentials * @param {string} target code of BU to use - * @param {boolean|string} [isCredentialOnly] true:don't ask for BU | string: name of BU + * @param {boolean | string} [isCredentialOnly] true:don't ask for BU | string: name of BU * @param {boolean} [allowAll] Offer ALL as option in BU selection * @returns {Promise.} credential to be used for Business Unit */ @@ -175,7 +175,12 @@ const Cli = { if (credential !== null) { Util.logger.warn(`Credential '${credential}' not found`); } - const response = await this._selectBU(properties, null, isCredentialOnly, allowAll); + const response = await this._selectBU( + properties, + null, + !!isCredentialOnly, + allowAll + ); credential = response.credential; businessUnit = response.businessUnit; if (!isCredentialOnly) { @@ -220,7 +225,7 @@ const Cli = { * @param {string} [credential] name of valid credential * @param {boolean} [isCredentialOnly] don't ask for BU if true * @param {boolean} [allowAll] Offer ALL as option in BU selection - * @returns {Promise.} selected credential/BU combo + * @returns {Promise.<{businessUnit:string, credential:string}>} selected credential/BU combo */ async _selectBU(properties, credential, isCredentialOnly, allowAll) { const credList = []; @@ -536,6 +541,7 @@ const Cli = { return 0; }); // add end-of-list marker + // @ts-ignore type checking this push() makes things very complicated... typeChoices.push(new inquirer.Separator(' ==== ')); responses = await inquirer.prompt([ { diff --git a/lib/util/config.js b/lib/util/config.js index e2db17b2b..eef5e773e 100644 --- a/lib/util/config.js +++ b/lib/util/config.js @@ -311,7 +311,7 @@ const config = { const configFileName = path.resolve(__dirname, Util.boilerplateDirectory, 'config.json'); if (!(await File.pathExists(configFileName))) { Util.logger.debug(`Default config file not found in ${configFileName}`); - return false; + return; } // const defaultProperties = File.readJsonSync(configFileName); const defaultProperties = await File.readJson(configFileName); diff --git a/lib/util/devops.js b/lib/util/devops.js index a503fa0f2..ae0d59775 100644 --- a/lib/util/devops.js +++ b/lib/util/devops.js @@ -41,14 +41,14 @@ const DevOps = { * @param {Mcdevrc} properties central properties object * @param {string} [range] git commit range * @param {boolean} [saveToDeployDir] if true, copy metadata changes into deploy directory - * @param {string} [filterPaths] filter file paths that start with any specified path (comma separated) + * @param {string} [filterPathsCSV] filter file paths that start with any specified path (comma separated) * @param {number} [commitHistory] cli option to override default commit history value in config * @returns {Promise.} - */ - async getDeltaList(properties, range, saveToDeployDir, filterPaths, commitHistory) { + async getDeltaList(properties, range, saveToDeployDir, filterPathsCSV, commitHistory) { const rangeUserInput = range; - filterPaths = filterPaths - ? filterPaths.split(',').map((filePath) => + const filterPaths = filterPathsCSV + ? filterPathsCSV.split(',').map((filePath) => path .normalize(properties.directories.retrieve + filePath) .split('\\') @@ -75,6 +75,7 @@ const DevOps = { name: commit.date + ' / ' + commit.message + ' / ' + commit.author_name, value: commit.hash, })); + // @ts-ignore type checking this push() makes things very complicated... display.push(new inquirer.Separator(' ==== ')); const responses = await inquirer.prompt([ diff --git a/lib/util/file.js b/lib/util/file.js index cdbd34186..ae1a7af3c 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -42,12 +42,14 @@ notifier.notify(); * File extends fs-extra. It adds logger and util methods for file handling */ const File = { + prettierConfig: null, + prettierConfigFileType: null, /** * copies a file from one path to another * * @param {string} from - full filepath including name of existing file * @param {string} to - full filepath including name where file should go - * @returns {object} - results object + * @returns {Promise.} - results object */ async copyFile(from, to) { try { @@ -198,6 +200,21 @@ const File = { } return this.writeToFile(directory, filename, filetype, formatted); }, + /** + * helper that applies beautyAmp onto given stringified content; strongly typed for strings only + * + * @param {string} content code + * @param {boolean} [formatHTML] applies formatting to html and ampscript if true + * @returns {Promise.} formatted code + */ + beautify_beautyAmp_beautify: async function (content, formatHTML = true) { + const response = beautyAmp.beautify(content, formatHTML); + if (response == typeof 'string') { + return (await response).trim() + '\n'; + } else { + throw new TypeError('beautyAmp failed to beautify the content'); + } + }, /** * helper for {@link File.writePrettyToFile}, applying beautyAmp onto given stringified content * @@ -224,7 +241,7 @@ const File = { try { beautyAmp.setup(ampscript, editor, logs); // Note: we need to trim the result as beautyAmp adds a leading new line; but we also want to ensure there is a single new line at the end to comply with standard linting rules - return (await beautyAmp.beautify(content, formatHTML)).trim() + '\n'; + return await this.beautify_beautyAmp_beautify(content, formatHTML); } catch (ex) { Util.logger.debug('File.beautify_beautyAmp:: error | ' + ex.message); return content; @@ -568,7 +585,5 @@ const File = { }, }; const FileFs = { ...fs, ...File }; -FileFs.prettierConfig = null; -FileFs.prettierConfigFileType = null; export default FileFs; diff --git a/lib/util/util.js b/lib/util/util.js index 04caa2317..8b0228f2f 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -18,6 +18,7 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').McdevLogger} McdevLogger * @typedef {import('../../types/mcdev.d.js').Logger} Logger * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem @@ -27,11 +28,12 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap - * @typedef {import('../../types/mcdev.d.js').skipInteraction} skipInteraction + * @typedef {import('../../types/mcdev.d.js').SkipInteraction} SkipInteraction * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError */ /** @@ -43,8 +45,8 @@ export const Util = { configFileName: '.mcdevrc.json', parentBuName: '_ParentBU_', standardizedSplitChar: '/', - /** @type {skipInteraction} */ - skipInteraction: false, + /** @type {SkipInteraction} */ + skipInteraction: null, packageJsonMcdev: readJsonSync(path.join(__dirname, '../../package.json')), OPTIONS: {}, changedKeysMap: {}, @@ -363,11 +365,12 @@ export const Util = { transports: Object.values(Util.loggerTransports), }); const winstonError = myWinston.error; + /** @type {McdevLogger} */ const winstonExtension = { /** * helper that prints better stack trace for errors * - * @param {Error} ex the error + * @param {SDKError} ex the error * @param {string} [message] optional custom message to be printed as error together with the exception's message * @returns {void} */ @@ -572,39 +575,44 @@ export const Util = { // sort list & remove the undefined dependencies const flatList = toposort(dependencies).filter((a) => !!a); - const finalList = {}; + /** @type {Object.>} */ + const setList = {}; // group subtypes per type for (const type of flatList) { if (type.includes('-')) { const [key, subKey] = Util.getTypeAndSubType(type); - if (finalList[key] === null) { + if (setList[key] === null) { // if main type is already required, then don't filter by subtypes continue; - } else if (finalList[key] && subKey) { + } else if (setList[key] && subKey) { // add another subtype to the set - finalList[key].add(subKey); + setList[key].add(subKey); continue; } else { // create a new set with the first subtype; subKey will be always set here - finalList[key] = new Set([subKey]); + setList[key] = new Set([subKey]); } if (subTypeDeps[key]) { // check if there are depndent subtypes that need to be added + /** @type {string[]} */ const temp = [...subTypeDeps[key]].map((a) => { const temp = a.split('-'); temp.shift(); // remove first item which is the main type return temp.join('-'); // subType can include "-" }); - finalList[key].add(...temp); + setList[key].add(...temp); // TODO - this might have only added the first item? } } else { - finalList[type] = null; + setList[type] = null; } } // convert sets into arrays - for (const type of Object.keys(finalList)) { - if (finalList[type] instanceof Set) { - finalList[type] = [...finalList[type]]; + /** @type {Object.} */ + const finalList = {}; + + for (const type of Object.keys(setList)) { + if (setList[type] instanceof Set) { + finalList[type] = [...setList[type]]; } } diff --git a/types/mcdev.d.js b/types/mcdev.d.js index b8248717d..1d67c0b8e 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -1,9 +1,8 @@ -import SDK from 'sfmc-sdk'; /** * @typedef {object} BuObject - * @property {string} clientId installed package client id - * @property {string} clientSecret installed package client secret - * @property {string} tenant subdomain part of Authentication Base Uri + * @property {string} [clientId] installed package client id + * @property {string} [clientSecret] installed package client secret + * @property {string} [tenant] subdomain part of Authentication Base Uri * @property {string} [eid] Enterprise ID = MID of the parent BU * @property {string} [mid] MID of the BU to work with * @property {string} [businessUnit] name of the BU to interact with @@ -57,10 +56,6 @@ import SDK from 'sfmc-sdk'; * @property {string} [categoryId] holds folder ID, replaced with r__folder_Path during retrieve * @property {string} r__folder_Path folder path in which this DE is saved * @typedef {Object.} QueryMap - * @typedef {object} CodeExtractItem - * @property {QueryItem} json metadata of one item w/o code - * @property {CodeExtract[]} codeArr list of code snippets in this item - * @property {string[]} subFolder mostly set to null, otherwise list of subfolders */ /** * @typedef {object} ScriptItem @@ -268,7 +263,7 @@ import SDK from 'sfmc-sdk'; * @typedef {Object.} AutomationMap * @typedef {{metadata:AutomationMap,type:string}} AutomationMapObj * @typedef {{metadata:AutomationItem,type:string}} AutomationItemObj - * @typedef {object} DeltaPkgItem + * @typedef {object} McdevDeltaPkgItem * @property {string} file relative path to file * @property {number} changes changed lines * @property {number} insertions added lines @@ -282,17 +277,27 @@ import SDK from 'sfmc-sdk'; * @property {'move'|'add/update'|'delete'} gitAction what git recognized as an action * @property {string} _credential mcdev credential name * @property {string} _businessUnit mcdev business unit name inside of _credential - * @typedef {SDK} SDK + * @typedef {import('simple-git').DiffResultTextFile & McdevDeltaPkgItem} DeltaPkgItem + */ +/** + * @typedef {import('sfmc-sdk').default} SDK + * @typedef {import('sfmc-sdk/lib/auth').default} SDKauth + * @typedef {import('sfmc-sdk/lib/rest').default} SDKrest + * @typedef {import('sfmc-sdk/lib/soap').default} SDKsoap + * @typedef {import('sfmc-sdk/lib/util').RestError} RestError + * @typedef {import('sfmc-sdk/lib/util').SOAPError} SOAPError + * @typedef {SOAPError & RestError} SDKError */ /** * @typedef {object} SkipInteraction signals what to insert automatically for things usually asked via wizard - * @property {string} client_id client id of installed package - * @property {string} client_secret client secret of installed package - * @property {string} auth_url tenant specific auth url of installed package - * @property {number} account_id MID of the Parent Business Unit - * @property {string} credentialName how you would like the credential to be named - * @property {string} gitRemoteUrl URL of Git remote server + * @property {string} [client_id] client id of installed package + * @property {string} [client_secret] client secret of installed package + * @property {string} [auth_url] tenant specific auth url of installed package + * @property {number} [account_id] MID of the Parent Business Unit + * @property {string} [credentialName] how you would like the credential to be named + * @property {string} [gitRemoteUrl] URL of Git remote server + * @property {boolean} [fixKeysReretrieve] will trigger re-downloading latest versions of dependent types after fixing keys */ /** @@ -334,16 +339,16 @@ complex * @property {string[]} metaDataTypes.retrieve define what types shall be downloaded by default during retrieve * @property {string[]} metaDataTypes.documentOnRetrieve which types should be parsed & documented after retrieve * @property {string} version mcdev version that last updated the config file + * @property {object} [marketBulk] deprecated in favor of marketList */ /** - * @typedef {object} Logger - * @property {Function} info (msg) print info message - * @property {Function} warn (msg) print warning message - * @property {Function} verbose (msg) additional messages that are not important - * @property {Function} debug (msg) print debug message + * @typedef {'error'|'verbose'|'info'|'debug'} LoggerLevel + * @typedef {object} McdevLogger + * @property {LoggerLevel} [level] (msg) print info message * @property {Function} error (msg) print error message * @property {Function} errorStack (ex, msg) print error with trace message + * @typedef {import('winston').Logger & McdevLogger} Logger */ export default {}; From cf11870473a9a5d3cacff2d3b892bac9026b95c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 3 Apr 2024 16:50:01 +0200 Subject: [PATCH 076/359] #1246: upgrade to nodeNext to solve issues with imports --- jsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsconfig.json b/jsconfig.json index f6fa033da..1b2b2925a 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,8 +1,8 @@ { "include": ["lib/**/*.js", "types/**/*.js", "test/**/*.js"], "compilerOptions": { - "module": "es6", - "moduleResolution": "node", + "module": "NodeNext", + "moduleResolution": "nodenext", "target": "es2022", "checkJs": true } From d94cd1908fb4458dcfdd9166be37e9fe799b32e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 3 Apr 2024 17:35:37 +0200 Subject: [PATCH 077/359] #1246: 2nd batch of fixes based on enhanced validation --- lib/util/auth.js | 1 + lib/util/file.js | 5 +++- lib/util/init.config.js | 54 +++++++++++++++++++++++++---------------- lib/util/init.git.js | 10 ++++---- lib/util/init.js | 12 ++++----- types/mcdev.d.js | 16 ++++++------ 6 files changed, 57 insertions(+), 41 deletions(-) diff --git a/lib/util/auth.js b/lib/util/auth.js index e1424042c..d103458c5 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -43,6 +43,7 @@ const Auth = { const sdk = setupSDK(credential, authObject); try { // check credentials to allow clear log output and stop execution + // @ts-expect-error - params are optional but jsdoc says otherwise const test = await sdk.auth.getAccessToken(); if (test.error) { throw new Error(test.error_description); diff --git a/lib/util/file.js b/lib/util/file.js index ae1a7af3c..b393baf4e 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -426,6 +426,7 @@ const File = { try { directory = this.filterIllegalPathChars(this.normalizePath(directory)); filename = this.filterIllegalFilenames(filename); + // @ts-ignore - somehow, the declared type does not allow for encoding to be passed in as a string, despite that working and being stated in the docs. return fs.readFile(path.join(directory, filename + '.' + filetype), encoding || 'utf8'); } catch (ex) { Util.logger.error('File.readFilteredFilename:: error | ' + ex.message); @@ -527,7 +528,9 @@ const File = { includeStem, _stemLength ); - children.push(...nestedChildren); + if (Array.isArray(nestedChildren) && nestedChildren.length > 0) { + children.push(...nestedChildren); + } } } return children; diff --git a/lib/util/init.config.js b/lib/util/init.config.js index fde858d7e..1f6d3d07f 100644 --- a/lib/util/init.config.js +++ b/lib/util/init.config.js @@ -54,13 +54,16 @@ const Init = { const missingFields = await config.checkProperties(properties, true); const defaultProps = await config.getDefaultProperties(); - if (missingFields.length) { + if (Array.isArray(missingFields) && missingFields.length) { for (const fieldName of missingFields) { switch (fieldName) { case 'marketList': { + // @ts-expect-error - deprecated field if (properties.marketBulk) { upgradeMsgs.push(`- ✔️ converted 'marketBulk' to '${fieldName}'`); + // @ts-expect-error - deprecated field properties[fieldName] = properties.marketBulk; + // @ts-expect-error - deprecated field delete properties.marketBulk; } else { upgradeMsgs.push(`- ✔️ added '${fieldName}'`); @@ -69,28 +72,35 @@ const Init = { break; } case 'directories.docs': { + // @ts-expect-error - deprecated field if (properties.directories.badKeys) { + // @ts-expect-error - deprecated field delete properties.directories.badKeys; upgradeMsgs.push(`- ✋ removed 'directories.badKeys'`); } + // @ts-expect-error - deprecated field if (properties.directories.dataExtension) { + // @ts-expect-error - deprecated field File.removeSync(properties.directories.dataExtension); + // @ts-expect-error - deprecated field delete properties.directories.dataExtension; upgradeMsgs.push(`- ✋ removed 'directories.dataExtension'`); } + // @ts-expect-error - deprecated field if (properties.directories.deltaPackage) { + // @ts-expect-error - deprecated field delete properties.directories.deltaPackage; upgradeMsgs.push(`- ✋ removed 'directories.deltaPackage'`); } - if (properties.directories.dataextension) { - delete properties.directories.dataextension; - upgradeMsgs.push(`- ✋ removed 'directories.dataextension'`); - } + // @ts-expect-error - deprecated field if (properties.directories.roles) { + // @ts-expect-error - deprecated field delete properties.directories.roles; upgradeMsgs.push(`- ✋ removed 'directories.roles'`); } + // @ts-expect-error - deprecated field if (properties.directories.users) { + // @ts-expect-error - deprecated field delete properties.directories.users; upgradeMsgs.push(`- ✋ removed 'directories.users'`); } @@ -257,22 +267,24 @@ const Init = { const boilerPlateFilesPath = path.resolve(__dirname, Util.boilerplateDirectory, 'files'); // ! do not switch to readDirectories before merging the two custom methods. Their logic is different! const directories = await File.readDirectoriesSync(boilerPlateFilesPath, 10, false); - for (const subdir of directories) { - // walk thru the root of our boilerplate-files directory and all sub folders - const curDir = path.join(boilerPlateFilesPath, subdir); - for (const file of await File.readdir(curDir)) { - // read all files in these directories - if (!(await File.lstat(path.join(curDir, file))).isDirectory()) { - // filter entries that are actually folders - const fileArr = file.split('.'); - const ext = '.' + fileArr.pop(); - // awaiting the result here due to interactive optional overwrite - creationLog.push( - await this._createIdeConfigFile( - [subdir + path.sep, fileArr.join('.'), ext], - relevantForcedUpdates - ) - ); + if (directories) { + for (const subdir of directories) { + // walk thru the root of our boilerplate-files directory and all sub folders + const curDir = path.join(boilerPlateFilesPath, subdir); + for (const file of await File.readdir(curDir)) { + // read all files in these directories + if (!(await File.lstat(path.join(curDir, file))).isDirectory()) { + // filter entries that are actually folders + const fileArr = file.split('.'); + const ext = '.' + fileArr.pop(); + // awaiting the result here due to interactive optional overwrite + creationLog.push( + await this._createIdeConfigFile( + [subdir + path.sep, fileArr.join('.'), ext], + relevantForcedUpdates + ) + ); + } } } } diff --git a/lib/util/init.git.js b/lib/util/init.git.js index b6525d1a6..169eedf37 100644 --- a/lib/util/init.git.js +++ b/lib/util/init.git.js @@ -4,8 +4,8 @@ import File from './file.js'; import inquirer from 'inquirer'; import { Util } from './util.js'; import commandExists from 'command-exists'; -import gitFactory from 'simple-git'; -const git = gitFactory(); +import { simpleGit } from 'simple-git'; +const git = simpleGit(); /** * CLI helper class @@ -78,7 +78,7 @@ const Init = { /** * offer to push the new repo straight to the server * - * @returns {void} + * @returns {Promise.} - */ async gitPush() { const skipInteraction = Util.skipInteraction; @@ -124,7 +124,7 @@ const Init = { /** * offers to add the git remote origin * - * @returns {string} repo name (optionally) + * @returns {Promise.} repo name (optionally) */ async _addGitRemote() { const skipInteraction = Util.skipInteraction; @@ -178,7 +178,7 @@ const Init = { /** * checks global config and ask to config the user info and then store it locally * - * @returns {void} + * @returns {Promise.} - */ async _updateGitConfigUser() { const skipInteraction = Util.skipInteraction; diff --git a/lib/util/init.js b/lib/util/init.js index 05d7b0100..6a6fa368e 100644 --- a/lib/util/init.js +++ b/lib/util/init.js @@ -40,7 +40,7 @@ const Init = { * Creates template file for properties.json * * @param {Mcdevrc} properties config file's json - * @param {string} credentialName identifying name of the installed package / project + * @param {string} [credentialName] identifying name of the installed package / project; if set, will update this credential * @returns {Promise.} - */ async initProject(properties, credentialName) { @@ -176,14 +176,12 @@ const Init = { // set up IDE files and load npm dependencies - let status = await this.upgradeProject(properties, true, initGit.repoName); - if (!status) { + if (!(await this.upgradeProject(properties, true, initGit.repoName))) { return; } // ask for credentials and create mcdev config - status = await Cli.initMcdevConfig(); - if (!status) { + if (!(await Cli.initMcdevConfig())) { return; } @@ -417,7 +415,7 @@ const Init = { return false; } // version 4 release to simplify auth - status = await InitConfig.upgradeAuthFile(properties); + status = await InitConfig.upgradeAuthFile(); if (!status) { return false; } @@ -441,7 +439,7 @@ const Init = { * check if git repo is being saved on a cloud service and warn the user * * @private - * @returns {void} throws errors if problems were found + * @returns {Promise.} true if path is good; false if project seems to be in a cloud service folder */ async _checkPathForCloud() { const absolutePath = path.resolve(''); diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 1d67c0b8e..30f9bca1f 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -281,11 +281,11 @@ */ /** * @typedef {import('sfmc-sdk').default} SDK - * @typedef {import('sfmc-sdk/lib/auth').default} SDKauth - * @typedef {import('sfmc-sdk/lib/rest').default} SDKrest - * @typedef {import('sfmc-sdk/lib/soap').default} SDKsoap - * @typedef {import('sfmc-sdk/lib/util').RestError} RestError - * @typedef {import('sfmc-sdk/lib/util').SOAPError} SOAPError + * @typedef {import('sfmc-sdk/auth').default} SDKauth + * @typedef {import('sfmc-sdk/rest').default} SDKrest + * @typedef {import('sfmc-sdk/soap').default} SDKsoap + * @typedef {import('sfmc-sdk/util').RestError} RestError + * @typedef {import('sfmc-sdk/util').SOAPError} SOAPError * @typedef {SOAPError & RestError} SDKError */ @@ -298,6 +298,9 @@ * @property {string} [credentialName] how you would like the credential to be named * @property {string} [gitRemoteUrl] URL of Git remote server * @property {boolean} [fixKeysReretrieve] will trigger re-downloading latest versions of dependent types after fixing keys + * @property {string} [gitPush] used by mcdev init to directly push to a remote + * @property {string} [developmentBu] used by mcdev init to directly push to a remote + * @property {string} [downloadBUs] used by mcdev init to directly push to a remote */ /** @@ -336,10 +339,9 @@ complex * @property {Object.} markets templating variables grouped by markets * @property {object} marketList combination of markets and BUs for streamlined deployments * @property {object} metaDataTypes templating variables grouped by markets - * @property {string[]} metaDataTypes.retrieve define what types shall be downloaded by default during retrieve + * @property {SupportedMetadataTypes[]} metaDataTypes.retrieve define what types shall be downloaded by default during retrieve * @property {string[]} metaDataTypes.documentOnRetrieve which types should be parsed & documented after retrieve * @property {string} version mcdev version that last updated the config file - * @property {object} [marketBulk] deprecated in favor of marketList */ /** From acc9409236c39640b82ee5af6957af562b22713e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 4 Apr 2024 17:25:13 +0200 Subject: [PATCH 078/359] #1246: regression fix from f9ef1effa51fd75618d9befc4a7d78ea65513782 --- lib/util/util.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/util/util.js b/lib/util/util.js index 8b0228f2f..c02e7c805 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -575,7 +575,7 @@ export const Util = { // sort list & remove the undefined dependencies const flatList = toposort(dependencies).filter((a) => !!a); - /** @type {Object.>} */ + /** @type {Object.>} */ const setList = {}; // group subtypes per type for (const type of flatList) { @@ -611,9 +611,7 @@ export const Util = { const finalList = {}; for (const type of Object.keys(setList)) { - if (setList[type] instanceof Set) { - finalList[type] = [...setList[type]]; - } + finalList[type] = setList[type] instanceof Set ? [...setList[type]] : null; } return finalList; From 6d7b39a7578c26fa6db486278a07cb0c7594f325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 4 Apr 2024 17:32:57 +0200 Subject: [PATCH 079/359] #1246: another regression fix for f9ef1effa51fd75618d9befc4a7d78ea65513782 --- lib/util/file.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/util/file.js b/lib/util/file.js index b393baf4e..304939450 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -208,9 +208,9 @@ const File = { * @returns {Promise.} formatted code */ beautify_beautyAmp_beautify: async function (content, formatHTML = true) { - const response = beautyAmp.beautify(content, formatHTML); - if (response == typeof 'string') { - return (await response).trim() + '\n'; + const response = await beautyAmp.beautify(content, formatHTML); + if (typeof response == 'string') { + return response.trim() + '\n'; } else { throw new TypeError('beautyAmp failed to beautify the content'); } From 8d3b4be67d0e73efdd90cb06e864c57ee83df385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 4 Apr 2024 18:31:34 +0200 Subject: [PATCH 080/359] #1246: removed type SupportedMetadataTypes in favor of "string" caused too many issues and didnt really help --- lib/Deployer.js | 9 ++++----- lib/Retriever.js | 7 +++---- lib/index.js | 42 +++++++++++++++++++--------------------- lib/util/auth.js | 1 - lib/util/businessUnit.js | 1 - lib/util/cache.js | 9 ++++----- lib/util/cli.js | 5 ++--- lib/util/config.js | 1 - lib/util/devops.js | 1 - lib/util/file.js | 1 - lib/util/init.config.js | 1 - lib/util/init.js | 1 - lib/util/util.js | 35 ++++++++++++++++----------------- types/mcdev.d.js | 2 +- 14 files changed, 51 insertions(+), 65 deletions(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index 67ddab538..4ece9f1b9 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -22,7 +22,6 @@ import auth from './util/auth.js'; * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap - * @typedef {import('../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap */ @@ -58,7 +57,7 @@ class Deployer { * Deploys all metadata located in the 'deploy' directory to the specified business unit * * @param {string} businessUnit references credentials from properties.json - * @param {SupportedMetadataTypes[]} [selectedTypesArr] limit deployment to given metadata type + * @param {string[]} [selectedTypesArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) */ @@ -201,7 +200,7 @@ class Deployer { * @param {string} cred name of Credential * @param {string} bu name of BU * @param {Mcdevrc} properties General configuration to be used in retrieve - * @param {SupportedMetadataTypes[]} [typeArr] limit deployment to given metadata type + * @param {string[]} [typeArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.} ensure that BUs are worked on sequentially */ @@ -227,7 +226,7 @@ class Deployer { /** * Deploy all metadata that is located in the deployDir * - * @param {SupportedMetadataTypes[]} [typeArr] limit deployment to given metadata type (can include subtype) + * @param {string[]} [typeArr] limit deployment to given metadata type (can include subtype) * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.} Promise of all deployed metadata */ @@ -364,7 +363,7 @@ class Deployer { * * @param {string} deployDir root directory of metadata. * @param {MultiMetadataTypeMap} metadata list of metadata - * @param {SupportedMetadataTypes[]} metadataTypeArr list of metadata types + * @param {string[]} metadataTypeArr list of metadata types * @returns {void} */ static async createFolderDefinitions(deployDir, metadata, metadataTypeArr) { diff --git a/lib/Retriever.js b/lib/Retriever.js index 25889fb52..f86000e27 100644 --- a/lib/Retriever.js +++ b/lib/Retriever.js @@ -20,7 +20,6 @@ import auth from './util/auth.js'; * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ @@ -50,7 +49,7 @@ class Retriever { /** * Retrieve metadata of specified types into local file system and Retriever.metadata * - * @param {SupportedMetadataTypes[]} metadataTypes list of metadata types to retrieve; can include subtypes! + * @param {string[]} metadataTypes list of metadata types to retrieve; can include subtypes! * @param {string[] | TypeKeyCombo} [namesOrKeys] name of Metadata to retrieveAsTemplate or list of keys for normal retrieval * @param {TemplateMap} [templateVariables] Object of values which can be replaced (in case of templating) * @param {boolean} [changelogOnly] skip saving, only create json in memory @@ -210,8 +209,8 @@ class Retriever { /** * helper for {@link Retriever.retrieve} to get all dependencies of the given types * - * @param {SupportedMetadataTypes[]} metadataTypes list of metadata types to retrieve; can include subtypes! - * @returns {SupportedMetadataTypes[]} unique list dependent metadata types + * @param {string[]} metadataTypes list of metadata types to retrieve; can include subtypes! + * @returns {string[]} unique list dependent metadata types */ _getTypeDependencies(metadataTypes) { let dependencies = []; diff --git a/lib/index.js b/lib/index.js index ceeb4e78d..e68d72900 100644 --- a/lib/index.js +++ b/lib/index.js @@ -31,7 +31,6 @@ import cache from './util/cache.js'; * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../types/mcdev.d.js').SkipInteraction} SkipInteraction * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ @@ -180,7 +179,7 @@ class Mcdev { * Retrieve all metadata from the specified business unit into the local file system. * * @param {string} businessUnit references credentials from properties.json - * @param {SupportedMetadataTypes[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type * @param {string[]} [keys] limit retrieval to given metadata key * @param {boolean} [changelogOnly] skip saving, only create json in memory * @returns {Promise.} - @@ -305,10 +304,9 @@ class Mcdev { /** * helper for {@link Mcdev.retrieve} * - * @private * @param {string} cred name of Credential * @param {string} bu name of BU - * @param {SupportedMetadataTypes[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type/subtype + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type/subtype * @param {string[]} [keys] limit retrieval to given metadata key * @param {boolean} [changelogOnly] skip saving, only create json in memory * @returns {Promise.} ensure that BUs are worked on sequentially @@ -346,7 +344,7 @@ class Mcdev { for (const selectedType of Array.isArray(selectedTypesArr) ? selectedTypesArr : Object.keys(selectedTypesArr)) { - const [type, subType] = Util.getTypeAndSubType(selectedType); + const { type, subType } = Util.getTypeAndSubType(selectedType); const removePathArr = [properties.directories.retrieve, cred, bu, type]; if ( type && @@ -418,7 +416,7 @@ class Mcdev { * Deploys all metadata located in the 'deploy' directory to the specified business unit * * @param {string} businessUnit references credentials from properties.json - * @param {SupportedMetadataTypes[]} [selectedTypesArr] limit deployment to given metadata type + * @param {string[]} [selectedTypesArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) */ @@ -515,7 +513,7 @@ class Mcdev { * deletes metadata from MC instance by key * * @param {string} businessUnit references credentials from properties.json - * @param {SupportedMetadataTypes} type supported metadata type + * @param {string} type supported metadata type * @param {string} customerKey Identifier of metadata * @returns {Promise.} true if successful, false otherwise */ @@ -553,7 +551,7 @@ class Mcdev { * get name & key for provided id * * @param {string} businessUnit references credentials from properties.json - * @param {SupportedMetadataTypes} type supported metadata type + * @param {string} type supported metadata type * @param {string} id Identifier of metadata * @returns {Promise.<{key:string, name:string, path:string}>} key, name and path of metadata; null if not found */ @@ -596,7 +594,7 @@ class Mcdev { * ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails * * @param {string} businessUnit references credentials from properties.json - * @param {SupportedMetadataTypes} type references credentials from properties.json + * @param {string} type references credentials from properties.json * @param {string[]} [keyArr] metadata keys * @returns {Promise.} - */ @@ -705,7 +703,7 @@ class Mcdev { * Retrieve a specific metadata file and templatise. * * @param {string} businessUnit references credentials from properties.json - * @param {SupportedMetadataTypes} selectedType supported metadata type + * @param {string} selectedType supported metadata type * @param {string[]} name name of the metadata * @param {string} market market which should be used to revert template * @returns {Promise.} - @@ -720,7 +718,7 @@ class Mcdev { if (!Util._isValidType(selectedType)) { return; } - const [type, subType] = Util.getTypeAndSubType(selectedType); + const { type, subType } = Util.getTypeAndSubType(selectedType); let retrieveTypesArr; if ( @@ -817,7 +815,7 @@ class Mcdev { * Schedule an item (shortcut for execute --schedule) * * @param {string} businessUnit name of BU - * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {string} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of scheduled item keys */ @@ -829,7 +827,7 @@ class Mcdev { * Start/execute an item * * @param {string} businessUnit name of BU - * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {string} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of executed item keys */ @@ -840,7 +838,7 @@ class Mcdev { * pause an item * * @param {string} businessUnit name of BU - * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {string} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of paused item keys */ @@ -851,7 +849,7 @@ class Mcdev { * Updates the key to match the name field * * @param {string} businessUnit name of BU - * @param {SupportedMetadataTypes} selectedType limit to given metadata types + * @param {string} selectedType limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of paused item keys */ @@ -863,7 +861,7 @@ class Mcdev { * * @param {'execute'|'pause'|'fixKeys'} methodName what to run * @param {string} businessUnit name of BU - * @param {SupportedMetadataTypes} [selectedType] limit to given metadata types + * @param {string} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of affected item keys */ @@ -1027,8 +1025,8 @@ class Mcdev { * @param {'execute'|'pause'|'fixKeys'} methodName what to run * @param {string} cred name of Credential * @param {string} bu name of BU - * @param {SupportedMetadataTypes} [type] limit execution to given metadata type - * @param {string[]} keyArr customerkey of the metadata + * @param {string} [type] limit execution to given metadata type + * @param {string[]} [keyArr] customerkey of the metadata * @returns {Promise.} list of keys that were affected */ static async #runOnBU(methodName, cred, bu, type, keyArr) { @@ -1080,11 +1078,11 @@ class Mcdev { } /** - * helper for {@link Mcdev.#runOnBU} + * helper for Mcdev.#runOnBU * - * @param {SupportedMetadataTypes} selectedType limit execution to given metadata type + * @param {string} selectedType limit execution to given metadata type * @param {BuObject} buObject properties for auth - * @returns {string[]} keyArr + * @returns {Promise.} keyArr */ static async #retrieveKeysWithLike(selectedType, buObject) { const properties = await config.getProperties(); @@ -1148,7 +1146,7 @@ class Mcdev { * * @param {string} cred name of Credential * @param {string} bu name of BU - * @param {SupportedMetadataTypes} type limit execution to given metadata type + * @param {string} type limit execution to given metadata type * @param {string[]} [keyArr] customerkey of the metadata * @returns {Promise.} list of keys that were affected */ diff --git a/lib/util/auth.js b/lib/util/auth.js index d103458c5..eb335b7e8 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -18,7 +18,6 @@ import Conf from 'conf'; * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ diff --git a/lib/util/businessUnit.js b/lib/util/businessUnit.js index befd82062..4e35d0d6f 100644 --- a/lib/util/businessUnit.js +++ b/lib/util/businessUnit.js @@ -19,7 +19,6 @@ import auth from './auth.js'; * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ diff --git a/lib/util/cache.js b/lib/util/cache.js index d2cf0cf8a..8ca995b19 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -16,7 +16,6 @@ import { Util } from './util.js'; * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ @@ -68,7 +67,7 @@ export default { /** * return a specific item from cache * - * @param {SupportedMetadataTypes} type of Metadata to retrieve from cache + * @param {string} type of Metadata to retrieve from cache * @param {string} key of the specific metadata * @returns {MetadataTypeItem} cached metadata item */ @@ -76,7 +75,7 @@ export default { /** * override cache for given metadata type with new data * - * @param {SupportedMetadataTypes} type of Metadata to retrieve from cache + * @param {string} type of Metadata to retrieve from cache * @param {MetadataTypeMap} metadataMap map to be set * @returns {void} */ @@ -86,7 +85,7 @@ export default { /** * merges entire metadata type with existing cache * - * @param {SupportedMetadataTypes} type of Metadata to retrieve from cache + * @param {string} type of Metadata to retrieve from cache * @param {MetadataTypeMap} metadataMap map to be merged * @param {number} overrideMID which should be used for merging * @returns {void} @@ -105,7 +104,7 @@ export default { /** * standardized method for getting data from cache. * - * @param {SupportedMetadataTypes} metadataType metadata type ie. query + * @param {string} metadataType metadata type ie. query * @param {string|number|boolean} searchValue unique identifier of metadata being looked for * @param {string} searchField field name (key in object) which contains the unique identifer * @param {string} returnField field which should be returned diff --git a/lib/util/cli.js b/lib/util/cli.js index d0718d37e..45ced182d 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -27,7 +27,6 @@ import TransactionalMessage from './../metadataTypes/TransactionalMessage.js'; * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ @@ -78,8 +77,8 @@ const Cli = { /** * - * @param {SupportedMetadataTypes} type limit execution to given metadata type - * @param {SupportedMetadataTypes[]} dependentTypes types that depent on type + * @param {string} type limit execution to given metadata type + * @param {string[]} dependentTypes types that depent on type * @returns {Promise.} true if user wants to continue with retrieve */ async postFixKeysReretrieve(type, dependentTypes) { diff --git a/lib/util/config.js b/lib/util/config.js index eef5e773e..b00acaa7e 100644 --- a/lib/util/config.js +++ b/lib/util/config.js @@ -22,7 +22,6 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ diff --git a/lib/util/devops.js b/lib/util/devops.js index ae0d59775..c3ecbd4a4 100644 --- a/lib/util/devops.js +++ b/lib/util/devops.js @@ -25,7 +25,6 @@ import jsonToTable from 'json-to-table'; * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ diff --git a/lib/util/file.js b/lib/util/file.js index 304939450..f8227101e 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -25,7 +25,6 @@ import updateNotifier from 'update-notifier'; * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ diff --git a/lib/util/init.config.js b/lib/util/init.config.js index 1f6d3d07f..ae5e938f4 100644 --- a/lib/util/init.config.js +++ b/lib/util/init.config.js @@ -26,7 +26,6 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ diff --git a/lib/util/init.js b/lib/util/init.js index 6a6fa368e..38b703c80 100644 --- a/lib/util/init.js +++ b/lib/util/init.js @@ -26,7 +26,6 @@ import path from 'node:path'; * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ diff --git a/lib/util/util.js b/lib/util/util.js index c02e7c805..8e967a20d 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -30,7 +30,6 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap * @typedef {import('../../types/mcdev.d.js').SkipInteraction} SkipInteraction * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams - * @typedef {import('../../types/mcdev.d.js').SupportedMetadataTypes} SupportedMetadataTypes * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError @@ -186,12 +185,12 @@ export const Util = { /** * helper for Mcdev.retrieve, Mcdev.retrieveAsTemplate and Mcdev.deploy * - * @param {SupportedMetadataTypes} selectedType type or type-subtype + * @param {string} selectedType type or type-subtype * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method * @returns {boolean} type ok or not */ _isValidType(selectedType, handleOutside) { - const [type, subType] = Util.getTypeAndSubType(selectedType); + const { type, subType } = Util.getTypeAndSubType(selectedType); if (type && !MetadataDefinitions[type]) { if (!handleOutside) { Util.logger.error(`:: '${type}' is not a valid metadata type`); @@ -214,23 +213,23 @@ export const Util = { * helper that deals with extracting type and subtype * * @param {string} selectedType "type" or "type-subtype" - * @returns {string[]} first elem is type, second elem is subType + * @returns {{type:string, subType:string}} first elem is type, second elem is subType */ getTypeAndSubType(selectedType) { if (selectedType) { const temp = selectedType.split('-'); const type = temp.shift(); // remove first item which is the main typ const subType = temp.join('-'); // subType can include "-" - return [type, subType]; + return { type, subType }; } else { - return []; + return { type: null, subType: null }; } }, /** * helper for getDefaultProperties() * - * @returns {SupportedMetadataTypes[]} type choices + * @returns {string[]} type choices */ getRetrieveTypeChoices() { const typeChoices = []; @@ -578,32 +577,32 @@ export const Util = { /** @type {Object.>} */ const setList = {}; // group subtypes per type - for (const type of flatList) { - if (type.includes('-')) { - const [key, subKey] = Util.getTypeAndSubType(type); - if (setList[key] === null) { + for (const flatType of flatList) { + if (flatType.includes('-')) { + const { type, subType } = Util.getTypeAndSubType(flatType); + if (setList[type] === null) { // if main type is already required, then don't filter by subtypes continue; - } else if (setList[key] && subKey) { + } else if (setList[type] && subType) { // add another subtype to the set - setList[key].add(subKey); + setList[type].add(subType); continue; } else { // create a new set with the first subtype; subKey will be always set here - setList[key] = new Set([subKey]); + setList[type] = new Set([subType]); } - if (subTypeDeps[key]) { + if (subTypeDeps[type]) { // check if there are depndent subtypes that need to be added /** @type {string[]} */ - const temp = [...subTypeDeps[key]].map((a) => { + const temp = [...subTypeDeps[type]].map((a) => { const temp = a.split('-'); temp.shift(); // remove first item which is the main type return temp.join('-'); // subType can include "-" }); - setList[key].add(...temp); // TODO - this might have only added the first item? + setList[type].add(...temp); // TODO - this might have only added the first item? } } else { - setList[type] = null; + setList[flatType] = null; } } // convert sets into arrays diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 30f9bca1f..9828c20d5 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -10,7 +10,7 @@ */ /** * @typedef {Object.} TemplateMap - * @typedef {'accountUser'|'asset'|'asset-archive'|'asset-asset'|'asset-audio'|'asset-block'|'asset-code'|'asset-document'|'asset-image'|'asset-message'|'asset-other'|'asset-rawimage'|'asset-template'|'asset-textfile'|'asset-video'|'attributeGroup'|'automation'|'campaign'|'contentArea'|'dataExtension'|'dataExtensionField'|'dataExtensionTemplate'|'dataExtract'|'dataExtractType'|'discovery'|'email'|'emailSend'|'event'|'fileTransfer'|'filter'|'folder'|'fileLocation'|'importFile'|'interaction'|'list'|'mobileCode'|'mobileKeyword'|'query'|'role'|'script'|'setDefinition'|'triggeredSend'} SupportedMetadataTypes + * @typedef {'asset'|'asset-archive'|'asset-asset'|'asset-audio'|'asset-block'|'asset-code'|'asset-document'|'asset-image'|'asset-message'|'asset-other'|'asset-rawimage'|'asset-template'|'asset-textfile'|'asset-video'|'attributeGroup'|'attributeSet'|'automation'|'campaign'|'contentArea'|'dataExtension'|'dataExtensionField'|'dataExtensionTemplate'|'dataExtract'|'dataExtractType'|'discovery'|'email'|'emailSend'|'event'|'fileLocation'|'fileTransfer'|'filter'|'folder'|'importFile'|'journey'|'list'|'mobileCode'|'mobileKeyword'|'mobileMessage'|'query'|'role'|'script'|'sendClassification'|'transactionalEmail'|'transactionalPush'|'transactionalSMS'|'triggeredSend'|'user'|'verification'} SupportedMetadataTypes * @typedef {Object.} TypeKeyCombo object-key=metadata type, value=array of external keys */ From 82e71710a971e4eb6fce240b5242a460582c656b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 4 Apr 2024 18:40:06 +0200 Subject: [PATCH 081/359] #1246: enhanced validation fixes --- lib/Builder.js | 1 - lib/Deployer.js | 2 +- lib/cli.js | 6 ++++-- lib/index.js | 6 +++--- lib/retrieveChangelog.js | 9 +++++++-- lib/util/cache.js | 2 +- lib/util/devops.js | 4 ++-- types/mcdev.d.js | 8 ++++---- 8 files changed, 22 insertions(+), 16 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index e8f24562d..402524a3f 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -155,7 +155,6 @@ saved /** @type {MetadataTypeItemObj[]} */ const result = await Promise.all( keyArr.map((key) => { - MetadataTypeInfo[type].client = this.client; MetadataTypeInfo[type].properties = this.properties; MetadataTypeInfo[type].buObject = this.buObject; diff --git a/lib/Deployer.js b/lib/Deployer.js index 4ece9f1b9..d29e6cf60 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -364,7 +364,7 @@ class Deployer { * @param {string} deployDir root directory of metadata. * @param {MultiMetadataTypeMap} metadata list of metadata * @param {string[]} metadataTypeArr list of metadata types - * @returns {void} + * @returns {Promise.} folder metadata */ static async createFolderDefinitions(deployDir, metadata, metadataTypeArr) { let i = 0; diff --git a/lib/cli.js b/lib/cli.js index c03ce8a65..546ef98c2 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -9,6 +9,7 @@ import { Util } from './util/util.js'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import Mcdev from './index.js'; +// @ts-expect-error - yargs is not properly typed. yargs(hideBin(process.argv)) .scriptName('mcdev') .usage('$0 [options]') @@ -107,7 +108,7 @@ yargs(hideBin(process.argv)) handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.deploy(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY), argv.fromRetrieve); + Mcdev.deploy(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); }, }) .command({ @@ -397,6 +398,7 @@ yargs(hideBin(process.argv)) }, handler: (argv) => { Mcdev.setOptions(argv); + // @ts-expect-error - us passing in argv directly here is a bit lazy and ts warns us about it... Mcdev.createDeltaPkg(argv); }, }) @@ -596,7 +598,7 @@ yargs(hideBin(process.argv)) desc: 'Add NPM dependencies and IDE configuration files to your project', handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.upgrade(argv.skipInteraction); + Mcdev.upgrade(); }, }) .option('verbose', { diff --git a/lib/index.js b/lib/index.js index e68d72900..77aa8d85c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -49,7 +49,7 @@ class Mcdev { /** * helper method to use unattended mode when including mcdev as a package * - * @param {boolean | SkipInteraction} [skipInteraction] signals what to insert automatically for things usually asked via wizard + * @param {SkipInteraction} [skipInteraction] signals what to insert automatically for things usually asked via wizard * @returns {void} */ static setSkipInteraction(skipInteraction) { @@ -776,7 +776,7 @@ class Mcdev { * @param {string} listName name of list of BU-market combos * @param {string} type supported metadata type * @param {string} name name of the metadata - * @returns {Promise.} - + * @returns {Promise.} - */ static async buildDefinitionBulk(listName, type, name) { Util.startLogger(); @@ -1020,7 +1020,7 @@ class Mcdev { return resultObj; } /** - * helper for {@link Mcdev.#runMethod} + * helper for Mcdev.#runMethod * * @param {'execute'|'pause'|'fixKeys'} methodName what to run * @param {string} cred name of Credential diff --git a/lib/retrieveChangelog.js b/lib/retrieveChangelog.js index c6130ad7e..5dff1d566 100644 --- a/lib/retrieveChangelog.js +++ b/lib/retrieveChangelog.js @@ -44,7 +44,7 @@ const customDefinition = { }; (async function () { // get userid>name mapping - const userList = (await mcdev.retrieve('ACN-Learning/_ParentBU_', 'user', true)).user; + const userList = (await mcdev.retrieve('ACN-Learning/_ParentBU_', ['user'], null, true)).user; // reduce userList to simple id-name map for (const key of Object.keys(userList)) { userList[userList[key].ID] = userList[key].Name; @@ -52,7 +52,12 @@ const customDefinition = { } // get changed metadata - const changelogList = await mcdev.retrieve('ACN-Learning/MCDEV_Training_Source', null, true); + const changelogList = await mcdev.retrieve( + 'ACN-Learning/MCDEV_Training_Source', + null, + null, + true + ); const allMetadata = []; Object.keys(changelogList).map((type) => { if (changelogList[type]) { diff --git a/lib/util/cache.js b/lib/util/cache.js index 8ca995b19..c51528411 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -87,7 +87,7 @@ export default { * * @param {string} type of Metadata to retrieve from cache * @param {MetadataTypeMap} metadataMap map to be merged - * @param {number} overrideMID which should be used for merging + * @param {number} [overrideMID] which should be used for merging * @returns {void} */ mergeMetadata: (type, metadataMap, overrideMID) => { diff --git a/lib/util/devops.js b/lib/util/devops.js index c3ecbd4a4..bffaf4372 100644 --- a/lib/util/devops.js +++ b/lib/util/devops.js @@ -3,8 +3,8 @@ import path from 'node:path'; import inquirer from 'inquirer'; import { Util } from './util.js'; import Cli from './cli.js'; -import gitFactory from 'simple-git'; -const git = gitFactory(); +import { simpleGit } from 'simple-git'; +const git = simpleGit(); import Builder from '../Builder.js'; import MetadataType from '../MetadataTypeInfo.js'; import jsonToTable from 'json-to-table'; diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 9828c20d5..7c9cb66ed 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -19,8 +19,8 @@ * @typedef {Object.} MetadataTypeMap key=customer key * @typedef {Object.} MultiMetadataTypeMap key=Supported MetadataType * @typedef {Object.} MultiMetadataTypeList key=Supported MetadataType - * @typedef {{metadata: MetadataTypeMap, type: SupportedMetadataTypes}} MetadataTypeMapObj - * @typedef {{metadata: MetadataTypeItem, type: SupportedMetadataTypes}} MetadataTypeItemObj + * @typedef {{metadata: MetadataTypeMap, type: string}} MetadataTypeMapObj + * @typedef {{metadata: MetadataTypeItem, type: string}} MetadataTypeItemObj * @typedef {Object.} Cache key=MID * @typedef {{before: MetadataTypeItem, after: MetadataTypeItem}} MetadataTypeItemDiff used during update */ @@ -271,7 +271,7 @@ * @property {boolean} binary is a binary file * @property {boolean} moved git thinks this file was moved * @property {string} [fromPath] git thinks this relative path is where the file was before - * @property {SupportedMetadataTypes} type metadata type + * @property {string} type metadata type * @property {string} externalKey key * @property {string} name name * @property {'move'|'add/update'|'delete'} gitAction what git recognized as an action @@ -339,7 +339,7 @@ complex * @property {Object.} markets templating variables grouped by markets * @property {object} marketList combination of markets and BUs for streamlined deployments * @property {object} metaDataTypes templating variables grouped by markets - * @property {SupportedMetadataTypes[]} metaDataTypes.retrieve define what types shall be downloaded by default during retrieve + * @property {string[]} metaDataTypes.retrieve define what types shall be downloaded by default during retrieve * @property {string[]} metaDataTypes.documentOnRetrieve which types should be parsed & documented after retrieve * @property {string} version mcdev version that last updated the config file */ From 0e2b28ff04b48e2f540266daf26068bcd2c6c4b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 5 Apr 2024 18:37:23 +0200 Subject: [PATCH 082/359] #1246: further updates based on enhanced validation --- lib/metadataTypes/Asset.js | 10 ++--- lib/metadataTypes/AttributeGroup.js | 4 +- lib/metadataTypes/Automation.js | 27 +++++++------ lib/metadataTypes/DataExtension.js | 4 +- lib/metadataTypes/MetadataType.js | 62 ++++++++++++++++------------- lib/util/file.js | 3 +- types/mcdev.d.js | 13 ++++-- 7 files changed, 68 insertions(+), 55 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index b7273831d..2ff03a74c 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -105,7 +105,7 @@ class Asset extends MetadataType { * helper for {@link Asset.retrieve} + {@link Asset.retrieveAsTemplate} * * @private - * @returns {AssetSubType[]} subtype array + * @returns {string[]} AssetSubType array */ static _getSubTypes() { const selectedSubTypeArr = this.properties.metaDataTypes.retrieve.filter((type) => @@ -885,7 +885,7 @@ class Asset extends MetadataType { * * @param {AssetItem} metadata a single asset definition * @param {string} deployDir directory of deploy files - * @param {AssetSubType} subType asset-subtype name + * @param {string} subType asset-subtype name; full list in AssetSubType * @param {string} [templateName] name of the template used to built defintion (prior applying templating) * @param {boolean} [fileListOnly] does not read file contents nor update metadata if true * @returns {Promise.} fileList for templating (disregarded during deployment) @@ -1550,7 +1550,7 @@ class Asset extends MetadataType { * @param {string[]} typeDirArr current subdir for this type * @param {string} templateName name of the metadata template * @param {string} fileName name of the metadata template file w/o extension - * @returns {AssetItem} metadata + * @returns {Promise.} metadata in string form */ static async readSecondaryFolder(templateDir, typeDirArr, templateName, fileName) { // handles subtypes that create 1 folder per asset -> currently causes the below File.ReadFile to error out @@ -1562,7 +1562,7 @@ class Asset extends MetadataType { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ static async getFilesToCommit(keyArr) { const basePath = File.normalizePath([ @@ -1708,7 +1708,7 @@ class Asset extends MetadataType { * get name & key for provided id * * @param {string} id Identifier of metadata - * @returns {Promise.<{key:string, name:string, path:string}>} key, name and path of metadata; null if not found + * @returns {Promise.<{key:string, name:string, path:string, mid:number}>} key, name and path of metadata; null if not found */ static async resolveId(id) { let response; diff --git a/lib/metadataTypes/AttributeGroup.js b/lib/metadataTypes/AttributeGroup.js index 0f18ac5d0..cd853ab45 100644 --- a/lib/metadataTypes/AttributeGroup.js +++ b/lib/metadataTypes/AttributeGroup.js @@ -19,8 +19,8 @@ class AttributeGroup extends MetadataType { * Retrieves Metadata of schema attribute groups. * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 01566314a..7f2f51a28 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -16,6 +16,7 @@ import pLimit from 'p-limit'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap */ @@ -35,12 +36,13 @@ import pLimit from 'p-limit'; */ class Automation extends MetadataType { static notificationUpdates = {}; + static createdKeyMap; /** * Retrieves Metadata of Automation * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ @@ -106,9 +108,9 @@ class Automation extends MetadataType { /** * helper for {@link this.retrieveRESTcollection} * - * @param {Error} ex exception + * @param {SDKError} ex exception * @param {string} id id or key of item - * @returns {null} - + * @returns {Promise.} - */ static async handleRESTErrors(ex, id) { try { @@ -127,9 +129,8 @@ class Automation extends MetadataType { /** * helper for {@link Automation.retrieve} to get Automation Notifications * - * @private * @param {MetadataTypeMap} metadataMap keyField => metadata map - * @returns {Promise.} Promise of nothing + * @returns {Promise.} Promise of automation legacy api response */ static async #getAutomationNotificationsREST(metadataMap) { Util.logger.info(Util.getGrayMsg(` Retrieving Automation Notification information...`)); @@ -606,7 +607,7 @@ class Automation extends MetadataType { * Standardizes a check for multiple messages but adds query specific filters to error texts * * @param {object} ex response payload from REST API - * @returns {string[] | void} formatted Error Message + * @returns {void | string[]} formatted Error Message */ static getErrorsREST(ex) { const errors = super.getErrorsREST(ex); @@ -936,7 +937,7 @@ class Automation extends MetadataType { * * @private * @param {MetadataTypeItem} metadataEntry a single metadata Entry - * @returns {void} + * @returns {Promise.} - */ static async _postChangeKeyTasks(metadataEntry) { super._postChangeKeyTasks(metadataEntry, true); @@ -1477,7 +1478,7 @@ class Automation extends MetadataType { * @param {string} filename name of the file without '.json' ending * @param {AutomationItem} json dataextension.columns * @param {'html'|'md'} mode html or md - * @returns {Promise.} Promise of success of saving the file + * @returns {Promise.} Promise of success of saving the file */ static async _writeDoc(directory, filename, json, mode) { await File.ensureDir(directory); @@ -1561,9 +1562,9 @@ class Automation extends MetadataType { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { if (this.properties.metaDataTypes.documentOnRetrieve.includes(this.definition.type)) { // document automation is active. assume we want to commit the MD file as well const path = File.normalizePath([ @@ -1605,7 +1606,7 @@ class Automation extends MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success status */ static async deleteByKey(customerKey) { // the delete endpoint returns a general exception if the automation does not exist; handle it gracefully instead by adding a retrieve first @@ -1620,7 +1621,7 @@ class Automation extends MetadataType { * clean up after deleting a metadata item * * @param {string} customerKey Identifier of metadata item - * @returns {void} + * @returns {Promise.} - */ static async postDeleteTasks(customerKey) { // delete local copy: retrieve/cred/bu/.../...-meta.json diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index ae80de4fe..361fb1781 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -1489,9 +1489,9 @@ class DataExtension extends MetadataType { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { if (this.properties.metaDataTypes.documentOnRetrieve.includes(this.definition.type)) { // document dataExtension is active. assume we want to commit the MD file as well const path = File.normalizePath([ diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index a67c03c11..191af40dd 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -26,7 +26,10 @@ import Mustache from 'mustache'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap - * @typedef {import('sfmc-sdk')} SDK + * @typedef {import('../../types/mcdev.d.js').SDK} SDK + * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError + * @typedef {import('../../types/mcdev.d.js').SOAPError} SOAPError + * @typedef {import('../../types/mcdev.d.js').RestError} RestError */ /** @@ -259,10 +262,10 @@ class MetadataType { * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} metadata */ - static retrieve(retrieveDir, additionalFields, subTypeArr, key) { + static async retrieve(retrieveDir, additionalFields, subTypeArr, key) { Util.metadataLogger('error', this.definition.type, 'retrieve', `Not Supported`); const metadata = {}; - return { metadata: null, type: this.definition.type }; + return { metadata: {}, type: this.definition.type }; } /** * Gets metadata from Marketing Cloud @@ -295,7 +298,7 @@ class MetadataType { * @param {string} [subType] optionally limit to a single subtype * @returns {Promise.} metadata */ - static retrieveAsTemplate(templateDir, name, templateVariables, subType) { + static async retrieveAsTemplate(templateDir, name, templateVariables, subType) { Util.logger.error('retrieveAsTemplate is not supported yet for ' + this.definition.type); Util.metadataLogger( 'debug', @@ -429,9 +432,9 @@ class MetadataType { * * @param {MetadataTypeItem} metadata single metadata entry * @param {string} deployDir directory where deploy metadata are saved - * @returns {void} + * @returns {Promise. | null} Promise of API response or null in case of an error */ - static create(metadata, deployDir) { + static async create(metadata, deployDir) { Util.logger.error( ` ☇ skipping ${this.definition.type} ${metadata[this.definition.keyField]} / ${ metadata[this.definition.nameField] @@ -445,9 +448,9 @@ class MetadataType { * * @param {MetadataTypeItem} metadata single metadata entry * @param {MetadataTypeItem} [metadataBefore] metadata mapped by their keyField - * @returns {void} + * @returns {Promise. | null} Promise of API response or null in case of an error */ - static update(metadata, metadataBefore) { + static async update(metadata, metadataBefore) { Util.logger.error( ` ☇ skipping ${this.definition.type} ${metadata[this.definition.keyField]} / ${ metadata[this.definition.nameField] @@ -470,9 +473,10 @@ class MetadataType { /** * Abstract execute method that needs to be implemented in child metadata type * - * @returns {void} + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were executed */ - static execute() { + static async execute(keyArr) { Util.logger.error( ` ☇ skipping ${this.definition.type}: execute is not supported yet for ${this.definition.type}` ); @@ -481,9 +485,10 @@ class MetadataType { /** * Abstract pause method that needs to be implemented in child metadata type * - * @returns {void} + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were paused */ - static pause() { + static async pause(keyArr) { Util.logger.error( ` ☇ skipping ${this.definition.type}: pause is not supported yet for ${this.definition.type}` ); @@ -931,7 +936,7 @@ class MetadataType { * @private * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {boolean} [keepMap] some types require to check the old-key new-key relationship in their postDeployTasks; currently used by dataExtension only - * @returns {void} + * @returns {Promise.} - */ static async _postChangeKeyTasks(metadataEntry, keepMap = false) { if ( @@ -992,8 +997,8 @@ class MetadataType { } /** * - * @param {Error} ex error that occured - * @param {'creating'|'updating'} msg what to print in the log + * @param {SOAPError} ex error that occured + * @param {'creating'|'updating'|'retrieving'|'executing'} msg what to print in the log * @param {MetadataTypeItem} [metadataEntry] single metadata entry * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method */ @@ -1009,7 +1014,7 @@ class MetadataType { /** * helper for {@link MetadataType._handleSOAPErrors} * - * @param {Error} ex error that occured + * @param {SOAPError} ex error that occured * @returns {string} error message */ static getSOAPErrorMsg(ex) { @@ -1157,7 +1162,7 @@ class MetadataType { /** * helper for {@link this.retrieveRESTcollection} * - * @param {Error} ex exception + * @param {RestError} ex exception * @param {string} id id or key of item * @returns {null} - */ @@ -1223,7 +1228,7 @@ class MetadataType { /** * helper for {@link MetadataType.retrieveREST} and {@link MetadataType.retrieveSOAP} * - * @param {string|number} [singleRetrieve] key of single item to filter by + * @param {string|number} singleRetrieve key of single item to filter by * @param {MetadataTypeMap} metadataMap saved metadata * @returns {Promise.} - */ @@ -1274,7 +1279,7 @@ class MetadataType { } else if (singleRetrieve) { // some types will return a single item intead of an array if the key is supported by their api // ! currently, the id: prefix is only supported by journey (interaction) - if (singleRetrieve.startsWith('id:')) { + if ('string' === typeof singleRetrieve && singleRetrieve.startsWith('id:')) { singleRetrieve = body[keyField]; } metadataStructure[singleRetrieve] = body; @@ -1303,7 +1308,7 @@ class MetadataType { * deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); * @param {MetadataTypeItem} metadataEntry One entry of a metadataType * @param {string} fieldPath field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' - * @param {'isCreateable'|'isUpdateable'|'retrieving'|'templating'} definitionProperty delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] + * @param {'isCreateable'|'isUpdateable'|'retrieving'|'template'} definitionProperty delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] * @param {string} origin string of parent object, required when using arrays as these are parsed slightly differently. * @returns {void} */ @@ -1787,7 +1792,7 @@ class MetadataType { * handles extracted code if any are found for complex types (e.g script, asset, query) * * @param {string} templateDir Directory where metadata templates are stored - * @param {string} targetDir Directory where built definitions will be saved + * @param {string | string[]} targetDir Directory where built definitions will be saved * @param {MetadataTypeItem} metadata main JSON file that was read from file system * @param {TemplateMap} variables variables to be replaced in the metadata * @param {string} templateName name of the template to be built @@ -1842,11 +1847,11 @@ class MetadataType { * @param {string} templateName name of the metadata template * @param {string} fileName name of the metadata template file w/o extension * @param {Error} ex error from first attempt - * @returns {object} metadata + * @returns {Promise.} metadata in string form */ static async readSecondaryFolder(templateDir, typeDirArr, templateName, fileName, ex) { // we just want to push the method into the catch here - throw new Error(ex); + return; } /** * Builds definition based on template @@ -1948,7 +1953,7 @@ class MetadataType { * Standardizes a check for multiple messages * * @param {object} ex response payload from REST API - * @returns {string[] | void} formatted Error Message + * @returns {string[]} formatted Error Message */ static getErrorsREST(ex) { const errors = []; @@ -2001,11 +2006,11 @@ class MetadataType { * get name & key for provided id * * @param {string} id Identifier of metadata - * @returns {Promise.} key of metadata + * @returns {Promise.<{key:string, name:string}>} key, name and path of metadata; null if not found */ - static resolveId(id) { + static async resolveId(id) { Util.logger.error(`resolveId type ${this.definition.type} is not supported.`); - return false; + return; } /** @@ -2053,6 +2058,7 @@ class MetadataType { metadata[overrideKeyField || this.definition.keyField] = customerKey; const soapType = this.definition.soapType || this.definition.type; try { + // @ts-expect-error - wrong jsdoc in SFMC-SDK await this.client.soap.delete(Util.capitalizeFirstLetter(soapType), metadata, null); if (!handleOutside) { Util.logger.info(` - deleted ${this.definition.type}: ${customerKey}`); @@ -2132,7 +2138,7 @@ class MetadataType { * @param {string[]} keyArr customerkey of the metadata * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { const typeExtension = '.' + this.definition.type + '-meta.json'; const path = File.normalizePath([ this.properties.directories.retrieve, diff --git a/lib/util/file.js b/lib/util/file.js index f8227101e..98f3f92d6 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -419,7 +419,7 @@ const File = { * @param {string} filename name of the file without '.json' ending * @param {string} filetype filetype suffix * @param {string} [encoding] read file with encoding (defaults to utf-8) - * @returns {Promise. | void} file contents; void on error + * @returns {Promise.} file contents; void on error */ readFilteredFilename: function (directory, filename, filetype, encoding) { try { @@ -430,6 +430,7 @@ const File = { } catch (ex) { Util.logger.error('File.readFilteredFilename:: error | ' + ex.message); } + return; }, /** * reads directories to a specific depth returning an array diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 7c9cb66ed..e65fbd634 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -15,7 +15,7 @@ */ /** - * @typedef {Object.} MetadataTypeItem + * @typedef {object} MetadataTypeItem * @typedef {Object.} MetadataTypeMap key=customer key * @typedef {Object.} MultiMetadataTypeMap key=Supported MetadataType * @typedef {Object.} MultiMetadataTypeList key=Supported MetadataType @@ -23,6 +23,7 @@ * @typedef {{metadata: MetadataTypeItem, type: string}} MetadataTypeItemObj * @typedef {Object.} Cache key=MID * @typedef {{before: MetadataTypeItem, after: MetadataTypeItem}} MetadataTypeItemDiff used during update + * @property */ /** @@ -222,6 +223,7 @@ * @property {string} [id] Object Id * @property {string} key key * @property {string} name name + * @property {any} notifications notifications * @property {string} description - * @property {'scheduled'|'triggered'} type Starting Source = Schedule / File Drop * @property {'Scheduled'|'Running'|'Ready'|'Building'|'PausedSchedule'|'InactiveTrigger'} status - @@ -236,7 +238,7 @@ * @property {object} [startSource] - * @property {AutomationSchedule} [startSource.schedule] rewritten to AutomationItem.schedule * @property {object} [startSource.fileDrop] rewritten to AutomationItem.fileTrigger - * @property {string} startSource.fileDrop.fileNamingPattern file name with placeholders + * @property {string} startSource.fileDrop.fileNamePattern file name with placeholders * @property {string} startSource.fileDrop.fileNamePatternTypeId - * @property {string} startSource.fileDrop.folderLocation - * @property {boolean} startSource.fileDrop.queueFiles - @@ -280,13 +282,16 @@ * @typedef {import('simple-git').DiffResultTextFile & McdevDeltaPkgItem} DeltaPkgItem */ /** - * @typedef {import('sfmc-sdk').default} SDK * @typedef {import('sfmc-sdk/auth').default} SDKauth * @typedef {import('sfmc-sdk/rest').default} SDKrest * @typedef {import('sfmc-sdk/soap').default} SDKsoap * @typedef {import('sfmc-sdk/util').RestError} RestError * @typedef {import('sfmc-sdk/util').SOAPError} SOAPError * @typedef {SOAPError & RestError} SDKError + * @typedef {object} SDK + * @property {SDKauth} auth SDKauth + * @property {SDKrest} rest SDKrest + * @property {SDKsoap} soap SDKsoap */ /** @@ -315,7 +320,7 @@ * @typedef {object} SoapRequestParams * @property {string} [continueRequest] request id * @property {object} [options] additional options (CallsInConversation, Client, ConversationID, Priority, RequestType, SaveOptions, ScheduledTime, SendResponseTo, SequenceCode) - * @property {*} clientIDs ? + * @property {*} [clientIDs] ? * @property {SoapFilter} [filter] simple or complex complex * @property {boolean} [QueryAllAccounts] all BUs or just one From 2eeb3e77faa2ba364ad94c214006fd63c238fc2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sat, 6 Apr 2024 00:30:55 +0200 Subject: [PATCH 083/359] #1246: more enhanced validation fixes --- lib/metadataTypes/Asset.js | 96 +++++++++++++++------------ lib/metadataTypes/AttributeSet.js | 7 +- lib/metadataTypes/Automation.js | 1 - lib/metadataTypes/DataExtension.js | 8 +-- lib/metadataTypes/MetadataType.js | 11 ++- lib/metadataTypes/MobileKeyword.js | 32 +++++---- lib/metadataTypes/MobileMessage.js | 2 +- lib/metadataTypes/Query.js | 4 +- lib/metadataTypes/Script.js | 4 +- lib/metadataTypes/TransactionalSMS.js | 4 +- lib/metadataTypes/TriggeredSend.js | 8 +-- lib/metadataTypes/User.js | 2 +- 12 files changed, 91 insertions(+), 88 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 2ff03a74c..77dcb313f 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -35,7 +35,7 @@ class Asset extends MetadataType { * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {void} _ - - * @param {AssetSubType[]} [subTypeArr] optionally limit to a single subtype + * @param {string[]} [subTypeArr] optionally limit to a single AssetSubType * @param {string} [key] customer key * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ @@ -149,12 +149,12 @@ class Asset extends MetadataType { /** * Retrieves Metadata of a specific asset type * - * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {string} subType group of similar assets to put in a folder (ie. images) * @param {string} [retrieveDir] target directory for saving assets * @param {string} [templateName] name of the metadata file * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata - * @param {string} key customer key to filter by - * @returns {Promise} Promise + * @param {string} [key] customer key to filter by + * @returns {Promise.} Promise */ static async requestSubType(subType, retrieveDir, templateName, templateVariables, key) { if (retrieveDir) { @@ -293,7 +293,7 @@ class Asset extends MetadataType { * Retrieves extended metadata (files or extended content) of asset * * @param {Array} items array of items to retrieve - * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {string} subType group of similar assets to put in a folder (ie. images) * @param {string} retrieveDir target directory for saving assets * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata * @returns {Promise} Promise @@ -390,28 +390,26 @@ class Asset extends MetadataType { */ static _resetLogLevel(loggerLevelBak, failed) { // re-enable CLI logs - if (loggerLevelBak !== 'error') { - // reset logging level - let obj; - switch (loggerLevelBak) { - case 'info': { - obj = {}; - break; - } - case 'verbose': { - obj = { verbose: true }; - break; - } - case 'debug': { - obj = { debug: true }; - break; - } - case 'error': { - obj = { silent: true }; - } + // reset logging level + let obj; + switch (loggerLevelBak) { + case 'info': { + obj = {}; + break; + } + case 'verbose': { + obj = { verbose: true }; + break; + } + case 'debug': { + obj = { debug: true }; + break; + } + case 'error': { + obj = { silent: true }; } - Util.setLoggingLevel(obj); } + Util.setLoggingLevel(obj); if (failed.length) { Util.logger.warn( @@ -444,7 +442,7 @@ class Asset extends MetadataType { * This method retrieves these and saves them alongside the metadata json * * @param {AssetItem} metadata a single asset - * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {string} subType group of similar assets to put in a folder (ie. images) * @param {string} retrieveDir target directory for saving assets * @returns {Promise.} - */ @@ -469,7 +467,7 @@ class Asset extends MetadataType { * This method reads these from the local FS stores them in the metadata object allowing to deploy it * * @param {AssetItem} metadata a single asset - * @param {AssetSubType} subType group of similar assets to put in a folder (ie. images) + * @param {string} subType group of similar assets to put in a folder (ie. images) * @param {string} deployDir directory of deploy files * @param {boolean} [pathOnly] used by getFilesToCommit which does not need the binary file to be actually read * @returns {Promise.} if found will return the path of the binary file @@ -510,8 +508,7 @@ class Asset extends MetadataType { // folder this.setFolderPath(metadata); // extract HTML for selected subtypes and convert payload for easier processing in MetadataType.saveResults() - metadata = this._extractCode(metadata); - return metadata; + return this._extractCode(metadata); } /** @@ -664,7 +661,7 @@ class Asset extends MetadataType { * @param {string} key key of the asset * @param {string} name name of the asset * @param {string} type assetType-name - * @param {string[]} namesInFolder names of the assets in the same folder + * @param {{ type: string; key: string; name: any; }[]} namesInFolder names of the assets in the same folder * @returns {string} new name */ static _findUniqueName(key, name, type, namesInFolder) { @@ -688,7 +685,7 @@ class Asset extends MetadataType { * * @private * @param {AssetItem} metadata a single asset - * @returns {AssetSubType | void} subtype + * @returns {string} subtype */ static _getSubtype(metadata) { for (const sub in this.definition.extendedSubTypes) { @@ -696,6 +693,7 @@ class Asset extends MetadataType { return sub; } } + return; } /** * helper for {@link MetadataType.buildDefinition} @@ -758,7 +756,7 @@ class Asset extends MetadataType { * handles extracted code if any are found for complex types * * @param {string} templateDir Directory where metadata templates are stored - * @param {string} targetDir Directory where built definitions will be saved + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved * @param {AssetItem} metadata main JSON file that was read from file system * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built @@ -1444,7 +1442,7 @@ class Asset extends MetadataType { * Returns file contents mapped to their fileName without '.json' ending * * @param {string} dir directory that contains '.json' files to be read - * @param {void} [_] unused parameter + * @param {boolean} _ unused parameter * @param {string[]} selectedSubType asset, message, ... * @returns {MetadataTypeMap} fileName => fileContent map */ @@ -1514,7 +1512,7 @@ class Asset extends MetadataType { * * @param {string} templateDir Directory where metadata templates are stored * @param {string} templateName name of the metadata file - * @returns {Promise.} subtype name + * @returns {Promise.} AssetSubType name */ static async findSubType(templateDir, templateName) { const typeDirArr = [this.definition.type]; @@ -1686,7 +1684,7 @@ class Asset extends MetadataType { * cannot use the generic method due to the complexity of how assets are saved to disk * * @param {string} customerKey Identifier of metadata item - * @returns {void} + * @returns {Promise.} - */ static async postDeleteTasks(customerKey) { const fileArr = await this.getFilesToCommit([customerKey]); @@ -1708,10 +1706,17 @@ class Asset extends MetadataType { * get name & key for provided id * * @param {string} id Identifier of metadata - * @returns {Promise.<{key:string, name:string, path:string, mid:number}>} key, name and path of metadata; null if not found + * @returns {Promise.<{key:string, name:string, path:string, mid:number, error:string}>} key, name and path of metadata; null if not found */ static async resolveId(id) { let response; + const json = { + key: '', + name: '', + path: '', + mid: 0, + error: '', + }; try { response = await this.client.rest.get('asset/v1/content/assets/' + id); } catch (ex) { @@ -1732,15 +1737,16 @@ class Asset extends MetadataType { const path = paths.find((p) => File.pathExistsSync(p)); // prep response object - const json = { - key: item[this.definition.keyField], - name: item[this.definition.nameField], - mid: item.memberId, - }; + json.key = item[this.definition.keyField]; + json.name = item[this.definition.nameField]; + json.mid = item.memberId; + if (path) { json.path = path; + delete json.error; } else { json.error = 'file not found on local disk'; + delete json.path; } if (Util.OPTIONS.json) { // for automated processing by VSCode extension, optionally print the json @@ -1757,9 +1763,11 @@ class Asset extends MetadataType { } return json; } else { - const json = { - error: 'id not found', - }; + json.error = 'id not found'; + delete json.key; + delete json.mid; + delete json.name; + delete json.path; if (Util.OPTIONS.json) { console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console return json; diff --git a/lib/metadataTypes/AttributeSet.js b/lib/metadataTypes/AttributeSet.js index 981afa9b3..edc75a928 100644 --- a/lib/metadataTypes/AttributeSet.js +++ b/lib/metadataTypes/AttributeSet.js @@ -17,12 +17,13 @@ import cache from '../util/cache.js'; * @augments MetadataType */ class AttributeSet extends MetadataType { + static systemValueDefinitions; /** * Retrieves Metadata of schema set Definitions. * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ @@ -155,7 +156,7 @@ class AttributeSet extends MetadataType { * Builds map of metadata entries mapped to their keyfields * * @param {object} body json of response body - * @param {string|number} [singleRetrieve] key of single item to filter by + * @param {string} [singleRetrieve] key of single item to filter by * @returns {MetadataTypeMap} keyField => metadata map */ static parseResponseBody(body, singleRetrieve) { diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 7f2f51a28..a56fec1e2 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -935,7 +935,6 @@ class Automation extends MetadataType { /** * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed * - * @private * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @returns {Promise.} - */ diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index 361fb1781..aafbedb05 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -211,7 +211,6 @@ class DataExtension extends MetadataType { /** * helper for {@link DataExtension.upsert} * - * @private * @param {object} res - * @returns {boolean} true: keep, false: discard */ @@ -737,7 +736,7 @@ class DataExtension extends MetadataType { * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true - * @param {void} [_] unused parameter + * @param {void | string[]} [_] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise of item map */ @@ -1001,12 +1000,11 @@ class DataExtension extends MetadataType { /** * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed * - * @private * @param {MetadataTypeItem} metadataEntry a single metadata Entry - * @returns {void} + * @returns {Promise.} - */ static async _postChangeKeyTasks(metadataEntry) { - super._postChangeKeyTasks(metadataEntry, true); + return super._postChangeKeyTasks(metadataEntry, true); } /** diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 191af40dd..c431a91aa 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -933,7 +933,6 @@ class MetadataType { /** * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed * - * @private * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {boolean} [keepMap] some types require to check the old-key new-key relationship in their postDeployTasks; currently used by dataExtension only * @returns {Promise.} - @@ -1032,7 +1031,7 @@ class MetadataType { * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) - * @param {string|number} [singleRetrieve] key of single item to filter by + * @param {string} [singleRetrieve] key of single item to filter by * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @returns {Promise.} Promise of item map */ @@ -1070,7 +1069,7 @@ class MetadataType { * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {string} uri rest endpoint for GET * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata - * @param {string|number} [singleRetrieve] key of single item to filter by + * @param {string} [singleRetrieve] key of single item to filter by * @returns {Promise.<{metadata: (MetadataTypeMap | MetadataTypeItem), type: string}>} Promise of item map (single item for templated result) */ static async retrieveREST(retrieveDir, uri, templateVariables, singleRetrieve) { @@ -1257,7 +1256,7 @@ class MetadataType { * Builds map of metadata entries mapped to their keyfields * * @param {object} body json of response body - * @param {string|number} [singleRetrieve] key of single item to filter by + * @param {string} [singleRetrieve] key of single item to filter by * @returns {MetadataTypeMap} keyField => metadata map */ static parseResponseBody(body, singleRetrieve) { @@ -2017,9 +2016,9 @@ class MetadataType { * Delete a metadata item from the specified business unit * * @param {string} customerKey Identifier of data extension - * @returns {boolean} deletion success status + * @returns {Promise.} deletion success status */ - static deleteByKey(customerKey) { + static async deleteByKey(customerKey) { Util.logger.error(`Deletion is not yet supported for ${this.definition.typeName}!`); return false; } diff --git a/lib/metadataTypes/MobileKeyword.js b/lib/metadataTypes/MobileKeyword.js index 128b33744..8cbb1b5c9 100644 --- a/lib/metadataTypes/MobileKeyword.js +++ b/lib/metadataTypes/MobileKeyword.js @@ -29,10 +29,10 @@ class MobileKeyword extends MetadataType { * Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise. | void} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { try { @@ -55,13 +55,14 @@ class MobileKeyword extends MetadataType { throw ex; } } + return; } /** * Builds map of metadata entries mapped to their keyfields * * @param {object} body json of response body - * @param {string|number} [singleRetrieve] key of single item to filter by + * @param {string} [singleRetrieve] key of single item to filter by * @returns {MetadataTypeMap} keyField => metadata map */ static parseResponseBody(body, singleRetrieve) { @@ -110,8 +111,7 @@ class MobileKeyword extends MetadataType { /** * helper for {@link MobileKeyword.parseResponseBody} that creates a custom key field for this type based on mobileCode and keyword * - * @private - * @param {MetadataType} metadata single item + * @param {MetadataTypeItem} metadata single item */ static #createCustomKeyField(metadata) { metadata.c__codeKeyword = metadata.code.code + '.' + metadata.keyword; @@ -120,8 +120,7 @@ class MobileKeyword extends MetadataType { /** * helper for {@link MobileKeyword.preDeployTasks} and {@link MobileKeyword.createOrUpdate} to ensure we have code & keyword properly set * - * @private - * @param {MetadataType} metadata single item + * @param {MetadataTypeItem} metadata single item */ static #setCodeAndKeyword(metadata) { const [code, keyword] = metadata.c__codeKeyword.split('.'); @@ -163,8 +162,8 @@ class MobileKeyword extends MetadataType { /** * Retrieves event definition metadata for caching * - * @param {void} [_] parameter not used - * @param {void} [__] parameter not used + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ @@ -206,7 +205,6 @@ class MobileKeyword extends MetadataType { /** * helper for {@link MobileKeyword.retrieve} and {@link MobileKeyword.retrieveAsTemplate} * - * @private * @param {string} key customer key of single item to retrieve / name of the metadata file * @returns {Array} key, queryParams */ @@ -385,7 +383,7 @@ class MobileKeyword extends MetadataType { if (!code) { return null; } - const file = this.prepExtractedCode(code, metadata.name); + const file = this.prepExtractedCode(code); const fileExt = file.fileExt; code = file.code; // apply templating @@ -461,7 +459,7 @@ class MobileKeyword extends MetadataType { * * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call - * @returns {void} + * @returns {Promise.} - */ static async postCreateTasks(metadataEntry, apiResponse) { await super.postDeployTasks_legacyApi(metadataEntry, apiResponse); @@ -471,7 +469,7 @@ class MobileKeyword extends MetadataType { * * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call - * @returns {void} + * @returns {Promise.} - */ static async postUpdateTasks(metadataEntry, apiResponse) { await super.postDeployTasks_legacyApi(metadataEntry, apiResponse); @@ -530,7 +528,7 @@ class MobileKeyword extends MetadataType { * clean up after deleting a metadata item * * @param {string} customerKey Identifier of metadata item - * @returns {void} + * @returns {Promise.} - */ static async postDeleteTasks(customerKey) { // delete local copy: retrieve/cred/bu/type/...-meta.json @@ -542,9 +540,9 @@ class MobileKeyword extends MetadataType { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { const path = File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/MobileMessage.js b/lib/metadataTypes/MobileMessage.js index be3300cb9..7b65dd916 100644 --- a/lib/metadataTypes/MobileMessage.js +++ b/lib/metadataTypes/MobileMessage.js @@ -140,7 +140,7 @@ class MobileMessage extends MetadataType { * @param {string[]} keyArr customerkey of the metadata * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { const path = File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index 98ca1a786..2c011dbea 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -419,9 +419,9 @@ class Query extends MetadataType { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { const path = File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index cac486f54..9ddc0bc45 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -315,9 +315,9 @@ class Script extends MetadataType { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { const path = File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/TransactionalSMS.js b/lib/metadataTypes/TransactionalSMS.js index 09ef81877..6685fed5c 100644 --- a/lib/metadataTypes/TransactionalSMS.js +++ b/lib/metadataTypes/TransactionalSMS.js @@ -314,9 +314,9 @@ class TransactionalSMS extends TransactionalMessage { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ - static getFilesToCommit(keyArr) { + static async getFilesToCommit(keyArr) { const path = File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 08d9914df..7d2a91b58 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -30,8 +30,8 @@ class TriggeredSend extends MetadataType { * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ @@ -164,7 +164,7 @@ class TriggeredSend extends MetadataType { * prepares a TSD for deployment * * @param {MetadataTypeItem} metadata of a single TSD - * @returns {MetadataTypeItem} metadata object + * @returns {Promise.} metadata object */ static async preDeployTasks(metadata) { const cachedVersion = cache.getByKey(this.definition.type, metadata.CustomerKey); @@ -247,7 +247,7 @@ class TriggeredSend extends MetadataType { /** * helper for {@link TriggeredSend.refresh} that extracts the keys from the TSD item map and eli * - * @param {MetadataTypeMapObj} metadata TSD item map + * @param {MetadataTypeMap} metadata TSD item map * @returns {Promise.} keyArr */ static async getKeysForValidTSDs(metadata) { diff --git a/lib/metadataTypes/User.js b/lib/metadataTypes/User.js index 0c1c76040..c777a553e 100644 --- a/lib/metadataTypes/User.js +++ b/lib/metadataTypes/User.js @@ -614,7 +614,7 @@ class User extends MetadataType { * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) - * @param {string|number} [singleRetrieve] key of single item to filter by + * @param {string} [singleRetrieve] key of single item to filter by * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @returns {Promise.} Promise of item map */ From 4f527ed104597589d1af24c4b98bf52ff7473849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 13:21:29 +0200 Subject: [PATCH 084/359] #1246: more enhanced validation fixes --- lib/metadataTypes/Asset.js | 29 +++++++++---- lib/metadataTypes/MetadataType.js | 5 ++- lib/metadataTypes/User.js | 64 ++++++++++++++-------------- types/mcdev.d.js | 69 +++++++++++++++++++++++++------ 4 files changed, 113 insertions(+), 54 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 77dcb313f..e51ca797f 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -22,6 +22,7 @@ import TriggeredSend from './TriggeredSend.js'; * @typedef {import('../../types/mcdev.d.js').AssetSubType} AssetSubType * @typedef {import('../../types/mcdev.d.js').AssetMap} AssetMap * @typedef {import('../../types/mcdev.d.js').AssetItem} AssetItem + * @typedef {import('../../types/mcdev.d.js').AssetRequestParams} AssetRequestParams */ /** @@ -34,7 +35,7 @@ class Asset extends MetadataType { * Retrieves Metadata of Asset * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} _ - + * @param {void | string[]} _ unused parameter * @param {string[]} [subTypeArr] optionally limit to a single AssetSubType * @param {string} [key] customer key * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise @@ -64,7 +65,7 @@ class Asset extends MetadataType { /** * Retrieves asset metadata for caching * - * @param {void} [_] parameter not used + * @param {void | string[]} [_] parameter not used * @param {string[]} [subTypeArr] optionally limit to a single subtype * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ @@ -168,6 +169,7 @@ class Asset extends MetadataType { (subTypeItemName) => Asset.definition.typeMapping[subTypeItemName] ); const uri = '/asset/v1/content/assets/query'; + /** @type {AssetRequestParams} */ const payload = { page: { page: 1, @@ -630,7 +632,7 @@ class Asset extends MetadataType { const namesInFolder = Object.keys(assetCache) .filter((key) => assetCache[key].category.id === metadata.category.id) .map((key) => ({ - type: this._getMainSubtype(assetCache[key].assetType.name), + type: this.#getMainSubtype(assetCache[key].assetType.name), key: key, name: assetCache[key].name, })); @@ -638,7 +640,7 @@ class Asset extends MetadataType { metadata[this.definition.nameField] = this._findUniqueName( metadata[this.definition.keyField], metadata[this.definition.nameField], - this._getMainSubtype(metadata.assetType.name), + this.#getMainSubtype(metadata.assetType.name), namesInFolder ); return metadata; @@ -649,7 +651,7 @@ class Asset extends MetadataType { * @param {string} extendedSubType webpage, htmlblock, etc * @returns {string} subType: block, message, other, etc */ - static _getMainSubtype(extendedSubType) { + static #getMainSubtype(extendedSubType) { return Object.keys(this.definition.extendedSubTypes).find((subType) => this.definition.extendedSubTypes[subType].includes(extendedSubType) ); @@ -704,7 +706,7 @@ class Asset extends MetadataType { * @param {AssetItem} metadata main JSON file that was read from file system * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built - * @returns {Promise.} - + * @returns {Promise.} list of extracted files with path-parts provided as an array */ static buildDefinitionForNested( templateDir, @@ -732,7 +734,7 @@ class Asset extends MetadataType { * @param {AssetItem} metadata main JSON file that was read from file system * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built - * @returns {Promise.} - + * @returns {Promise.} list of extracted files with path-parts provided as an array */ static buildTemplateForNested( templateDir, @@ -761,7 +763,7 @@ class Asset extends MetadataType { * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @param {string} templateName name of the template to be built * @param {'definition'|'template'} mode defines what we use this helper for - * @returns {Promise.} - + * @returns {Promise.} list of extracted files with path-parts provided as an array */ static async _buildForNested( templateDir, @@ -829,6 +831,7 @@ class Asset extends MetadataType { encoding: 'base64', }); } + const nestedFilePaths = []; // write to file (#1 + #2) const targetDirArr = Array.isArray(targetDir) ? targetDir : [targetDir]; @@ -841,8 +844,18 @@ class Asset extends MetadataType { extractedFile.content, extractedFile.encoding || null ); + nestedFilePaths.push([ + File.normalizePath([targetDir, ...extractedFile.subFolder]), + this.definition.type, + extractedFile.fileName + + '.' + + this.definition.type + + '-meta.' + + extractedFile.fileExt, + ]); } } + return nestedFilePaths; } /** * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index c431a91aa..9de07faf7 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -53,9 +53,10 @@ class MetadataType { * * @param {string} dir directory that contains '.json' files to be read * @param {boolean} [listBadKeys] do not print errors, used for badKeys() + * @param {string[]} [selectedSubType] asset, message, ... * @returns {MetadataTypeMap} fileName => fileContent map */ - static getJsonFromFS(dir, listBadKeys) { + static getJsonFromFS(dir, listBadKeys, selectedSubType) { const fileName2FileContent = {}; try { const files = File.readdirSync(dir); @@ -1048,7 +1049,7 @@ class MetadataType { ); } catch (ex) { this._handleSOAPErrors(ex, 'retrieving'); - return {}; + return; } const metadata = this.parseResponseBody(response); diff --git a/lib/metadataTypes/User.js b/lib/metadataTypes/User.js index c777a553e..9e5618650 100644 --- a/lib/metadataTypes/User.js +++ b/lib/metadataTypes/User.js @@ -20,9 +20,10 @@ import cache from '../util/cache.js'; /** * @typedef {import('../../types/mcdev.d.js').UserDocument} UserDocument + * @typedef {import('../../types/mcdev.d.js').UserDocumentDocument} UserDocumentDocument * @typedef {import('../../types/mcdev.d.js').UserDocumentDiff} UserDocumentDiff * @typedef {import('../../types/mcdev.d.js').UserDocumentMap} UserDocumentMap - * @typedef {import('../../types/mcdev.d.js').UserConfiguration} UserConfiguration + * @typedef {import('../../types/mcdev.d.js').AccountUserConfiguration} AccountUserConfiguration */ /** @@ -31,12 +32,13 @@ import cache from '../util/cache.js'; * @augments MetadataType */ class User extends MetadataType { + static userBUassignments; /** * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} _ unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} _ unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ @@ -87,7 +89,7 @@ class User extends MetadataType { * prepares a item for deployment * * @param {UserDocument} metadata of a single item - * @returns {UserDocument} metadata object + * @returns {Promise.} metadata object */ static async preDeployTasks(metadata) { metadata.Client = { @@ -111,7 +113,7 @@ class User extends MetadataType { 'Name', 'CustomerKey' ); - roleCache = cache.getByKey('role', roleKey); + roleCache = cache.getByKey('role', roleKey + ''); } catch { // skip this role in case of errors return; @@ -149,12 +151,9 @@ class User extends MetadataType { if (metadata.c__TimeZoneName) { // find the ID of the timezone metadata.TimeZone = { Name: metadata.c__TimeZoneName }; - metadata.TimeZone.ID = cache.searchForField( - '_timezone', - metadata.c__TimeZoneName, - 'description', - 'id' - ); + metadata.TimeZone.ID = + '' + + cache.searchForField('_timezone', metadata.c__TimeZoneName, 'description', 'id'); delete metadata.c__TimeZoneName; } @@ -222,7 +221,7 @@ class User extends MetadataType { * @param {boolean} hasError error flag from previous code * @param {UserDocumentDiff[]} metadataToUpdate list of items to update * @param {UserDocument[]} metadataToCreate list of items to create - * @returns {void} + * @returns {'create' | 'update' | 'skip'} action to take */ static createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) { const action = super.createOrUpdate( @@ -236,13 +235,14 @@ class User extends MetadataType { if (action === 'create') { const createItem = metadataToCreate.at(-1); User._setPasswordForNewUser(createItem); - User._prepareRoleAssignments({ after: createItem }); + User._prepareRoleAssignments({ before: null, after: createItem }); User._prepareBuAssignments(metadata[metadataKey], null, createItem); } else if (action === 'update') { const updateItem = metadataToUpdate.at(-1); User._prepareRoleAssignments(updateItem); User._prepareBuAssignments(metadata[metadataKey], updateItem, null); } + return action; } /** @@ -306,10 +306,10 @@ class User extends MetadataType { * * @private * @param {UserDocumentMap} upsertResults metadata mapped by their keyField - * @returns {void} + * @returns {Promise.} - */ static async _handleBuAssignments(upsertResults) { - /** @type {UserConfiguration[]} */ + /** @type {AccountUserConfiguration[]} */ const configs = []; for (const action in this.userBUassignments) { for (const data of Object.entries(this.userBUassignments[action])) { @@ -320,7 +320,7 @@ class User extends MetadataType { } userId = userId.startsWith('key:') ? upsertResults[userId.slice(4)].ID : userId; configs.push( - /** @type {UserConfiguration} */ { + /** @type {AccountUserConfiguration} */ { Client: { ID: this.buObject.eid }, ID: userId, BusinessUnitAssignmentConfiguration: { @@ -334,6 +334,7 @@ class User extends MetadataType { if (configs.length > 0) { Util.logger.info('Deploying: BU assignment changes'); // run update + // @ts-expect-error bad jsodc in SFMC-SDK const buResponse = await this.client.soap.configure('AccountUser', configs); // process response if (buResponse.OverallStatus === 'OK') { @@ -356,7 +357,7 @@ class User extends MetadataType { const userBUresults = {}; for (const result of configureResults) { if (result.StatusCode === 'OK') { - /** @type {UserConfiguration} */ + /** @type {AccountUserConfiguration} */ const config = result.Object; const buArr = config.BusinessUnitAssignmentConfiguration.BusinessUnitIds @@ -572,7 +573,7 @@ class User extends MetadataType { * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @private - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ @@ -665,7 +666,7 @@ class User extends MetadataType { } } catch (ex) { this._handleSOAPErrors(ex, 'retrieving'); - return {}; + return; } } if ( @@ -677,7 +678,7 @@ class User extends MetadataType { resultsBulk )) ) { - return {}; + return; } const metadata = this.parseResponseBody(resultsBulk); @@ -762,13 +763,14 @@ class User extends MetadataType { * helper for {@link User.retrieveSOAP} * * @private - * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {SoapRequestParams} requestParams required for the specific request (filter for example) * @param {string} soapType e.g. AccountUser * @param {string[]} fields list of fields to retrieve * @param {object} resultsBulk actual return value of this method * @returns {Promise.} success flag */ static async _retrieveSOAP_installedPackage(requestParams, soapType, fields, resultsBulk) { + /** @type {SoapRequestParams} */ const requestParamsInstalledPackage = { QueryAllAccounts: true, @@ -838,21 +840,21 @@ class User extends MetadataType { /** * * @private - * @param {string} date first date - * @returns {number} time difference + * @param {string} dateStr first date + * @param {string} interval defaults to 'days' + * @returns {string} time difference */ - static _timeSinceDate(date) { - const interval = 'days'; + static _timeSinceDate(dateStr, interval = 'days') { const second = 1000, minute = second * 60, hour = minute * 60, day = hour * 24, week = day * 7; - date = new Date(date); + const date = new Date(dateStr); const now = new Date(); const timediff = now - date; if (Number.isNaN(timediff)) { - return Number.NaN; + return ''; } let result; switch (interval) { @@ -949,7 +951,7 @@ class User extends MetadataType { /** * Creates markdown documentation of all roles * - * @param {MetadataTypeMap} [metadata] user list + * @param {UserDocumentMap} [metadata] user list * @returns {Promise.} - */ static async document(metadata) { @@ -980,9 +982,7 @@ class User extends MetadataType { // init map of BU Ids > BU Name this._getBuNames(); - /** - * @type {UserDocument[]} - */ + /** @type {UserDocumentDocument[]} */ const users = []; for (const id in metadata) { @@ -1091,7 +1091,7 @@ class User extends MetadataType { * * @private * @param {object[]} users list of users and installed package - * @param {'Installed Package'|'User'} type choose what sub type to print + * @param {'Installed Package'|'User'|'Inactivated User'} type choose what sub type to print * @param {Array[]} columnsToPrint helper array * @returns {string} markdown */ diff --git a/types/mcdev.d.js b/types/mcdev.d.js index e65fbd634..3bc447fb4 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -3,8 +3,8 @@ * @property {string} [clientId] installed package client id * @property {string} [clientSecret] installed package client secret * @property {string} [tenant] subdomain part of Authentication Base Uri - * @property {string} [eid] Enterprise ID = MID of the parent BU - * @property {string} [mid] MID of the BU to work with + * @property {number} [eid] Enterprise ID = MID of the parent BU + * @property {number} [mid] MID of the BU to work with * @property {string} [businessUnit] name of the BU to interact with * @property {string} [credential] name of the credential to interact with */ @@ -15,7 +15,7 @@ */ /** - * @typedef {object} MetadataTypeItem + * @typedef {Object.} MetadataTypeItem generic metadata item * @typedef {Object.} MetadataTypeMap key=customer key * @typedef {Object.} MultiMetadataTypeMap key=Supported MetadataType * @typedef {Object.} MultiMetadataTypeList key=Supported MetadataType @@ -23,7 +23,6 @@ * @typedef {{metadata: MetadataTypeItem, type: string}} MetadataTypeItemObj * @typedef {Object.} Cache key=MID * @typedef {{before: MetadataTypeItem, after: MetadataTypeItem}} MetadataTypeItemDiff used during update - * @property */ /** @@ -115,6 +114,7 @@ */ /** * @typedef {object} UserDocument + * @property {'User'|'Installed Package'|'Inactivated User'} TYPE - * @property {string} [ID] equal to UserID; optional in update/create calls * @property {string} UserID equal to ID; required in update/create calls * @property {number} [AccountUserID] user.AccountUserID @@ -126,7 +126,7 @@ * @property {boolean} ActiveFlag user.ActiveFlag === true ? '✓' : '-' * @property {boolean} IsAPIUser user.IsAPIUser === true ? '✓' : '-' * @property {boolean} MustChangePassword user.MustChangePassword === true ? '✓' : '-' - * @property {number} DefaultBusinessUnit defaultBUName + * @property {number} DefaultBusinessUnit default MID; BUName after we resolved it * @property {number[]} c__AssociatedBusinessUnits associatedBus * @property {object} [Roles] (API only) * @property {object[]} [Roles.Role] roles (API only) @@ -137,27 +137,39 @@ * @property {string} ModifiedDate user.ModifiedDate * @property {object} Client - * @property {number} [Client.ID] EID e.g:7281698 - * @property {number} Client.ModifiedBy AccountUserID of user who last modified this user + * @property {number} [Client.ModifiedBy] AccountUserID of user who last modified this user * @property {'User'|'Installed Package'} c__type - - * @property {boolean} [IsLocked] (API only) + * @property {boolean|string} [IsLocked] (API only) * @property {boolean} [Unlock] used to unlock a user that has IsLocked === true * @property {boolean} c__IsLocked_readOnly copy of IsLocked * @property {string} c__TimeZoneName name of timezone * @property {object} [TimeZone] (API only) * @property {string} [TimeZone.Name] (API only) * @property {string} [TimeZone.ID] (API only) + * @property {string} [Password] only used to set the password. cannot be retrieved * @property {'en-US'|'fr-CA'|'fr-FR'|'de-DE'|'it-IT'|'ja-JP'|'pt-BR'|'es-419'|'es-ES'} c__LocaleCode fr-CA, en-US, ... * @property {object} [Locale] (API only) * @property {'en-US'|'fr-CA'|'fr-FR'|'de-DE'|'it-IT'|'ja-JP'|'pt-BR'|'es-419'|'es-ES'} [Locale.LocaleCode] (API only) + * @property {object} [SsoIdentity] - + * @property {Array|object} [SsoIdentities] - + */ +/** * @typedef {{before:UserDocument,after:UserDocument}} UserDocumentDiff * @typedef {Object.} UserDocumentMap key=customer key */ +/** + * @typedef {UserDocument & object} UserDocumentDocument + * @property {boolean | string} ActiveFlag user.ActiveFlag === true ? '✓' : '-' + * @property {boolean | string} IsAPIUser user.IsAPIUser === true ? '✓' : '-' + * @property {boolean | string} MustChangePassword user.MustChangePassword === true ? '✓' : '-' + * @property {number | string} DefaultBusinessUnit default MID; BUName after we resolved it + */ /** * @typedef {object} AccountUserConfiguration * @property {object} Client wrapper * @property {number} Client.ID EID e.g:7281698 * @property {string} [PartnerKey] empty string - * @property {number} ID User ID e.g:717133502 + * @property {number | string} ID User ID e.g:717133502 * @property {string} [ObjectID] empty string * @property {number} [Delete] 0,1 * @property {BusinessUnitAssignmentConfiguration} BusinessUnitAssignmentConfiguration - @@ -321,13 +333,46 @@ * @property {string} [continueRequest] request id * @property {object} [options] additional options (CallsInConversation, Client, ConversationID, Priority, RequestType, SaveOptions, ScheduledTime, SendResponseTo, SequenceCode) * @property {*} [clientIDs] ? - * @property {SoapFilter} [filter] simple or complex + * @property {SoapFilter | SoapFilterSimple} [filter] simple or complex complex * @property {boolean} [QueryAllAccounts] all BUs or just one + */ +/** + * @typedef {object} SoapFilterSimple + * @property {string} property field + * @property {'equals'|'equal'|'notEquals'|'isNull'|'isNotNull'|'greaterThan'|'lessThan'|'greaterThanOrEqual'|'lessThanOrEqual'|'between'|'IN'|'in'|'like'} simpleOperator various options + * @property {string | number | boolean | Array} [value] field value + */ +/** * @typedef {object} SoapFilter - * @property {string|SoapFilter} leftOperand string for simple or a new filter-object for complex - * @property {'AND'|'OR'|'equals'|'notEquals'|'isNull'|'isNotNull'|'greaterThan'|'lessThan'|'greaterThanOrEqual'|'lessThanOrEqual'|'between'|'IN'|'like'} operator various options - * @property {string|number|boolean|Array|SoapFilter} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull + * @property {SoapFilter | SoapFilterSimple} leftOperand string for simple or a new filter-object for complex + * @property {'AND'|'OR'} operator various options + * @property {SoapFilter | SoapFilterSimple} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ + +/** + * @typedef {object} AssetRequestParams + * @property {string} [continueRequest] request id + * @property {object} [options] additional options (CallsInConversation, Client, ConversationID, Priority, RequestType, SaveOptions, ScheduledTime, SendResponseTo, SequenceCode) + * @property {*} [clientIDs] ? +complex + * @property {object} [page] pagination + * @property {string[]} [fields] list of fields we want returned + * @property {{property:string, direction: 'ASC'|'DESC'}[]} [sort] pagination + * @property {AssetFilter | AssetFilterSimple} [query] simple or complex filter + */ + +/** + * @typedef {object} AssetFilter + * @property {AssetFilter | AssetFilterSimple} leftOperand string for simple or a new filter-object for complex + * @property {'AND'|'OR'} logicalOperator various options + * @property {SoapFilter | AssetFilterSimple} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ +/** + * @typedef {object} AssetFilterSimple + * @property {string} property field + * @property {'equal'|'notEquals'|'isNull'|'isNotNull'|'greaterThan'|'lessThan'|'greaterThanOrEqual'|'lessThanOrEqual'|'between'|'IN'|'in'|'like'} simpleOperator various options + * @property {string | number | boolean | Array} value field value */ /** From 6baf68e5668c526238290f18dc2adfce45166052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 13:28:35 +0200 Subject: [PATCH 085/359] #1238: add { folder:string, isShared:boolean } and ContentBlockByName snippet to resolveId response --- lib/metadataTypes/Asset.js | 130 ++++++++++++++++-- .../resolveId-1295064-noPath-expected.json | 4 +- .../resolveId-1295064-withPath-expected.json | 2 + 3 files changed, 124 insertions(+), 12 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index e51ca797f..71e689d1f 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -7,6 +7,7 @@ import pLimit from 'p-limit'; import cliProgress from 'cli-progress'; import cache from '../util/cache.js'; import TriggeredSend from './TriggeredSend.js'; +import Folder from './Folder.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -1719,14 +1720,16 @@ class Asset extends MetadataType { * get name & key for provided id * * @param {string} id Identifier of metadata - * @returns {Promise.<{key:string, name:string, path:string, mid:number, error:string}>} key, name and path of metadata; null if not found + * @returns {Promise.<{key:string, name:string, path:string, folder:string, mid:number, error:string, isShared:boolean}>} key, name and path of metadata; null if not found */ static async resolveId(id) { let response; const json = { key: '', + isShared: false, name: '', path: '', + folder: '', mid: 0, error: '', }; @@ -1739,20 +1742,44 @@ class Asset extends MetadataType { } if (response?.id) { const item = response; - const subType = this._getMainSubtype(item.assetType.name); - // find path for code of content block, fall back to json if not found; undefined if not even the json exists - const pathBase1 = `./retrieve/${this.buObject.credential}/${this.buObject.businessUnit}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; - const pathBase2 = `./retrieve/${this.buObject.credential}/${this.buObject.businessUnit}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; - const paths = []; - for (const ext of ['html', 'ssjs', 'amp', 'json']) { - paths.push(pathBase1 + ext, pathBase2 + ext); - } - const path = paths.find((p) => File.pathExistsSync(p)); + const subType = this.#getMainSubtype(item.assetType.name); // prep response object json.key = item[this.definition.keyField]; json.name = item[this.definition.nameField]; json.mid = item.memberId; + json.isShared = item.memberId != this.buObject.mid; + + // find path for code of content block, fall back to json if not found; undefined if not even the json exists + let path = json.isShared ? null : this.#getPath(subType, item); + + if (!json.isShared && !path) { + // if not shared, we should have the file on disk; attempt download + if (!cache.getCache()?.folder) { + // folders not cached yet but required to fill json.path + Folder.client = this.client; + Folder.buObject = this.buObject; + Folder.properties = this.properties; + const result = await Folder.retrieveForCache(null, ['asset', 'asset-shared']); + if (!cache.getCache()) { + cache.initCache(this.buObject); + } + cache.setMetadata('folder', result.metadata); + } + + await this.retrieve( + File.normalizePath([ + this.properties.directories.retrieve, + this.buObject.credential, + this.buObject.businessUnit, + ]), + null, + [subType], + json.key + ); + // try again + path = this.#getPath(subType, item); + } if (path) { json.path = path; @@ -1761,6 +1788,11 @@ class Asset extends MetadataType { json.error = 'file not found on local disk'; delete json.path; } + const fileContent = this.#getJson(subType, item); + if (fileContent?.r__folder_Path) { + json.folder = fileContent.r__folder_Path; + } + if (Util.OPTIONS.json) { // for automated processing by VSCode extension, optionally print the json console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console @@ -1768,8 +1800,21 @@ class Asset extends MetadataType { Util.logger.info( ` - ${this.definition.type}-${subType} found: ${item[this.definition.keyField]} (${item[this.definition.nameField]})` ); + if (json.isShared) { + Util.logger.warn(' - Shared from MID ' + json.mid); + } + if (json.folder) { + Util.logger.info( + ` - ContentBlockByName("${json.folder.split('/').join('\\') + '\\' + json.name}")` + ); + if (json.folder.includes('&') || json.name.includes('&')) { + Util.logger.warn( + ` - ContentBlockByName will fail because your path or name contains the & or & symbol. Please replace it with 'and' or remove it.` + ); + } + } Util.logger.info( - ' - link: ' + + ' - local link: ' + (path || `404. Try running mcdev r ${this.buObject.credential}/${this.buObject.businessUnit} ${this.definition.type}-${subType} ${item[this.definition.keyField]}`) ); @@ -1781,6 +1826,8 @@ class Asset extends MetadataType { delete json.mid; delete json.name; delete json.path; + delete json.folder; + delete json.isShared; if (Util.OPTIONS.json) { console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console return json; @@ -1789,6 +1836,67 @@ class Asset extends MetadataType { return json; } } + + /** + * helper for {@link Asset.resolveId} that finds the path to the asset's code + * + * @param {string} subType asset subtype + * @param {object} item api response for metadata + * @returns {string} path to the asset's code + */ + static #getPath(subType, item) { + const mid = item.memberId; + const buName = + mid === this.buObject.mid + ? this.buObject.businessUnit + : Object.keys( + this.properties.credentials[this.buObject.credential].businessUnits + ).find( + (buName) => + this.properties.credentials[this.buObject.credential].businessUnits[ + buName + ] == mid + ); + const pathBase1 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; + const pathBase2 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; + const paths = []; + for (const ext of ['html', 'ssjs', 'amp', 'json']) { + paths.push(pathBase1 + ext, pathBase2 + ext); + } + const path = paths.find((p) => File.pathExistsSync(p)); + return path; + } + /** + * helper for {@link Asset.resolveId} that loads the JSON file for the asset + * + * @param {string} subType asset subtype + * @param {object} item api response for metadata + * @returns {object} JS object of the asset we loaded from disk + */ + static #getJson(subType, item) { + const mid = item.memberId; + const buName = + mid === this.buObject.mid + ? this.buObject.businessUnit + : Object.keys( + this.properties.credentials[this.buObject.credential].businessUnits + ).find( + (buName) => + this.properties.credentials[this.buObject.credential].businessUnits[ + buName + ] == mid + ); + const pathBase1 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; + const pathBase2 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; + const paths = []; + paths.push(pathBase1 + 'json', pathBase2 + 'json'); + const path = paths.find((p) => File.pathExistsSync(p)); + + const pathArr = path.split('/'); + const fileName = pathArr.pop().slice(0, -5); + const fileContent = File.readJSONFile(pathArr.join('/'), fileName, true, false); + return fileContent; + } } // Assign definition to static attributes diff --git a/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json b/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json index 2f9ef8a28..436b54e36 100644 --- a/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json +++ b/test/resources/9999999/asset/resolveId-1295064-noPath-expected.json @@ -1,6 +1,8 @@ { + "folder": "Content Builder", + "isShared": false, "key": "mcdev-issue-1157", "mid": 9999999, "name": "mcdev-issue-1157-Mcdev-strips-content", - "error": "file not found on local disk" + "path": "./retrieve/testInstance/testBU/asset/block/mcdev-issue-1157.asset-block-meta.html" } diff --git a/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json b/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json index 9a05a481c..436b54e36 100644 --- a/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json +++ b/test/resources/9999999/asset/resolveId-1295064-withPath-expected.json @@ -1,4 +1,6 @@ { + "folder": "Content Builder", + "isShared": false, "key": "mcdev-issue-1157", "mid": 9999999, "name": "mcdev-issue-1157-Mcdev-strips-content", From e3c4c9535ae1568e61934ad97664f6c9f4e0ec6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 14:24:26 +0200 Subject: [PATCH 086/359] #1167: move beautyamp config out of code and into config file --- boilerplate/files/.beautyamp.json | 13 +++++++++++++ boilerplate/forcedUpdates.json | 4 ++++ lib/util/file.js | 13 +------------ test/utils.js | 3 +++ 4 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 boilerplate/files/.beautyamp.json diff --git a/boilerplate/files/.beautyamp.json b/boilerplate/files/.beautyamp.json new file mode 100644 index 000000000..612573c50 --- /dev/null +++ b/boilerplate/files/.beautyamp.json @@ -0,0 +1,13 @@ +{ + "ampscript": { + "capitalizeAndOrNot": true, + "capitalizeIfFor": true, + "capitalizeSet": true, + "capitalizeVar": true, + "maxParametersPerLine": 4 + }, + "editor": { + "insertSpaces": true, + "tabSize": 4 + } +} diff --git a/boilerplate/forcedUpdates.json b/boilerplate/forcedUpdates.json index b67b5c030..422b4abf4 100644 --- a/boilerplate/forcedUpdates.json +++ b/boilerplate/forcedUpdates.json @@ -1,4 +1,8 @@ [ + { + "version": "6.1.0", + "files": [".vscode/settings.json", ".beautyamp.json"] + }, { "version": "6.0.3", "files": [".prettierrc"] diff --git a/lib/util/file.js b/lib/util/file.js index 98f3f92d6..d4aadbeac 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -222,23 +222,12 @@ const File = { * @returns {Promise.} original string on error; formatted string on success */ beautify_beautyAmp: async function (content, formatHTML = true) { - const ampscript = { - capitalizeAndOrNot: true, - capitalizeIfFor: true, - capitalizeSet: true, - capitalizeVar: true, - maxParametersPerLine: 4, - }; - const editor = { - insertSpaces: true, - tabSize: 4, - }; // logs trough console only for the moment. const logs = { loggerOn: false, // <= disable logging }; try { - beautyAmp.setup(ampscript, editor, logs); + beautyAmp.setup(null, null, logs); // Note: we need to trim the result as beautyAmp adds a leading new line; but we also want to ensure there is a single new line at the end to comply with standard linting rules return await this.beautify_beautyAmp_beautify(content, formatHTML); } catch (ex) { diff --git a/test/utils.js b/test/utils.js index 0e4b881c4..80c7c0405 100644 --- a/test/utils.js +++ b/test/utils.js @@ -142,6 +142,9 @@ export function mockSetup(isDeploy) { .onAny(new RegExp(`^${escapeRegExp(restUrl)}`)) .reply((config) => handleRESTRequest(config)); const fsMockConf = { + '.beautyamp.json': fsmock.load( + path.resolve(__dirname, '../boilerplate/files/.beautyamp.json') + ), '.prettierrc': fsmock.load(path.resolve(__dirname, '../boilerplate/files/.prettierrc')), '.eslintrc': fsmock.load(path.resolve(__dirname, '../boilerplate/files/.eslintrc')), '.eslintignore': fsmock.load(path.resolve(__dirname, '../boilerplate/files/.eslintignore')), From caa0082c70de798a84a1b06ed5f2d8afda66b1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 14:27:12 +0200 Subject: [PATCH 087/359] #1167: cleanup --- .prettierrc | 8 -------- lib/util/file.js | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.prettierrc b/.prettierrc index 946dd787e..a252f3aa7 100644 --- a/.prettierrc +++ b/.prettierrc @@ -28,14 +28,6 @@ "options": { "tabWidth": 2 } - }, - { - "files": "*.sql", - "options": { - "formatter": "sql-formatter", - "language": "tsql", - "keywordCase": "upper" - } } ] } diff --git a/lib/util/file.js b/lib/util/file.js index d4aadbeac..1e8b10245 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -371,7 +371,7 @@ const File = { * @param {string | string[]} directory directory where the file is stored * @param {string} filename name of the file without '.json' ending * @param {boolean} sync should execute sync (default is async) - * @param {boolean} cleanPath should execute sync (default is true) + * @param {boolean} cleanPath filters illegal chars if true * @returns {Promise. | object | void} Promise or JSON object depending on if async or not; void on error */ readJSONFile: function (directory, filename, sync, cleanPath) { From 4a74001618141ed658fdc2fae5a36fbaf73a6f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 14:33:22 +0200 Subject: [PATCH 088/359] #1167: associate html files with ampscript to ensure proper ampscript rendering --- boilerplate/files/.vscode/settings.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json index 4058d63cb..051c841c6 100644 --- a/boilerplate/files/.vscode/settings.json +++ b/boilerplate/files/.vscode/settings.json @@ -36,7 +36,8 @@ }, "editor.formatOnSave": true, "files.associations": { - "*.ssjs": "javascript" + "*.ssjs": "javascript", + "*.html": "AMPscript" }, "files.eol": "\n", "files.exclude": { From 3ec37c7c8bafa8e9304aa7d2e6ba5f6058fe20a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 15:24:21 +0200 Subject: [PATCH 089/359] #1247: update source.fixAll.eslint to new default "explicit" --- boilerplate/files/.vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json index 051c841c6..e9314ffa1 100644 --- a/boilerplate/files/.vscode/settings.json +++ b/boilerplate/files/.vscode/settings.json @@ -32,7 +32,7 @@ "*.txt": "${capture}.asset-textfile-meta.json" }, "editor.codeActionsOnSave": { - "source.fixAll.eslint": true + "source.fixAll.eslint": "explicit" }, "editor.formatOnSave": true, "files.associations": { From 2a833adf02be3c7a34cc43c189859b6565367dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 15:26:39 +0200 Subject: [PATCH 090/359] #1253: add file icon to ampscript files in vscode --- boilerplate/files/.vscode/extensions.json | 3 +++ boilerplate/files/.vscode/settings.json | 13 ++++++++++++- boilerplate/forcedUpdates.json | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/boilerplate/files/.vscode/extensions.json b/boilerplate/files/.vscode/extensions.json index cfc600e5c..21f7b3670 100644 --- a/boilerplate/files/.vscode/extensions.json +++ b/boilerplate/files/.vscode/extensions.json @@ -17,6 +17,9 @@ "xnerd.ampscript-language", "FiB.beautyAmp", + // file icons for ampscript + "vscode-icons-team.vscode-icons", + // Markdown / Readme.md "joernberkefeld.markdown-preview-bitbucket-innersource" ] diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json index e9314ffa1..6a4e75c53 100644 --- a/boilerplate/files/.vscode/settings.json +++ b/boilerplate/files/.vscode/settings.json @@ -64,5 +64,16 @@ }, "[AMPscript]": { "editor.defaultFormatter": "FiB.beautyAmp" - } + }, + "vsicons.associations.files": [ + { + "icon": "apex", + "languages": [ + { "ids": "ampscript", "defaultExtension": "amp" }, + { "ids": "AMPscript", "defaultExtension": "amp" } + ], + "light": true, + "format": "FileFormat.svg" + } + ] } diff --git a/boilerplate/forcedUpdates.json b/boilerplate/forcedUpdates.json index 422b4abf4..c325c1b39 100644 --- a/boilerplate/forcedUpdates.json +++ b/boilerplate/forcedUpdates.json @@ -1,7 +1,7 @@ [ { "version": "6.1.0", - "files": [".vscode/settings.json", ".beautyamp.json"] + "files": [".vscode/settings.json", ".beautyamp.json", ".vscode/extensions.json"] }, { "version": "6.0.3", From 34d1492842ee4511afcc70aff187f379a7a3384d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 15:28:13 +0200 Subject: [PATCH 091/359] #1254: add ampscript snippets to make coding easier --- boilerplate/files/.vscode/extensions.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boilerplate/files/.vscode/extensions.json b/boilerplate/files/.vscode/extensions.json index 21f7b3670..6cbbe832f 100644 --- a/boilerplate/files/.vscode/extensions.json +++ b/boilerplate/files/.vscode/extensions.json @@ -17,6 +17,9 @@ "xnerd.ampscript-language", "FiB.beautyAmp", + // coding helper + "MarketingThibs.ampscriptsnippets", + // file icons for ampscript "vscode-icons-team.vscode-icons", From ba99a61b23c3b4f122160a93a25a303f5a659a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 9 Apr 2024 15:29:53 +0200 Subject: [PATCH 092/359] #1255: remove vscode extension recommendation for gruntfuggly.todo-tree --- boilerplate/files/.vscode/extensions.json | 1 - 1 file changed, 1 deletion(-) diff --git a/boilerplate/files/.vscode/extensions.json b/boilerplate/files/.vscode/extensions.json index 6cbbe832f..fffe700d5 100644 --- a/boilerplate/files/.vscode/extensions.json +++ b/boilerplate/files/.vscode/extensions.json @@ -5,7 +5,6 @@ // List of extensions which should be recommended for users of this workspace. "recommendations": [ // collaboration - "gruntfuggly.todo-tree", "aaron-bond.better-comments", // Linters From 8a417efb5a38efbdf662fb29da48306d0b0ca46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 10 Apr 2024 18:57:39 +0200 Subject: [PATCH 093/359] #1246: more enhanced validation fixes --- lib/Deployer.js | 1 + lib/metadataTypes/Automation.js | 38 +++++++++------ lib/metadataTypes/EmailSend.js | 6 +-- lib/metadataTypes/MetadataType.js | 6 +-- lib/metadataTypes/User.js | 5 +- lib/metadataTypes/Verification.js | 17 ++++--- lib/util/cache.js | 2 +- lib/util/util.js | 2 +- test/utils.js | 5 +- types/mcdev.d.js | 81 +++++++++++++++++++++---------- 10 files changed, 103 insertions(+), 60 deletions(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index d29e6cf60..ef0a24824 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -63,6 +63,7 @@ class Deployer { */ static async deploy(businessUnit, selectedTypesArr, keyArr) { Util.logger.info('mcdev:: Deploy'); + /** @type {Object.} */ const buMultiMetadataTypeMap = {}; const properties = await config.getProperties(); if (!(await config.checkProperties(properties))) { diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index a56fec1e2..d6782975b 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -37,10 +37,13 @@ import pLimit from 'p-limit'; class Automation extends MetadataType { static notificationUpdates = {}; static createdKeyMap; + static _skipNotificationRetrieve = false; + /** @type {AutomationMap} */ + static _cachedMetadataMap; /** * Retrieves Metadata of Automation * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved * @param {void | string[]} [_] unused parameter * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve @@ -110,7 +113,7 @@ class Automation extends MetadataType { * * @param {SDKError} ex exception * @param {string} id id or key of item - * @returns {Promise.} - + * @returns {Promise.} can return retry-result */ static async handleRESTErrors(ex, id) { try { @@ -266,6 +269,7 @@ class Automation extends MetadataType { 'Name', ]); } + /** @type {AutomationMap} */ const resultsConverted = {}; if (Array.isArray(results?.Results)) { // get encodedAutomationID to retrieve notification information @@ -469,7 +473,7 @@ class Automation extends MetadataType { // / if managed by cache we can update references to support deployment if ( Definitions[activity.r__type]?.['idField'] && - cache.getCache(this.buObject.mid)[activity.r__type] + cache.getCache()[activity.r__type] ) { try { // this will override the name returned by the API in case this activity's name was changed since the automation was last updated, keeping things nicely in sync for mcdev @@ -521,6 +525,7 @@ class Automation extends MetadataType { * @returns {Promise.} Returns list of keys that were executed */ static async execute(keyArr) { + /** @type {AutomationMap} */ const metadataMap = {}; for (const key of keyArr) { if (Util.OPTIONS.schedule) { @@ -540,14 +545,13 @@ class Automation extends MetadataType { } else { // runOnce const objectId = await this.#getObjectIdForSingleRetrieve(key); - metadataMap[key] = {}; - metadataMap[key][this.definition.idField] = objectId; - metadataMap[key][this.definition.keyField] = key; + /** @type {AutomationItem} */ + metadataMap[key] = { key, id: objectId }; } } if (!Object.keys(metadataMap).length) { Util.logger.error(`No ${this.definition.type} to execute`); - return false; + return; } Util.logger.info( `Starting automations ${ @@ -607,7 +611,7 @@ class Automation extends MetadataType { * Standardizes a check for multiple messages but adds query specific filters to error texts * * @param {object} ex response payload from REST API - * @returns {void | string[]} formatted Error Message + * @returns {string[]} formatted Error Message */ static getErrorsREST(ex) { const errors = super.getErrorsREST(ex); @@ -798,7 +802,7 @@ class Automation extends MetadataType { if (metadata.notifications) { this.notificationUpdates[metadata.key] = metadata.notifications; } else { - const cached = cache.getByKey(metadata.key); + const cached = cache.getByKey(this.definition.type, metadata.key); if (cached?.notifications) { // if notifications existed but are no longer present in the deployment package, we need to run an empty update call to remove them this.notificationUpdates[metadata.key] = []; @@ -823,8 +827,8 @@ class Automation extends MetadataType { // prep startSource metadata.startSource = { fileDrop: { - filenamePattern: metadata.fileTrigger.fileNamingPattern, - filenamePatternTypeId: metadata.fileTrigger.fileNamePatternTypeId, + fileNamePattern: metadata.fileTrigger.fileNamingPattern, + fileNamePatternTypeId: metadata.fileTrigger.fileNamePatternTypeId, folderLocation: metadata.fileTrigger.folderLocationText, queueFiles: metadata.fileTrigger.queueFiles, }, @@ -977,7 +981,7 @@ class Automation extends MetadataType { ); } - // el.status + // @ts-expect-error - string vs enum item.status ||= Util.inverseGet(this.definition.statusMapping, item.statusId); } // need to put schedule on here if status is scheduled @@ -1206,7 +1210,12 @@ class Automation extends MetadataType { /** * @type {AutomationScheduleSoap} */ - const schedule = { Recurrence: {}, TimeZone: { IDSpecified: true } }; + const schedule = { + Recurrence: {}, + TimeZone: { ID: null, IDSpecified: true }, + RecurrenceRangeType: null, + StartDateTime: null, + }; // build recurrence const recurHelper = {}; // ical values are split by ; then have key values split by = @@ -1549,7 +1558,7 @@ class Automation extends MetadataType { // as part of retrieve & manual execution we could face an empty folder return; } - return await Promise.all( + await Promise.all( Object.keys(metadata).map((key) => this._writeDoc(docPath + '/', key, metadata[key], 'md') ) @@ -1586,7 +1595,6 @@ class Automation extends MetadataType { /** * helper to allow us to select single metadata entries via REST * - * @private * @param {string} key customer key * @returns {Promise.} objectId or enpty string */ diff --git a/lib/metadataTypes/EmailSend.js b/lib/metadataTypes/EmailSend.js index 2184d915d..36fa5fee6 100644 --- a/lib/metadataTypes/EmailSend.js +++ b/lib/metadataTypes/EmailSend.js @@ -26,9 +26,9 @@ class EmailSend extends MetadataType { /** * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 9de07faf7..f24911a3c 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -998,7 +998,7 @@ class MetadataType { /** * * @param {SOAPError} ex error that occured - * @param {'creating'|'updating'|'retrieving'|'executing'} msg what to print in the log + * @param {'creating'|'updating'|'retrieving'|'executing'|'pausing'} msg what to print in the log * @param {MetadataTypeItem} [metadataEntry] single metadata entry * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method */ @@ -1164,9 +1164,9 @@ class MetadataType { * * @param {RestError} ex exception * @param {string} id id or key of item - * @returns {null} - + * @returns {Promise.} - */ - static handleRESTErrors(ex, id) { + static async handleRESTErrors(ex, id) { // if the ID is too short, the system will throw the 400 error Util.logger.debug(` ☇ skipping ${this.definition.type} ${id}: ${ex.message} ${ex.code}`); diff --git a/lib/metadataTypes/User.js b/lib/metadataTypes/User.js index 9e5618650..636620e28 100644 --- a/lib/metadataTypes/User.js +++ b/lib/metadataTypes/User.js @@ -806,7 +806,10 @@ class User extends MetadataType { }, }, }; - if (requestParams?.filter?.leftOperand?.leftOperand === 'CustomerKey') { + if ( + 'object' === typeof requestParams?.filter?.leftOperand && + requestParams?.filter?.leftOperand?.leftOperand === 'CustomerKey' + ) { requestParamsInstalledPackage.filter = { leftOperand: requestParams?.filter?.leftOperand, operator: 'AND', diff --git a/lib/metadataTypes/Verification.js b/lib/metadataTypes/Verification.js index 3afa3d979..0cc74e02f 100644 --- a/lib/metadataTypes/Verification.js +++ b/lib/metadataTypes/Verification.js @@ -16,6 +16,7 @@ import cache from '../util/cache.js'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').RestError} RestError */ /** @@ -31,10 +32,10 @@ class Verification extends MetadataType { /** * Retrieves Metadata of Data Verification Activity. * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter - * @param {string} key customer key of single item to retrieve + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ static async retrieve(retrieveDir, _, __, key) { @@ -109,7 +110,7 @@ class Verification extends MetadataType { /** * helper for {@link this.retrieveRESTcollection} * - * @param {Error} ex exception + * @param {RestError} ex exception * @param {string} id id or key of item * @returns {null} - */ @@ -153,7 +154,7 @@ class Verification extends MetadataType { * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call * @param {MetadataTypeItem} metadataEntryWithAllFields like metadataEntry but before non-creatable fields were stripped - * @returns {void} + * @returns {Promise.} - */ static async postCreateTasks(metadataEntry, apiResponse, metadataEntryWithAllFields) { if (!apiResponse?.[this.definition.idField]) { @@ -195,9 +196,9 @@ class Verification extends MetadataType { * prepares a verification for deployment * * @param {VerificationItem} metadata a single verification activity definition - * @returns {VerificationItem} metadata object + * @returns {Promise.} metadata object */ - static preDeployTasks(metadata) { + static async preDeployTasks(metadata) { metadata.targetObjectId = cache.searchForField( 'dataExtension', metadata.r__dataExtension_CustomerKey, diff --git a/lib/util/cache.js b/lib/util/cache.js index c51528411..9aa2cf8ed 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -109,7 +109,7 @@ export default { * @param {string} searchField field name (key in object) which contains the unique identifer * @param {string} returnField field which should be returned * @param {number} [overrideMID] ignore currentMID and use alternative (for example parent MID) - * @returns {string|number|boolean} value of specified field. Error is thrown if not found + * @returns {string} value of specified field. Error is thrown if not found */ searchForField(metadataType, searchValue, searchField, returnField, overrideMID) { for (const key in dataStore[overrideMID || currentMID]?.[metadataType]) { diff --git a/lib/util/util.js b/lib/util/util.js index 8e967a20d..b4333708f 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -488,7 +488,7 @@ export const Util = { * get key of an object based on the first matching value * * @param {object} objs object of objects to be searched - * @param {string} val value to be searched for + * @param {string | number} val value to be searched for * @returns {string} key */ inverseGet: function (objs, val) { diff --git a/test/utils.js b/test/utils.js index 0e4b881c4..2c7d3b2f5 100644 --- a/test/utils.js +++ b/test/utils.js @@ -100,7 +100,7 @@ export function getActualTemplateFile(customerKey, type, ext) { /** * gets file from resources folder which should be used for comparison * - * @param {number} mid of Business Unit + * @param {string} mid of Business Unit * @param {string} type of metadata * @param {string} action of SOAP request * @returns {Promise.} file in string form @@ -111,7 +111,7 @@ export function getExpectedJson(mid, type, action) { /** * gets file from resources folder which should be used for comparison * - * @param {number} mid of Business Unit + * @param {string} mid of Business Unit * @param {string} type of metadata * @param {string} action of SOAP request * @param {string} ext file extension @@ -131,6 +131,7 @@ export function mockSetup(isDeploy) { // no need to execute this again - already done in standard setup handler.setOptions({ debug: true, noLogFile: true }); } + // @ts-expect-error somehow, MockAdapter does not expect type AxiosInstance apimock = new MockAdapter(axiosInstance, { onNoMatch: 'throwException' }); // set access_token to mid to allow for autorouting of mock to correct resources apimock.onPost(authResources.success.url).reply((config) => { diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 3bc447fb4..1766f497c 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -182,7 +182,7 @@ /** * @typedef {object} AutomationActivity * @property {string} name name (not key) of activity - * @property {string} [objectTypeId] Id of assoicated activity type; see this.definition.activityTypeMapping + * @property {number} [objectTypeId] Id of assoicated activity type; see this.definition.activityTypeMapping * @property {string} [activityObjectId] Object Id of assoicated metadata item * @property {number} [displayOrder] order within step; starts with 1 or higher number * @property {string} r__type see this.definition.activityTypeMapping @@ -197,17 +197,23 @@ */ /** * @typedef {object} AutomationSchedule REST format - * @property {number} typeId ? + * @property {number} typeId equals schedule.scheduleTypeId; upsert endpoint requires scheduleTypeId. retrieve endpoint returns typeId + * @property {number} [scheduleTypeId] equals schedule.typeId; upsert endpoint requires scheduleTypeId. retrieve endpoint returns typeId * @property {string} startDate example: '2021-05-07T09:00:00' * @property {string} endDate example: '2021-05-07T09:00:00' * @property {string} icalRecur example: 'FREQ=DAILY;UNTIL=20790606T160000;INTERVAL=1' * @property {string} timezoneName example: 'W. Europe Standard Time'; see this.definition.timeZoneMapping * @property {number} [timezoneId] see this.definition.timeZoneMapping + * @property {number} [rangeTypeId] ? + * @property {any} [pattern] ? + * @property {any} [scheduledTime] ? + * @property {string} [scheduledStatus] ? */ /** * @typedef {object} AutomationScheduleSoap SOAP format + * @property {string} [RecurrenceType] 'Minutely'|'Hourly'|'Daily'|'Weekly'|'Monthly'|'Yearly' * @property {object} Recurrence - - * @property {object} Recurrence.$ {'xsi:type': keyStem + 'lyRecurrence'} + * @property {object} [Recurrence.$] {'xsi:type': keyStem + 'lyRecurrence'} * @property {'ByYear'} [Recurrence.YearlyRecurrencePatternType] * currently not supported by tool * * @property {'ByMonth'} [Recurrence.MonthlyRecurrencePatternType] * currently not supported by tool * * @property {'ByWeek'} [Recurrence.WeeklyRecurrencePatternType] * currently not supported by tool * @@ -220,25 +226,32 @@ * @property {number} [Recurrence.DayInterval] 1..n * @property {number} [Recurrence.HourInterval] 1..n * @property {number} [Recurrence.MinuteInterval] 1..n - * @property {number} _interval internal variable for CLI output only + * @property {number} [_interval] internal variable for CLI output only * @property {object} TimeZone - * @property {number} TimeZone.ID AutomationSchedule.timezoneId - * @property {string} _timezoneString internal variable for CLI output only + * @property {true} [TimeZone.IDSpecified] always true + * @property {string} [_timezoneString] internal variable for CLI output only * @property {string} StartDateTime AutomationSchedule.startDate - * @property {string} EndDateTime AutomationSchedule.endDate - * @property {string} _StartDateTime AutomationSchedule.startDate; internal variable for CLI output only + * @property {string} [_StartDateTime] AutomationSchedule.startDate; internal variable for CLI output only + * @property {string} [EndDateTime] AutomationSchedule.endDate * @property {'EndOn'|'EndAfter'} RecurrenceRangeType set to 'EndOn' if AutomationSchedule.icalRecur contains 'UNTIL'; otherwise to 'EndAfter' - * @property {number} Occurrences only exists if RecurrenceRangeType=='EndAfter' + * @property {number} [Occurrences] only exists if RecurrenceRangeType=='EndAfter' */ /** * @typedef {object} AutomationItem - * @property {string} [id] Object Id - * @property {string} key key - * @property {string} name name - * @property {any} notifications notifications - * @property {string} description - - * @property {'scheduled'|'triggered'} type Starting Source = Schedule / File Drop - * @property {'Scheduled'|'Running'|'Ready'|'Building'|'PausedSchedule'|'InactiveTrigger'} status - + * @property {string} id Object Id + * @property {string} [legacyId] legacy Object Id - used for handling notifications + * @property {string} [ObjectID] Object Id as returned by SOAP API + * @property {string} [programId] legacy id + * @property {string} key key (Rest API) + * @property {string} [CustomerKey] key (SOAP API) + * @property {string} [name] name (Rest API) + * @property {string} [Name] name (SOAP API) + * @property {any} [notifications] notifications + * @property {string} [description] - + * @property {'scheduled'|'triggered'} [type] Starting Source = Schedule / File Drop + * @property {'Scheduled'|'Running'|'Ready'|'Building'|'PausedSchedule'|'InactiveTrigger'} [status] automation status + * @property {number} [statusId] automation status * @property {AutomationSchedule} [schedule] only existing if type=scheduled * @property {object} [fileTrigger] only existing if type=triggered * @property {string} fileTrigger.fileNamingPattern file name with placeholders @@ -251,12 +264,12 @@ * @property {AutomationSchedule} [startSource.schedule] rewritten to AutomationItem.schedule * @property {object} [startSource.fileDrop] rewritten to AutomationItem.fileTrigger * @property {string} startSource.fileDrop.fileNamePattern file name with placeholders - * @property {string} startSource.fileDrop.fileNamePatternTypeId - + * @property {number} startSource.fileDrop.fileNamePatternTypeId - * @property {string} startSource.fileDrop.folderLocation - * @property {boolean} startSource.fileDrop.queueFiles - * @property {number} startSource.typeId - - * @property {AutomationStep[]} steps - - * @property {string} r__folder_Path folder path + * @property {AutomationStep[]} [steps] - + * @property {string} [r__folder_Path] folder path * @property {string} [categoryId] holds folder ID, replaced with r__folder_Path during retrieve */ /** @@ -270,13 +283,14 @@ * @property {string} notificationEmailAddress email address to send notification to; empty string if shouldEmailOnFailure=false * @property {string} notificationEmailMessage email message to send; empty string if shouldEmailOnFailure=false * @property {number} createdBy user id of creator + * @property {string} [targetObjectId] ObjectID of target data extension * @property {string} r__dataExtension_CustomerKey key of target data extension */ /** * @typedef {Object.} AutomationMap * @typedef {{metadata:AutomationMap,type:string}} AutomationMapObj - * @typedef {{metadata:AutomationItem,type:string}} AutomationItemObj + * @typedef {{metadata:object | AutomationItem,type:string}} AutomationItemObj * @typedef {object} McdevDeltaPkgItem * @property {string} file relative path to file * @property {number} changes changed lines @@ -333,21 +347,36 @@ * @property {string} [continueRequest] request id * @property {object} [options] additional options (CallsInConversation, Client, ConversationID, Priority, RequestType, SaveOptions, ScheduledTime, SendResponseTo, SequenceCode) * @property {*} [clientIDs] ? - * @property {SoapFilter | SoapFilterSimple} [filter] simple or complex + * @property {SoapSDKFilter} [filter] simple or complex complex * @property {boolean} [QueryAllAccounts] all BUs or just one */ /** * @typedef {object} SoapFilterSimple * @property {string} property field - * @property {'equals'|'equal'|'notEquals'|'isNull'|'isNotNull'|'greaterThan'|'lessThan'|'greaterThanOrEqual'|'lessThanOrEqual'|'between'|'IN'|'in'|'like'} simpleOperator various options + * @property {'equals'|'notEquals'|'isNull'|'isNotNull'|'greaterThan'|'lessThan'|'greaterThanOrEqual'|'lessThanOrEqual'|'between'|'IN'|'in'|'like'} simpleOperator various options * @property {string | number | boolean | Array} [value] field value */ /** - * @typedef {object} SoapFilter - * @property {SoapFilter | SoapFilterSimple} leftOperand string for simple or a new filter-object for complex - * @property {'AND'|'OR'} operator various options - * @property {SoapFilter | SoapFilterSimple} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull + * @typedef {object} SoapFilterComplex + * @property {SoapSDKFilter} leftOperand string for simple or a new filter-object for complex + * @property {'AND'|'OR'} logicalOperator various options + * @property {SoapSDKFilter} rightOperand string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ +/** + * @typedef {object} SoapSDKFilterSimple + * @property {SoapFilterSimple["property"]} leftOperand string for simple or a new filter-object for complex + * @property {SoapFilterSimple["simpleOperator"]} operator various options + * @property {SoapFilterSimple["value"]} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ +/** + * @typedef {object} SoapSDKFilterComplex + * @property {SoapFilterComplex["leftOperand"]} leftOperand string for simple or a new filter-object for complex + * @property {SoapFilterComplex["logicalOperator"]} operator various options + * @property {SoapFilterComplex["rightOperand"]} rightOperand string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ +/** + * @typedef {SoapSDKFilterSimple | SoapSDKFilterComplex} SoapSDKFilter */ /** @@ -366,7 +395,7 @@ complex * @typedef {object} AssetFilter * @property {AssetFilter | AssetFilterSimple} leftOperand string for simple or a new filter-object for complex * @property {'AND'|'OR'} logicalOperator various options - * @property {SoapFilter | AssetFilterSimple} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull + * @property {SoapSDKFilter | AssetFilterSimple} [rightOperand] string for simple or a new filter-object for complex; omit for isNull and isNotNull */ /** * @typedef {object} AssetFilterSimple From e4c7bfb1899d30dd8c146275f9bf4a4fc98382fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 10 Apr 2024 18:59:54 +0200 Subject: [PATCH 094/359] #1246: more enhanced validation fixes --- lib/metadataTypes/Discovery.js | 4 ++-- lib/metadataTypes/Email.js | 4 ++-- lib/metadataTypes/Event.js | 4 ++-- lib/metadataTypes/FileLocation.js | 4 ++-- lib/metadataTypes/FileTransfer.js | 4 ++-- lib/metadataTypes/Filter.js | 4 ++-- lib/metadataTypes/Folder.js | 10 +++++++--- lib/metadataTypes/ImportFile.js | 10 +++++----- lib/metadataTypes/Journey.js | 6 +++--- 9 files changed, 27 insertions(+), 23 deletions(-) diff --git a/lib/metadataTypes/Discovery.js b/lib/metadataTypes/Discovery.js index 4c33ee5ea..9d2267a9a 100644 --- a/lib/metadataTypes/Discovery.js +++ b/lib/metadataTypes/Discovery.js @@ -26,8 +26,8 @@ class Discovery extends MetadataType { * documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] not used - * @param {void} [__] unused parameter + * @param {void | string[]} [_] not used + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ diff --git a/lib/metadataTypes/Email.js b/lib/metadataTypes/Email.js index 81d33ef36..4aef82c95 100644 --- a/lib/metadataTypes/Email.js +++ b/lib/metadataTypes/Email.js @@ -26,8 +26,8 @@ class Email extends MetadataType { * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 28769e61f..f0a0f415b 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -30,8 +30,8 @@ class Event extends MetadataType { * Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/FileLocation.js b/lib/metadataTypes/FileLocation.js index b1dbf6969..d9e4f9d33 100644 --- a/lib/metadataTypes/FileLocation.js +++ b/lib/metadataTypes/FileLocation.js @@ -26,8 +26,8 @@ class FtpLocation extends MetadataType { * Endpoint /automation/v1/ftplocations/ return all FtpLocations * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ diff --git a/lib/metadataTypes/FileTransfer.js b/lib/metadataTypes/FileTransfer.js index 5239945f0..1cadaea75 100644 --- a/lib/metadataTypes/FileTransfer.js +++ b/lib/metadataTypes/FileTransfer.js @@ -29,8 +29,8 @@ class FileTransfer extends MetadataType { * Endpoint /automation/v1/filetransfers/ returns all File Transfers * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ diff --git a/lib/metadataTypes/Filter.js b/lib/metadataTypes/Filter.js index c24959523..d589c2c62 100644 --- a/lib/metadataTypes/Filter.js +++ b/lib/metadataTypes/Filter.js @@ -28,8 +28,8 @@ class Filter extends MetadataType { * Filters with the endpoint /automation/v1/filters/{id} * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index 22ccea7b3..a5211c571 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -162,7 +162,7 @@ class Folder extends MetadataType { /** * Retrieves folder metadata for caching * - * @param {void} [_] parameter not used + * @param {void | string[]} [_] parameter not used * @param {string[]} [subTypeArr] content type of folder * @returns {Promise} Promise */ @@ -469,9 +469,13 @@ class Folder extends MetadataType { */ static getJsonFromFS(dir, listBadKeys) { try { + /** @type {MetadataTypeMap} */ const fileName2FileContent = {}; const directories = File.readDirectoriesSync(dir, 10, true); let newCounter = 0; + if (!Array.isArray(directories)) { + return fileName2FileContent; + } for (const subdir of directories) { // standardise to / and then remove the stem up until folder as this // should not be in the path for the metadata. In case no split then return empty as this is root @@ -579,9 +583,9 @@ class Folder extends MetadataType { /** * Helper for writing Metadata to disk, used for Retrieve and deploy * - * @param {object} results metadata results from deploy + * @param {MetadataTypeMap} results metadata results from deploy * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve - * @param {number} mid current mid for this credential / business unit + * @param {number | string} mid unused parameter * @returns {Promise.} Promise of saved metadata */ static async saveResults(results, retrieveDir, mid) { diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index a4bb52116..81d9fb647 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -29,9 +29,9 @@ class ImportFile extends MetadataType { * Endpoint /automation/v1/imports/ return all Import Files with all details. * Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ @@ -87,8 +87,8 @@ class ImportFile extends MetadataType { /** * Retrieves import definition metadata for caching * - * @param {void} [_] parameter not used - * @param {void} [__] parameter not used + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 7d0752499..83af3a058 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -33,8 +33,8 @@ class Journey extends MetadataType { * Retrieves Metadata of Journey * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ @@ -660,7 +660,7 @@ class Journey extends MetadataType { * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! * * @param {MetadataTypeItem} metadata of a single TSD - * @returns {MetadataTypeItem} metadata object + * @returns {Promise.} metadata object */ static async preDeployTasks(metadata) { if (metadata.status !== 'Draft') { From c166a1444008c9e00a8cecb0e932c3cfd4a96022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 10 Apr 2024 19:01:29 +0200 Subject: [PATCH 095/359] #1246: more enhanced validation fixes --- lib/metadataTypes/Campaign.js | 4 ++-- lib/metadataTypes/ContentArea.js | 4 ++-- lib/metadataTypes/List.js | 6 ++--- lib/metadataTypes/MetadataType.js | 2 +- lib/metadataTypes/MobileCode.js | 4 ++-- lib/metadataTypes/MobileMessage.js | 19 ++++++++-------- lib/metadataTypes/Query.js | 8 +++---- lib/metadataTypes/Role.js | 29 ++++++++++++------------- lib/metadataTypes/Script.js | 10 ++++----- lib/metadataTypes/SendClassification.js | 4 ++-- lib/metadataTypes/TransactionalSMS.js | 6 ++--- 11 files changed, 48 insertions(+), 48 deletions(-) diff --git a/lib/metadataTypes/Campaign.js b/lib/metadataTypes/Campaign.js index b589489f3..af26e7ff7 100644 --- a/lib/metadataTypes/Campaign.js +++ b/lib/metadataTypes/Campaign.js @@ -27,8 +27,8 @@ class Campaign extends MetadataType { * Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ diff --git a/lib/metadataTypes/ContentArea.js b/lib/metadataTypes/ContentArea.js index 8f4ff2363..4e05e545d 100644 --- a/lib/metadataTypes/ContentArea.js +++ b/lib/metadataTypes/ContentArea.js @@ -27,8 +27,8 @@ class ContentArea extends MetadataType { * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/List.js b/lib/metadataTypes/List.js index 63da05577..31e8c7699 100644 --- a/lib/metadataTypes/List.js +++ b/lib/metadataTypes/List.js @@ -28,9 +28,9 @@ class List extends MetadataType { /** * Retrieves Metadata of Lists * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise */ diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index f24911a3c..5745c883d 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1030,7 +1030,7 @@ class MetadataType { /** * Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) * @param {string} [singleRetrieve] key of single item to filter by * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true diff --git a/lib/metadataTypes/MobileCode.js b/lib/metadataTypes/MobileCode.js index 93cf374d1..bdc5f785e 100644 --- a/lib/metadataTypes/MobileCode.js +++ b/lib/metadataTypes/MobileCode.js @@ -26,8 +26,8 @@ class MobileCode extends MetadataType { * Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/MobileMessage.js b/lib/metadataTypes/MobileMessage.js index 7b65dd916..58390931d 100644 --- a/lib/metadataTypes/MobileMessage.js +++ b/lib/metadataTypes/MobileMessage.js @@ -28,10 +28,10 @@ class MobileMessage extends MetadataType { * Retrieves Metadata of Mobile Keywords * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve - * @returns {Promise. | void} Promise of metadata + * @returns {Promise.} Promise of metadata */ static retrieve(retrieveDir, _, __, key) { if (key && key.startsWith('id:')) { @@ -57,13 +57,14 @@ class MobileMessage extends MetadataType { throw ex; } } + return; } /** * Retrieves event definition metadata for caching * - * @param {void} [_] parameter not used - * @param {void} [__] parameter not used + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ @@ -138,7 +139,7 @@ class MobileMessage extends MetadataType { * additionally, the documentation for dataExtension and automation should be returned * * @param {string[]} keyArr customerkey of the metadata - * @returns {string[]} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] */ static async getFilesToCommit(keyArr) { const path = File.normalizePath([ @@ -262,7 +263,7 @@ class MobileMessage extends MetadataType { * * @param {MetadataTypeItem} metadata a single MobileMessage * @param {string} deployDir directory of deploy files - * @returns {MetadataTypeItem} Promise + * @returns {Promise.} Promise */ static async preDeployTasks(metadata, deployDir) { // mobileCode @@ -320,7 +321,7 @@ class MobileMessage extends MetadataType { * * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call - * @returns {void} + * @returns {Promise.} - */ static async postCreateTasks(metadataEntry, apiResponse) { await super.postDeployTasks_legacyApi(metadataEntry, apiResponse); @@ -330,7 +331,7 @@ class MobileMessage extends MetadataType { * * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {object} apiResponse varies depending on the API call - * @returns {void} + * @returns {Promise.} - */ static async postUpdateTasks(metadataEntry, apiResponse) { await super.postDeployTasks_legacyApi(metadataEntry, apiResponse); diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index 2c011dbea..801c28e29 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -44,8 +44,8 @@ class Query extends MetadataType { * Retrieves Metadata of queries * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.<{metadata: QueryMap, type: string}>} Promise of metadata */ @@ -440,7 +440,7 @@ class Query extends MetadataType { * Standardizes a check for multiple messages but adds query specific filters to error texts * * @param {object} ex response payload from REST API - * @returns {string[] | void} formatted Error Message + * @returns {string[]} formatted Error Message */ static getErrorsREST(ex) { const errors = super.getErrorsREST(ex); @@ -468,7 +468,7 @@ class Query extends MetadataType { * clean up after deleting a metadata item * * @param {string} customerKey Identifier of metadata item - * @returns {void} + * @returns {Promise.} - */ static async postDeleteTasks(customerKey) { // delete local copy: retrieve/cred/bu/.../...-meta.json diff --git a/lib/metadataTypes/Role.js b/lib/metadataTypes/Role.js index 407a3f670..12c65de47 100644 --- a/lib/metadataTypes/Role.js +++ b/lib/metadataTypes/Role.js @@ -15,6 +15,7 @@ import cache from '../util/cache.js'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SoapSDKFilterSimple} SoapSDKFilterSimple * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap */ @@ -28,8 +29,8 @@ class Role extends MetadataType { * Gets metadata from Marketing Cloud * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {string[]} _ Returns specified fields even if their retrieve definition is not set to true - * @param {void} [___] unused parameter + * @param {void | string[]} [_] Returns specified fields even if their retrieve definition is not set to true + * @param {void | string[]} [___] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Metadata store object */ @@ -43,6 +44,7 @@ class Role extends MetadataType { const fields = super.getFieldNamesToRetrieve(null, !retrieveDir); + /** @type {SoapRequestParams} */ let requestParams = { // filter individual roles filter: { @@ -51,23 +53,21 @@ class Role extends MetadataType { rightOperand: false, }, }; - /** @type {SoapRequestParams} */ if (key) { // move original filter down one level into rightOperand and add key filter into leftOperand + /** @type {SoapSDKFilterSimple} */ const keyFilter = { leftOperand: 'CustomerKey', operator: 'equals', rightOperand: key, }; - requestParams = requestParams - ? { - filter: { - leftOperand: keyFilter, - operator: 'AND', - rightOperand: requestParams.filter, - }, - } - : keyFilter; + requestParams = { + filter: { + leftOperand: keyFilter, + operator: 'AND', + rightOperand: requestParams.filter, + }, + }; } const results = await this.client.soap.retrieve('Role', fields, requestParams); @@ -273,7 +273,7 @@ class Role extends MetadataType { * @param {string} role name of the user role * @param {object} element data of the permission * @param {string} [permission] name of the permission - * @param {string} [isAllowed] "true" / "false" from the + * @param {string} [isAllowed] "true" / "false" from the parent * @memberof Role * @returns {void} */ @@ -309,8 +309,7 @@ class Role extends MetadataType { role, element.PermissionSets.PermissionSet, _permission, - element.IsAllowed, - isAllowed + element.IsAllowed || isAllowed ); } // Not at end: Traverse more diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index 9ddc0bc45..d3968d439 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -32,9 +32,9 @@ class Script extends MetadataType { * Retrieves Metadata of Script * Endpoint /automation/v1/scripts/ return all Scripts with all details. * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.<{metadata: ScriptMap, type: string}>} Promise */ @@ -128,7 +128,7 @@ class Script extends MetadataType { * * @param {ScriptItem} metadata a single script activity definition * @param {string} dir directory of deploy files - * @returns {ScriptItem} Promise + * @returns {Promise.} Promise */ static async preDeployTasks(metadata, dir) { // folder @@ -371,7 +371,7 @@ class Script extends MetadataType { * clean up after deleting a metadata item * * @param {string} customerKey Identifier of metadata item - * @returns {void} + * @returns {Promise.} - */ static async postDeleteTasks(customerKey) { // delete local copy: retrieve/cred/bu/.../...-meta.json diff --git a/lib/metadataTypes/SendClassification.js b/lib/metadataTypes/SendClassification.js index 9bdc62bd3..2683efacd 100644 --- a/lib/metadataTypes/SendClassification.js +++ b/lib/metadataTypes/SendClassification.js @@ -25,8 +25,8 @@ class SendClassification extends MetadataType { * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/TransactionalSMS.js b/lib/metadataTypes/TransactionalSMS.js index 6685fed5c..ccbd6e102 100644 --- a/lib/metadataTypes/TransactionalSMS.js +++ b/lib/metadataTypes/TransactionalSMS.js @@ -29,12 +29,12 @@ class TransactionalSMS extends TransactionalMessage { * clean up after deleting a metadata item * * @param {string} customerKey Identifier of metadata item - * @returns {void} + * @returns {Promise.} - */ static async postDeleteTasks(customerKey) { // delete local copy: retrieve/cred/bu/type/...-meta.json // delete local copy: retrieve/cred/bu/type/...-meta.amp - super.postDeleteTasks(customerKey, [`${this.definition.type}-meta.amp`]); + return super.postDeleteTasks(customerKey, [`${this.definition.type}-meta.amp`]); } /** @@ -258,7 +258,7 @@ class TransactionalSMS extends TransactionalMessage { ) { // get code from filesystem let code = await this._mergeCode(metadata, templateDir, templateName); - const file = await this.prepExtractedCode(code, metadata.name); + const file = await this.prepExtractedCode(code); const fileExt = file.fileExt; code = file.code; // apply templating From 23c27cefb67501f2833a1b2ac25faf47aea63b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 10 Apr 2024 19:03:45 +0200 Subject: [PATCH 096/359] #1246: more enhanced validation fixes --- lib/metadataTypes/DataExtension.js | 17 +++-- lib/metadataTypes/DataExtensionField.js | 48 ++++++------- lib/metadataTypes/DataExtensionTemplate.js | 4 +- lib/metadataTypes/DataExtract.js | 4 +- lib/metadataTypes/DataExtractType.js | 4 +- lib/metadataTypes/TransactionalEmail.js | 6 +- lib/metadataTypes/TransactionalMessage.js | 14 ++-- lib/metadataTypes/TransactionalPush.js | 2 +- .../definitions/DataExtractType.definition.js | 2 +- .../TransactionalMessage.definition.js | 69 +++++++++++++++++++ types/mcdev.d.js | 10 ++- 11 files changed, 125 insertions(+), 55 deletions(-) create mode 100644 lib/metadataTypes/definitions/TransactionalMessage.definition.js diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index aafbedb05..b985e9d0f 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -33,6 +33,7 @@ import inquirer from 'inquirer'; * @augments MetadataType */ class DataExtension extends MetadataType { + static oldFields; /** * Upserts dataExtensions after retrieving them from source and target to compare * if create or update operation is needed. @@ -102,9 +103,7 @@ class DataExtension extends MetadataType { await Promise.allSettled( metadataToUpdate .filter((r) => r !== undefined && r !== null) - .map((metadataEntry) => - updateLimit(() => this.update(metadataEntry.after, metadataEntry.before)) - ) + .map((metadataEntry) => updateLimit(() => this.update(metadataEntry.after))) ) ) .filter((r) => r !== undefined && r !== null) @@ -147,7 +146,7 @@ class DataExtension extends MetadataType { * @param {boolean} hasError error flag from previous code * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update * @param {MetadataTypeItem[]} metadataToCreate list of items to create - * @returns {'create' | 'update' | 'skip'} action to take + * @returns {Promise.<'create'|'update'|'skip'>} action to take */ static async createOrUpdate( metadataMap, @@ -356,7 +355,7 @@ class DataExtension extends MetadataType { } // UPDATE + CREATE for (const field of item.Fields) { - DataExtensionField.postRetrieveTasks(field, true); + DataExtensionField.postRetrieveTasksDE(field); } } await this.#fixShared(upsertedMetadata, originalMetadata, createdUpdated); @@ -691,7 +690,7 @@ class DataExtension extends MetadataType { DataExtensionField.buObject = buObjectParent; DataExtensionField.client = clientParent; const fieldKey = `[${deKey}].[TriggerUpdate${randomSuffix}]`; - const fieldResponse = await DataExtensionField.retrieveForCache( + const fieldResponse = await DataExtensionField.retrieveForCacheDE( { filter: { leftOperand: 'CustomerKey', @@ -890,7 +889,7 @@ class DataExtension extends MetadataType { // remove attributes that we do not want to retrieve // * do this after sorting on the DE's field list for (const key of fieldKeys) { - DataExtensionField.postRetrieveTasks(fieldsObj[key], true); + DataExtensionField.postRetrieveTasksDE(fieldsObj[key]); } } @@ -964,7 +963,7 @@ class DataExtension extends MetadataType { DataExtensionField.client = this.client; DataExtensionField.properties = this.properties; - const response = await DataExtensionField.retrieveForCache(options, additionalFields); + const response = await DataExtensionField.retrieveForCacheDE(options, additionalFields); return response.metadata; } /** @@ -992,7 +991,7 @@ class DataExtension extends MetadataType { // remove attributes that we do not want to retrieve // * do this after sorting on the DE's field list for (const field of fieldArr) { - DataExtensionField.postRetrieveTasks(field, true); + DataExtensionField.postRetrieveTasksDE(field); } metadata[customerKey].Fields = fieldArr; diff --git a/lib/metadataTypes/DataExtensionField.js b/lib/metadataTypes/DataExtensionField.js index 747c01ca0..b5ca637b7 100644 --- a/lib/metadataTypes/DataExtensionField.js +++ b/lib/metadataTypes/DataExtensionField.js @@ -25,6 +25,7 @@ import { Util } from '../util/util.js'; * @augments MetadataType */ class DataExtensionField extends MetadataType { + static fixShared_fields; /** * Retrieves all records and saves it to disk * @@ -42,7 +43,7 @@ class DataExtensionField extends MetadataType { * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @returns {Promise.<{metadata: DataExtensionFieldMap, type: string}>} Promise of items */ - static async retrieveForCache(requestParams, additionalFields) { + static async retrieveForCacheDE(requestParams, additionalFields) { return super.retrieveSOAP(null, requestParams, null, additionalFields); } /** @@ -65,31 +66,28 @@ class DataExtensionField extends MetadataType { * * @param {DataExtensionFieldItem} a - * @param {DataExtensionFieldItem} b - - * @returns {boolean} sorting based on Ordinal + * @returns {number} sorting based on Ordinal */ static sortDeFields(a, b) { return a.Ordinal - b.Ordinal; } /** - * manages post retrieve steps + * manages post retrieve steps; only used by DataExtension class * * @param {DataExtensionFieldItem} metadata a single item - * @param {boolean} forDataExtension when used by DataExtension class we remove more fields * @returns {DataExtensionFieldItem} metadata */ - static postRetrieveTasks(metadata, forDataExtension) { - if (forDataExtension) { - // remove fields according to definition - this.keepRetrieveFields(metadata); + static postRetrieveTasksDE(metadata) { + // remove fields according to definition + this.keepRetrieveFields(metadata); - // remove fields that we do not need after association to a DE - delete metadata.CustomerKey; - delete metadata.DataExtension; - delete metadata.Ordinal; - if (metadata.FieldType !== 'Decimal') { - // remove scale - it's only used for "Decimal" to define the digits behind the decimal - delete metadata.Scale; - } + // remove fields that we do not need after association to a DE + delete metadata.CustomerKey; + delete metadata.DataExtension; + delete metadata.Ordinal; + if (metadata.FieldType !== 'Decimal') { + // remove scale - it's only used for "Decimal" to define the digits behind the decimal + delete metadata.Scale; } return metadata; } @@ -120,7 +118,7 @@ class DataExtensionField extends MetadataType { } // retrieve existing fields to enable updating them - const response = await this.retrieveForCache( + const response = await this.retrieveForCacheDE( { filter: { leftOperand: 'DataExtension.CustomerKey', @@ -271,7 +269,7 @@ class DataExtensionField extends MetadataType { * @param {string} customerKey Identifier of data extension * @returns {Promise.} deletion success status */ - static deleteByKey(customerKey) { + static async deleteByKey(customerKey) { return this.deleteByKeySOAP(customerKey); } @@ -280,7 +278,7 @@ class DataExtensionField extends MetadataType { * * @param {string} customerKey Identifier of metadata * @param {string} [fieldId] for programmatic deletes only one can pass in the ID directly - * @returns {boolean} deletion success flag + * @returns {Promise.} deletion success flag */ static async deleteByKeySOAP(customerKey, fieldId) { const [deKey, fieldKey] = customerKey.split('.'); @@ -289,7 +287,7 @@ class DataExtensionField extends MetadataType { let fieldObjectID = fieldId; // get the object id if (!fieldObjectID) { - const response = await this.retrieveForCache( + const response = await this.retrieveForCacheDE( { filter: { leftOperand: 'CustomerKey', @@ -316,11 +314,9 @@ class DataExtensionField extends MetadataType { }, }; try { - this.client.soap.delete( - 'DataExtension', // yes, not DataExtensionField - keyObj, - null - ); + // ! we really do need to delete from DataExtension not DataExtensionField here! + // @ts-expect-error wrong jsdoc for 2nd parameter in SFMC-SDK + this.client.soap.delete('DataExtension', keyObj, null); if (!fieldId) { Util.logger.info(` - deleted ${this.definition.type}: ${customerKey}`); @@ -342,7 +338,7 @@ class DataExtensionField extends MetadataType { * clean up after deleting a metadata item * * @param {string} customerKey Identifier of metadata item - * @returns {void} + * @returns {Promise.} - */ static async postDeleteTasks(customerKey) { // TODO actually clean up local dataextension json diff --git a/lib/metadataTypes/DataExtensionTemplate.js b/lib/metadataTypes/DataExtensionTemplate.js index 060f8ee71..101a64ddf 100644 --- a/lib/metadataTypes/DataExtensionTemplate.js +++ b/lib/metadataTypes/DataExtensionTemplate.js @@ -25,8 +25,8 @@ class DataExtensionTemplate extends MetadataType { * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/DataExtract.js b/lib/metadataTypes/DataExtract.js index 1d9a92dcc..9dba7db36 100644 --- a/lib/metadataTypes/DataExtract.js +++ b/lib/metadataTypes/DataExtract.js @@ -29,8 +29,8 @@ class DataExtract extends MetadataType { * Endpoint /automation/v1/dataextracts/ returns all Data Extracts * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/DataExtractType.js b/lib/metadataTypes/DataExtractType.js index c66bf97fd..ba1a6da69 100644 --- a/lib/metadataTypes/DataExtractType.js +++ b/lib/metadataTypes/DataExtractType.js @@ -27,8 +27,8 @@ class DataExtractType extends MetadataType { * Retrieves Metadata of Data Extract Type. * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ diff --git a/lib/metadataTypes/TransactionalEmail.js b/lib/metadataTypes/TransactionalEmail.js index 7f6952ae1..dd6e3d05e 100644 --- a/lib/metadataTypes/TransactionalEmail.js +++ b/lib/metadataTypes/TransactionalEmail.js @@ -25,6 +25,8 @@ import cache from '../util/cache.js'; */ class TransactionalEmail extends TransactionalMessage { static subType = 'email'; + /** @type {Array} */ + static _createdJourneyKeys; /** * Updates a single item @@ -49,7 +51,7 @@ class TransactionalEmail extends TransactionalMessage { * prepares for deployment * * @param {MetadataTypeItem} metadata a single item - * @returns {MetadataTypeItem} Promise + * @returns {Promise.} - */ static async preDeployTasks(metadata) { // asset @@ -96,7 +98,7 @@ class TransactionalEmail extends TransactionalMessage { * * @param {MetadataTypeItem} _ not used * @param {object} apiResponse varies depending on the API call - * @returns {void} + * @returns {Promise.} - */ static async postCreateTasks(_, apiResponse) { if (apiResponse.journey?.interactionKey) { diff --git a/lib/metadataTypes/TransactionalMessage.js b/lib/metadataTypes/TransactionalMessage.js index 9f05f562f..c019f7967 100644 --- a/lib/metadataTypes/TransactionalMessage.js +++ b/lib/metadataTypes/TransactionalMessage.js @@ -27,9 +27,9 @@ class TransactionalMessage extends MetadataType { /** * Retrieves Metadata * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ @@ -79,8 +79,8 @@ class TransactionalMessage extends MetadataType { /** * Retrieves event definition metadata for caching * - * @param {void} [_] parameter not used - * @param {void} [__] parameter not used + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used * @param {string} [key] customer key of single item to cache * @returns {Promise.} Promise of metadata */ @@ -130,6 +130,6 @@ class TransactionalMessage extends MetadataType { // Assign definition to static attributes // ! using SMS definitions here as placeholder to have auto completion import MetadataTypeDefinitions from '../MetadataTypeDefinitions.js'; -TransactionalMessage.definition = MetadataTypeDefinitions.transactionalSMS; - +TransactionalMessage.definition = MetadataTypeDefinitions.transactionalMessage; +TransactionalMessage.definition; export default TransactionalMessage; diff --git a/lib/metadataTypes/TransactionalPush.js b/lib/metadataTypes/TransactionalPush.js index 08965b6a8..4fc95b2d7 100644 --- a/lib/metadataTypes/TransactionalPush.js +++ b/lib/metadataTypes/TransactionalPush.js @@ -29,7 +29,7 @@ class TransactionalPush extends TransactionalMessage { * prepares for deployment * * @param {MetadataTypeItem} metadata a single item - * @returns {MetadataTypeItem} Promise + * @returns {Promise.} - */ static async preDeployTasks(metadata) { // asset diff --git a/lib/metadataTypes/definitions/DataExtractType.definition.js b/lib/metadataTypes/definitions/DataExtractType.definition.js index 07c1abbab..188c376d7 100644 --- a/lib/metadataTypes/definitions/DataExtractType.definition.js +++ b/lib/metadataTypes/definitions/DataExtractType.definition.js @@ -1,5 +1,5 @@ export default { - bodyIteratorField: [], + bodyIteratorField: '', dependencies: [], hasExtended: false, idField: 'extractId', diff --git a/lib/metadataTypes/definitions/TransactionalMessage.definition.js b/lib/metadataTypes/definitions/TransactionalMessage.definition.js new file mode 100644 index 000000000..d3dcde4b7 --- /dev/null +++ b/lib/metadataTypes/definitions/TransactionalMessage.definition.js @@ -0,0 +1,69 @@ +export default { + bodyIteratorField: 'definitions', + dependencies: [], + hasExtended: false, + idField: 'definitionId', + keyIsFixed: true, // sending definitionKey in update call not allowed by API + keyField: 'definitionKey', + nameField: 'name', + createdDateField: 'createdDate', + createdNameField: null, + lastmodDateField: 'modifiedDate', + lastmodNameField: null, + restPagination: true, + restPageSize: 100, + type: '', + typeDescription: 'here as a placeholder to have auto completion', + typeRetrieveByDefault: true, + typeName: '', + fields: { + name: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + definitionKey: { + isCreateable: true, + isUpdateable: false, + retrieving: true, + template: true, + }, + description: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + requestId: { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + definitionId: { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + status: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + createdDate: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + modifiedDate: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + }, +}; diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 1766f497c..cfb77328d 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -48,13 +48,14 @@ * @property {string} createdDate e.g. "2020-09-14T01:42:03.017" * @property {string} modifiedDate e.g. "2020-09-14T01:42:03.017" * @property {'Overwrite'|'Update'|'Append'} targetUpdateTypeName defines how the query writes into the target data extension - * @property {0|1|2} [targetUpdateTypeId] mapped to targetUpdateTypeName via this.definition.targetUpdateTypeMapping + * @property {number} [targetUpdateTypeId] 0|1|2, mapped to targetUpdateTypeName via this.definition.targetUpdateTypeMapping * @property {string} [targetId] Object ID of DE (removed before save) * @property {string} [targetDescription] Description DE (removed before save) * @property {boolean} isFrozen looks like this is always set to false * @property {string} [queryText] contains SQL query with line breaks converted to '\n'. The content is extracted during retrieval and written into a separate *.sql file * @property {string} [categoryId] holds folder ID, replaced with r__folder_Path during retrieve * @property {string} r__folder_Path folder path in which this DE is saved + * @property {string} [queryDefinitionId] Object ID of query * @typedef {Object.} QueryMap */ /** @@ -85,9 +86,12 @@ * @property {string} DefaultValue empty string for not set * @property {true|false} IsRequired - * @property {true|false} IsPrimaryKey - - * @property {string} Ordinal 1, 2, 3, ... + * @property {number} Ordinal 1, 2, 3, ... * @property {'Text'|'Number'|'Date'|'Boolean'|'Decimal'|'EmailAddress'|'Phone'|'Locale'} FieldType can only be set on create + * @property {number} MaxLength field length * @property {string} Scale the number of places after the decimal that the field can hold; example: "0","1", ... + */ +/** * @typedef {Object.} DataExtensionFieldMap */ /** @@ -355,7 +359,7 @@ complex * @typedef {object} SoapFilterSimple * @property {string} property field * @property {'equals'|'notEquals'|'isNull'|'isNotNull'|'greaterThan'|'lessThan'|'greaterThanOrEqual'|'lessThanOrEqual'|'between'|'IN'|'in'|'like'} simpleOperator various options - * @property {string | number | boolean | Array} [value] field value + * @property {string | number | boolean | string[] | number[]} [value] field value */ /** * @typedef {object} SoapFilterComplex From 6e1ae45bbc73041aedbf3f3edc0afb88b55e27e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 11 Apr 2024 10:02:10 +0200 Subject: [PATCH 097/359] #1246: more enhanced validation fixes --- lib/Builder.js | 1 - lib/cli.js | 25 ++++++++- lib/metadataTypes/Asset.js | 2 +- lib/metadataTypes/DataExtension.js | 86 ++++++++++++++++-------------- lib/metadataTypes/Journey.js | 12 +++-- lib/metadataTypes/MetadataType.js | 14 +++-- lib/metadataTypes/MobileKeyword.js | 12 +++-- lib/metadataTypes/User.js | 12 +++-- lib/util/cli.js | 2 +- lib/util/devops.js | 3 +- lib/util/file.js | 2 +- types/mcdev.d.js | 11 +++- 12 files changed, 121 insertions(+), 61 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index 402524a3f..46740e707 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -6,7 +6,6 @@ import config from './util/config.js'; import Cli from './util/cli.js'; import auth from './util/auth.js'; import MetadataTypeInfo from './MetadataTypeInfo.js'; -// @ts-ignore /** * @typedef {import('../types/mcdev.d.js').BuObject} BuObject diff --git a/lib/cli.js b/lib/cli.js index 546ef98c2..e46cc8ee7 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -9,15 +9,14 @@ import { Util } from './util/util.js'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import Mcdev from './index.js'; -// @ts-expect-error - yargs is not properly typed. yargs(hideBin(process.argv)) .scriptName('mcdev') .usage('$0 [options]') + // @ts-expect-error .command({ command: 'retrieve [BU] [TYPE] [KEY]', aliases: ['r'], desc: 'retrieves metadata of a business unit', - // @ts-ignore builder: (yargs) => { yargs .positional('BU', { @@ -45,6 +44,7 @@ yargs(hideBin(process.argv)) Mcdev.retrieve(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'deploy [BU] [TYPE] [KEY]', aliases: ['d'], @@ -111,6 +111,7 @@ yargs(hideBin(process.argv)) Mcdev.deploy(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'init [credentialsName]', desc: `creates '${Util.configFileName}' in your root or adds additional credentials to the existing one`, @@ -125,6 +126,7 @@ yargs(hideBin(process.argv)) Mcdev.initProject(argv.credentialsName); }, }) + // @ts-expect-error .command({ command: 'join', desc: `clones an existing project from git`, @@ -133,6 +135,7 @@ yargs(hideBin(process.argv)) Mcdev.joinProject(); }, }) + // @ts-expect-error .command({ command: 'reloadBUs [credentialsName]', aliases: ['rb'], @@ -148,6 +151,7 @@ yargs(hideBin(process.argv)) Mcdev.findBUs(argv.credentialsName); }, }) + // @ts-expect-error .command({ command: 'badKeys [BU]', desc: 'lists metadata with random API names in specified Business Unit directory', @@ -162,6 +166,7 @@ yargs(hideBin(process.argv)) Mcdev.badKeys(argv.BU); }, }) + // @ts-expect-error .command({ command: 'document ', aliases: ['doc'], @@ -184,6 +189,7 @@ yargs(hideBin(process.argv)) Mcdev.document(argv.BU, argv.TYPE); }, }) + // @ts-expect-error .command({ command: 'delete ', aliases: ['del'], @@ -209,6 +215,7 @@ yargs(hideBin(process.argv)) Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.EXTERNALKEY); }, }) + // @ts-expect-error .command({ command: 'resolveId ', aliases: ['rid'], @@ -239,6 +246,7 @@ yargs(hideBin(process.argv)) Mcdev.resolveId(argv.BU, argv.TYPE, argv.ID); }, }) + // @ts-expect-error .command({ command: 'retrieveAsTemplate ', aliases: ['rt'], @@ -268,6 +276,7 @@ yargs(hideBin(process.argv)) Mcdev.retrieveAsTemplate(argv.BU, argv.TYPE, csvToArray(argv.NAME), argv.MARKET); }, }) + // @ts-expect-error .command({ command: 'buildTemplate ', aliases: ['bt'], @@ -297,6 +306,7 @@ yargs(hideBin(process.argv)) Mcdev.buildTemplate(argv.BU, argv.TYPE, csvToArray(argv.KEY), argv.MARKET); }, }) + // @ts-expect-error .command({ command: 'buildDefinition ', aliases: ['bd'], @@ -325,6 +335,7 @@ yargs(hideBin(process.argv)) Mcdev.buildDefinition(argv.BU, argv.TYPE, argv.FILENAME, argv.MARKET); }, }) + // @ts-expect-error .command({ command: 'buildDefinitionBulk ', aliases: ['bdb'], @@ -349,6 +360,7 @@ yargs(hideBin(process.argv)) Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, argv.FILENAME); }, }) + // @ts-expect-error .command({ command: 'selectTypes', aliases: ['st'], @@ -358,6 +370,7 @@ yargs(hideBin(process.argv)) Mcdev.selectTypes(); }, }) + // @ts-expect-error .command({ command: 'explainTypes', aliases: ['et'], @@ -374,6 +387,7 @@ yargs(hideBin(process.argv)) Mcdev.explainTypes(); }, }) + // @ts-expect-error .command({ command: 'createDeltaPkg [range]', aliases: ['cdp'], @@ -402,6 +416,7 @@ yargs(hideBin(process.argv)) Mcdev.createDeltaPkg(argv); }, }) + // @ts-expect-error .command({ command: 'getFilesToCommit ', aliases: ['fc'], @@ -427,6 +442,7 @@ yargs(hideBin(process.argv)) Mcdev.getFilesToCommit(argv.BU, argv.TYPE, csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'refresh [TYPE] [KEY]', aliases: ['re'], @@ -451,6 +467,7 @@ yargs(hideBin(process.argv)) Mcdev.refresh(argv.BU, argv.TYPE, csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'execute [KEY]', aliases: ['exec', 'start'], @@ -488,6 +505,7 @@ yargs(hideBin(process.argv)) Mcdev.execute(argv.BU, argv.TYPE, csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'schedule [KEY]', aliases: ['sched'], @@ -519,6 +537,7 @@ yargs(hideBin(process.argv)) Mcdev.schedule(argv.BU, argv.TYPE, csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'pause [KEY]', aliases: ['p', 'stop'], @@ -550,6 +569,7 @@ yargs(hideBin(process.argv)) Mcdev.pause(argv.BU, argv.TYPE, csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'fixKeys [KEY]', aliases: ['fx'], @@ -592,6 +612,7 @@ yargs(hideBin(process.argv)) Mcdev.fixKeys(argv.BU, argv.TYPE, csvToArray(argv.KEY)); }, }) + // @ts-expect-error .command({ command: 'upgrade', aliases: ['up'], diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index e51ca797f..287eb3964 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1739,7 +1739,7 @@ class Asset extends MetadataType { } if (response?.id) { const item = response; - const subType = this._getMainSubtype(item.assetType.name); + const subType = this.#getMainSubtype(item.assetType.name); // find path for code of content block, fall back to json if not found; undefined if not even the json exists const pathBase1 = `./retrieve/${this.buObject.credential}/${this.buObject.businessUnit}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; const pathBase2 = `./retrieve/${this.buObject.credential}/${this.buObject.businessUnit}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index b985e9d0f..8581d71bf 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -33,6 +33,7 @@ import inquirer from 'inquirer'; * @augments MetadataType */ class DataExtension extends MetadataType { + /** @type {DataExtensionFieldMap} */ static oldFields; /** * Upserts dataExtensions after retrieving them from source and target to compare @@ -44,6 +45,7 @@ class DataExtension extends MetadataType { static async upsert(metadataMap) { // get existing DE-fields for DE-keys in deployment package to properly handle add/update/delete of fields // we need to use IN here because it would fail otherwise if we try to deploy too many DEs at the same time + /** @type {SoapRequestParams} */ const fieldOptions = { filter: { leftOperand: 'DataExtension.CustomerKey', @@ -206,6 +208,7 @@ class DataExtension extends MetadataType { // metadataMap[metadataKey].Fields = { Field: metadataMap[metadataKey].Fields }; } + return action; } /** * helper for {@link DataExtension.upsert} @@ -254,7 +257,6 @@ class DataExtension extends MetadataType { * if that field duplicates whats in the period fields * during deployment, that extra value is not accepted by the APIs which is why it needs to be removed * - * @private * @param {DataExtensionItem} metadata single metadata entry * @returns {void} */ @@ -285,7 +287,7 @@ class DataExtension extends MetadataType { * @param {DataExtensionMap} upsertedMetadata metadata mapped by their keyField * @param {DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates - * @returns {void} + * @returns {Promise.} - */ static async postDeployTasks(upsertedMetadata, originalMetadata, createdUpdated) { for (const key in upsertedMetadata) { @@ -307,6 +309,7 @@ class DataExtension extends MetadataType { const existingFields = DataExtension.oldFields[item[this.definition.keyField]]; + // @ts-expect-error Fields is a special case that cannot be properly typed; emtpy string is required for SOAP API if (item.Fields === '') { // if no fields were updated, we need to set Fields to "empty string" for the API to work // reset here to get the correct field list @@ -315,7 +318,7 @@ class DataExtension extends MetadataType { .sort((a, b) => a.Ordinal - b.Ordinal); } else if (existingFields) { // get list of updated fields - /** @type {DataExtensionFieldItem[]} */ + /** @type {DataExtensionFieldItem[]} */ // @ts-ignore Fields.Field is a special case that cannot be properly typed; only required for SOAP API const updatedFieldsArr = originalMetadata[oldKey].Fields.Field.filter( (field) => field.ObjectID && field.ObjectID !== '' ); @@ -339,7 +342,7 @@ class DataExtension extends MetadataType { .sort((a, b) => a.Ordinal - b.Ordinal); // get list of new fields - /** @type {DataExtensionFieldItem[]} */ + /** @type {DataExtensionFieldItem[]} */ // @ts-ignore Fields.Field is a special case that cannot be properly typed; only required for SOAP API const newFieldsArr = originalMetadata[oldKey].Fields.Field.filter( (field) => !field.ObjectID ); @@ -369,7 +372,7 @@ class DataExtension extends MetadataType { * @param {DataExtensionMap} upsertedMetadata metadata mapped by their keyField * @param {DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates - * @returns {void} + * @returns {Promise.} - */ static async #fixShared(upsertedMetadata, originalMetadata, createdUpdated) { if (this.buObject.eid !== this.buObject.mid) { @@ -403,6 +406,7 @@ class DataExtension extends MetadataType { const clientBak = this.client; // get dataExtension ID-Key relationship + /** @type {Object.} */ const sharedDataExtensionMap = {}; for (const key of sharedDataExtensionsKeys) { try { @@ -446,7 +450,7 @@ class DataExtension extends MetadataType { /** * helper for {@link DataExtension.#fixShared} * - * @returns {string[]} list of selected BU names + * @returns {Promise.} list of selected BU names */ static async #fixShared_getBUs() { const buListObj = this.properties.credentials[this.buObject.credential].businessUnits; @@ -479,13 +483,16 @@ class DataExtension extends MetadataType { value: name, checked: fixBuPreselected.includes(name), })); - const questions = { - type: 'checkbox', - name: 'businessUnits', - message: 'Please select BUs that have access to the updated Shared Data Extensions:', - pageSize: 10, - choices: buList, - }; + const questions = [ + { + type: 'checkbox', + name: 'businessUnits', + message: + 'Please select BUs that have access to the updated Shared Data Extensions:', + pageSize: 10, + choices: buList, + }, + ]; let responses = null; try { @@ -651,28 +658,26 @@ class DataExtension extends MetadataType { this.client = clientChildBu; const randomSuffix = Util.OPTIONS._runningTest ? '_randomNumber_' - : Math.floor(Math.random() * 9999999999); + : Math.floor(Math.random() * 9999999999).toString(); // add a new field to the shared DE to trigger an update to the data model const soapType = this.definition.soapType || this.definition.type; - await this.client.soap.update( - Util.capitalizeFirstLetter(soapType), - { - CustomerKey: deKey, - ObjectID: deId, - Fields: { - Field: [ - { - Name: 'TriggerUpdate' + randomSuffix, - IsRequired: false, - IsPrimaryKey: false, - FieldType: 'Boolean', - ObjectID: null, - }, - ], - }, + const payload = { + CustomerKey: deKey, + ObjectID: deId, + Fields: { + Field: [ + { + Name: 'TriggerUpdate' + randomSuffix, + IsRequired: false, + IsPrimaryKey: false, + FieldType: 'Boolean', + ObjectID: null, + }, + ], }, - null - ); + }; + // @ts-expect-error SFMC-SDK typing error + await this.client.soap.update(Util.capitalizeFirstLetter(soapType), payload, null); return randomSuffix; } @@ -861,7 +866,6 @@ class DataExtension extends MetadataType { /** * helper to retrieve all dataExtension fields and attach them to the dataExtension metadata * - * @private * @param {DataExtensionMap} metadata already cached dataExtension metadata * @param {SoapRequestParams} [fieldOptions] optionally filter results * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true @@ -907,7 +911,7 @@ class DataExtension extends MetadataType { * manages post retrieve steps * * @param {DataExtensionItem} metadata a single dataExtension - * @returns {DataExtensionItem} metadata + * @returns {Promise.} metadata */ static async postRetrieveTasks(metadata) { // Error during deploy if SendableSubscriberField.Name = '_SubscriberKey' even though it is retrieved like that @@ -975,6 +979,7 @@ class DataExtension extends MetadataType { * @returns {Promise.} - */ static async _retrieveFieldsForSingleDe(metadata, customerKey) { + /** @type {SoapRequestParams} */ const fieldOptions = { filter: { leftOperand: 'DataExtension.CustomerKey', @@ -1207,11 +1212,12 @@ class DataExtension extends MetadataType { * @param {DataExtensionItem} json dataextension.columns * @param {'html'|'md'} mode html or md * @param {string[]} [fieldsToKeep] list of keys(columns) to show. This will also specify - * @returns {Promise.} Promise of success of saving the file + * @returns {Promise.} Promise of success of saving the file */ static async _writeDoc(directory, filename, json, mode, fieldsToKeep) { let fieldsJson = Object.values(json.Fields); if (fieldsToKeep) { + /** @type {DataExtensionFieldItem[]} */ const newJson = []; for (const element of fieldsJson) { const newJsonElement = {}; @@ -1222,6 +1228,7 @@ class DataExtension extends MetadataType { newJsonElement[field] = element[field]; } } + // @ts-ignore hard to tell ts that this is in fact a DataExtensionFieldItem newJson.push(newJsonElement); } fieldsJson = newJson; @@ -1244,7 +1251,7 @@ class DataExtension extends MetadataType { * Parses metadata into a readable Markdown/HTML format then saves it * * @param {DataExtensionMap} [metadataMap] a list of dataExtension definitions - * @returns {Promise.} - + * @returns {Promise.} - */ static async document(metadataMap) { try { @@ -1346,7 +1353,7 @@ class DataExtension extends MetadataType { * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise */ static async retrieveForCache() { - return this.retrieve(null, ['ObjectID', 'CustomerKey', 'Name'], this.buObject, null, null); + return this.retrieve(null, ['ObjectID', 'CustomerKey', 'Name']); } /** * Retrieves dataExtension metadata in template format. @@ -1354,9 +1361,10 @@ class DataExtension extends MetadataType { * @param {string} templateDir Directory where retrieved metadata directory will be saved * @param {string} name name of the metadata item * @param {TemplateMap} templateVariables variables to be replaced in the metadata - * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise of items + * @returns {Promise.<{metadata: DataExtensionItem, type: string}>} Promise of items */ static async retrieveAsTemplate(templateDir, name, templateVariables) { + /** @type {SoapRequestParams} */ const options = { filter: { leftOperand: 'Name', @@ -1370,7 +1378,7 @@ class DataExtension extends MetadataType { if (!Object.keys(metadata).length) { Util.logger.error(`${this.definition.type} '${name}' not found on server.`); Util.logger.info('Downloaded: dataExtension (0)'); - return { metadata: {}, type: 'dataExtension' }; + return { metadata: null, type: 'dataExtension' }; } const customerKey = Object.keys(metadata)[0]; await this._retrieveFieldsForSingleDe(metadata, customerKey); diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 83af3a058..54dbd5fdd 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -909,10 +909,16 @@ class Journey extends MetadataType { * @param {boolean} hasError error flag from previous code * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update * @param {MetadataTypeItem[]} metadataToCreate list of items to create - * @returns {'create' | 'update' | 'skip'} action to take + * @returns {Promise.<'create'|'update'|'skip'>} action to take */ - static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { - const action = super.createOrUpdate( + static async createOrUpdate( + metadataMap, + metadataKey, + hasError, + metadataToUpdate, + metadataToCreate + ) { + const action = await super.createOrUpdate( metadataMap, metadataKey, hasError, diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 5745c883d..0159a1a84 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -645,7 +645,6 @@ class MetadataType { // if Results then parse as SOAP // put in Retrieve Format for parsing // todo add handling when response does not contain items. - // @ts-ignore const metadataResults = createResults .concat(updateResults) // TODO remove Object.keys check after create/update SOAP methods stop returning empty objects instead of null @@ -657,7 +656,6 @@ class MetadataType { // likely comming from one of the many REST APIs // put in Retrieve Format for parsing // todo add handling when response does not contain items. - // @ts-ignore const metadataResults = createResults.concat(updateResults).filter(Boolean); upsertResults = this.parseResponseBody(metadataResults); } @@ -676,9 +674,15 @@ class MetadataType { * @param {boolean} hasError error flag from previous code * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update * @param {MetadataTypeItem[]} metadataToCreate list of items to create - * @returns {'create' | 'update' | 'skip'} action to take - */ - static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { + * @returns {Promise.<'create' | 'update' | 'skip'>} action to take + */ + static async createOrUpdate( + metadataMap, + metadataKey, + hasError, + metadataToUpdate, + metadataToCreate + ) { const normalizedKey = File.reverseFilterIllegalFilenames( metadataMap[metadataKey][this.definition.keyField] ); diff --git a/lib/metadataTypes/MobileKeyword.js b/lib/metadataTypes/MobileKeyword.js index 8cbb1b5c9..88249b82e 100644 --- a/lib/metadataTypes/MobileKeyword.js +++ b/lib/metadataTypes/MobileKeyword.js @@ -142,10 +142,16 @@ class MobileKeyword extends MetadataType { * @param {boolean} hasError error flag from previous code * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update * @param {MetadataTypeItem[]} metadataToCreate list of items to create - * @returns {'create' | 'update' | 'skip'} action to take + * @returns {Promise.<'create'|'update'|'skip'>} action to take */ - static createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) { - const createOrUpdateAction = super.createOrUpdate( + static async createOrUpdate( + metadataMap, + metadataKey, + hasError, + metadataToUpdate, + metadataToCreate + ) { + const createOrUpdateAction = await super.createOrUpdate( metadataMap, metadataKey, hasError, diff --git a/lib/metadataTypes/User.js b/lib/metadataTypes/User.js index 636620e28..e2cbad7ae 100644 --- a/lib/metadataTypes/User.js +++ b/lib/metadataTypes/User.js @@ -221,10 +221,16 @@ class User extends MetadataType { * @param {boolean} hasError error flag from previous code * @param {UserDocumentDiff[]} metadataToUpdate list of items to update * @param {UserDocument[]} metadataToCreate list of items to create - * @returns {'create' | 'update' | 'skip'} action to take + * @returns {Promise.<'create'|'update'|'skip'>} action to take */ - static createOrUpdate(metadata, metadataKey, hasError, metadataToUpdate, metadataToCreate) { - const action = super.createOrUpdate( + static async createOrUpdate( + metadata, + metadataKey, + hasError, + metadataToUpdate, + metadataToCreate + ) { + const action = await super.createOrUpdate( metadata, metadataKey, hasError, diff --git a/lib/util/cli.js b/lib/util/cli.js index 45ced182d..7207510f5 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -540,7 +540,7 @@ const Cli = { return 0; }); // add end-of-list marker - // @ts-ignore type checking this push() makes things very complicated... + // @ts-expect-error type checking this push() makes things very complicated... typeChoices.push(new inquirer.Separator(' ==== ')); responses = await inquirer.prompt([ { diff --git a/lib/util/devops.js b/lib/util/devops.js index bffaf4372..8feb529fc 100644 --- a/lib/util/devops.js +++ b/lib/util/devops.js @@ -74,7 +74,7 @@ const DevOps = { name: commit.date + ' / ' + commit.message + ' / ' + commit.author_name, value: commit.hash, })); - // @ts-ignore type checking this push() makes things very complicated... + // @ts-expect-error type checking this push() makes things very complicated... display.push(new inquirer.Separator(' ==== ')); const responses = await inquirer.prompt([ @@ -561,6 +561,7 @@ const DevOps = { for (let i = 1; i < tabled.length; i++) { for (let field of tabled[i]) { if (field !== '') { + // @ts-expect-error bad typing in jsonToTable field = field === true ? '✓' : field === false ? '✗' : field; output += `| ${field} `; } diff --git a/lib/util/file.js b/lib/util/file.js index 98f3f92d6..db9c5ea7d 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -425,7 +425,7 @@ const File = { try { directory = this.filterIllegalPathChars(this.normalizePath(directory)); filename = this.filterIllegalFilenames(filename); - // @ts-ignore - somehow, the declared type does not allow for encoding to be passed in as a string, despite that working and being stated in the docs. + // @ts-expect-error - somehow, the declared type does not allow for encoding to be passed in as a string, despite that working and being stated in the docs. return fs.readFile(path.join(directory, filename + '.' + filetype), encoding || 'utf8'); } catch (ex) { Util.logger.error('File.readFilteredFilename:: error | ' + ex.message); diff --git a/types/mcdev.d.js b/types/mcdev.d.js index cfb77328d..6f8e1bd28 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -85,10 +85,11 @@ * @property {string} [Name_new] custom attribute that is only used when trying to rename a field from Name to Name_new * @property {string} DefaultValue empty string for not set * @property {true|false} IsRequired - + * @property {true|false} [IsNullable] opposite of IsRequired * @property {true|false} IsPrimaryKey - * @property {number} Ordinal 1, 2, 3, ... * @property {'Text'|'Number'|'Date'|'Boolean'|'Decimal'|'EmailAddress'|'Phone'|'Locale'} FieldType can only be set on create - * @property {number} MaxLength field length + * @property {number|string} MaxLength field length * @property {string} Scale the number of places after the decimal that the field can hold; example: "0","1", ... */ /** @@ -114,6 +115,14 @@ * @property {string} [r__dataExtensionTemplate_Name] name of optionally associated DE template * @property {object} [Template] - * @property {string} [Template.CustomerKey] key of optionally associated DE teplate + * @property {string} [RetainUntil] ? + * @property {any} [DataRetentionPeriodLength] ? + * @property {any} [DataRetentionPeriodUnitOfMeasure] ? + * @property {any} [RowBasedRetention] ? + * @property {any} [ResetRetentionPeriodOnImport] ? + * @property {any} [DeleteAtEndOfRetentionPeriod] ? + */ +/** * @typedef {Object.} DataExtensionMap */ /** From 03c8dd09883771cbcc797864009e0494c6f00707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 11 Apr 2024 15:02:09 +0200 Subject: [PATCH 098/359] #1246: enhanced validation fixes for test-cases --- test/general.test.js | 4 +- test/type.asset.test.js | 2 +- test/type.attributeGroup.test.js | 2 +- test/type.attributeSet.test.js | 2 +- test/type.automation.test.js | 66 +++++++++++----------------- test/type.dataExtension.test.js | 40 +++++------------ test/type.dataExtract.test.js | 20 +++------ test/type.fileTransfer.test.js | 20 +++------ test/type.importFile.test.js | 22 +++------- test/type.journey.test.js | 14 +++--- test/type.mobileKeyword.test.js | 26 +++-------- test/type.mobileMessage.test.js | 20 +++------ test/type.query.test.js | 60 ++++++++++--------------- test/type.script.test.js | 36 +++++---------- test/type.transactionalEmail.test.js | 14 +++--- test/type.transactionalPush.test.js | 14 +++--- test/type.transactionalSMS.test.js | 14 +++--- test/type.triggeredSend.test.js | 14 +++--- test/type.user.test.js | 14 +++--- test/type.verification.test.js | 12 ++--- 20 files changed, 140 insertions(+), 276 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index 97d9bc58b..9c0a45c31 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -41,7 +41,7 @@ describe('GENERAL', () => { describe('explainTypes ================', () => { it('without options', () => { handler.explainTypes(); - assert.equal(process.exitCode, false, 'explainTypes should not have thrown an error'); + assert.equal(process.exitCode, 0, 'explainTypes should not have thrown an error'); return; }); @@ -52,7 +52,7 @@ describe('GENERAL', () => { assert.equal( process.exitCode, - false, + 0, 'explainTypes --json should not have thrown an error' ); diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 308f21274..dbe52e73b 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -53,7 +53,7 @@ describe('type: asset', () => { const retrieve = await handler.retrieve('testInstance/testBU', ['asset']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); assert.equal( retrieve['testInstance/testBU'].asset ? Object.keys(retrieve['testInstance/testBU'].asset).length diff --git a/test/type.attributeGroup.test.js b/test/type.attributeGroup.test.js index f371b31bd..57c0ad955 100644 --- a/test/type.attributeGroup.test.js +++ b/test/type.attributeGroup.test.js @@ -22,7 +22,7 @@ describe('type: attributeGroup', () => { const retrieve = await handler.retrieve('testInstance/testBU', ['attributeGroup']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); assert.equal( retrieve['testInstance/testBU'].attributeGroup ? Object.keys(retrieve['testInstance/testBU'].attributeGroup).length diff --git a/test/type.attributeSet.test.js b/test/type.attributeSet.test.js index 141ad1c34..08c1302e8 100644 --- a/test/type.attributeSet.test.js +++ b/test/type.attributeSet.test.js @@ -22,7 +22,7 @@ describe('type: attributeSet', () => { const retrieve = await handler.retrieve('testInstance/testBU', ['attributeSet']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); assert.equal( retrieve['testInstance/testBU'].attributeSet ? Object.keys(retrieve['testInstance/testBU'].attributeSet).length diff --git a/test/type.automation.test.js b/test/type.automation.test.js index a2a7c64d6..2be5f5682 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -23,7 +23,7 @@ describe('type: automation', () => { // WHEN await handler.retrieve('testInstance/testBU', ['automation']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -70,7 +70,7 @@ describe('type: automation', () => { ['testExisting_automation', 'testNew_automation', 'testNew_39f6a488-20eb-4ba0-b0b9'] ); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // check how many items were deployed assert.equal( @@ -143,7 +143,7 @@ describe('type: automation', () => { // THEN assert.equal( process.exitCode, - false, + 0, 'deploy with --execute should not have thrown an error' ); @@ -213,7 +213,7 @@ describe('type: automation', () => { // THEN assert.equal( process.exitCode, - false, + 0, 'deploy with --execute should not have thrown an error' ); @@ -284,7 +284,7 @@ describe('type: automation', () => { 'testExisting_automation', ]); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // check which keys were fixed assert.equal( resultFixKeys['testInstance/testBU'].length, @@ -326,7 +326,7 @@ describe('type: automation', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson( @@ -371,7 +371,7 @@ describe('type: automation', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson( @@ -416,7 +416,7 @@ describe('type: automation', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson( @@ -460,7 +460,7 @@ describe('type: automation', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson( @@ -502,7 +502,7 @@ describe('type: automation', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson( @@ -544,7 +544,7 @@ describe('type: automation', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson( @@ -578,11 +578,7 @@ describe('type: automation', () => { ['testExisting_automation'], 'testSourceMarket' ); - assert.equal( - process.exitCode, - false, - 'retrieveAsTemplate should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'retrieveAsTemplate should not have thrown an error'); // WHEN assert.equal( @@ -602,11 +598,7 @@ describe('type: automation', () => { 'testExisting_automation', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_automation', 'automation'), await testUtils.getExpectedJson('9999999', 'automation', 'build'), @@ -630,7 +622,7 @@ describe('type: automation', () => { ['testExisting_automation'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // WHEN assert.equal( result.automation ? Object.keys(result.automation).length : 0, @@ -649,11 +641,7 @@ describe('type: automation', () => { 'testExisting_automation', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_automation', 'automation'), @@ -678,7 +666,7 @@ describe('type: automation', () => { 'testExisting_automation' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; @@ -692,11 +680,7 @@ describe('type: automation', () => { 'testExisting_automation', ]); // THEN - assert.equal( - process.exitCode, - false, - 'getFilesToCommit should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'getFilesToCommit should not have thrown an error'); assert.equal(fileList.length, 2, 'expected only 2 file paths'); assert.equal( @@ -718,7 +702,7 @@ describe('type: automation', () => { const executedKeys = await handler.schedule('testInstance/testBU', 'automation', [ 'testExisting_automation', ]); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, @@ -735,7 +719,7 @@ describe('type: automation', () => { it('Should schedule an automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%automation' } }); const executedKeys = await handler.schedule('testInstance/testBU', 'automation'); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, @@ -770,7 +754,7 @@ describe('type: automation', () => { const executedKeys = await handler.execute('testInstance/testBU', 'automation', [ 'testExisting_automation', ]); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, @@ -787,7 +771,7 @@ describe('type: automation', () => { it('Should execute --schedule an automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%automation' }, schedule: true }); const executedKeys = await handler.execute('testInstance/testBU', 'automation'); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, @@ -819,7 +803,7 @@ describe('type: automation', () => { const executedKeys = await handler.execute('testInstance/testBU', 'automation', [ 'testExisting_automation', ]); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, @@ -836,7 +820,7 @@ describe('type: automation', () => { it('Should runOnce an automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%automation' } }); const executedKeys = await handler.execute('testInstance/testBU', 'automation'); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, @@ -872,7 +856,7 @@ describe('type: automation', () => { const pausedKeys = await handler.pause('testInstance/testBU', 'automation', [ 'testExisting_automation_pause', ]); - assert.equal(process.exitCode, false, 'pause should not have thrown an error'); + assert.equal(process.exitCode, 0, 'pause should not have thrown an error'); assert.equal( pausedKeys['testInstance/testBU']?.length, 1, @@ -889,7 +873,7 @@ describe('type: automation', () => { it('Should pause a automation selected via --like', async () => { handler.setOptions({ like: { key: 'testExisting_a%n_pause' } }); const pausedKeys = await handler.pause('testInstance/testBU', 'automation'); - assert.equal(process.exitCode, false, 'pause should not have thrown an error'); + assert.equal(process.exitCode, 0, 'pause should not have thrown an error'); assert.equal( pausedKeys['testInstance/testBU']?.length, 1, diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index 708b86c3d..6b2e1310f 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -23,7 +23,7 @@ describe('type: dataExtension', () => { // WHEN await handler.retrieve('testInstance/testBU', ['dataExtension']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -56,7 +56,7 @@ describe('type: dataExtension', () => { // WHEN await handler.retrieve('testInstance/_ParentBU_', ['dataExtension']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -105,7 +105,7 @@ describe('type: dataExtension', () => { // WHEN const deployResult = await handler.deploy('testInstance/testBU', ['dataExtension']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); assert.equal( deployResult['testInstance/testBU']?.dataExtension @@ -146,7 +146,7 @@ describe('type: dataExtension', () => { // WHEN const deployResult = await handler.deploy('testInstance/_ParentBU_', ['dataExtension']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); assert.equal( deployResult['testInstance/_ParentBU_']?.dataExtension @@ -197,7 +197,7 @@ describe('type: dataExtension', () => { const deployResult = await handler.deploy('testInstance/_ParentBU_', ['dataExtension']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); assert.equal( deployResult['testInstance/_ParentBU_']?.dataExtension @@ -252,11 +252,7 @@ describe('type: dataExtension', () => { ['testExisting_dataExtension'], 'testSourceMarket' ); - assert.equal( - process.exitCode, - false, - 'retrieveAsTemplate should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'retrieveAsTemplate should not have thrown an error'); // WHEN assert.equal( @@ -279,11 +275,7 @@ describe('type: dataExtension', () => { 'testExisting_dataExtension', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_dataExtension', 'dataExtension'), await testUtils.getExpectedJson('9999999', 'dataExtension', 'build'), @@ -307,7 +299,7 @@ describe('type: dataExtension', () => { ['testExisting_dataExtension'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // WHEN assert.equal( result.dataExtension ? Object.keys(result.dataExtension).length : 0, @@ -329,11 +321,7 @@ describe('type: dataExtension', () => { 'testExisting_dataExtension', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_dataExtension', 'dataExtension'), @@ -358,7 +346,7 @@ describe('type: dataExtension', () => { 'testExisting_dataExtension' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; @@ -372,7 +360,7 @@ describe('type: dataExtension', () => { 'testExisting_dataExtension.LastName' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; @@ -388,11 +376,7 @@ describe('type: dataExtension', () => { ['testExisting_dataExtension'] ); // THEN - assert.equal( - process.exitCode, - false, - 'getFilesToCommit should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'getFilesToCommit should not have thrown an error'); assert.equal(fileList.length, 2, 'expected only 2 file paths (json, md)'); assert.equal( diff --git a/test/type.dataExtract.test.js b/test/type.dataExtract.test.js index 0fb197c28..1677e0079 100644 --- a/test/type.dataExtract.test.js +++ b/test/type.dataExtract.test.js @@ -21,7 +21,7 @@ describe('type: dataExtract', () => { // WHEN await handler.retrieve('testInstance/testBU', ['dataExtract']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -53,7 +53,7 @@ describe('type: dataExtract', () => { await handler.deploy('testInstance/testBU', ['dataExtract']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -94,7 +94,7 @@ describe('type: dataExtract', () => { ['testExisting_dataExtract'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.dataExtract ? Object.keys(result.dataExtract).length : 0, 1, @@ -112,11 +112,7 @@ describe('type: dataExtract', () => { 'testExisting_dataExtract', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_dataExtract', 'dataExtract'), await testUtils.getExpectedJson('9999999', 'dataExtract', 'build'), @@ -140,7 +136,7 @@ describe('type: dataExtract', () => { ['testExisting_dataExtract'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.dataExtract ? Object.keys(result.dataExtract).length : 0, 1, @@ -158,11 +154,7 @@ describe('type: dataExtract', () => { 'testExisting_dataExtract', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_dataExtract', 'dataExtract'), await testUtils.getExpectedJson('9999999', 'dataExtract', 'build'), diff --git a/test/type.fileTransfer.test.js b/test/type.fileTransfer.test.js index 0dc820c58..72eed54c1 100644 --- a/test/type.fileTransfer.test.js +++ b/test/type.fileTransfer.test.js @@ -21,7 +21,7 @@ describe('type: fileTransfer', () => { // WHEN await handler.retrieve('testInstance/testBU', ['fileTransfer']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -52,7 +52,7 @@ describe('type: fileTransfer', () => { // WHEN await handler.deploy('testInstance/testBU', ['fileTransfer']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -91,7 +91,7 @@ describe('type: fileTransfer', () => { ['testExisting_fileTransfer'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.fileTransfer ? Object.keys(result.fileTransfer).length : 0, 1, @@ -109,11 +109,7 @@ describe('type: fileTransfer', () => { 'testExisting_fileTransfer', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_fileTransfer', 'fileTransfer'), await testUtils.getExpectedJson('9999999', 'fileTransfer', 'build'), @@ -137,7 +133,7 @@ describe('type: fileTransfer', () => { ['testExisting_fileTransfer'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.fileTransfer ? Object.keys(result.fileTransfer).length : 0, 1, @@ -155,11 +151,7 @@ describe('type: fileTransfer', () => { 'testExisting_fileTransfer', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_fileTransfer', 'fileTransfer'), await testUtils.getExpectedJson('9999999', 'fileTransfer', 'build'), diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 7471426dd..1de52f156 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -21,7 +21,7 @@ describe('type: importFile', () => { // WHEN await handler.retrieve('testInstance/testBU', ['importFile']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -55,7 +55,7 @@ describe('type: importFile', () => { ['testExisting_importFile'] ); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -87,7 +87,7 @@ describe('type: importFile', () => { await handler.deploy('testInstance/testBU', ['importFile']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -126,7 +126,7 @@ describe('type: importFile', () => { ['testExisting_importFile'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.importFile ? Object.keys(result.importFile).length : 0, 1, @@ -144,11 +144,7 @@ describe('type: importFile', () => { 'testExisting_importFile', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_importFile', 'importFile'), await testUtils.getExpectedJson('9999999', 'importFile', 'build'), @@ -172,7 +168,7 @@ describe('type: importFile', () => { ['testExisting_importFile'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.importFile ? Object.keys(result.importFile).length : 0, 1, @@ -190,11 +186,7 @@ describe('type: importFile', () => { 'testExisting_importFile', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_importFile', 'importFile'), await testUtils.getExpectedJson('9999999', 'importFile', 'build'), diff --git a/test/type.journey.test.js b/test/type.journey.test.js index ad7dcd4ae..c96c4e8c8 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -21,7 +21,7 @@ describe('type: journey', () => { // WHEN await handler.retrieve('testInstance/testBU', ['journey']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -52,7 +52,7 @@ describe('type: journey', () => { // WHEN await handler.deploy('testInstance/testBU', ['journey']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -108,7 +108,7 @@ describe('type: journey', () => { ['testExisting_interaction'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.journey ? Object.keys(result.journey).length : 0, 1, @@ -127,11 +127,7 @@ describe('type: journey', () => { 'testExisting_interaction', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_interaction', 'journey'), await testUtils.getExpectedJson('9999999', 'journey', 'build'), @@ -184,7 +180,7 @@ describe('type: journey', () => { 'testExisting_interaction/1' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; diff --git a/test/type.mobileKeyword.test.js b/test/type.mobileKeyword.test.js index 51939ca25..9a8534aa0 100644 --- a/test/type.mobileKeyword.test.js +++ b/test/type.mobileKeyword.test.js @@ -23,7 +23,7 @@ describe('type: mobileKeyword', () => { // WHEN await handler.retrieve('testInstance/testBU', ['mobileKeyword']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -70,7 +70,7 @@ describe('type: mobileKeyword', () => { ['4912312345678.TESTNEW_KEYWORD'] ); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -137,11 +137,7 @@ describe('type: mobileKeyword', () => { 'testSourceMarket' ); // WHEN - assert.equal( - process.exitCode, - false, - 'retrieveAsTemplate should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'retrieveAsTemplate should not have thrown an error'); assert.equal( result.mobileKeyword ? Object.keys(result.mobileKeyword).length : 0, 1, @@ -184,7 +180,7 @@ describe('type: mobileKeyword', () => { ['4912312345678.TESTEXISTING_KEYWORD'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.mobileKeyword ? Object.keys(result.mobileKeyword).length : 0, @@ -218,11 +214,7 @@ describe('type: mobileKeyword', () => { '4912312345678.TESTEXISTING_KEYWORD', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson( '4912312345678.TESTTEMPLATED_KEYWORD', @@ -259,7 +251,7 @@ describe('type: mobileKeyword', () => { '4912312345678.TESTEXISTING_KEYWORD' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; @@ -275,11 +267,7 @@ describe('type: mobileKeyword', () => { ['4912312345678.TESTEXISTING_KEYWORD'] ); // THEN - assert.equal( - process.exitCode, - false, - 'getFilesToCommit should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'getFilesToCommit should not have thrown an error'); assert.equal(fileList.length, 2, 'expected only 2 file paths'); assert.equal( diff --git a/test/type.mobileMessage.test.js b/test/type.mobileMessage.test.js index 241a27658..691acc40d 100644 --- a/test/type.mobileMessage.test.js +++ b/test/type.mobileMessage.test.js @@ -23,7 +23,7 @@ describe('type: mobileMessage', () => { // WHEN await handler.retrieve('testInstance/testBU', ['mobileMessage']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -57,7 +57,7 @@ describe('type: mobileMessage', () => { // WHEN await handler.deploy('testInstance/testBU', ['mobileMessage']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -119,7 +119,7 @@ describe('type: mobileMessage', () => { ['NTIzOjc4OjA'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.mobileMessage ? Object.keys(result.mobileMessage).length : 0, @@ -144,11 +144,7 @@ describe('type: mobileMessage', () => { 'NTIzOjc4OjA', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('NTIzOjc4OjA', 'mobileMessage'), await testUtils.getExpectedJson('9999999', 'mobileMessage', 'build'), @@ -176,7 +172,7 @@ describe('type: mobileMessage', () => { 'NTIzOjc4OjA' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; @@ -192,11 +188,7 @@ describe('type: mobileMessage', () => { ['NTIzOjc4OjA'] ); // THEN - assert.equal( - process.exitCode, - false, - 'getFilesToCommit should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'getFilesToCommit should not have thrown an error'); assert.equal(fileList.length, 2, 'expected only 2 file paths'); assert.equal( diff --git a/test/type.query.test.js b/test/type.query.test.js index 0734274bd..f378daaa6 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -23,7 +23,7 @@ describe('type: query', () => { // WHEN await handler.retrieve('testInstance/testBU', ['query']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -59,7 +59,7 @@ describe('type: query', () => { // WHEN await handler.retrieve('testInstance/testBU', ['query'], ['testExisting_query']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -88,7 +88,7 @@ describe('type: query', () => { handler.setOptions({ like: { key: '%Existing_query' } }); await handler.retrieve('testInstance/testBU', ['query']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -119,7 +119,7 @@ describe('type: query', () => { handler.setOptions({ like: { key: 'NotExisting_query' } }); await handler.retrieve('testInstance/testBU', ['query']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -154,7 +154,7 @@ describe('type: query', () => { ['testNew_query', 'testExisting_query'] ); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); assert.equal( resultDeploy['testInstance/testBU']?.query ? Object.keys(resultDeploy['testInstance/testBU']?.query).length @@ -207,7 +207,7 @@ describe('type: query', () => { // THEN assert.equal( process.exitCode, - false, + 0, 'deploy with --execute should not have thrown an error' ); // confirm updated item @@ -253,7 +253,7 @@ describe('type: query', () => { // THEN assert.equal( process.exitCode, - false, + 0, 'deploy --changeKeyValue should not have thrown an error' ); assert.equal( @@ -301,7 +301,7 @@ describe('type: query', () => { // THEN assert.equal( process.exitCode, - false, + 0, 'deploy --changeKeyValue should not have thrown an error' ); assert.equal( @@ -339,7 +339,7 @@ describe('type: query', () => { 'testExisting_query', ]); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // check which keys were fixed assert.equal( resultFixKeys['testInstance/testBU'].length, @@ -381,7 +381,7 @@ describe('type: query', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson('testExisting_query_fixedKeys', 'query'), @@ -420,7 +420,7 @@ describe('type: query', () => { // THEN assert.equal( process.exitCode, - false, + 0, 'fixKeys with --execute should not have thrown an error' ); // confirm updated item @@ -459,7 +459,7 @@ describe('type: query', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson('testExisting_query_fixedKeys', 'query'), @@ -498,7 +498,7 @@ describe('type: query', () => { // THEN assert.equal( process.exitCode, - false, + 0, 'fixKeys with --execute should not have thrown an error' ); // confirm updated item @@ -537,7 +537,7 @@ describe('type: query', () => { 'returned keys do not correspond to expected fixed keys' ); // THEN - assert.equal(process.exitCode, false, 'fixKeys should not have thrown an error'); + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson('testExisting_query_fixedKeys', 'query'), @@ -567,11 +567,7 @@ describe('type: query', () => { 'testSourceMarket' ); // WHEN - assert.equal( - process.exitCode, - false, - 'retrieveAsTemplate should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'retrieveAsTemplate should not have thrown an error'); assert.equal( result.query ? Object.keys(result.query).length : 0, 1, @@ -592,11 +588,7 @@ describe('type: query', () => { 'testExisting_query', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_query', 'query'), @@ -626,7 +618,7 @@ describe('type: query', () => { 'testSourceMarket' ); // WHEN - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.query ? Object.keys(result.query).length : 0, @@ -648,11 +640,7 @@ describe('type: query', () => { 'testExisting_query', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_query', 'query'), @@ -681,7 +669,7 @@ describe('type: query', () => { 'testExisting_query' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; @@ -695,11 +683,7 @@ describe('type: query', () => { 'testExisting_query', ]); // THEN - assert.equal( - process.exitCode, - false, - 'getFilesToCommit should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'getFilesToCommit should not have thrown an error'); assert.equal(fileList.length, 2, 'expected only 2 file paths'); assert.equal( @@ -721,7 +705,7 @@ describe('type: query', () => { const executedKeys = await handler.execute('testInstance/testBU', 'query', [ 'testExisting_query', ]); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, @@ -738,7 +722,7 @@ describe('type: query', () => { it('Should start a query selected via --like', async () => { handler.setOptions({ like: { key: 'testExist%query' } }); const executedKeys = await handler.execute('testInstance/testBU', 'query'); - assert.equal(process.exitCode, false, 'execute should not have thrown an error'); + assert.equal(process.exitCode, 0, 'execute should not have thrown an error'); assert.equal( executedKeys['testInstance/testBU']?.length, 1, diff --git a/test/type.script.test.js b/test/type.script.test.js index 592ef273e..328dacb00 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -23,7 +23,7 @@ describe('type: script', () => { // WHEN const retrieve = await handler.retrieve('testInstance/testBU', ['script']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // retrieve result assert.equal( retrieve['testInstance/testBU'].script @@ -120,7 +120,7 @@ describe('type: script', () => { // WHEN await handler.retrieve('testInstance/testBU', ['script'], ['testExisting_script']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -163,7 +163,7 @@ describe('type: script', () => { await handler.retrieve('testInstance/testBU', ['script']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); @@ -204,7 +204,7 @@ describe('type: script', () => { handler.setOptions({ like: { key: 'NotExisting_script' } }); await handler.retrieve('testInstance/testBU', ['script']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); @@ -234,7 +234,7 @@ describe('type: script', () => { // WHEN await handler.deploy('testInstance/testBU', ['script']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -279,11 +279,7 @@ describe('type: script', () => { 'testSourceMarket' ); // WHEN - assert.equal( - process.exitCode, - false, - 'retrieveAsTemplate should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'retrieveAsTemplate should not have thrown an error'); assert.equal( result.script ? Object.keys(result.script).length : 0, 1, @@ -304,11 +300,7 @@ describe('type: script', () => { 'testExisting_script', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_script', 'script'), @@ -338,7 +330,7 @@ describe('type: script', () => { 'testSourceMarket' ); // WHEN - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.script ? Object.keys(result.script).length : 0, @@ -360,11 +352,7 @@ describe('type: script', () => { 'testExisting_script', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_script', 'script'), @@ -406,11 +394,7 @@ describe('type: script', () => { 'testExisting_script', ]); // THEN - assert.equal( - process.exitCode, - false, - 'getFilesToCommit should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'getFilesToCommit should not have thrown an error'); assert.equal(fileList.length, 3, 'expected only 3 file paths (html, json, ssjs)'); assert.equal( diff --git a/test/type.transactionalEmail.test.js b/test/type.transactionalEmail.test.js index e84c7e67d..56d690c62 100644 --- a/test/type.transactionalEmail.test.js +++ b/test/type.transactionalEmail.test.js @@ -21,7 +21,7 @@ describe('type: transactionalEmail', () => { // WHEN await handler.retrieve('testInstance/testBU', ['transactionalEmail']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -52,7 +52,7 @@ describe('type: transactionalEmail', () => { // WHEN await handler.deploy('testInstance/testBU', ['transactionalEmail']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -111,7 +111,7 @@ describe('type: transactionalEmail', () => { ['testExisting_temail'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.transactionalEmail ? Object.keys(result.transactionalEmail).length : 0, 1, @@ -129,11 +129,7 @@ describe('type: transactionalEmail', () => { 'testExisting_temail', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_temail', 'transactionalEmail'), await testUtils.getExpectedJson('9999999', 'transactionalEmail', 'build'), @@ -157,7 +153,7 @@ describe('type: transactionalEmail', () => { 'testExisting_temail' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; diff --git a/test/type.transactionalPush.test.js b/test/type.transactionalPush.test.js index 80e299815..d45bc0b50 100644 --- a/test/type.transactionalPush.test.js +++ b/test/type.transactionalPush.test.js @@ -21,7 +21,7 @@ describe('type: transactionalPush', () => { // WHEN await handler.retrieve('testInstance/testBU', ['transactionalPush']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -52,7 +52,7 @@ describe('type: transactionalPush', () => { // WHEN await handler.deploy('testInstance/testBU', ['transactionalPush']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -111,7 +111,7 @@ describe('type: transactionalPush', () => { ['testExisting_tpush'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.transactionalPush ? Object.keys(result.transactionalPush).length : 0, 1, @@ -129,11 +129,7 @@ describe('type: transactionalPush', () => { 'testExisting_tpush', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_tpush', 'transactionalPush'), @@ -155,7 +151,7 @@ describe('type: transactionalPush', () => { // // WHEN // const isDeleted = await handler.deleteByKey('testInstance/testBU', 'mobileKeyword', 'testExisting_keyword'); // // THEN - // assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + // assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); // assert.equal(isDeleted, true, 'should have deleted the item'); // return; diff --git a/test/type.transactionalSMS.test.js b/test/type.transactionalSMS.test.js index feb0e20f4..ee19fe601 100644 --- a/test/type.transactionalSMS.test.js +++ b/test/type.transactionalSMS.test.js @@ -23,7 +23,7 @@ describe('type: transactionalSMS', () => { // WHEN await handler.retrieve('testInstance/testBU', ['transactionalSMS']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -59,7 +59,7 @@ describe('type: transactionalSMS', () => { // WHEN await handler.deploy('testInstance/testBU', ['transactionalSMS']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -128,7 +128,7 @@ describe('type: transactionalSMS', () => { ['testExisting_tsms'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.transactionalSMS ? Object.keys(result.transactionalSMS).length : 0, @@ -154,11 +154,7 @@ describe('type: transactionalSMS', () => { 'testExisting_tsms', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_tsms', 'transactionalSMS'), @@ -185,7 +181,7 @@ describe('type: transactionalSMS', () => { // // WHEN // const isDeleted = await handler.deleteByKey('testInstance/testBU', 'mobileKeyword', 'testExisting_keyword'); // // THEN - // assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + // assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); // assert.equal(isDeleted, true, 'should have deleted the item'); // return; diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index f41e38376..b11154108 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -21,7 +21,7 @@ describe('type: triggeredSend', () => { // WHEN await handler.retrieve('testInstance/testBU', ['triggeredSend']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -52,7 +52,7 @@ describe('type: triggeredSend', () => { // WHEN await handler.deploy('testInstance/testBU', ['triggeredSend']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -93,7 +93,7 @@ describe('type: triggeredSend', () => { ['testExisting_triggeredSend'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.triggeredSend ? Object.keys(result.triggeredSend).length : 0, 1, @@ -114,11 +114,7 @@ describe('type: triggeredSend', () => { 'testExisting_triggeredSend', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_triggeredSend', 'triggeredSend'), await testUtils.getExpectedJson('9999999', 'triggeredSend', 'build'), @@ -142,7 +138,7 @@ describe('type: triggeredSend', () => { 'testExisting_triggeredSend' ); // THEN - assert.equal(process.exitCode, false, 'delete should not have thrown an error'); + assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); assert.equal(isDeleted, true, 'should have deleted the item'); return; diff --git a/test/type.user.test.js b/test/type.user.test.js index 5b72b444a..d512482c6 100644 --- a/test/type.user.test.js +++ b/test/type.user.test.js @@ -24,7 +24,7 @@ describe('type: user', () => { // WHEN await handler.retrieve('testInstance/_ParentBU_', ['user']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -68,7 +68,7 @@ describe('type: user', () => { // WHEN await handler.retrieve('testInstance/_ParentBU_', ['user'], ['testExisting_user']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // because user is single-document-type we would not want to find an md file when we retrieve specific keys. only the generic retrieve updates it expect(file(`./docs/user/testInstance.users.md`)).to.not.exist; @@ -97,7 +97,7 @@ describe('type: user', () => { ]; await handler.deploy('testInstance/_ParentBU_', ['user'], expectedCache); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); @@ -182,7 +182,7 @@ describe('type: user', () => { ['testExisting_user'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); // WHEN assert.equal( result.user ? Object.keys(result.user).length : 0, @@ -201,11 +201,7 @@ describe('type: user', () => { 'testExisting_user', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_user', 'user', '_ParentBU_'), diff --git a/test/type.verification.test.js b/test/type.verification.test.js index 42890286b..c2aa57f8c 100644 --- a/test/type.verification.test.js +++ b/test/type.verification.test.js @@ -21,7 +21,7 @@ describe('type: verification', () => { // WHEN const retrieved = await handler.retrieve('testInstance/testBU', ['verification']); // THEN - assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -64,7 +64,7 @@ describe('type: verification', () => { const deployed = await handler.deploy('testInstance/testBU', ['verification']); // THEN - assert.equal(process.exitCode, false, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); // get results from cache const result = cache.getCache(); assert.equal( @@ -115,7 +115,7 @@ describe('type: verification', () => { ['testExisting_39f6a488-20eb-4ba0-b0b9'], 'testSourceMarket' ); - assert.equal(process.exitCode, false, 'buildTemplate should not have thrown an error'); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.verification ? Object.keys(result.verification).length : 0, 1, @@ -136,11 +136,7 @@ describe('type: verification', () => { 'testExisting_39f6a488-20eb-4ba0-b0b9', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson( 'testTemplated_39f6a488-20eb-4ba0-b0b9', From 71e4f23671e139a2af264757b158078da0e19215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 11 Apr 2024 15:17:05 +0200 Subject: [PATCH 099/359] #1246: fix explainTypes --- lib/MetadataTypeDefinitions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/MetadataTypeDefinitions.js b/lib/MetadataTypeDefinitions.js index d34eeeef7..05075f877 100644 --- a/lib/MetadataTypeDefinitions.js +++ b/lib/MetadataTypeDefinitions.js @@ -29,6 +29,7 @@ import query from './metadataTypes/definitions/Query.definition.js'; import role from './metadataTypes/definitions/Role.definition.js'; import script from './metadataTypes/definitions/Script.definition.js'; import sendClassification from './metadataTypes/definitions/SendClassification.definition.js'; +import transactionalMessage from './metadataTypes/definitions/TransactionalMessage.definition.js'; import transactionalEmail from './metadataTypes/definitions/TransactionalEmail.definition.js'; import transactionalPush from './metadataTypes/definitions/TransactionalPush.definition.js'; import transactionalSMS from './metadataTypes/definitions/TransactionalSMS.definition.js'; @@ -69,6 +70,7 @@ export default { role, script, sendClassification, + transactionalMessage, transactionalEmail, transactionalPush, transactionalSMS, From 5ca0d7f19e004cc2057eebda79c9ff74e31c715b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 11 Apr 2024 16:55:25 +0200 Subject: [PATCH 100/359] #1246: upgrade ts config + add evaluate all script --- jsconfig.json | 5 ++++- lib/index.js | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/jsconfig.json b/jsconfig.json index 1b2b2925a..1add30d47 100644 --- a/jsconfig.json +++ b/jsconfig.json @@ -1,9 +1,12 @@ { "include": ["lib/**/*.js", "types/**/*.js", "test/**/*.js"], + "exclude": ["node_modules"], "compilerOptions": { "module": "NodeNext", "moduleResolution": "nodenext", "target": "es2022", - "checkJs": true + "checkJs": true, + "skipLibCheck": true, + "noEmit": true } } diff --git a/lib/index.js b/lib/index.js index 77aa8d85c..1115297c5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -871,6 +871,7 @@ class Mcdev { let lang_present; let requireKeyOrLike; let checkMetadataSupport; + /** @type {Object.} */ const resultObj = {}; switch (methodName) { From 46e7d6448a80dc2c101f5cf34b96dd4cd9929a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 11 Apr 2024 17:04:47 +0200 Subject: [PATCH 101/359] #1246: enhanced validaiton for test classes --- test/type.automation.test.js | 8 ++++---- test/type.journey.test.js | 4 ++-- test/type.mobileKeyword.test.js | 2 +- test/type.query.test.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 2be5f5682..f299f8292 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -738,7 +738,7 @@ describe('type: automation', () => { const executedKeys = await handler.schedule('testInstance/testBU', 'automation', [ 'testExisting_automation', ]); - assert.equal(process.exitCode, true, 'execute should have thrown an error'); + assert.equal(process.exitCode, 1, 'execute should have thrown an error'); assert.equal( Object.keys(executedKeys).length, 0, @@ -790,7 +790,7 @@ describe('type: automation', () => { const executedKeys = await handler.execute('testInstance/testBU', 'automation', [ 'testExisting_automation', ]); - assert.equal(process.exitCode, true, 'execute should have thrown an error'); + assert.equal(process.exitCode, 1, 'execute should have thrown an error'); assert.equal( Object.keys(executedKeys).length, 0, @@ -840,7 +840,7 @@ describe('type: automation', () => { const executedKeys = await handler.execute('testInstance/testBU', 'automation', [ 'testExisting_automation', ]); - assert.equal(process.exitCode, true, 'execute should have thrown an error'); + assert.equal(process.exitCode, 1, 'execute should have thrown an error'); assert.equal( Object.keys(executedKeys).length, 0, @@ -892,7 +892,7 @@ describe('type: automation', () => { const pausedKeys = await handler.pause('testInstance/testBU', 'automation', [ 'testExisting_automation_pause', ]); - assert.equal(process.exitCode, true, 'pause should have thrown an error'); + assert.equal(process.exitCode, 1, 'pause should have thrown an error'); assert.equal( Object.keys(pausedKeys).length, 0, diff --git a/test/type.journey.test.js b/test/type.journey.test.js index c96c4e8c8..c3a04f028 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -152,7 +152,7 @@ describe('type: journey', () => { 'testExisting_interaction' ); // THEN - assert.equal(process.exitCode, true, 'delete should have thrown an error'); + assert.equal(process.exitCode, 1, 'delete should have thrown an error'); assert.equal(isDeleted, false, 'should not have deleted the item'); return; @@ -166,7 +166,7 @@ describe('type: journey', () => { 'testExisting_interaction/2' ); // THEN - assert.equal(process.exitCode, true, 'delete should have thrown an error'); + assert.equal(process.exitCode, 1, 'delete should have thrown an error'); assert.equal(isDeleted, false, 'should not have deleted the item'); return; diff --git a/test/type.mobileKeyword.test.js b/test/type.mobileKeyword.test.js index 9a8534aa0..613844ff3 100644 --- a/test/type.mobileKeyword.test.js +++ b/test/type.mobileKeyword.test.js @@ -115,7 +115,7 @@ describe('type: mobileKeyword', () => { ['4912312345678.TESTNEW_KEYWORD_BLOCKED'] ); // THEN - assert.equal(process.exitCode, true, 'deploy should have thrown an error'); + assert.equal(process.exitCode, 1, 'deploy should have thrown an error'); // check number of API calls assert.equal( diff --git a/test/type.query.test.js b/test/type.query.test.js index f378daaa6..826c3314b 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -741,7 +741,7 @@ describe('type: query', () => { const executedKeys = await handler.execute('testInstance/testBU', 'query', [ 'testExisting_query', ]); - assert.equal(process.exitCode, true, 'execute should have thrown an error'); + assert.equal(process.exitCode, 1, 'execute should have thrown an error'); assert.equal( Object.keys(executedKeys).length, 0, From 333fbc705d609bcc01599d250f8233787d4058f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 12:06:10 +0200 Subject: [PATCH 102/359] #1246: adding @types/mocha and @types/node --- package-lock.json | 23 +++++++++++++++++++++++ package.json | 3 +++ 2 files changed, 26 insertions(+) diff --git a/package-lock.json b/package-lock.json index 992acc09b..3f614d180 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,8 @@ "mcdev": "lib/cli.js" }, "devDependencies": { + "@types/mocha": "10.0.6", + "@types/node": "20.12.7", "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", @@ -584,6 +586,21 @@ "optional": true, "peer": true }, + "node_modules/@types/mocha": { + "version": "10.0.6", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.6.tgz", + "integrity": "sha512-dJvrYWxP/UcXm36Qn36fxhUKu8A/xMRXVT2cliFF1Z7UA9liG5Psj3ezNSZw+5puH2czDXRLcXQxf8JbJt0ejg==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.12.7", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", + "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } + }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.1.tgz", @@ -6943,6 +6960,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unique-string": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-3.0.0.tgz", diff --git a/package.json b/package.json index c93bfc630..a93ef4a93 100644 --- a/package.json +++ b/package.json @@ -50,6 +50,7 @@ "debug": "node --nolazy --inspect-brk=9229 lib/cli.js", "lint:fix": "eslint --fix lib/**/*.js && eslint --fix types/*.js && eslint --fix test/**/*.js", "lint": "run-p -c lint-type lint-lib lint-test", + "lint-ts": "tsc -p jsconfig.json --maxNodeModuleJsDepth 1 --noEmit", "lint-lib": "eslint lib/**/*.js", "lint-type": "eslint types/*.js", "lint-test": "eslint test/**/*.js", @@ -84,6 +85,8 @@ "yargs": "17.7.2" }, "devDependencies": { + "@types/mocha": "10.0.6", + "@types/node": "20.12.7", "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", From 96c223c5ad2afe01ce94e4fb52e670060173706d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 14:40:36 +0200 Subject: [PATCH 103/359] #54: add typep senderProfile (add/update/delete) --- lib/MetadataTypeDefinitions.js | 2 + lib/MetadataTypeInfo.js | 2 + lib/metadataTypes/SenderProfile.js | 83 ++++++++ .../definitions/SenderProfile.definition.js | 184 ++++++++++++++++++ 4 files changed, 271 insertions(+) create mode 100644 lib/metadataTypes/SenderProfile.js create mode 100644 lib/metadataTypes/definitions/SenderProfile.definition.js diff --git a/lib/MetadataTypeDefinitions.js b/lib/MetadataTypeDefinitions.js index d34eeeef7..7b26654c2 100644 --- a/lib/MetadataTypeDefinitions.js +++ b/lib/MetadataTypeDefinitions.js @@ -29,6 +29,7 @@ import query from './metadataTypes/definitions/Query.definition.js'; import role from './metadataTypes/definitions/Role.definition.js'; import script from './metadataTypes/definitions/Script.definition.js'; import sendClassification from './metadataTypes/definitions/SendClassification.definition.js'; +import senderProfile from './metadataTypes/definitions/SenderProfile.definition.js'; import transactionalEmail from './metadataTypes/definitions/TransactionalEmail.definition.js'; import transactionalPush from './metadataTypes/definitions/TransactionalPush.definition.js'; import transactionalSMS from './metadataTypes/definitions/TransactionalSMS.definition.js'; @@ -69,6 +70,7 @@ export default { role, script, sendClassification, + senderProfile, transactionalEmail, transactionalPush, transactionalSMS, diff --git a/lib/MetadataTypeInfo.js b/lib/MetadataTypeInfo.js index 17ae9d198..b0be83eaa 100644 --- a/lib/MetadataTypeInfo.js +++ b/lib/MetadataTypeInfo.js @@ -29,6 +29,7 @@ import query from './metadataTypes/Query.js'; import role from './metadataTypes/Role.js'; import script from './metadataTypes/Script.js'; import sendClassification from './metadataTypes/SendClassification.js'; +import senderProfile from './metadataTypes/SenderProfile.js'; import transactionalEmail from './metadataTypes/TransactionalEmail.js'; import transactionalPush from './metadataTypes/TransactionalPush.js'; import transactionalSMS from './metadataTypes/TransactionalSMS.js'; @@ -69,6 +70,7 @@ export default { role, script, sendClassification, + senderProfile, transactionalEmail, transactionalPush, transactionalSMS, diff --git a/lib/metadataTypes/SenderProfile.js b/lib/metadataTypes/SenderProfile.js new file mode 100644 index 000000000..509919b3b --- /dev/null +++ b/lib/metadataTypes/SenderProfile.js @@ -0,0 +1,83 @@ +'use strict'; + +import MetadataType from './MetadataType.js'; + +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + +/** + * SenderProfile MetadataType + * + * @augments MetadataType + */ +class SenderProfile extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void} [_] unused parameter + * @param {void} [__] unused parameter + * @param {void} [___] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir, _, __, ___, key) { + /** @type {SoapRequestParams} */ + let requestParams = null; + if (key) { + requestParams = { + filter: { + leftOperand: 'CustomerKey', + operator: 'equals', + rightOperand: key, + }, + }; + } + return super.retrieveSOAP(retrieveDir, null, requestParams); + } + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static update(metadataItem) { + return super.updateSOAP(metadataItem); + } + + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static create(metadataItem) { + return super.createSOAP(metadataItem); + } + + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {Promise.} deletion success status + */ + static deleteByKey(customerKey) { + return super.deleteByKeySOAP(customerKey); + } +} + +// Assign definition & cache to static attributes +import MetadataTypeDefinitions from '../MetadataTypeDefinitions.js'; +SenderProfile.definition = MetadataTypeDefinitions.senderProfile; + +export default SenderProfile; diff --git a/lib/metadataTypes/definitions/SenderProfile.definition.js b/lib/metadataTypes/definitions/SenderProfile.definition.js new file mode 100644 index 000000000..92ccdf798 --- /dev/null +++ b/lib/metadataTypes/definitions/SenderProfile.definition.js @@ -0,0 +1,184 @@ +export default { + bodyIteratorField: 'Results', + dependencies: [], + filter: {}, + hasExtended: false, + idField: 'ObjectID', + keyIsFixed: true, + keyField: 'CustomerKey', + nameField: 'Name', + createdDateField: 'CreatedDate', + createdNameField: null, + lastmodDateField: 'ModifiedDate', + lastmodNameField: null, + restPagination: false, + type: 'senderProfile', + typeDescription: 'todo', + typeRetrieveByDefault: false, + typeName: 'Sender Profile', + fields: { + 'Client.ID': { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + CreatedDate: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + ModifiedDate: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + CustomerKey: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + ObjectID: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + Name: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + Description: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + PartnerKey: { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + PartnerProperties: { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + + AutoForwardToEmailAddress: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + AutoForwardToName: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + AutoForwardTriggeredSend: { + // not supported + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + AutoReply: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + AutoReplyTriggeredSend: { + // not supported + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + DataRetentionPeriodLength: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + DataRetentionPeriodUnitOfMeasure: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + DirectForward: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + FromAddress: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + FromName: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + ID: { + // not supported + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + ReplyManagementRuleSet: { + // not supported + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + ReplyToAddress: { + // not supported + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + ReplyToDisplayName: { + // not supported + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + SenderHeaderEmailAddress: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + SenderHeaderName: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + UseDefaultRMMRules: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + }, +}; From a65681df0cc686b1babc705afe37a16c1feeb52f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 15:08:26 +0200 Subject: [PATCH 104/359] #54: added test cases for senderProfile --- ...ting_senderProfile.senderProfile-meta.json | 14 ++ ...tNew_senderProfile.senderProfile-meta.json | 14 ++ .../9999999/senderProfile/build-expected.json | 14 ++ .../9999999/senderProfile/create-response.xml | 49 ++++++ .../9999999/senderProfile/delete-response.xml | 36 +++++ .../9999999/senderProfile/get-expected.json | 16 ++ .../9999999/senderProfile/patch-expected.json | 14 ++ .../9999999/senderProfile/post-expected.json | 14 ++ .../senderProfile/retrieve-response.xml | 44 +++++ .../senderProfile/template-expected.json | 14 ++ .../9999999/senderProfile/update-response.xml | 47 ++++++ test/type.senderProfile.test.js | 151 ++++++++++++++++++ 12 files changed, 427 insertions(+) create mode 100644 test/mockRoot/deploy/testInstance/testBU/senderProfile/testExisting_senderProfile.senderProfile-meta.json create mode 100644 test/mockRoot/deploy/testInstance/testBU/senderProfile/testNew_senderProfile.senderProfile-meta.json create mode 100644 test/resources/9999999/senderProfile/build-expected.json create mode 100644 test/resources/9999999/senderProfile/create-response.xml create mode 100644 test/resources/9999999/senderProfile/delete-response.xml create mode 100644 test/resources/9999999/senderProfile/get-expected.json create mode 100644 test/resources/9999999/senderProfile/patch-expected.json create mode 100644 test/resources/9999999/senderProfile/post-expected.json create mode 100644 test/resources/9999999/senderProfile/retrieve-response.xml create mode 100644 test/resources/9999999/senderProfile/template-expected.json create mode 100644 test/resources/9999999/senderProfile/update-response.xml create mode 100644 test/type.senderProfile.test.js diff --git a/test/mockRoot/deploy/testInstance/testBU/senderProfile/testExisting_senderProfile.senderProfile-meta.json b/test/mockRoot/deploy/testInstance/testBU/senderProfile/testExisting_senderProfile.senderProfile-meta.json new file mode 100644 index 000000000..949919fbc --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/senderProfile/testExisting_senderProfile.senderProfile-meta.json @@ -0,0 +1,14 @@ +{ + "CustomerKey": "testExisting_senderProfile", + "Name": "testExisting_senderProfile", + "Description": "updated via deploy", + "FromName": "Jörn Berkefeld", + "FromAddress": "joern.berkefeld@accenture.com", + "UseDefaultRMMRules": false, + "AutoForwardToEmailAddress": "joern.berkefeld@accenture.com", + "AutoForwardToName": "Jörn Berkefeld", + "DirectForward": false, + "AutoReply": false, + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "" +} diff --git a/test/mockRoot/deploy/testInstance/testBU/senderProfile/testNew_senderProfile.senderProfile-meta.json b/test/mockRoot/deploy/testInstance/testBU/senderProfile/testNew_senderProfile.senderProfile-meta.json new file mode 100644 index 000000000..46f07378e --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/senderProfile/testNew_senderProfile.senderProfile-meta.json @@ -0,0 +1,14 @@ +{ + "CustomerKey": "testNew_senderProfile", + "Name": "testNew_senderProfile", + "Description": "created on deploy", + "FromName": "Jörn Berkefeld", + "FromAddress": "joern.berkefeld@accenture.com", + "UseDefaultRMMRules": false, + "AutoForwardToEmailAddress": "joern.berkefeld@accenture.com", + "AutoForwardToName": "Jörn Berkefeld", + "DirectForward": false, + "AutoReply": false, + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "" +} diff --git a/test/resources/9999999/senderProfile/build-expected.json b/test/resources/9999999/senderProfile/build-expected.json new file mode 100644 index 000000000..b4e1838f5 --- /dev/null +++ b/test/resources/9999999/senderProfile/build-expected.json @@ -0,0 +1,14 @@ +{ + "AutoForwardToEmailAddress": "", + "AutoForwardToName": "", + "AutoReply": false, + "CustomerKey": "testTemplated_senderProfile", + "Description": "Send from joern.berkefeld@accenture.com", + "DirectForward": false, + "FromAddress": "joern.berkefeld@accenture.com", + "FromName": "Jörn Berkefeld", + "Name": "testTemplated_senderProfile", + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "", + "UseDefaultRMMRules": true +} diff --git a/test/resources/9999999/senderProfile/create-response.xml b/test/resources/9999999/senderProfile/create-response.xml new file mode 100644 index 000000000..24c20420c --- /dev/null +++ b/test/resources/9999999/senderProfile/create-response.xml @@ -0,0 +1,49 @@ + + + + CreateResponse + urn:uuid:da5fb2ee-2ca9-4f56-a9e8-2b98d43379f7 + urn:uuid:3cbd2577-f0e6-4593-8657-e1f48d94624c + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-12T12:53:28Z + 2024-04-12T12:58:28Z + + + + + + + OK + SenderProfile created + 0 + 0 + 70accba4-cbf8-ee11-a5c8-5cba2c6fc270 + + + 70accba4-cbf8-ee11-a5c8-5cba2c6fc270 + testNew_senderProfile + testNew_senderProfile + created on deploy + Jörn Berkefeld + joern.berkefeld@accenture.com + false + joern.berkefeld@accenture.com + Jörn Berkefeld + false + false + + + + + b6be1480-01a4-4e48-9f47-06bf51a301c1 + OK + + + diff --git a/test/resources/9999999/senderProfile/delete-response.xml b/test/resources/9999999/senderProfile/delete-response.xml new file mode 100644 index 000000000..2be198379 --- /dev/null +++ b/test/resources/9999999/senderProfile/delete-response.xml @@ -0,0 +1,36 @@ + + + + DeleteResponse + urn:uuid:9d089538-9132-421c-b905-827dc760447b + urn:uuid:2dbd051c-b714-4302-bb66-53d0916620ed + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-12T13:05:55Z + 2024-04-12T13:10:55Z + + + + + + + OK + SenderProfile deleted + 0 + + + + testExisting_senderProfile + + + 0387ba17-c330-4239-a2dd-c0e15f968476 + OK + + + diff --git a/test/resources/9999999/senderProfile/get-expected.json b/test/resources/9999999/senderProfile/get-expected.json new file mode 100644 index 000000000..e92fcba48 --- /dev/null +++ b/test/resources/9999999/senderProfile/get-expected.json @@ -0,0 +1,16 @@ +{ + "CreatedDate": "2021-08-03T11:14:00", + "ModifiedDate": "2021-08-03T11:14:00", + "CustomerKey": "testExisting_senderProfile", + "Name": "testExisting_senderProfile", + "Description": "Send from joern.berkefeld@accenture.com", + "FromName": "Jörn Berkefeld", + "FromAddress": "joern.berkefeld@accenture.com", + "UseDefaultRMMRules": true, + "AutoForwardToEmailAddress": "", + "AutoForwardToName": "", + "DirectForward": false, + "AutoReply": false, + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "" +} diff --git a/test/resources/9999999/senderProfile/patch-expected.json b/test/resources/9999999/senderProfile/patch-expected.json new file mode 100644 index 000000000..c82bbdecc --- /dev/null +++ b/test/resources/9999999/senderProfile/patch-expected.json @@ -0,0 +1,14 @@ +{ + "AutoForwardToEmailAddress": "joern.berkefeld@accenture.com", + "AutoForwardToName": "Jörn Berkefeld", + "AutoReply": false, + "CustomerKey": "testExisting_senderProfile", + "Description": "updated via deploy", + "DirectForward": false, + "FromAddress": "joern.berkefeld@accenture.com", + "FromName": "Jörn Berkefeld", + "Name": "testExisting_senderProfile", + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "", + "UseDefaultRMMRules": false +} diff --git a/test/resources/9999999/senderProfile/post-expected.json b/test/resources/9999999/senderProfile/post-expected.json new file mode 100644 index 000000000..8286574c4 --- /dev/null +++ b/test/resources/9999999/senderProfile/post-expected.json @@ -0,0 +1,14 @@ +{ + "AutoForwardToEmailAddress": "joern.berkefeld@accenture.com", + "AutoForwardToName": "Jörn Berkefeld", + "AutoReply": false, + "CustomerKey": "testNew_senderProfile", + "Description": "created on deploy", + "DirectForward": false, + "FromAddress": "joern.berkefeld@accenture.com", + "FromName": "Jörn Berkefeld", + "Name": "testNew_senderProfile", + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "", + "UseDefaultRMMRules": false +} diff --git a/test/resources/9999999/senderProfile/retrieve-response.xml b/test/resources/9999999/senderProfile/retrieve-response.xml new file mode 100644 index 000000000..8ed9de26c --- /dev/null +++ b/test/resources/9999999/senderProfile/retrieve-response.xml @@ -0,0 +1,44 @@ + + + + RetrieveResponse + urn:uuid:cbecb68a-7bdf-417e-8fce-bef6c72febbd + urn:uuid:2e88f8d2-82e7-4e2d-b780-b885a2205a0f + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-12T12:20:37Z + 2024-04-12T12:25:37Z + + + + + + OK + 4c6f37a1-7ab4-47a1-b341-f9912462ee97 + + + 2021-08-03T11:14:00 + 2021-08-03T11:14:00 + a75d452b-7ef4-eb11-b82d-48df37d1da95 + testExisting_senderProfile + testExisting_senderProfile + Send from joern.berkefeld@accenture.com + Jörn Berkefeld + joern.berkefeld@accenture.com + true + + + false + false + + + + + + diff --git a/test/resources/9999999/senderProfile/template-expected.json b/test/resources/9999999/senderProfile/template-expected.json new file mode 100644 index 000000000..2dee8a079 --- /dev/null +++ b/test/resources/9999999/senderProfile/template-expected.json @@ -0,0 +1,14 @@ +{ + "AutoForwardToEmailAddress": "", + "AutoForwardToName": "", + "AutoReply": false, + "CustomerKey": "{{{prefix}}}senderProfile", + "Description": "Send from joern.berkefeld@accenture.com", + "DirectForward": false, + "FromAddress": "joern.berkefeld@accenture.com", + "FromName": "Jörn Berkefeld", + "Name": "{{{prefix}}}senderProfile", + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "", + "UseDefaultRMMRules": true +} diff --git a/test/resources/9999999/senderProfile/update-response.xml b/test/resources/9999999/senderProfile/update-response.xml new file mode 100644 index 000000000..f2a4fa26a --- /dev/null +++ b/test/resources/9999999/senderProfile/update-response.xml @@ -0,0 +1,47 @@ + + + + UpdateResponse + urn:uuid:4ba5314f-13c0-4fcf-a193-f6160531acd6 + urn:uuid:4f56d229-63e7-4d8b-9bfe-1ace0c596056 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2022-04-19T20:03:41Z + 2024-04-12T12:58:29Z + + + + + + + OK + SenderProfile updated + 0 + + + + testExisting_senderProfile + testExisting_senderProfile + updated via deploy + Jörn Berkefeld + joern.berkefeld@accenture.com + false + joern.berkefeld@accenture.com + Jörn Berkefeld + false + false + + + + + ef6e2933-b767-47ea-a1c4-d3dc44674a56 + OK + + + diff --git a/test/type.senderProfile.test.js b/test/type.senderProfile.test.js new file mode 100644 index 000000000..64cbfa330 --- /dev/null +++ b/test/type.senderProfile.test.js @@ -0,0 +1,151 @@ +import * as chai from 'chai'; +const assert = chai.assert; + +import chaiFiles from 'chai-files'; +import cache from '../lib/util/cache.js'; +import * as testUtils from './utils.js'; +import handler from '../lib/index.js'; +chai.use(chaiFiles); + +describe('type: senderProfile', () => { + beforeEach(() => { + testUtils.mockSetup(); + }); + + afterEach(() => { + testUtils.mockReset(); + }); + + describe('Retrieve ================', () => { + it('Should retrieve a senderProfile', async () => { + // WHEN + await handler.retrieve('testInstance/testBU', ['senderProfile']); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.senderProfile ? Object.keys(result.senderProfile).length : 0, + 1, + 'only one senderProfile expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 1, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Deploy ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + + it('Should create & upsert a senderProfile', async () => { + // WHEN + + await handler.deploy('testInstance/testBU', ['senderProfile']); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.senderProfile ? Object.keys(result.senderProfile).length : 0, + 2, + 'two senderProfiles expected' + ); + // confirm created item + assert.deepEqual( + await testUtils.getActualJson('testNew_senderProfile', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'post'), + 'returned new-JSON was not equal expected for insert senderProfile' + ); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'patch'), + 'returned existing-JSON was not equal expected for update senderProfile' + ); + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 3, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Templating ================', () => { + it('Should create a senderProfile template via buildTemplate and build it', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['senderProfile']); + // buildTemplate + const result = await handler.buildTemplate( + 'testInstance/testBU', + 'senderProfile', + ['testExisting_senderProfile'], + 'testSourceMarket' + ); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); + assert.equal( + result.senderProfile ? Object.keys(result.senderProfile).length : 0, + 1, + 'only one senderProfile expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson( + 'testExisting_senderProfile', + 'senderProfile' + ), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'template'), + 'returned template JSON was not equal expected' + ); + // buildDefinition + await handler.buildDefinition( + 'testInstance/testBU', + 'senderProfile', + 'testExisting_senderProfile', + 'testTargetMarket' + ); + assert.equal( + process.exitCode, + false, + 'buildDefinition should not have thrown an error' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_senderProfile', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'build'), + 'returned deployment JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 1, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Delete ================', () => { + it('Should delete the item', async () => { + // WHEN + const isDeleted = await handler.deleteByKey( + 'testInstance/testBU', + 'senderProfile', + 'testExisting_senderProfile' + ); + // THEN + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); + return; + }); + }); +}); From 2b0bfda18c04dbee13a9fb840a683f6b63da76e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 15:14:07 +0200 Subject: [PATCH 105/359] #54: enable changeKeyX for senderProfile --- lib/metadataTypes/definitions/SenderProfile.definition.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/metadataTypes/definitions/SenderProfile.definition.js b/lib/metadataTypes/definitions/SenderProfile.definition.js index 92ccdf798..2ed45ac47 100644 --- a/lib/metadataTypes/definitions/SenderProfile.definition.js +++ b/lib/metadataTypes/definitions/SenderProfile.definition.js @@ -4,7 +4,7 @@ export default { filter: {}, hasExtended: false, idField: 'ObjectID', - keyIsFixed: true, + keyIsFixed: false, keyField: 'CustomerKey', nameField: 'Name', createdDateField: 'CreatedDate', @@ -43,7 +43,7 @@ export default { }, ObjectID: { isCreateable: false, - isUpdateable: false, + isUpdateable: true, retrieving: true, template: false, }, From bb3aea61c7d902cc7a13158c16741959936a01c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 15:16:15 +0200 Subject: [PATCH 106/359] #54: add type description for senderProfile --- lib/metadataTypes/definitions/SenderProfile.definition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadataTypes/definitions/SenderProfile.definition.js b/lib/metadataTypes/definitions/SenderProfile.definition.js index 2ed45ac47..53957a1e0 100644 --- a/lib/metadataTypes/definitions/SenderProfile.definition.js +++ b/lib/metadataTypes/definitions/SenderProfile.definition.js @@ -13,7 +13,7 @@ export default { lastmodNameField: null, restPagination: false, type: 'senderProfile', - typeDescription: 'todo', + typeDescription: 'Specifies the From information for a send in a central location', typeRetrieveByDefault: false, typeName: 'Sender Profile', fields: { From bd04ef09f114ce8e2d6ef09c06aa12323e1a5890 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 15:25:12 +0200 Subject: [PATCH 107/359] #54: auto-correction of UseDefaultRMMRules value dependant on AutoForward... values --- lib/metadataTypes/SenderProfile.js | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/lib/metadataTypes/SenderProfile.js b/lib/metadataTypes/SenderProfile.js index 509919b3b..41ebfedd4 100644 --- a/lib/metadataTypes/SenderProfile.js +++ b/lib/metadataTypes/SenderProfile.js @@ -1,6 +1,7 @@ 'use strict'; import MetadataType from './MetadataType.js'; +import { Util } from '../util/util.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -74,6 +75,37 @@ class SenderProfile extends MetadataType { static deleteByKey(customerKey) { return super.deleteByKeySOAP(customerKey); } + + /** + * prepares a single item for deployment + * + * @param {MetadataTypeItem} metadata a single query activity + * @returns {Promise.} Promise + */ + static async preDeployTasks(metadata) { + if ( + metadata.UseDefaultRMMRules && + (metadata.AutoForwardToEmailAddress !== '' || metadata.AutoForwardToName !== '') + ) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ + metadata[this.definition.keyField] + }): AutoForwardToEmailAddress and AutoForwardToName will be ignored because UseDefaultRMMRules is set to true; setting UseDefaultRMMRules to false` + ); + metadata.UseDefaultRMMRules = false; + } else if ( + !metadata.UseDefaultRMMRules && + (metadata.AutoForwardToEmailAddress === '' || metadata.AutoForwardToName === '') + ) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ + metadata[this.definition.keyField] + }): AutoForwardToEmailAddress and AutoForwardToName are required when UseDefaultRMMRules is set to false; setting UseDefaultRMMRules to true` + ); + metadata.UseDefaultRMMRules = true; + } + return metadata; + } } // Assign definition & cache to static attributes From 7a9aeb562bf5e260f6d9449e3589669921490f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 15:35:32 +0200 Subject: [PATCH 108/359] #54: activate retrieve-by-default for senderProfile --- lib/metadataTypes/definitions/SenderProfile.definition.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadataTypes/definitions/SenderProfile.definition.js b/lib/metadataTypes/definitions/SenderProfile.definition.js index 53957a1e0..ea98f6d9a 100644 --- a/lib/metadataTypes/definitions/SenderProfile.definition.js +++ b/lib/metadataTypes/definitions/SenderProfile.definition.js @@ -14,7 +14,7 @@ export default { restPagination: false, type: 'senderProfile', typeDescription: 'Specifies the From information for a send in a central location', - typeRetrieveByDefault: false, + typeRetrieveByDefault: true, typeName: 'Sender Profile', fields: { 'Client.ID': { From 324813a10ca5ac75a19b06b299e562e36a166ae7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 16:01:30 +0200 Subject: [PATCH 109/359] #54: fix parameters for senderProfile retrieve --- lib/metadataTypes/SenderProfile.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/metadataTypes/SenderProfile.js b/lib/metadataTypes/SenderProfile.js index 41ebfedd4..360c68448 100644 --- a/lib/metadataTypes/SenderProfile.js +++ b/lib/metadataTypes/SenderProfile.js @@ -25,16 +25,15 @@ class SenderProfile extends MetadataType { /** * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void} [_] unused parameter - * @param {void} [__] unused parameter - * @param {void} [___] unused parameter + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ - static retrieve(retrieveDir, _, __, ___, key) { + static retrieve(retrieveDir, _, __, key) { /** @type {SoapRequestParams} */ - let requestParams = null; + let requestParams; if (key) { requestParams = { filter: { @@ -44,7 +43,7 @@ class SenderProfile extends MetadataType { }, }; } - return super.retrieveSOAP(retrieveDir, null, requestParams); + return super.retrieveSOAP(retrieveDir, requestParams); } /** * Updates a single item From e27f298fda3ded5c3e45c30d9e8f82e01f738d14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 21:20:51 +0200 Subject: [PATCH 110/359] #1246: more enhanced validation fixes --- lib/metadataTypes/Automation.js | 14 ++++++++------ lib/metadataTypes/User.js | 8 ++++---- lib/util/auth.js | 2 +- lib/util/devops.js | 2 +- lib/util/file.js | 4 ++-- lib/util/util.js | 4 +++- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index d6782975b..a2dee3578 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -1274,10 +1274,12 @@ class Automation extends MetadataType { // add tz to input date to ensure Date() creates a date object with the right tz const inputStartDateString = scheduleObject.startDate + schedule._timezoneString; + /** @type {Date | string} */ + let startDateTime; if (new Date(inputStartDateString) > new Date()) { // if start date is in future take this - schedule.StartDateTime = scheduleObject.startDate; - schedule._StartDateTime = schedule.StartDateTime; // store copy for CLI output + startDateTime = scheduleObject.startDate; + schedule._StartDateTime = scheduleObject.startDate; // store copy for CLI output } else { // if start date is in past calculate new start date const scheduledDate = new Date(inputStartDateString); @@ -1317,16 +1319,16 @@ class Automation extends MetadataType { // No default } // return time as Dateobject - schedule.StartDateTime = futureDate; - const localTimezoneOffset = schedule.StartDateTime.getTimezoneOffset() / -60; - schedule._StartDateTime = this._calcTime(localTimezoneOffset, schedule.StartDateTime); // store copy for CLI output + startDateTime = futureDate; + const localTimezoneOffset = futureDate.getTimezoneOffset() / -60; + schedule._StartDateTime = this._calcTime(localTimezoneOffset, futureDate); // store copy for CLI output } // The Create/Update API expects dates to be in US-Central time // The retrieve API returns the date in whatever timezone one chose, hence we need to convert this upon upsert schedule.StartDateTime = this._calcTime( this.properties.options.serverTimeOffset, - schedule.StartDateTime, + startDateTime, schedule._timezoneString ); diff --git a/lib/metadataTypes/User.js b/lib/metadataTypes/User.js index e2cbad7ae..57b66a586 100644 --- a/lib/metadataTypes/User.js +++ b/lib/metadataTypes/User.js @@ -848,12 +848,11 @@ class User extends MetadataType { /** * - * @private * @param {string} dateStr first date * @param {string} interval defaults to 'days' * @returns {string} time difference */ - static _timeSinceDate(dateStr, interval = 'days') { + static #timeSinceDate(dateStr, interval = 'days') { const second = 1000, minute = second * 60, hour = minute * 60, @@ -861,7 +860,8 @@ class User extends MetadataType { week = day * 7; const date = new Date(dateStr); const now = new Date(); - const timediff = now - date; + // get difference in miliseconds + const timediff = now.valueOf() - date.valueOf(); if (Number.isNaN(timediff)) { return ''; } @@ -1035,7 +1035,7 @@ class User extends MetadataType { LastSuccessfulLogin === user.CreatedDate.split('.')[0] || LastSuccessfulLogin === user.ModifiedDate.split('.')[0] ? 'unknown' - : this._timeSinceDate(user.LastSuccessfulLogin) + : this.#timeSinceDate(user.LastSuccessfulLogin) : 'never', CreatedDate: user.CreatedDate ? user.CreatedDate.split('T').join(' ') : 'n/a', ModifiedDate: user.ModifiedDate ? user.ModifiedDate.split('T').join(' ') : 'n/a', diff --git a/lib/util/auth.js b/lib/util/auth.js index eb335b7e8..803e29616 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -42,7 +42,7 @@ const Auth = { const sdk = setupSDK(credential, authObject); try { // check credentials to allow clear log output and stop execution - // @ts-expect-error - params are optional but jsdoc says otherwise + // @ts-expect-error - params are optional but jsdoc in SFMC-SDK says otherwise const test = await sdk.auth.getAccessToken(); if (test.error) { throw new Error(test.error_description); diff --git a/lib/util/devops.js b/lib/util/devops.js index 8feb529fc..46b8f53b2 100644 --- a/lib/util/devops.js +++ b/lib/util/devops.js @@ -313,7 +313,7 @@ const DevOps = { } } - /** @type {DeltaPkgItem[]} */ + /** @type {Promise.<{status:'ok'|'skipped'|'failed', statusMessage:string, file:string}>[]} */ const copied = delta .filter((file) => !file.file.endsWith('.md')) // filter documentation files .map((file) => diff --git a/lib/util/file.js b/lib/util/file.js index db9c5ea7d..471c88cda 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -48,12 +48,12 @@ const File = { * * @param {string} from - full filepath including name of existing file * @param {string} to - full filepath including name where file should go - * @returns {Promise.} - results object + * @returns {Promise.<{status:'ok'|'skipped'|'failed', statusMessage:string, file:string}>} - results object */ async copyFile(from, to) { try { await fs.copy(from, to); - return { status: 'ok', file: from }; + return { status: 'ok', statusMessage: null, file: from }; } catch (ex) { // This can happen in some cases where referencing files deleted in Commit return ex.message.startsWith('ENOENT: no such file or directory') diff --git a/lib/util/util.js b/lib/util/util.js index b4333708f..c98031628 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -599,7 +599,9 @@ export const Util = { temp.shift(); // remove first item which is the main type return temp.join('-'); // subType can include "-" }); - setList[type].add(...temp); // TODO - this might have only added the first item? + for (const item of temp) { + setList[type].add(item); + } } } else { setList[flatType] = null; From d688cb4536c74b4c1a10dad7a06e4685b5da4543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 12 Apr 2024 22:01:26 +0200 Subject: [PATCH 111/359] #1246: type fix --- test/type.senderProfile.test.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/type.senderProfile.test.js b/test/type.senderProfile.test.js index 64cbfa330..4266ebe0d 100644 --- a/test/type.senderProfile.test.js +++ b/test/type.senderProfile.test.js @@ -115,11 +115,7 @@ describe('type: senderProfile', () => { 'testExisting_senderProfile', 'testTargetMarket' ); - assert.equal( - process.exitCode, - false, - 'buildDefinition should not have thrown an error' - ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( await testUtils.getActualDeployJson('testTemplated_senderProfile', 'senderProfile'), await testUtils.getExpectedJson('9999999', 'senderProfile', 'build'), From b39865be53f9b3c13236af48d7b7479a38ffa779 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Apr 2024 08:47:47 +0000 Subject: [PATCH 112/359] Bump eslint-plugin-jsdoc from 48.2.1 to 48.2.3 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.2.1 to 48.2.3. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.2.1...v48.2.3) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f614d180..0cf82ddb3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.1", + "eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", @@ -2297,9 +2297,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.2.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.1.tgz", - "integrity": "sha512-iUvbcyDZSO/9xSuRv2HQBw++8VkV/pt3UWtX9cpPH0l7GKPq78QC/6+PmyQHHvNZaTjAce6QVciEbnc6J/zH5g==", + "version": "48.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.3.tgz", + "integrity": "sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.42.0", diff --git a/package.json b/package.json index a93ef4a93..4c81c0bc0 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.1", + "eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "51.0.1", From 41d0eaad41dd28397371f281ae01f3d784ab633e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 14 Apr 2024 08:49:18 +0000 Subject: [PATCH 113/359] Bump eslint-plugin-unicorn from 51.0.1 to 52.0.0 Bumps [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn) from 51.0.1 to 52.0.0. - [Release notes](https://github.com/sindresorhus/eslint-plugin-unicorn/releases) - [Commits](https://github.com/sindresorhus/eslint-plugin-unicorn/compare/v51.0.1...v52.0.0) --- updated-dependencies: - dependency-name: eslint-plugin-unicorn dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0cf82ddb3..773bb583f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", - "eslint-plugin-unicorn": "51.0.1", + "eslint-plugin-unicorn": "52.0.0", "fast-xml-parser": "4.3.6", "husky": "9.0.11", "lint-staged": "15.2.2", @@ -2377,9 +2377,9 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "51.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-51.0.1.tgz", - "integrity": "sha512-MuR/+9VuB0fydoI0nIn2RDA5WISRn4AsJyNSaNKLVwie9/ONvQhxOBbkfSICBPnzKrB77Fh6CZZXjgTt/4Latw==", + "version": "52.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", + "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", diff --git a/package.json b/package.json index 4c81c0bc0..a9e746d2b 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "eslint-plugin-jsdoc": "48.2.3", "eslint-plugin-mocha": "10.4.1", "eslint-plugin-prettier": "5.1.2", - "eslint-plugin-unicorn": "51.0.1", + "eslint-plugin-unicorn": "52.0.0", "fast-xml-parser": "4.3.6", "husky": "9.0.11", "lint-staged": "15.2.2", From fddf28a15c3460cf3d635f59b16c952802e04541 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 14 Apr 2024 20:31:56 +0200 Subject: [PATCH 114/359] #1246: after-merge enhanced validation fixes --- lib/metadataTypes/DataExtension.js | 2 ++ test/resourceFactory.js | 4 +++- test/type.asset.test.js | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index 8581d71bf..c6eabb63c 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -119,6 +119,7 @@ class DataExtension extends MetadataType { let upsertResults; if (successfulResults.length > 0) { const metadataResults = successfulResults + // @ts-expect-error not sure why this produces a type error. looks 100% correct .map((r) => r.value.Results[0].Object) .map((r) => { // if only one fields added will return object otherwise array @@ -171,6 +172,7 @@ class DataExtension extends MetadataType { DataExtensionField.client = this.client; DataExtensionField.properties = this.properties; DataExtension.oldFields ||= {}; + // @ts-expect-error not sure why this produces a type error. looks 100% correct DataExtension.oldFields[metadataMap[metadataKey][this.definition.keyField]] = await DataExtensionField.prepareDeployColumnsOnUpdate( metadataMap[metadataKey].Fields, diff --git a/test/resourceFactory.js b/test/resourceFactory.js index e9141d0a9..e23a81013 100644 --- a/test/resourceFactory.js +++ b/test/resourceFactory.js @@ -4,6 +4,7 @@ import { XMLParser } from 'fast-xml-parser'; import { Util } from '../lib/util/util.js'; const parser = new XMLParser(); const attributeParser = new XMLParser({ ignoreAttributes: false }); +/** @type {typeof Util.color} */ let color; /* eslint-disable unicorn/prefer-ternary */ @@ -12,6 +13,7 @@ if ( process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost' ) { // when we execute the test in a VSCode extension host, we don't want CLI color codes. + // @ts-expect-error hacky way to get rid of colors - ts doesn't appreciate the hack color = new Proxy( {}, { @@ -38,7 +40,7 @@ if ( * @param {string} type metadata Type * @param {string} mid of Business Unit * @param {object|string} filter likely for customer key - * @returns {string} relevant metadata stringified + * @returns {Promise.} relevant metadata stringified */ async function loadSOAPRecords(mcdevAction, type, mid, filter) { type = type[0].toLowerCase() + type.slice(1); diff --git a/test/type.asset.test.js b/test/type.asset.test.js index dbe52e73b..d1daf9ee9 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -114,6 +114,7 @@ describe('type: asset', () => { assert.equal(process.exitCode, 0, 'resolveId should not have thrown an error'); assert.deepEqual( resolveIdJson, + // @ts-expect-error bad typing of assert.deepEqual await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1295064-noPath'), 'returned response was not equal expected' ); @@ -142,6 +143,7 @@ describe('type: asset', () => { assert.equal(process.exitCode, 0, 'resolveId should not have thrown an error'); assert.deepEqual( resolveIdJson, + // @ts-expect-error bad typing of assert.deepEqual await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1295064-withPath'), 'returned response was not equal expected' ); @@ -156,6 +158,7 @@ describe('type: asset', () => { // IMPORTANT: this will throw a false "TEST-ERROR" but our testing framework currently needs to not find the file to throw a 404 assert.deepEqual( resolveIdJson, + // @ts-expect-error bad typing of assert.deepEqual await testUtils.getExpectedJson('9999999', 'asset', 'resolveId-1234-notFound'), 'returned response was not equal expected' ); From 0890dbb7e94270ef1dfdc38c90c2def99636ab8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 14:22:25 +0200 Subject: [PATCH 115/359] #1227: fix test case for importFile SMS --- .../9999999/importFile/get-sms-expected.json | 2 ++ .../v1/beta/mobile/imports/get-response.json | 20 +++++++++---------- .../message/NTQ3Ojc4OjA/get-response.json | 2 +- .../mobileMessage/post-create-expected.json | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/test/resources/9999999/importFile/get-sms-expected.json b/test/resources/9999999/importFile/get-sms-expected.json index 230885a1a..05853918e 100644 --- a/test/resources/9999999/importFile/get-sms-expected.json +++ b/test/resources/9999999/importFile/get-sms-expected.json @@ -1,7 +1,9 @@ { "allowErrors": true, "c__dataAction": "AddUpdate", + "c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD", "c__destinationType": "SMS", + "c__sourceObjectKey": "testExisting_dataExtension", "c__subscriberImportType": "DataExtension", "createdDate": "2022-11-24T03:29:01.05", "customerKey": "testExisting_importFileSMS", diff --git a/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json b/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json index 2a4ea6fcc..cb63280f6 100644 --- a/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json +++ b/test/resources/9999999/legacy/v1/beta/mobile/imports/get-response.json @@ -5,16 +5,16 @@ "entry": [ { "id": "ZTFXX0hpNDNFZXU0RzBqZk45SGIxdzo0MTow", - "name": "Contact_SMS_DEV_2", + "name": "testExisting_importFileSMS", "sourceFile": "_CustomObject", "audience": { "id": "QUFBQUFBQUFBQUFBQUFBQUFBQUFBQTo2Mzow", - "name": "Contact_SMS_DEV_2", + "name": "testExisting_importFileSMS", "description": "" }, "code": { - "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow", - "code": "491771783703", + "id": "RXBwc0JoNk9jVTY0YWJNWFZDaGxvdzo4MTow", + "code": "4912312345678", "codeType": "PRIVATE", "isShortCode": false, "isGsmCharacterSetOnly": false, @@ -27,8 +27,8 @@ "isOwner": false }, "keyword": { - "id": "Y0ZDXzVjVHdYVUNlQVJlT2U2dzVKZzo4Njow", - "keyword": "ONEDEVICE_DEV", + "id": "cTVJaG5oSDJPVUNHcUh6Z3pQT2tVdzo4Njow", + "keyword": "TESTEXISTING_KEYWORD", "restriction": "NONE", "isInherited": false, "isLinkShorteningEnabled": false, @@ -48,8 +48,8 @@ "description": "" }, "code": { - "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow", - "code": "491771783703", + "id": "RXBwc0JoNk9jVTY0YWJNWFZDaGxvdzo4MTow", + "code": "4912312345678", "codeType": "PRIVATE", "isShortCode": false, "isGsmCharacterSetOnly": false, @@ -83,8 +83,8 @@ "description": "" }, "code": { - "id": "N3Y3RTN6aXBWVUtmdUtGWEpfNW5yUTo4MTow", - "code": "491771783703", + "id": "RXBwc0JoNk9jVTY0YWJNWFZDaGxvdzo4MTow", + "code": "4912312345678", "codeType": "PRIVATE", "isShortCode": false, "isGsmCharacterSetOnly": false, diff --git a/test/resources/9999999/legacy/v1/beta/mobile/message/NTQ3Ojc4OjA/get-response.json b/test/resources/9999999/legacy/v1/beta/mobile/message/NTQ3Ojc4OjA/get-response.json index a355de3d9..61417f3ae 100644 --- a/test/resources/9999999/legacy/v1/beta/mobile/message/NTQ3Ojc4OjA/get-response.json +++ b/test/resources/9999999/legacy/v1/beta/mobile/message/NTQ3Ojc4OjA/get-response.json @@ -31,7 +31,7 @@ "status": "Active/Scheduled", "invalidMessage": "", "responseMessage": "", - "publishedMessage": "Text '' to 491771783703.", + "publishedMessage": "Text '' to 4912312345678.", "nextJob": { "id": "NTQ3Ojc5OjA", "lastUpdated": "2023-03-28T13:15:58.323Z", diff --git a/test/resources/9999999/mobileMessage/post-create-expected.json b/test/resources/9999999/mobileMessage/post-create-expected.json index e292aa8b1..936c2bd69 100644 --- a/test/resources/9999999/mobileMessage/post-create-expected.json +++ b/test/resources/9999999/mobileMessage/post-create-expected.json @@ -18,7 +18,7 @@ "status": "Active/Scheduled", "invalidMessage": "", "responseMessage": "", - "publishedMessage": "Text '' to 491771783703.", + "publishedMessage": "Text '' to 4912312345678.", "isTest": false, "moTimezone": { "offset": 1, From 569e18abeb11c2a9dfad4c2bf94cca89832c24a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 15:02:22 +0200 Subject: [PATCH 116/359] #1227: regroup source/destination fields --- lib/metadataTypes/ImportFile.js | 80 +++++++++++-------- .../definitions/ImportFile.definition.js | 20 ++++- ...stExisting_importFile.importFile-meta.json | 10 ++- .../testNew_importFile.importFile-meta.json | 12 ++- .../9999999/importFile/build-expected.json | 12 ++- .../9999999/importFile/get-expected.json | 13 ++- .../9999999/importFile/get-sms-expected.json | 14 ++-- .../9999999/importFile/patch-expected.json | 12 ++- .../9999999/importFile/post-expected.json | 12 ++- .../9999999/importFile/template-expected.json | 12 ++- 10 files changed, 129 insertions(+), 68 deletions(-) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index 81d9fb647..b7c1ee65b 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -198,8 +198,9 @@ class ImportFile extends MetadataType { */ static async deploy(metadataMap, deployDir, retrieveDir) { if ( - Object.values(metadataMap).filter((item) => item.c__destinationType === 'SMS').length > - 0 + Object.values(metadataMap).filter( + (item) => item.destination.c__destinationType === 'SMS' + ).length > 0 ) { Util.logger.info(`Caching dependent Metadata: dataExtension (source for SMS imports)`); @@ -225,61 +226,69 @@ class ImportFile extends MetadataType { * @returns {Promise} Promise */ static async preDeployTasks(metadata) { - const fileLocation = cache.getByKey('fileLocation', metadata.r__fileLocation_name); + const fileLocation = cache.getByKey('fileLocation', metadata.source.r__fileLocation_name); if (!fileLocation) { throw new Error(`fileLocation ${metadata.r__fileLocation_name} not found in cache`); } metadata.fileTransferLocationId = fileLocation.id; metadata.fileTransferLocationTypeId = fileLocation.locationTypeId; - delete metadata.r__fileLocation_name; + delete metadata.source.r__fileLocation_name; - switch (metadata.c__destinationType) { + switch (metadata.destination.c__destinationType) { case 'DataExtension': { - if (metadata.r__dataExtension_CustomerKey) { + if (metadata.destination.r__dataExtension_CustomerKey) { metadata.destinationObjectId = cache.searchForField( 'dataExtension', - metadata.r__dataExtension_CustomerKey, + metadata.destination.r__dataExtension_CustomerKey, 'CustomerKey', 'ObjectID' ); - delete metadata.r__dataExtension_CustomerKey; + delete metadata.destination.r__dataExtension_CustomerKey; } else { throw new Error('Import Destination DataExtension not defined'); } break; } case 'List': { - if (metadata.r__list_PathName) { + if (metadata.destination.r__list_PathName) { metadata.destinationObjectId = cache.getListObjectId( - metadata.r__list_PathName, + metadata.destination.r__list_PathName, 'ObjectID' ); // destinationId is also needed for List types - metadata.destinationId = cache.getListObjectId(metadata.r__list_PathName, 'ID'); - delete metadata.r__list_PathName; + metadata.destinationId = cache.getListObjectId( + metadata.destination.r__list_PathName, + 'ID' + ); + delete metadata.destination.r__list_PathName; } else { throw new Error('Import Destination List not defined'); } break; } case 'SMS': { - if (metadata.c__codeKeyword) { + if (metadata.destination.c__codeKeyword) { // code const codeObj = cache.getByKey( 'mobileCode', - metadata.c__codeKeyword.split('.')[0] + metadata.destination.c__codeKeyword.split('.')[0] ); if (!codeObj) { - throw new Error(`mobileCode ${metadata.c__codeKeyword} not found in cache`); + throw new Error( + `mobileCode ${metadata.destination.c__codeKeyword} not found in cache` + ); } metadata.code = codeObj; // keyword - const keywordObj = cache.getByKey('mobileKeyword', metadata.c__codeKeyword); + const keywordObj = cache.getByKey( + 'mobileKeyword', + metadata.destination.c__codeKeyword + ); if (!keywordObj) { throw new Error( - `mobileKeyword ${metadata.c__codeKeyword} not found in cache` + `mobileKeyword ${metadata.destination.c__codeKeyword} not found in cache` ); } metadata.keyword = keywordObj; @@ -293,17 +302,19 @@ class ImportFile extends MetadataType { metadata.destinationObjectId = '00000000-0000-0000-0000-000000000000'; metadata.destinationObjectType = 'MobileSubscription'; // source - if (this.dataExtensionsLegacy[metadata.c__sourceObjectKey]) { + if (this.dataExtensionsLegacy[metadata.source.r__dataExtension_CustomerKey]) { metadata.sourceObjectId = - this.dataExtensionsLegacy[metadata.c__sourceObjectKey].id; + this.dataExtensionsLegacy[metadata.source.r__dataExtension_CustomerKey].id; metadata.sourceObjectName = - this.dataExtensionsLegacy[metadata.c__sourceObjectKey].dataExtensionName; - delete metadata.c__sourceObjectKey; + this.dataExtensionsLegacy[ + metadata.source.r__dataExtension_CustomerKey + ].dataExtensionName; + delete metadata.source.r__dataExtension_CustomerKey; } Util.logger.debug( ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${ - metadata.c__destinationType + metadata.destination.c__destinationType } not fully supported. Deploy might fail.` ); break; @@ -311,7 +322,7 @@ class ImportFile extends MetadataType { default: { Util.logger.debug( ` - importFile ${metadata[this.definition.keyField]}: Import Destination Type ${ - metadata.c__destinationType + metadata.destination.c__destinationType } not fully supported. Deploy might fail.` ); } @@ -323,10 +334,13 @@ class ImportFile extends MetadataType { } // When the destinationObjectTypeId is 584 it refers to Mobile Connect which is not supported as an Import Type metadata.destinationObjectTypeId = - this.definition.destinationObjectTypeMapping[metadata.c__destinationType]; + this.definition.destinationObjectTypeMapping[metadata.destination.c__destinationType]; metadata.subscriberImportTypeId = this.definition.subscriberImportTypeMapping[metadata.c__subscriberImportType]; metadata.updateTypeId = this.definition.updateTypeMapping[metadata.c__dataAction]; + + delete metadata.destination; + delete metadata.source; return metadata; } @@ -337,7 +351,9 @@ class ImportFile extends MetadataType { * @returns {MetadataTypeItem} parsed metadata */ static postRetrieveTasks(metadata) { - metadata.r__fileLocation_name = cache.searchForField( + metadata.destination = {}; + metadata.source = {}; + metadata.source.r__fileLocation_name = cache.searchForField( 'fileLocation', metadata.fileTransferLocationId, 'id', @@ -346,14 +362,14 @@ class ImportFile extends MetadataType { delete metadata.fileTransferLocationId; // * When the destinationObjectTypeId is 584 it refers to Mobile Connect which is not supported as an Import Type - metadata.c__destinationType = Util.inverseGet( + metadata.destination.c__destinationType = Util.inverseGet( this.definition.destinationObjectTypeMapping, metadata.destinationObjectTypeId ); - switch (metadata.c__destinationType) { + switch (metadata.destination.c__destinationType) { case 'DataExtension': { try { - metadata.r__dataExtension_CustomerKey = cache.searchForField( + metadata.destination.r__dataExtension_CustomerKey = cache.searchForField( 'dataExtension', metadata.destinationObjectId, 'ObjectID', @@ -368,7 +384,7 @@ class ImportFile extends MetadataType { } case 'List': { try { - metadata.r__list_PathName = cache.getListPathName( + metadata.destination.r__list_PathName = cache.getListPathName( metadata.destinationObjectId, 'ObjectID' ); @@ -383,14 +399,14 @@ class ImportFile extends MetadataType { if (this.smsImports[metadata.name]) { const smsImport = this.smsImports[metadata.name]; // code + keyword - metadata.c__codeKeyword = + metadata.destination.c__codeKeyword = smsImport.code?.code + '.' + smsImport.keyword?.keyword; // source dataExtension if (smsImport.sourceObjectKey) { - metadata.c__sourceObjectKey = smsImport.sourceObjectKey; + metadata.source.r__dataExtension_CustomerKey = smsImport.sourceObjectKey; } } else { - Util.logger.debug( + Util.logger.warn( ` - ImportFile ${metadata.customerKey}: Could not find mobile code and keyword nor source for this SMS import activity.` ); } diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js index cbefdc7b1..236f954b7 100644 --- a/lib/metadataTypes/definitions/ImportFile.definition.js +++ b/lib/metadataTypes/definitions/ImportFile.definition.js @@ -255,25 +255,37 @@ export default { retrieving: true, template: true, }, - r__dataExtension_CustomerKey: { + 'destination.c__codeKeyword': { isCreateable: false, isUpdateable: false, retrieving: true, template: true, }, - c__destinationType: { + 'source.r__dataExtension_CustomerKey': { isCreateable: false, isUpdateable: false, retrieving: true, template: true, }, - r__list_PathName: { + 'destination.r__dataExtension_CustomerKey': { isCreateable: false, isUpdateable: false, retrieving: true, template: true, }, - r__fileLocation_name: { + 'destination.c__destinationType': { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, + 'destination.r__list_PathName': { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, + 'source.r__fileLocation_name': { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json index 16c631818..84a4db504 100644 --- a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json @@ -24,8 +24,12 @@ "standardQuotedStrings": true, "c__blankFileProcessing": "Process", "c__dataAction": "AddUpdate", - "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", - "r__fileLocation_name": "ExactTarget Enhanced FTP" + "destination": { + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension" + }, + "source": { + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } diff --git a/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json b/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json index bf4bd6ad2..81a4d3dc6 100644 --- a/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json @@ -21,9 +21,13 @@ "name": "testNew_importFile", "sendEmailNotification": false, "standardQuotedStrings": true, - "r__fileLocation_name": "ExactTarget Enhanced FTP", - "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", "c__subscriberImportType": "DataExtension", - "c__dataAction": "AddUpdate" + "c__dataAction": "AddUpdate", + "destination": { + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension" + }, + "source": { + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } diff --git a/test/resources/9999999/importFile/build-expected.json b/test/resources/9999999/importFile/build-expected.json index 33e915fff..51b090b67 100644 --- a/test/resources/9999999/importFile/build-expected.json +++ b/test/resources/9999999/importFile/build-expected.json @@ -2,7 +2,6 @@ "allowErrors": true, "c__blankFileProcessing": "Skip", "c__dataAction": "AddUpdate", - "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", "customerKey": "testTemplated_importFile", "dateFormatLocale": "en-US", @@ -21,8 +20,13 @@ "maxFileAgeScheduleOffsetHours": 0, "maxImportFrequencyHours": 0, "name": "testTemplated_importFile", - "r__dataExtension_CustomerKey": "testTemplated_dataExtension", - "r__fileLocation_name": "ExactTarget Enhanced FTP", "sendEmailNotification": false, - "standardQuotedStrings": true + "standardQuotedStrings": true, + "destination": { + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testTemplated_dataExtension" + }, + "source": { + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } diff --git a/test/resources/9999999/importFile/get-expected.json b/test/resources/9999999/importFile/get-expected.json index c60924af2..5e05166a9 100644 --- a/test/resources/9999999/importFile/get-expected.json +++ b/test/resources/9999999/importFile/get-expected.json @@ -2,7 +2,6 @@ "allowErrors": true, "c__blankFileProcessing": "Skip", "c__dataAction": "AddUpdate", - "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", "createdDate": "2022-11-09T05:32:30.533", "customerKey": "testExisting_importFile", @@ -23,8 +22,14 @@ "maxImportFrequencyHours": 0, "modifiedDate": "2022-11-17T07:13:03.95", "name": "testExisting_importFile", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", - "r__fileLocation_name": "ExactTarget Enhanced FTP", + "sendEmailNotification": false, - "standardQuotedStrings": true + "standardQuotedStrings": true, + "destination": { + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension" + }, + "source": { + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } diff --git a/test/resources/9999999/importFile/get-sms-expected.json b/test/resources/9999999/importFile/get-sms-expected.json index 05853918e..b25b501aa 100644 --- a/test/resources/9999999/importFile/get-sms-expected.json +++ b/test/resources/9999999/importFile/get-sms-expected.json @@ -1,9 +1,6 @@ { "allowErrors": true, "c__dataAction": "AddUpdate", - "c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD", - "c__destinationType": "SMS", - "c__sourceObjectKey": "testExisting_dataExtension", "c__subscriberImportType": "DataExtension", "createdDate": "2022-11-24T03:29:01.05", "customerKey": "testExisting_importFileSMS", @@ -69,7 +66,14 @@ "modifiedDate": "2023-07-19T23:06:33.577", "name": "testExisting_importFileSMS", "notificationEmailAddress": "joern.berkefeld@accenture.com", - "r__fileLocation_name": "ExactTarget Enhanced FTP", "sendEmailNotification": true, - "standardQuotedStrings": false + "standardQuotedStrings": false, + "destination": { + "c__destinationType": "SMS", + "c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + }, + "source": { + "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } diff --git a/test/resources/9999999/importFile/patch-expected.json b/test/resources/9999999/importFile/patch-expected.json index c0c078629..4dc13b3a6 100644 --- a/test/resources/9999999/importFile/patch-expected.json +++ b/test/resources/9999999/importFile/patch-expected.json @@ -2,7 +2,6 @@ "allowErrors": true, "c__blankFileProcessing": "Process", "c__dataAction": "AddUpdate", - "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", "createdDate": "2022-11-09T05:32:30.533", "customerKey": "testExisting_importFile", @@ -23,8 +22,13 @@ "maxImportFrequencyHours": 0, "modifiedDate": "2023-07-18T09:11:26.19", "name": "testExisting_importFile", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", - "r__fileLocation_name": "ExactTarget Enhanced FTP", "sendEmailNotification": false, - "standardQuotedStrings": true + "standardQuotedStrings": true, + "destination": { + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension" + }, + "source": { + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } diff --git a/test/resources/9999999/importFile/post-expected.json b/test/resources/9999999/importFile/post-expected.json index 4fb99f81b..d3c37c058 100644 --- a/test/resources/9999999/importFile/post-expected.json +++ b/test/resources/9999999/importFile/post-expected.json @@ -1,7 +1,6 @@ { "allowErrors": true, "c__dataAction": "AddUpdate", - "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", "createdDate": "2022-11-09T05:53:03.243", "customerKey": "testNew_importFile", @@ -21,8 +20,13 @@ "maxImportFrequencyHours": 0, "modifiedDate": "2023-07-18T09:11:26.19", "name": "testNew_importFile", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", - "r__fileLocation_name": "ExactTarget Enhanced FTP", "sendEmailNotification": false, - "standardQuotedStrings": true + "standardQuotedStrings": true, + "destination": { + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension" + }, + "source": { + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } diff --git a/test/resources/9999999/importFile/template-expected.json b/test/resources/9999999/importFile/template-expected.json index 52508601f..c29bd7989 100644 --- a/test/resources/9999999/importFile/template-expected.json +++ b/test/resources/9999999/importFile/template-expected.json @@ -2,7 +2,6 @@ "allowErrors": true, "c__blankFileProcessing": "Skip", "c__dataAction": "AddUpdate", - "c__destinationType": "DataExtension", "c__subscriberImportType": "DataExtension", "customerKey": "{{{prefix}}}importFile", "dateFormatLocale": "en-US", @@ -21,8 +20,13 @@ "maxFileAgeScheduleOffsetHours": 0, "maxImportFrequencyHours": 0, "name": "{{{prefix}}}importFile", - "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension", - "r__fileLocation_name": "ExactTarget Enhanced FTP", "sendEmailNotification": false, - "standardQuotedStrings": true + "standardQuotedStrings": true, + "destination": { + "c__destinationType": "DataExtension", + "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension" + }, + "source": { + "r__fileLocation_name": "ExactTarget Enhanced FTP" + } } From 342608d0dc68d9783131560375f93cfcd0e8594b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 15:28:04 +0200 Subject: [PATCH 117/359] #882: define default git branch 'main' --- lib/util/util.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/util/util.js b/lib/util/util.js index c98031628..38c009020 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -42,6 +42,7 @@ export const Util = { authFileName: '.mcdev-auth.json', boilerplateDirectory: '../../boilerplate', configFileName: '.mcdevrc.json', + defaultGitBranch: 'main', parentBuName: '_ParentBU_', standardizedSplitChar: '/', /** @type {SkipInteraction} */ From 5bf333a6e31d61e223f3acf7408a61e719be6c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 15:29:26 +0200 Subject: [PATCH 118/359] #882: include default git branch in mcdev init / git init --- lib/util/init.git.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/init.git.js b/lib/util/init.git.js index 169eedf37..83c7dccd9 100644 --- a/lib/util/init.git.js +++ b/lib/util/init.git.js @@ -36,7 +36,7 @@ const Init = { newRepoInitialized = false; } else { Util.logger.warn('No Git repository found. Initializing git:'); - Util.execSync('git', ['init']); + Util.execSync('git', ['init', '--initial-branch=' + Util.defaultGitBranch]); if (await File.pathExists('.git')) { newRepoInitialized = true; } else { From 39e4fb6f1600840a248ffe31e707f10d731f82e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 15:57:27 +0200 Subject: [PATCH 119/359] #1200: include message to accenture colleagues --- lib/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/lib/index.js b/lib/index.js index 1115297c5..ff335181b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -175,6 +175,23 @@ class Mcdev { return Init.upgradeProject(properties, false); } + /** + * helper to show an off-the-logs message to users + */ + static #welcomeMessage() { + /* eslint-disable no-console */ + if (process.env['USERDNSDOMAIN'] === 'DIR.SVC.ACCENTURE.COM') { + // Accenture internal message + console.log( + `\n` + + ` Thank you for using Accenture's SFMC DevTools on your Accenture laptop!\n` + + ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you pinged joern.berkefeld via Accenture Teams.\n` + + `\n` + + ` For any questions or concerns, please feel free to create a ticket at https://github.com/Accenture/sfmc-devtools/issues.\n` + ); + } + /* eslint-enable no-console */ + } /** * Retrieve all metadata from the specified business unit into the local file system. * @@ -185,6 +202,7 @@ class Mcdev { * @returns {Promise.} - */ static async retrieve(businessUnit, selectedTypesArr, keys, changelogOnly) { + this.#welcomeMessage(); console.time('Time'); // eslint-disable-line no-console Util.startLogger(); Util.logger.info('mcdev:: Retrieve'); @@ -421,6 +439,7 @@ class Mcdev { * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) */ static async deploy(businessUnit, selectedTypesArr, keyArr) { + this.#welcomeMessage(); console.time('Time'); // eslint-disable-line no-console Util.startLogger(); const deployResult = await Deployer.deploy(businessUnit, selectedTypesArr, keyArr); From c75deba2786c374e5cb6fd57d3898bd8d6962ad2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 16:11:05 +0200 Subject: [PATCH 120/359] #1200: external users welcome message --- lib/index.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/index.js b/lib/index.js index ff335181b..3cc59dab1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -189,6 +189,14 @@ class Mcdev { `\n` + ` For any questions or concerns, please feel free to create a ticket at https://github.com/Accenture/sfmc-devtools/issues.\n` ); + } else { + // external message + console.log( + `\n` + + ` Thank you for using Accenture's SFMC DevTools!\n` + + `\n` + + ` For any questions or concerns, please feel free to create a ticket at https://github.com/Accenture/sfmc-devtools/issues.\n` + ); } /* eslint-enable no-console */ } From 54d3a63916e3053860cf5524ff50f3d48d514914 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 16:23:55 +0200 Subject: [PATCH 121/359] #1200: fix typo --- lib/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 3cc59dab1..11622dbf9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -184,7 +184,7 @@ class Mcdev { // Accenture internal message console.log( `\n` + - ` Thank you for using Accenture's SFMC DevTools on your Accenture laptop!\n` + + ` Thank you for using Accenture SFMC DevTools on your Accenture laptop!\n` + ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you pinged joern.berkefeld via Accenture Teams.\n` + `\n` + ` For any questions or concerns, please feel free to create a ticket at https://github.com/Accenture/sfmc-devtools/issues.\n` @@ -193,7 +193,7 @@ class Mcdev { // external message console.log( `\n` + - ` Thank you for using Accenture's SFMC DevTools!\n` + + ` Thank you for using Accenture SFMC DevTools!\n` + `\n` + ` For any questions or concerns, please feel free to create a ticket at https://github.com/Accenture/sfmc-devtools/issues.\n` ); From 24c449a1c0258d1e61865a9e49e6a1d0ccbd440c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 16:57:03 +0200 Subject: [PATCH 122/359] #1229: refactor vscode extension test --- lib/util/util.js | 6 ++++-- test/resourceFactory.js | 5 +---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/util/util.js b/lib/util/util.js index 38c009020..89d2c63d6 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -39,6 +39,9 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url)); * Util that contains logger and simple util methods */ export const Util = { + isRunViaVSCodeExtension: + process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' || // run via VSCode extension + process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost', authFileName: '.mcdev-auth.json', boilerplateDirectory: '../../boilerplate', configFileName: '.mcdevrc.json', @@ -275,8 +278,7 @@ export const Util = { // silly: 6 // } if ( - process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' || // run via VSCode extension - process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost' || // run via VSCode extension + this.isRunViaVSCodeExtension || // run via VSCode extension process.env.FORK_PROCESS_ID || // run via Git-Fork process.env.PATH.toLowerCase().includes('sourcetree') // run via Atlassian SourceTree ) { diff --git a/test/resourceFactory.js b/test/resourceFactory.js index e23a81013..39281b09e 100644 --- a/test/resourceFactory.js +++ b/test/resourceFactory.js @@ -8,10 +8,7 @@ const attributeParser = new XMLParser({ ignoreAttributes: false }); let color; /* eslint-disable unicorn/prefer-ternary */ -if ( - process.env.VSCODE_AMD_ENTRYPOINT === 'vs/workbench/api/node/extensionHostProcess' || - process.env.VSCODE_CRASH_REPORTER_PROCESS_TYPE === 'extensionHost' -) { +if (Util.isRunViaVSCodeExtension) { // when we execute the test in a VSCode extension host, we don't want CLI color codes. // @ts-expect-error hacky way to get rid of colors - ts doesn't appreciate the hack color = new Proxy( From 56f4277b14ff3130912c7874faa4a07b1a80a346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 17:00:44 +0200 Subject: [PATCH 123/359] #1229: log downloaded assets counter to info stream if executed via vscode extension --- lib/metadataTypes/Asset.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 71e689d1f..baa9ae48f 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -282,7 +282,11 @@ class Asset extends MetadataType { } // we have to wait on execution or it potentially causes memory reference issues when changing between BUs await this.requestAndSaveExtended(items, subType, retrieveDir, templateVariables); - Util.logger.debug(`Downloaded asset-${subType}: ${items.length}`); + if (Util.isRunViaVSCodeExtension) { + Util.logger.info(` Downloaded asset-${subType}: ${items.length}`); + } else { + Util.logger.debug(`Downloaded asset-${subType}: ${items.length}`); + } } else if (retrieveDir && !items.length) { Util.logger.info(` Downloaded asset-${subType}: ${items.length}`); } From ebffd18e6afcc37a1686163a09dd62c26251174f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 18:59:43 +0200 Subject: [PATCH 124/359] #60: basic retrieve-support for deliveryProfile --- lib/MetadataTypeDefinitions.js | 2 + lib/MetadataTypeInfo.js | 2 + lib/metadataTypes/DeliveryProfile.js | 47 +++++++++++++++ .../definitions/DeliveryProfile.definition.js | 57 +++++++++++++++++++ 4 files changed, 108 insertions(+) create mode 100644 lib/metadataTypes/DeliveryProfile.js create mode 100644 lib/metadataTypes/definitions/DeliveryProfile.definition.js diff --git a/lib/MetadataTypeDefinitions.js b/lib/MetadataTypeDefinitions.js index 86f51d0ae..4acbcaf6d 100644 --- a/lib/MetadataTypeDefinitions.js +++ b/lib/MetadataTypeDefinitions.js @@ -11,6 +11,7 @@ import dataExtensionField from './metadataTypes/definitions/DataExtensionField.d import dataExtensionTemplate from './metadataTypes/definitions/DataExtensionTemplate.definition.js'; import dataExtract from './metadataTypes/definitions/DataExtract.definition.js'; import dataExtractType from './metadataTypes/definitions/DataExtractType.definition.js'; +import deliveryProfile from './metadataTypes/definitions/DeliveryProfile.definition.js'; import discovery from './metadataTypes/definitions/Discovery.definition.js'; import email from './metadataTypes/definitions/Email.definition.js'; import emailSend from './metadataTypes/definitions/EmailSend.definition.js'; @@ -53,6 +54,7 @@ export default { dataExtensionTemplate, dataExtract, dataExtractType, + deliveryProfile, discovery, email, emailSend, diff --git a/lib/MetadataTypeInfo.js b/lib/MetadataTypeInfo.js index b0be83eaa..b66222cff 100644 --- a/lib/MetadataTypeInfo.js +++ b/lib/MetadataTypeInfo.js @@ -11,6 +11,7 @@ import dataExtensionField from './metadataTypes/DataExtensionField.js'; import dataExtensionTemplate from './metadataTypes/DataExtensionTemplate.js'; import dataExtract from './metadataTypes/DataExtract.js'; import dataExtractType from './metadataTypes/DataExtractType.js'; +import deliveryProfile from './metadataTypes/DeliveryProfile.js'; import discovery from './metadataTypes/Discovery.js'; import email from './metadataTypes/Email.js'; import emailSend from './metadataTypes/EmailSend.js'; @@ -52,6 +53,7 @@ export default { dataExtensionTemplate, dataExtract, dataExtractType, + deliveryProfile, discovery, email, emailSend, diff --git a/lib/metadataTypes/DeliveryProfile.js b/lib/metadataTypes/DeliveryProfile.js new file mode 100644 index 000000000..2c94f7ebf --- /dev/null +++ b/lib/metadataTypes/DeliveryProfile.js @@ -0,0 +1,47 @@ +'use strict'; + +import MetadataType from './MetadataType.js'; + +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + +/** + * DeliveryProfile MetadataType + * + * @augments MetadataType + */ +class DeliveryProfile extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] not used + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir, _, __, key) { + return super.retrieveREST( + retrieveDir, + '/legacy/v1/beta/messaging/deliverypolicy/', + null, + key + ); + } +} + +// Assign definition to static attributes +import MetadataTypeDefinitions from '../MetadataTypeDefinitions.js'; +DeliveryProfile.definition = MetadataTypeDefinitions.deliveryProfile; + +export default DeliveryProfile; diff --git a/lib/metadataTypes/definitions/DeliveryProfile.definition.js b/lib/metadataTypes/definitions/DeliveryProfile.definition.js new file mode 100644 index 000000000..fefbe0059 --- /dev/null +++ b/lib/metadataTypes/definitions/DeliveryProfile.definition.js @@ -0,0 +1,57 @@ +export default { + bodyIteratorField: 'entry', + dependencies: [], + filter: {}, + hasExtended: false, + idField: 'id', + keyField: 'key', + nameField: 'name', + createdDateField: 'createdDate', + createdNameField: null, + lastmodDateField: 'lastUpdated', + lastmodNameField: null, + restPagination: false, + type: 'deliveryProfile', + typeDescription: + 'Delivery profiles specify details such as IP address, domain, header inclusion, and footer; Via API we can only check for their existence but not see any details.', + typeRetrieveByDefault: false, + typeName: 'Delivery Profile', + fields: { + id: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + key: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + name: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + description: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + createdDate: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + lastUpdated: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: false, + }, + }, +}; From 9ea07ecfc7a6f6281b4fa33a652f06ef96cff510 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 19:14:56 +0200 Subject: [PATCH 125/359] #60: test case for retrieving deliveryProfile --- .../9999999/deliveryProfile/get-expected.json | 7 +++ .../deliverypolicy/get-response.json | 15 +++++++ test/type.deliveryProfile.test.js | 45 +++++++++++++++++++ 3 files changed, 67 insertions(+) create mode 100644 test/resources/9999999/deliveryProfile/get-expected.json create mode 100644 test/resources/9999999/legacy/v1/beta/messaging/deliverypolicy/get-response.json create mode 100644 test/type.deliveryProfile.test.js diff --git a/test/resources/9999999/deliveryProfile/get-expected.json b/test/resources/9999999/deliveryProfile/get-expected.json new file mode 100644 index 000000000..d36d9bdf9 --- /dev/null +++ b/test/resources/9999999/deliveryProfile/get-expected.json @@ -0,0 +1,7 @@ +{ + "key": "Default", + "createdDate": "2021-06-21T17:55:00Z", + "lastUpdated": "2021-06-21T17:55:00Z", + "name": "Default", + "description": "Account defaults" +} diff --git a/test/resources/9999999/legacy/v1/beta/messaging/deliverypolicy/get-response.json b/test/resources/9999999/legacy/v1/beta/messaging/deliverypolicy/get-response.json new file mode 100644 index 000000000..39ebac4f0 --- /dev/null +++ b/test/resources/9999999/legacy/v1/beta/messaging/deliverypolicy/get-response.json @@ -0,0 +1,15 @@ +{ + "startIndex": 0, + "itemsPerPage": 50, + "totalResults": 1, + "entry": [ + { + "id": "ejQ1Y2Q5SzVFZXU0UHZRRFE4bFptQTo0ODow", + "key": "Default", + "createdDate": "2021-06-21T17:55:00Z", + "lastUpdated": "2021-06-21T17:55:00Z", + "name": "Default", + "description": "Account defaults" + } + ] +} diff --git a/test/type.deliveryProfile.test.js b/test/type.deliveryProfile.test.js new file mode 100644 index 000000000..8a38f7711 --- /dev/null +++ b/test/type.deliveryProfile.test.js @@ -0,0 +1,45 @@ +import * as chai from 'chai'; +const assert = chai.assert; + +import chaiFiles from 'chai-files'; +import cache from '../lib/util/cache.js'; +import * as testUtils from './utils.js'; +import handler from '../lib/index.js'; +chai.use(chaiFiles); + +describe('type: deliveryProfile', () => { + beforeEach(() => { + testUtils.mockSetup(); + }); + + afterEach(() => { + testUtils.mockReset(); + }); + + describe('Retrieve ================', () => { + it('Should retrieve a deliveryProfile', async () => { + // WHEN + await handler.retrieve('testInstance/testBU', ['deliveryProfile']); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.deliveryProfile ? Object.keys(result.deliveryProfile).length : 0, + 1, + 'only one deliveryProfile expected' + ); + assert.deepEqual( + await testUtils.getActualJson('Default', 'deliveryProfile'), + await testUtils.getExpectedJson('9999999', 'deliveryProfile', 'get'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 1, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); +}); From e1b206eeec5210a69012e992044c6947d3860298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 23:57:45 +0200 Subject: [PATCH 126/359] #62: create/update/delete support for sendClassification + resolve sender+deliveryProfile --- lib/metadataTypes/ImportFile.js | 2 +- lib/metadataTypes/SendClassification.js | 103 ++++++++++++++++++ lib/metadataTypes/SenderProfile.js | 2 +- .../SendClassification.definition.js | 77 +++++++++---- 4 files changed, 163 insertions(+), 21 deletions(-) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index b7c1ee65b..e4f3cd0ed 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -223,7 +223,7 @@ class ImportFile extends MetadataType { * prepares a import definition for deployment * * @param {MetadataTypeItem} metadata a single importDef - * @returns {Promise} Promise + * @returns {Promise.} Promise */ static async preDeployTasks(metadata) { const fileLocation = cache.getByKey('fileLocation', metadata.source.r__fileLocation_name); diff --git a/lib/metadataTypes/SendClassification.js b/lib/metadataTypes/SendClassification.js index 2683efacd..79b8413eb 100644 --- a/lib/metadataTypes/SendClassification.js +++ b/lib/metadataTypes/SendClassification.js @@ -1,6 +1,8 @@ 'use strict'; import MetadataType from './MetadataType.js'; +import { Util } from '../util/util.js'; +import cache from '../util/cache.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -44,6 +46,107 @@ class SendClassification extends MetadataType { } return super.retrieveSOAP(retrieveDir, requestParams, key); } + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static update(metadataItem) { + return super.updateSOAP(metadataItem); + } + + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static create(metadataItem) { + return super.createSOAP(metadataItem); + } + + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {Promise.} deletion success status + */ + static deleteByKey(customerKey) { + return super.deleteByKeySOAP(customerKey); + } + /** + * prepares a import definition for deployment + * + * @param {MetadataTypeItem} metadata a single importDef + * @returns {Promise.} Promise + */ + static async preDeployTasks(metadata) { + metadata.SendClassificationType = + this.definition.sendClassificationTypeMapping[metadata.c__classification]; + delete metadata.c__classification; + + metadata.SenderProfile = { + CustomerKey: cache.searchForField( + 'senderProfile', + metadata.r__senderProfile_CustomerKey, + 'CustomerKey', + 'CustomerKey' + ), + }; + delete metadata.r__senderProfile_CustomerKey; + + metadata.DeliveryProfile = { + CustomerKey: cache.searchForField( + 'deliveryProfile', + metadata.r__deliveryProfile_key, + 'key', + 'key' + ), + }; + delete metadata.r__deliveryProfile_key; + + return metadata; + } + + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} parsed metadata + */ + static postRetrieveTasks(metadata) { + metadata.c__classification = Util.inverseGet( + this.definition.sendClassificationTypeMapping, + metadata.SendClassificationType + ); + delete metadata.SendClassificationType; + + try { + metadata.r__senderProfile_CustomerKey = cache.searchForField( + 'senderProfile', + metadata.SenderProfile.CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + delete metadata.SenderProfile; + } catch (ex) { + Util.logger.warn(` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}`); + } + try { + metadata.r__deliveryProfile_key = cache.searchForField( + 'deliveryProfile', + metadata.DeliveryProfile.CustomerKey, + 'key', + 'key' + ); + delete metadata.DeliveryProfile; + } catch (ex) { + Util.logger.warn(` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}`); + } + + return metadata; + } } // Assign definition to static attributes diff --git a/lib/metadataTypes/SenderProfile.js b/lib/metadataTypes/SenderProfile.js index 360c68448..edd5d46d5 100644 --- a/lib/metadataTypes/SenderProfile.js +++ b/lib/metadataTypes/SenderProfile.js @@ -31,7 +31,7 @@ class SenderProfile extends MetadataType { * @param {string} [key] customer key of single item to retrieve * @returns {Promise.} Promise of metadata */ - static retrieve(retrieveDir, _, __, key) { + static async retrieve(retrieveDir, _, __, key) { /** @type {SoapRequestParams} */ let requestParams; if (key) { diff --git a/lib/metadataTypes/definitions/SendClassification.definition.js b/lib/metadataTypes/definitions/SendClassification.definition.js index 669c3da15..11f0c87f7 100644 --- a/lib/metadataTypes/definitions/SendClassification.definition.js +++ b/lib/metadataTypes/definitions/SendClassification.definition.js @@ -1,7 +1,7 @@ // https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/sendclassification.html export default { bodyIteratorField: 'Results', - dependencies: [], + dependencies: ['senderProfile', 'deliveryProfile'], filter: {}, hasExtended: false, idField: 'ObjectID', @@ -18,6 +18,10 @@ export default { 'Lets admins define Delivery Profile, Sender Profile and CAN-SPAM for an email job in a central location.', typeRetrieveByDefault: false, typeName: 'Send Classification', + sendClassificationTypeMapping: { + Commercial: 'Marketing', + Transactional: 'Operational', + }, fields: { 'Client.ID': { isCreateable: false, @@ -28,38 +32,38 @@ export default { CreatedDate: { isCreateable: false, isUpdateable: false, - retrieving: false, + retrieving: true, template: false, }, ModifiedDate: { isCreateable: false, isUpdateable: false, - retrieving: false, + retrieving: true, template: false, }, CustomerKey: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, ObjectID: { isCreateable: false, - isUpdateable: false, + isUpdateable: true, retrieving: true, template: false, }, Name: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, Description: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, PartnerKey: { isCreateable: false, @@ -75,40 +79,75 @@ export default { }, ArchiveEmail: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, - DeliveryProfile: { + 'DeliveryProfile.CustomerKey': { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + 'DeliveryProfile.PartnerKey': { isCreateable: false, isUpdateable: false, retrieving: false, template: false, }, - HonorPublicationListOptOutsForTransactionalSends: { + 'DeliveryProfile.ObjectID': { isCreateable: false, isUpdateable: false, retrieving: false, template: false, }, - SendClassificationType: { + HonorPublicationListOptOutsForTransactionalSends: { + /* not supported */ isCreateable: false, isUpdateable: false, + retrieving: false, + template: false, + }, + SendClassificationType: { + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, + }, + 'SenderProfile.CustomerKey': { + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, - SenderProfile: { + 'SenderProfile.PartnerKey': { + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, + }, + 'SenderProfile.ObjectID': { isCreateable: false, isUpdateable: false, retrieving: false, template: false, }, SendPriority: { + /* not supported */ isCreateable: false, isUpdateable: false, retrieving: false, template: false, }, + c__classification: { + skipValidation: true, + }, + r__deliveryProfile_key: { + skipValidation: true, + }, + r__senderProfile_CustomerKey: { + skipValidation: true, + }, }, }; From 83ef7b6538e3993cccdc9831b6f2d7e97b5fa368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 15 Apr 2024 23:59:28 +0200 Subject: [PATCH 127/359] #1266: add test cases for sendClassification --- ...lassification.sendClassification-meta.json | 8 + ...lassification.sendClassification-meta.json | 8 + .../sendClassification/build-expected.json | 8 + .../sendClassification/create-response.xml | 51 ++++++ .../sendClassification/delete-response.xml | 36 ++++ .../sendClassification/get-expected.json | 10 ++ .../sendClassification/patch-expected.json | 8 + .../sendClassification/post-expected.json | 8 + .../sendClassification/retrieve-response.xml | 86 ++++++++++ .../sendClassification/template-expected.json | 8 + .../sendClassification/update-response.xml | 49 ++++++ .../senderProfile/retrieve-response.xml | 18 ++ test/type.sendClassification.test.js | 156 ++++++++++++++++++ test/type.senderProfile.test.js | 4 +- 14 files changed, 456 insertions(+), 2 deletions(-) create mode 100644 test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json create mode 100644 test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json create mode 100644 test/resources/9999999/sendClassification/build-expected.json create mode 100644 test/resources/9999999/sendClassification/create-response.xml create mode 100644 test/resources/9999999/sendClassification/delete-response.xml create mode 100644 test/resources/9999999/sendClassification/get-expected.json create mode 100644 test/resources/9999999/sendClassification/patch-expected.json create mode 100644 test/resources/9999999/sendClassification/post-expected.json create mode 100644 test/resources/9999999/sendClassification/retrieve-response.xml create mode 100644 test/resources/9999999/sendClassification/template-expected.json create mode 100644 test/resources/9999999/sendClassification/update-response.xml create mode 100644 test/type.sendClassification.test.js diff --git a/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json new file mode 100644 index 000000000..5a7701d88 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json @@ -0,0 +1,8 @@ +{ + "CustomerKey": "testExisting_sendClassification", + "Name": "testExisting_sendClassification", + "Description": "updated on deploy", + "c__classification": "Commercial", + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__deliveryProfile_key": "Default" +} diff --git a/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json new file mode 100644 index 000000000..dd786c022 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json @@ -0,0 +1,8 @@ +{ + "CustomerKey": "testNew_sendClassification", + "Name": "testNew_sendClassification", + "Description": "created on deploy", + "c__classification": "Commercial", + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__deliveryProfile_key": "Default" +} diff --git a/test/resources/9999999/sendClassification/build-expected.json b/test/resources/9999999/sendClassification/build-expected.json new file mode 100644 index 000000000..e7cc512c7 --- /dev/null +++ b/test/resources/9999999/sendClassification/build-expected.json @@ -0,0 +1,8 @@ +{ + "CustomerKey": "testTemplated_sendClassification", + "Description": "", + "Name": "testTemplated_sendClassification", + "c__classification": "Commercial", + "r__deliveryProfile_key": "Default", + "r__senderProfile_CustomerKey": "testTemplated_senderProfile" +} diff --git a/test/resources/9999999/sendClassification/create-response.xml b/test/resources/9999999/sendClassification/create-response.xml new file mode 100644 index 000000000..6f79d6be5 --- /dev/null +++ b/test/resources/9999999/sendClassification/create-response.xml @@ -0,0 +1,51 @@ + + + + CreateResponse + urn:uuid:bb642235-9021-414c-8f0e-31d693a573e8 + urn:uuid:b49d6c14-33d7-4ba8-8aea-0fe3282fdbfd + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-15T21:38:02Z + 2024-04-15T21:43:02Z + + + + + + + OK + SendClassification created + 0 + 0 + 07cf2a6e-70fb-ee11-a5c8-5cba2c6fc270 + + + 07cf2a6e-70fb-ee11-a5c8-5cba2c6fc270 + testNew_sendClassification + Operational + testNew_sendClassification + created on deploy + + + + testExisting_senderProfile + + + + + Default + + + + d5f798f9-02eb-4b76-a4b4-90cfee939ce2 + OK + + + diff --git a/test/resources/9999999/sendClassification/delete-response.xml b/test/resources/9999999/sendClassification/delete-response.xml new file mode 100644 index 000000000..b42fd3fbe --- /dev/null +++ b/test/resources/9999999/sendClassification/delete-response.xml @@ -0,0 +1,36 @@ + + + + DeleteResponse + urn:uuid:51ac7e8d-3d31-425c-8899-7ba4b2b09626 + urn:uuid:9ee7419c-06be-4dcd-b386-5b64df545f2c + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-15T21:53:10Z + 2024-04-15T21:58:10Z + + + + + + + OK + SendClassification deleted + 0 + + + + testExisting_sendClassification + + + 0451cd2c-ab68-4e1c-9ded-d67003287283 + OK + + + diff --git a/test/resources/9999999/sendClassification/get-expected.json b/test/resources/9999999/sendClassification/get-expected.json new file mode 100644 index 000000000..f1239e7f6 --- /dev/null +++ b/test/resources/9999999/sendClassification/get-expected.json @@ -0,0 +1,10 @@ +{ + "CreatedDate": "2016-08-31T11:29:00", + "ModifiedDate": "2024-04-15T15:33:00", + "CustomerKey": "testExisting_sendClassification", + "Name": "testExisting_sendClassification", + "Description": "", + "c__classification": "Commercial", + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__deliveryProfile_key": "Default" +} diff --git a/test/resources/9999999/sendClassification/patch-expected.json b/test/resources/9999999/sendClassification/patch-expected.json new file mode 100644 index 000000000..5a7701d88 --- /dev/null +++ b/test/resources/9999999/sendClassification/patch-expected.json @@ -0,0 +1,8 @@ +{ + "CustomerKey": "testExisting_sendClassification", + "Name": "testExisting_sendClassification", + "Description": "updated on deploy", + "c__classification": "Commercial", + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__deliveryProfile_key": "Default" +} diff --git a/test/resources/9999999/sendClassification/post-expected.json b/test/resources/9999999/sendClassification/post-expected.json new file mode 100644 index 000000000..23346b5eb --- /dev/null +++ b/test/resources/9999999/sendClassification/post-expected.json @@ -0,0 +1,8 @@ +{ + "CustomerKey": "testNew_sendClassification", + "Name": "testNew_sendClassification", + "Description": "created on deploy", + "c__classification": "Transactional", + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__deliveryProfile_key": "Default" +} diff --git a/test/resources/9999999/sendClassification/retrieve-response.xml b/test/resources/9999999/sendClassification/retrieve-response.xml new file mode 100644 index 000000000..11e892a2c --- /dev/null +++ b/test/resources/9999999/sendClassification/retrieve-response.xml @@ -0,0 +1,86 @@ + + + + RetrieveResponse + urn:uuid:31b53ebd-b853-4f8c-b952-f176aed80aa9 + urn:uuid:cac816ee-0b59-4748-b629-4475b198708f + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-15T21:11:54Z + 2024-04-15T21:16:54Z + + + + + + OK + e7197c3d-0483-44fd-93ad-d7dd2e0cfb56 + + + 2016-07-22T11:53:00 + 2016-07-22T11:53:00 + 8ecfb80f-3550-e611-96fe-38eaa7142c61 + Default Commercial + Marketing + Default Commercial + Default Commercial Send Classification + + + + Default + + + + + Default + + + + + 2016-07-22T11:53:00 + 2016-07-22T11:53:00 + 90cfb80f-3550-e611-96fe-38eaa7142c61 + Default Transactional + Operational + Default Transactional + Default Transactional Send Classification + + + + Default + + + + + Default + + + + + 2016-08-31T11:29:00 + 2024-04-15T15:33:00 + 95da425b-a06f-e611-96fe-38eaa7142c61 + testExisting_sendClassification + Marketing + testExisting_sendClassification + + + + + testExisting_senderProfile + + + + + Default + + + + + diff --git a/test/resources/9999999/sendClassification/template-expected.json b/test/resources/9999999/sendClassification/template-expected.json new file mode 100644 index 000000000..ebf5f00f1 --- /dev/null +++ b/test/resources/9999999/sendClassification/template-expected.json @@ -0,0 +1,8 @@ +{ + "CustomerKey": "{{{prefix}}}sendClassification", + "Description": "", + "Name": "{{{prefix}}}sendClassification", + "c__classification": "Commercial", + "r__deliveryProfile_key": "Default", + "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile" +} diff --git a/test/resources/9999999/sendClassification/update-response.xml b/test/resources/9999999/sendClassification/update-response.xml new file mode 100644 index 000000000..2a8ce0c09 --- /dev/null +++ b/test/resources/9999999/sendClassification/update-response.xml @@ -0,0 +1,49 @@ + + + + UpdateResponse + urn:uuid:76f29c30-cfd5-41b5-8c8f-d58a7ce82964 + urn:uuid:e05b39ff-7e0b-4c3e-811d-362ee08f48f4 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-15T21:32:54Z + 2024-04-15T21:37:54Z + + + + + + + OK + SendClassification updated + 0 + + + 95da425b-a06f-e611-96fe-38eaa7142c61 + testExisting_sendClassification + Marketing + testExisting_sendClassification + updated on deploy + + + + testExisting_senderProfile + + + + + Default + + + + 0ff3e991-df4f-4206-b8e1-bdccf95d3931 + OK + + + diff --git a/test/resources/9999999/senderProfile/retrieve-response.xml b/test/resources/9999999/senderProfile/retrieve-response.xml index 8ed9de26c..c10108b15 100644 --- a/test/resources/9999999/senderProfile/retrieve-response.xml +++ b/test/resources/9999999/senderProfile/retrieve-response.xml @@ -21,6 +21,24 @@ OK 4c6f37a1-7ab4-47a1-b341-f9912462ee97 + + + 2016-07-22T11:53:00 + 2016-07-22T11:53:00 + 7acfb80f-3550-e611-96fe-38eaa7142c61 + Default + Default + Account defaults + Accenture + joern.berkefeld@accenture.com + true + + + false + false + + + 2021-08-03T11:14:00 diff --git a/test/type.sendClassification.test.js b/test/type.sendClassification.test.js new file mode 100644 index 000000000..6e88f865a --- /dev/null +++ b/test/type.sendClassification.test.js @@ -0,0 +1,156 @@ +import * as chai from 'chai'; +const assert = chai.assert; + +import chaiFiles from 'chai-files'; +import cache from '../lib/util/cache.js'; +import * as testUtils from './utils.js'; +import handler from '../lib/index.js'; +chai.use(chaiFiles); + +describe('type: sendClassification', () => { + beforeEach(() => { + testUtils.mockSetup(); + }); + + afterEach(() => { + testUtils.mockReset(); + }); + + describe('Retrieve ================', () => { + it('Should retrieve a sendClassification', async () => { + // WHEN + await handler.retrieve('testInstance/testBU', ['sendClassification']); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.sendClassification ? Object.keys(result.sendClassification).length : 0, + 3, + 'only 3 sendClassifications expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_sendClassification', + 'sendClassification' + ), + await testUtils.getExpectedJson('9999999', 'sendClassification', 'get'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 3, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Deploy ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + + it('Should create & upsert a sendClassification', async () => { + // WHEN + + await handler.deploy('testInstance/testBU', ['sendClassification']); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.sendClassification ? Object.keys(result.sendClassification).length : 0, + 4, + 'two sendClassifications expected' + ); + // confirm created item + assert.deepEqual( + await testUtils.getActualJson('testNew_sendClassification', 'sendClassification'), + await testUtils.getExpectedJson('9999999', 'sendClassification', 'post'), + 'returned new-JSON was not equal expected for insert sendClassification' + ); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_sendClassification', + 'sendClassification' + ), + await testUtils.getExpectedJson('9999999', 'sendClassification', 'patch'), + 'returned existing-JSON was not equal expected for update sendClassification' + ); + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 5, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Templating ================', () => { + it('Should create a sendClassification template via buildTemplate and build it', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['sendClassification']); + // buildTemplate + const result = await handler.buildTemplate( + 'testInstance/testBU', + 'sendClassification', + ['testExisting_sendClassification'], + 'testSourceMarket' + ); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); + assert.equal( + result.sendClassification ? Object.keys(result.sendClassification).length : 0, + 1, + 'only one sendClassification expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson( + 'testExisting_sendClassification', + 'sendClassification' + ), + await testUtils.getExpectedJson('9999999', 'sendClassification', 'template'), + 'returned template JSON was not equal expected' + ); + // buildDefinition + await handler.buildDefinition( + 'testInstance/testBU', + 'sendClassification', + 'testExisting_sendClassification', + 'testTargetMarket' + ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); + assert.deepEqual( + await testUtils.getActualDeployJson( + 'testTemplated_sendClassification', + 'sendClassification' + ), + await testUtils.getExpectedJson('9999999', 'sendClassification', 'build'), + 'returned deployment JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 3, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Delete ================', () => { + it('Should delete the item', async () => { + // WHEN + const isDeleted = await handler.deleteByKey( + 'testInstance/testBU', + 'sendClassification', + 'testExisting_sendClassification' + ); + // THEN + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); + return; + }); + }); +}); diff --git a/test/type.senderProfile.test.js b/test/type.senderProfile.test.js index 4266ebe0d..a148880aa 100644 --- a/test/type.senderProfile.test.js +++ b/test/type.senderProfile.test.js @@ -26,7 +26,7 @@ describe('type: senderProfile', () => { const result = cache.getCache(); assert.equal( result.senderProfile ? Object.keys(result.senderProfile).length : 0, - 1, + 2, 'only one senderProfile expected' ); assert.deepEqual( @@ -58,7 +58,7 @@ describe('type: senderProfile', () => { const result = cache.getCache(); assert.equal( result.senderProfile ? Object.keys(result.senderProfile).length : 0, - 2, + 3, 'two senderProfiles expected' ); // confirm created item From efbb5ad3c29cf3097041250a5eceed2a6d4fce76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 16 Apr 2024 13:38:48 +0200 Subject: [PATCH 128/359] #1200: improve welcome message --- lib/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 11622dbf9..401c53cfe 100644 --- a/lib/index.js +++ b/lib/index.js @@ -185,9 +185,9 @@ class Mcdev { console.log( `\n` + ` Thank you for using Accenture SFMC DevTools on your Accenture laptop!\n` + - ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you pinged joern.berkefeld via Accenture Teams.\n` + + ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you left a message in our Accenture Teams channel telling us about your journey with mcdev: https://bit.ly/acn-teams-devtools.\n` + `\n` + - ` For any questions or concerns, please feel free to create a ticket at https://github.com/Accenture/sfmc-devtools/issues.\n` + ` For any questions or concerns, please feel free to create a ticket at https://bit.ly/mcdev-support.\n` ); } else { // external message @@ -195,7 +195,7 @@ class Mcdev { `\n` + ` Thank you for using Accenture SFMC DevTools!\n` + `\n` + - ` For any questions or concerns, please feel free to create a ticket at https://github.com/Accenture/sfmc-devtools/issues.\n` + ` For any questions or concerns, please feel free to create a ticket at https://bit.ly/mcdev-support.\n` ); } /* eslint-enable no-console */ From 07c5f7575de11e5ed9bf550a8e26d9aadd6d07e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 16 Apr 2024 14:19:39 +0200 Subject: [PATCH 129/359] #1200: switched out internal bitly link with go.accenture link --- lib/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 401c53cfe..d32c55e5b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -185,9 +185,9 @@ class Mcdev { console.log( `\n` + ` Thank you for using Accenture SFMC DevTools on your Accenture laptop!\n` + - ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you left a message in our Accenture Teams channel telling us about your journey with mcdev: https://bit.ly/acn-teams-devtools.\n` + + ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you left a message in our Accenture Teams channel telling us about your journey with mcdev: https://go.accenture.com/mcdevTeams.\n` + `\n` + - ` For any questions or concerns, please feel free to create a ticket at https://bit.ly/mcdev-support.\n` + ` For any questions or concerns, please feel free to create a ticket in GitHub: https://bit.ly/mcdev-support.\n` ); } else { // external message @@ -195,7 +195,7 @@ class Mcdev { `\n` + ` Thank you for using Accenture SFMC DevTools!\n` + `\n` + - ` For any questions or concerns, please feel free to create a ticket at https://bit.ly/mcdev-support.\n` + ` For any questions or concerns, please feel free to create a ticket in GitHub: https://bit.ly/mcdev-support.\n` ); } /* eslint-enable no-console */ From 509f0a501317941a84c9a8488747730b950e311c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 16 Apr 2024 14:41:49 +0200 Subject: [PATCH 130/359] #1200: adding a bit of color to the welcome message --- lib/index.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index d32c55e5b..19d401ccc 100644 --- a/lib/index.js +++ b/lib/index.js @@ -179,15 +179,19 @@ class Mcdev { * helper to show an off-the-logs message to users */ static #welcomeMessage() { + const color = Util.isRunViaVSCodeExtension + ? { reset: '', bgWhite: '', fgBlue: '' } + : Util.color; /* eslint-disable no-console */ if (process.env['USERDNSDOMAIN'] === 'DIR.SVC.ACCENTURE.COM') { // Accenture internal message console.log( `\n` + ` Thank you for using Accenture SFMC DevTools on your Accenture laptop!\n` + - ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you left a message in our Accenture Teams channel telling us about your journey with mcdev: https://go.accenture.com/mcdevTeams.\n` + + ` We are trying to understand who is using mcdev across the globe and would therefore appreciate it if you left a message\n` + + ` in our Accenture Teams channel ${color.bgWhite}telling us about your journey with mcdev${color.reset}: ${color.fgBlue}https://go.accenture.com/mcdevTeams${color.reset}.\n` + `\n` + - ` For any questions or concerns, please feel free to create a ticket in GitHub: https://bit.ly/mcdev-support.\n` + ` For any questions or concerns, please feel free to create a ticket in GitHub: ${color.fgBlue}https://bit.ly/mcdev-support${color.reset}.\n` ); } else { // external message @@ -195,7 +199,7 @@ class Mcdev { `\n` + ` Thank you for using Accenture SFMC DevTools!\n` + `\n` + - ` For any questions or concerns, please feel free to create a ticket in GitHub: https://bit.ly/mcdev-support.\n` + ` For any questions or concerns, please feel free to create a ticket in GitHub: ${color.fgBlue}https://bit.ly/mcdev-support${color.reset}.\n` ); } /* eslint-enable no-console */ From 907c68508c55fe53e1758865fb00d97805973f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 16 Apr 2024 15:41:58 +0200 Subject: [PATCH 131/359] #1238: add legacyId and sharing infos to output; fix path for shared assets --- lib/metadataTypes/Asset.js | 70 ++++++++++++++++++++++++++++---------- 1 file changed, 52 insertions(+), 18 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index baa9ae48f..9a03db12a 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1735,10 +1735,16 @@ class Asset extends MetadataType { path: '', folder: '', mid: 0, + legacyId: 0, error: '', + sharedWith: [], }; try { - response = await this.client.rest.get('asset/v1/content/assets/' + id); + response = await this.client.rest.get( + 'asset/v1/content/assets/' + + id + + '?$fields=id,customerKey,name,memberId,legacyData,sharingProperties' + ); } catch (ex) { if (ex.response?.status !== 404) { throw ex; @@ -1753,10 +1759,22 @@ class Asset extends MetadataType { json.name = item[this.definition.nameField]; json.mid = item.memberId; json.isShared = item.memberId != this.buObject.mid; + json.sharedWith = item.sharingProperties?.sharedWith || null; + json.legacyId = item.legacyData?.legacyId; + + const ownerBUName = json.isShared + ? Util.inverseGet( + this.properties.credentials[this.buObject.credential].businessUnits, + json.mid + ) + : this.buObject.businessUnit; // find path for code of content block, fall back to json if not found; undefined if not even the json exists - let path = json.isShared ? null : this.#getPath(subType, item); + let path = this.#getPath(subType, item, ownerBUName); + if (!json.sharedWith) { + delete json.sharedWith; + } if (!json.isShared && !path) { // if not shared, we should have the file on disk; attempt download if (!cache.getCache()?.folder) { @@ -1782,7 +1800,7 @@ class Asset extends MetadataType { json.key ); // try again - path = this.#getPath(subType, item); + path = this.#getPath(subType, item, this.buObject.businessUnit); } if (path) { @@ -1796,6 +1814,9 @@ class Asset extends MetadataType { if (fileContent?.r__folder_Path) { json.folder = fileContent.r__folder_Path; } + if (!json.legacyId) { + delete json.legacyId; + } if (Util.OPTIONS.json) { // for automated processing by VSCode extension, optionally print the json @@ -1805,7 +1826,29 @@ class Asset extends MetadataType { ` - ${this.definition.type}-${subType} found: ${item[this.definition.keyField]} (${item[this.definition.nameField]})` ); if (json.isShared) { - Util.logger.warn(' - Shared from MID ' + json.mid); + Util.logger.warn(' - Shared from ' + ownerBUName + ' (' + json.mid + ')'); + } + if (json.sharedWith && Array.isArray(json.sharedWith)) { + Util.logger.warn( + ` - Shared with: ${json.sharedWith + .map( + (mid) => + Util.inverseGet( + this.properties.credentials[this.buObject.credential] + .businessUnits, + mid + ) + + ' (' + + mid + + ')' + ) + .sort() + .join(', ')}` + ); + } + Util.logger.info(` - ID: ${id}`); + if (json.legacyId) { + Util.logger.info(` - Legacy ID: ${json.legacyId}`); } if (json.folder) { Util.logger.info( @@ -1820,7 +1863,7 @@ class Asset extends MetadataType { Util.logger.info( ' - local link: ' + (path || - `404. Try running mcdev r ${this.buObject.credential}/${this.buObject.businessUnit} ${this.definition.type}-${subType} ${item[this.definition.keyField]}`) + `404. Try running mcdev r ${this.buObject.credential}/${ownerBUName} ${this.definition.type}-${subType} ${item[this.definition.keyField]}`) ); } return json; @@ -1832,6 +1875,8 @@ class Asset extends MetadataType { delete json.path; delete json.folder; delete json.isShared; + delete json.legacyId; + delete json.sharedWith; if (Util.OPTIONS.json) { console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console return json; @@ -1846,21 +1891,10 @@ class Asset extends MetadataType { * * @param {string} subType asset subtype * @param {object} item api response for metadata + * @param {string} buName owner business unit name * @returns {string} path to the asset's code */ - static #getPath(subType, item) { - const mid = item.memberId; - const buName = - mid === this.buObject.mid - ? this.buObject.businessUnit - : Object.keys( - this.properties.credentials[this.buObject.credential].businessUnits - ).find( - (buName) => - this.properties.credentials[this.buObject.credential].businessUnits[ - buName - ] == mid - ); + static #getPath(subType, item, buName) { const pathBase1 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; const pathBase2 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; const paths = []; From d020f55b3857f1997111cae1b2dcb810cb4f42b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 16 Apr 2024 16:41:50 +0200 Subject: [PATCH 132/359] #62: resolve sendClassification and senderProfile in triggeredSend --- lib/metadataTypes/TriggeredSend.js | 63 ++++++++++++++++++- .../definitions/TriggeredSend.definition.js | 6 +- ...ting_triggeredSend.triggeredSend-meta.json | 7 +-- ...tNew_triggeredSend.triggeredSend-meta.json | 7 +-- .../9999999/triggeredSend/build-expected.json | 7 +-- .../9999999/triggeredSend/get-expected.json | 7 +-- .../9999999/triggeredSend/patch-expected.json | 7 +-- .../9999999/triggeredSend/post-expected.json | 7 +-- .../triggeredSend/template-expected.json | 7 +-- .../create-response.xml | 7 ++- ...ctive,Inactive,Moved,Canceled-response.xml | 7 ++- .../update-response.xml | 7 ++- test/type.triggeredSend.test.js | 6 +- 13 files changed, 109 insertions(+), 36 deletions(-) diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 7d2a91b58..8d42e3b14 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -113,7 +113,6 @@ class TriggeredSend extends MetadataType { // do not save this TSD because it would not be visible in the user interface return; } - // email try { // classic @@ -158,6 +157,42 @@ class TriggeredSend extends MetadataType { } } + // sender profile + if (metadata.SenderProfile?.CustomerKey) { + try { + cache.searchForField( + 'senderProfile', + metadata.SenderProfile.CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.r__senderProfile_CustomerKey = metadata.SenderProfile.CustomerKey; + delete metadata.SenderProfile; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}` + ); + } + } + // send classification + if (metadata.SendClassification?.CustomerKey) { + try { + cache.searchForField( + 'sendClassification', + metadata.SendClassification.CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.r__sendClassification_CustomerKey = + metadata.SendClassification.CustomerKey; + delete metadata.SendClassification; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}` + ); + } + } + return metadata; } /** @@ -216,6 +251,32 @@ class TriggeredSend extends MetadataType { `r__list_PathName not defined but instead found List.ID. Please try re-retrieving this TSD from your BU.` ); } + // sender profile + if (metadata.r__senderProfile_CustomerKey) { + cache.searchForField( + 'senderProfile', + metadata.r__senderProfile_CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.SenderProfile = { + CustomerKey: metadata.r__senderProfile_CustomerKey, + }; + delete metadata.r__senderProfile_CustomerKey; + } + // send classification + if (metadata.r__sendClassification_CustomerKey) { + cache.searchForField( + 'sendClassification', + metadata.r__sendClassification_CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.SendClassification = { + CustomerKey: metadata.r__sendClassification_CustomerKey, + }; + delete metadata.r__sendClassification_CustomerKey; + } return metadata; } diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index 3a99b1646..2870164d1 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -7,7 +7,9 @@ export default { 'email', 'asset-message', 'list', - ], // SendClassification, SenderProfile, DeliveryProfile + 'sendClassification', + 'senderProfile', + ], folderType: 'triggered_send', hasExtended: false, idField: 'ObjectID', @@ -537,5 +539,7 @@ export default { r__assetMessage_Key: { skipValidation: true }, r__email_Name: { skipValidation: true }, r__list_PathName: { skipValidation: true }, + r__sendClassification_CustomerKey: { skipValidation: true }, + r__senderProfile_CustomerKey: { skipValidation: true }, }, }; diff --git a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json index 89a0da5fd..43d0fc8fa 100644 --- a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json @@ -18,12 +18,11 @@ "Name": "testExisting_triggeredSend", "NewSlotTrigger": 0, "Priority": 4, - "SendClassification": { - "CustomerKey": "Default Transactional" - }, "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", "r__email_Name": "Sporting Goods for September", - "r__folder_Path": "Triggered Sends" + "r__folder_Path": "Triggered Sends", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" } diff --git a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json index e9031ce8c..535df8ee7 100644 --- a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json @@ -18,12 +18,11 @@ "Name": "testNew_triggeredSend", "NewSlotTrigger": 0, "Priority": 4, - "SendClassification": { - "CustomerKey": "Default Transactional" - }, "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", "r__email_Name": "Sporting Goods for September", - "r__folder_Path": "Triggered Sends" + "r__folder_Path": "Triggered Sends", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/build-expected.json b/test/resources/9999999/triggeredSend/build-expected.json index 7a80475ea..2e8d859e1 100644 --- a/test/resources/9999999/triggeredSend/build-expected.json +++ b/test/resources/9999999/triggeredSend/build-expected.json @@ -18,12 +18,11 @@ "Name": "testTemplated_triggeredSend", "NewSlotTrigger": 0, "Priority": 4, - "SendClassification": { - "CustomerKey": "Default Transactional" - }, "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", "r__email_Name": "Sporting Goods for September", - "r__folder_Path": "Triggered Sends" + "r__folder_Path": "Triggered Sends", + "r__sendClassification_CustomerKey": "testTemplated_sendClassification", + "r__senderProfile_CustomerKey": "testTemplated_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/get-expected.json b/test/resources/9999999/triggeredSend/get-expected.json index 49858491f..5902b45ac 100644 --- a/test/resources/9999999/triggeredSend/get-expected.json +++ b/test/resources/9999999/triggeredSend/get-expected.json @@ -18,12 +18,11 @@ "Name": "testExisting_triggeredSend", "NewSlotTrigger": 0, "Priority": 4, - "SendClassification": { - "CustomerKey": "Default Transactional" - }, "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", "r__email_Name": "Sporting Goods for September", - "r__folder_Path": "Triggered Sends" + "r__folder_Path": "Triggered Sends", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/patch-expected.json b/test/resources/9999999/triggeredSend/patch-expected.json index 89a0da5fd..43d0fc8fa 100644 --- a/test/resources/9999999/triggeredSend/patch-expected.json +++ b/test/resources/9999999/triggeredSend/patch-expected.json @@ -18,12 +18,11 @@ "Name": "testExisting_triggeredSend", "NewSlotTrigger": 0, "Priority": 4, - "SendClassification": { - "CustomerKey": "Default Transactional" - }, "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", "r__email_Name": "Sporting Goods for September", - "r__folder_Path": "Triggered Sends" + "r__folder_Path": "Triggered Sends", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/post-expected.json b/test/resources/9999999/triggeredSend/post-expected.json index e9031ce8c..535df8ee7 100644 --- a/test/resources/9999999/triggeredSend/post-expected.json +++ b/test/resources/9999999/triggeredSend/post-expected.json @@ -18,12 +18,11 @@ "Name": "testNew_triggeredSend", "NewSlotTrigger": 0, "Priority": 4, - "SendClassification": { - "CustomerKey": "Default Transactional" - }, "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", "r__email_Name": "Sporting Goods for September", - "r__folder_Path": "Triggered Sends" + "r__folder_Path": "Triggered Sends", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/template-expected.json b/test/resources/9999999/triggeredSend/template-expected.json index 0dd1252a2..f69ed0d3c 100644 --- a/test/resources/9999999/triggeredSend/template-expected.json +++ b/test/resources/9999999/triggeredSend/template-expected.json @@ -18,12 +18,11 @@ "Name": "{{{prefix}}}triggeredSend", "NewSlotTrigger": 0, "Priority": 4, - "SendClassification": { - "CustomerKey": "Default Transactional" - }, "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", "r__email_Name": "Sporting Goods for September", - "r__folder_Path": "Triggered Sends" + "r__folder_Path": "Triggered Sends", + "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", + "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile" } diff --git a/test/resources/9999999/triggeredSendDefinition/create-response.xml b/test/resources/9999999/triggeredSendDefinition/create-response.xml index decdebd9d..b4ba29764 100644 --- a/test/resources/9999999/triggeredSendDefinition/create-response.xml +++ b/test/resources/9999999/triggeredSendDefinition/create-response.xml @@ -43,8 +43,13 @@ - Default Transactional + testExisting_sendClassification + + + + testExisting_senderProfile + unsubscribe unsubscribe@emails.mcdev.accenture.com false diff --git a/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml b/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml index 174140d06..83f6115b8 100644 --- a/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml +++ b/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml @@ -39,8 +39,13 @@ - Default Transactional + testExisting_sendClassification + + + + testExisting_senderProfile + unsubscribe unsubscribe@emails.mcdev.accenture.com false diff --git a/test/resources/9999999/triggeredSendDefinition/update-response.xml b/test/resources/9999999/triggeredSendDefinition/update-response.xml index 036e60f5e..f30cf9c50 100644 --- a/test/resources/9999999/triggeredSendDefinition/update-response.xml +++ b/test/resources/9999999/triggeredSendDefinition/update-response.xml @@ -42,8 +42,13 @@ - Default Transactional + testExisting_sendClassification + + + + testExisting_senderProfile + unsubscribe unsubscribe@emails.mcdev.accenture.com false diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index b11154108..5fd16de52 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -36,7 +36,7 @@ describe('type: triggeredSend', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 10, + 12, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -75,7 +75,7 @@ describe('type: triggeredSend', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 12, + 14, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; @@ -122,7 +122,7 @@ describe('type: triggeredSend', () => { ); assert.equal( testUtils.getAPIHistoryLength(), - 10, + 12, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; From 5ca998f81f0b582eac59083ab64e6aa14d565efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 16 Apr 2024 17:54:29 +0200 Subject: [PATCH 133/359] #62: prioritize getting content builder emails over classic emails --- lib/metadataTypes/TriggeredSend.js | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 8d42e3b14..3f9929371 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -115,27 +115,27 @@ class TriggeredSend extends MetadataType { } // email try { - // classic - const classicEmail = cache.searchForField('email', metadata.Email.ID, 'ID', 'Name'); - metadata.r__email_Name = classicEmail; + // content builder + const contentBuilderEmailName = cache.searchForField( + 'asset', + metadata.Email.ID, + 'legacyData.legacyId', + 'name' + ); + metadata.r__assetMessage_Name_readOnly = contentBuilderEmailName; + const contentBuilderEmailKey = cache.searchForField( + 'asset', + metadata.Email.ID, + 'legacyData.legacyId', + 'customerKey' + ); + metadata.r__assetMessage_Key = contentBuilderEmailKey; delete metadata.Email; } catch { try { - // content builder - const contentBuilderEmailName = cache.searchForField( - 'asset', - metadata.Email.ID, - 'legacyData.legacyId', - 'name' - ); - metadata.r__assetMessage_Name_readOnly = contentBuilderEmailName; - const contentBuilderEmailKey = cache.searchForField( - 'asset', - metadata.Email.ID, - 'legacyData.legacyId', - 'customerKey' - ); - metadata.r__assetMessage_Key = contentBuilderEmailKey; + // classic + const classicEmail = cache.searchForField('email', metadata.Email.ID, 'ID', 'Name'); + metadata.r__email_Name = classicEmail; delete metadata.Email; } catch { Util.logger.verbose( From 9f94ed60c25006451476aa26dad8605337fd5f48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 17 Apr 2024 15:27:37 +0200 Subject: [PATCH 134/359] #62: resolve sendClassification, deliveryProfile and senderProfile in emailSend --- lib/metadataTypes/EmailSend.js | 97 +++++++++++- .../definitions/EmailSend.definition.js | 17 ++- ...testExisting_emailSend.emailSend-meta.json | 36 +++++ .../testNew_emailSend.emailSend-meta.json | 36 +++++ .../dataExtension/retrieve-response.xml | 28 +++- ...ontentType=userinitiatedsends-response.xml | 48 ++++++ .../9999999/emailSend/build-expected.json | 43 ++++++ .../9999999/emailSend/get-expected.json | 43 ++++++ .../9999999/emailSend/patch-expected.json | 41 +++++ .../9999999/emailSend/post-expected.json | 41 +++++ .../9999999/emailSend/template-expected.json | 43 ++++++ .../emailSendDefinition/create-response.xml | 98 ++++++++++++ .../emailSendDefinition/delete-response.xml | 36 +++++ ...tionnotEqualsSFSendDefinition-response.xml | 26 +++- .../emailSendDefinition/update-response.xml | 97 ++++++++++++ test/type.dataExtension.test.js | 8 +- test/type.emailSend.test.js | 144 ++++++++++++++++++ 17 files changed, 864 insertions(+), 18 deletions(-) create mode 100644 test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json create mode 100644 test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json create mode 100644 test/resources/9999999/dataFolder/retrieve-ContentType=userinitiatedsends-response.xml create mode 100644 test/resources/9999999/emailSend/build-expected.json create mode 100644 test/resources/9999999/emailSend/get-expected.json create mode 100644 test/resources/9999999/emailSend/patch-expected.json create mode 100644 test/resources/9999999/emailSend/post-expected.json create mode 100644 test/resources/9999999/emailSend/template-expected.json create mode 100644 test/resources/9999999/emailSendDefinition/create-response.xml create mode 100644 test/resources/9999999/emailSendDefinition/delete-response.xml create mode 100644 test/resources/9999999/emailSendDefinition/update-response.xml create mode 100644 test/type.emailSend.test.js diff --git a/lib/metadataTypes/EmailSend.js b/lib/metadataTypes/EmailSend.js index 36fa5fee6..644fd0f32 100644 --- a/lib/metadataTypes/EmailSend.js +++ b/lib/metadataTypes/EmailSend.js @@ -183,7 +183,7 @@ class EmailSend extends MetadataType { if (sdl.r__dataExtension_Key) { if (sdl.DataSourceTypeID !== 'CustomObject') { throw new Error( - ` ☇ skipping ${this.definition.type} ${metadata.Name} (${metadata.CustomerKey}): Expecting DataSourceTypeID to equal 'CustomObject' when r__dataExtension_Key is defined; Found '${sdl.DataSourceTypeID}'` + `Expecting DataSourceTypeID to equal 'CustomObject' when r__dataExtension_Key is defined; Found '${sdl.DataSourceTypeID}'` ); } sdl.CustomObjectID = cache.searchForField( @@ -195,7 +195,7 @@ class EmailSend extends MetadataType { delete sdl.r__dataExtension_Key; } else if (sdl.DataSourceTypeID === 'CustomObject') { throw new Error( - ` ☇ skipping ${this.definition.type} ${metadata.Name} (${metadata.CustomerKey}): Expecting r__dataExtension_Key to be defined if DataSourceTypeID='CustomObject'` + `Expecting r__dataExtension_Key to be defined if DataSourceTypeID='CustomObject'` ); } if (!sdl.SalesForceObjectID || sdl.SalesForceObjectID === '') { @@ -208,13 +208,49 @@ class EmailSend extends MetadataType { ID: cache.getListObjectId(sdl.r__list_PathName, 'ID'), }; delete sdl.r__list_PathName; - } else { + } else if (sdl.SendDefinitionListType === 'SourceList') { + // dont throw an error for type 'ExclusionList' throw new Error( - ` ☇ skipping ${this.definition.type} ${metadata.Name} (${metadata.CustomerKey}) Field SendDefinitionList.r__list_PathName was not defined. Please try re-retrieving this ESD from your source BU.` + `Field SendDefinitionList.r__list_PathName was not defined. Please try re-retrieving this ESD from your source BU.` ); } } + // sender profile + if (metadata.r__senderProfile_CustomerKey) { + cache.searchForField( + 'senderProfile', + metadata.r__senderProfile_CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.SenderProfile = { + CustomerKey: metadata.r__senderProfile_CustomerKey, + }; + delete metadata.r__senderProfile_CustomerKey; + } + // send classification + if (metadata.r__sendClassification_CustomerKey) { + cache.searchForField( + 'sendClassification', + metadata.r__sendClassification_CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.SendClassification = { + CustomerKey: metadata.r__sendClassification_CustomerKey, + }; + delete metadata.r__sendClassification_CustomerKey; + } + // delivery profile + if (metadata.r__deliveryProfile_key) { + cache.searchForField('deliveryProfile', metadata.r__deliveryProfile_key, 'key', 'key'); + metadata.DeliveryProfile = { + CustomerKey: metadata.r__deliveryProfile_key, + }; + delete metadata.r__deliveryProfile_key; + } + return metadata; } @@ -319,6 +355,59 @@ class EmailSend extends MetadataType { } } + // sender profile + if (metadata.SenderProfile?.CustomerKey) { + try { + cache.searchForField( + 'senderProfile', + metadata.SenderProfile.CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.r__senderProfile_CustomerKey = metadata.SenderProfile.CustomerKey; + delete metadata.SenderProfile; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}` + ); + } + } + // send classification + if (metadata.SendClassification?.CustomerKey) { + try { + cache.searchForField( + 'sendClassification', + metadata.SendClassification.CustomerKey, + 'CustomerKey', + 'CustomerKey' + ); + metadata.r__sendClassification_CustomerKey = + metadata.SendClassification.CustomerKey; + delete metadata.SendClassification; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}` + ); + } + } + // delivery profile + if (metadata.DeliveryProfile?.CustomerKey) { + try { + cache.searchForField( + 'deliveryProfile', + metadata.DeliveryProfile.CustomerKey, + 'key', + 'key' + ); + metadata.r__deliveryProfile_key = metadata.DeliveryProfile.CustomerKey; + delete metadata.DeliveryProfile; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata.CustomerKey}: ${ex.message}` + ); + } + } + return metadata; } } diff --git a/lib/metadataTypes/definitions/EmailSend.definition.js b/lib/metadataTypes/definitions/EmailSend.definition.js index c839d0409..584caed9e 100644 --- a/lib/metadataTypes/definitions/EmailSend.definition.js +++ b/lib/metadataTypes/definitions/EmailSend.definition.js @@ -1,6 +1,15 @@ export default { bodyIteratorField: 'Results', - dependencies: ['folder-userinitiatedsends', 'email', 'asset-message', 'dataExtension', 'list'], // filter(+), sendClassification(+), SenderProfile(n/a), DeliveryProfile(n/a) + dependencies: [ + 'folder-userinitiatedsends', + 'email', + 'asset-message', + 'dataExtension', + 'list', + 'sendClassification', + 'senderProfile', + 'deliveryProfile', + ], // filter(+) folderType: 'userinitiatedsends', hasExtended: false, idField: 'ObjectID', @@ -468,6 +477,9 @@ export default { retrieving: false, templating: false, }, + 'SendDefinitionList[].r__list_PathName': { + skipValidation: true, + }, 'SenderProfile.CustomerKey': { isCreateable: true, isUpdateable: true, @@ -556,5 +568,8 @@ export default { r__assetMessage_Key: { skipValidation: true }, r__email_Name: { skipValidation: true }, r__folder_Path: { skipValidation: true }, + r__senderProfile_CustomerKey: { skipValidation: true }, + r__sendClassification_CustomerKey: { skipValidation: true }, + r__deliveryProfile_key: { skipValidation: true }, }, }; diff --git a/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json new file mode 100644 index 000000000..6d929d3f0 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json @@ -0,0 +1,36 @@ +{ + "Additional": "", + "AutoBccEmail": "", + "BccEmail": "", + "CCEmail": "", + "CreatedDate": "2022-11-14T12:27:29.963", + "CustomerKey": "testExisting_emailSend", + "DeduplicateByEmail": false, + "Description": "updated on deploy", + "DynamicEmailSubject": "someSubject", + "EmailSubject": "someSubject", + "ExclusionFilter": "", + "IsMultipart": true, + "IsSendLogging": false, + "IsWrapped": true, + "ModifiedDate": "2022-11-14T12:27:29.963", + "Name": "testExisting_emailSend", + "SendDefinitionList": [ + { + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "SendDefinitionListType": "SourceList", + "r__dataExtension_Key": "testExisting_dataExtension", + "r__list_PathName": "Publication Lists/Demo Publication List" + } + ], + "SuppressTracking": false, + "TestEmailAddr": "", + "r__assetMessage_Key": "testExisting_asset_message", + "r__assetMessage_Name": "testExisting_asset_message", + "r__deliveryProfile_key": "Default", + "r__folder_Path": "User-Initiated", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" +} diff --git a/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json new file mode 100644 index 000000000..f6f6302a4 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json @@ -0,0 +1,36 @@ +{ + "Additional": "", + "AutoBccEmail": "", + "BccEmail": "", + "CCEmail": "", + "CreatedDate": "2022-11-14T12:27:29.963", + "CustomerKey": "testNew_emailSend", + "DeduplicateByEmail": false, + "Description": "created on deploy", + "DynamicEmailSubject": "testExisting_asset_email", + "EmailSubject": "testExisting_asset_email", + "ExclusionFilter": "", + "IsMultipart": true, + "IsSendLogging": false, + "IsWrapped": true, + "ModifiedDate": "2022-11-14T12:27:29.963", + "Name": "testNew_emailSend", + "SendDefinitionList": [ + { + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "SendDefinitionListType": "SourceList", + "r__dataExtension_Key": "testExisting_dataExtension", + "r__list_PathName": "Publication Lists/Demo Publication List" + } + ], + "SuppressTracking": false, + "TestEmailAddr": "", + "r__assetMessage_Key": "testExisting_asset_message", + "r__assetMessage_Name": "testExisting_asset_message", + "r__deliveryProfile_key": "Default", + "r__folder_Path": "User-Initiated", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" +} diff --git a/test/resources/9999999/dataExtension/retrieve-response.xml b/test/resources/9999999/dataExtension/retrieve-response.xml index e7cf0d2ef..1cc8aeb08 100644 --- a/test/resources/9999999/dataExtension/retrieve-response.xml +++ b/test/resources/9999999/dataExtension/retrieve-response.xml @@ -47,6 +47,32 @@ 2 + + + 2022-04-21T06:56:27.927 + 2022-04-21T06:56:27.927 + 21711373-72c1-ec11-b83b-exclusion + testExisting_dataExtension_exclusion + testExisting_dataExtension_exclusion + bla bla + true + true + + + + ContactKey + + + _SubscriberKey + + 6 + 5 + true + false + false + + 2 + - \ No newline at end of file + diff --git a/test/resources/9999999/dataFolder/retrieve-ContentType=userinitiatedsends-response.xml b/test/resources/9999999/dataFolder/retrieve-ContentType=userinitiatedsends-response.xml new file mode 100644 index 000000000..b2b920e20 --- /dev/null +++ b/test/resources/9999999/dataFolder/retrieve-ContentType=userinitiatedsends-response.xml @@ -0,0 +1,48 @@ + + + + RetrieveResponse + urn:uuid:1512750f-32c9-4e70-adfe-6863acb037b4 + urn:uuid:58a10fa7-12d7-4221-9d70-028add22d7be + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-16T16:38:36Z + 2024-04-16T16:43:36Z + + + + + + OK + f0fec0a3-586b-4da9-95d3-ed47245d395c + + + 9999999 + + + 2021-06-21T11:54:58.023 + 2021-06-21T11:54:58.023 + 4691 + + userinitiatedsends_default + + + 0 + + + User-Initiated + + userinitiatedsends + true + false + true + + + + diff --git a/test/resources/9999999/emailSend/build-expected.json b/test/resources/9999999/emailSend/build-expected.json new file mode 100644 index 000000000..d1e1c0094 --- /dev/null +++ b/test/resources/9999999/emailSend/build-expected.json @@ -0,0 +1,43 @@ +{ + "Additional": "", + "AutoBccEmail": "", + "BccEmail": "", + "CCEmail": "", + "CreatedDate": "2022-11-14T12:27:29.963", + "CustomerKey": "testTemplated_emailSend", + "DeduplicateByEmail": false, + "Description": "some description", + "DynamicEmailSubject": "someSubject", + "EmailSubject": "someSubject", + "ExclusionFilter": "Domain(emailaddr) != \"accenture.com\"", + "IsMultipart": true, + "IsSendLogging": false, + "IsWrapped": true, + "ModifiedDate": "2022-11-14T12:27:29.963", + "Name": "testTemplated_emailSend", + "SendDefinitionList": [ + { + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "SendDefinitionListType": "ExclusionList", + "r__dataExtension_Key": "testTemplated_dataExtension_exclusion" + }, + { + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "SendDefinitionListType": "SourceList", + "r__dataExtension_Key": "testTemplated_dataExtension", + "r__list_PathName": "Publication Lists/Demo Publication List" + } + ], + "SuppressTracking": false, + "TestEmailAddr": "", + "r__assetMessage_Key": "testTemplated_asset_message", + "r__assetMessage_Name": "testTemplated_asset_message", + "r__deliveryProfile_key": "Default", + "r__folder_Path": "User-Initiated", + "r__sendClassification_CustomerKey": "testTemplated_sendClassification", + "r__senderProfile_CustomerKey": "testTemplated_senderProfile" +} diff --git a/test/resources/9999999/emailSend/get-expected.json b/test/resources/9999999/emailSend/get-expected.json new file mode 100644 index 000000000..fb715576c --- /dev/null +++ b/test/resources/9999999/emailSend/get-expected.json @@ -0,0 +1,43 @@ +{ + "Additional": "", + "AutoBccEmail": "", + "BccEmail": "", + "CCEmail": "", + "CreatedDate": "2022-11-14T12:27:29.963", + "CustomerKey": "testExisting_emailSend", + "DeduplicateByEmail": false, + "Description": "some description", + "DynamicEmailSubject": "someSubject", + "EmailSubject": "someSubject", + "ExclusionFilter": "Domain(emailaddr) != \"accenture.com\"", + "IsMultipart": true, + "IsSendLogging": false, + "IsWrapped": true, + "ModifiedDate": "2022-11-14T12:27:29.963", + "Name": "testExisting_emailSend", + "SendDefinitionList": [ + { + "SendDefinitionListType": "ExclusionList", + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "r__dataExtension_Key": "testExisting_dataExtension_exclusion" + }, + { + "SendDefinitionListType": "SourceList", + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "r__dataExtension_Key": "testExisting_dataExtension", + "r__list_PathName": "Publication Lists/Demo Publication List" + } + ], + "SuppressTracking": false, + "TestEmailAddr": "", + "r__assetMessage_Key": "testExisting_asset_message", + "r__assetMessage_Name": "testExisting_asset_message", + "r__deliveryProfile_key": "Default", + "r__folder_Path": "User-Initiated", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" +} diff --git a/test/resources/9999999/emailSend/patch-expected.json b/test/resources/9999999/emailSend/patch-expected.json new file mode 100644 index 000000000..9aca8fbb7 --- /dev/null +++ b/test/resources/9999999/emailSend/patch-expected.json @@ -0,0 +1,41 @@ +{ + "Additional": "", + "AutoBccEmail": "", + "BccEmail": "", + "CCEmail": "", + "CustomerKey": "testExisting_emailSend", + "DeduplicateByEmail": false, + "Description": "updated on deploy", + "DynamicEmailSubject": "someSubject", + "EmailSubject": "someSubject", + "ExclusionFilter": "", + "IsMultipart": true, + "IsSendLogging": false, + "IsWrapped": true, + "Name": "testExisting_emailSend", + "SendDefinitionList": [ + { + "SendDefinitionListType": "ExclusionList", + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "r__dataExtension_Key": "testExisting_dataExtension_exclusion" + }, + { + "SendDefinitionListType": "SourceList", + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "r__dataExtension_Key": "testExisting_dataExtension", + "r__list_PathName": "Publication Lists/Demo Publication List" + } + ], + "SuppressTracking": false, + "TestEmailAddr": "", + "r__assetMessage_Key": "testExisting_asset_message", + "r__assetMessage_Name": "testExisting_asset_message", + "r__deliveryProfile_key": "Default", + "r__folder_Path": "User-Initiated", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" +} diff --git a/test/resources/9999999/emailSend/post-expected.json b/test/resources/9999999/emailSend/post-expected.json new file mode 100644 index 000000000..d8d2e93c8 --- /dev/null +++ b/test/resources/9999999/emailSend/post-expected.json @@ -0,0 +1,41 @@ +{ + "Additional": "", + "AutoBccEmail": "", + "BccEmail": "", + "CCEmail": "", + "CustomerKey": "testNew_emailSend", + "DeduplicateByEmail": false, + "Description": "created on deploy", + "DynamicEmailSubject": "testExisting_asset_email", + "EmailSubject": "testExisting_asset_email", + "ExclusionFilter": "", + "IsMultipart": true, + "IsSendLogging": false, + "IsWrapped": true, + "Name": "testNew_emailSend", + "SendDefinitionList": [ + { + "SendDefinitionListType": "ExclusionList", + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "r__dataExtension_Key": "testExisting_dataExtension_exclusion" + }, + { + "SendDefinitionListType": "SourceList", + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "r__dataExtension_Key": "testExisting_dataExtension", + "r__list_PathName": "Publication Lists/Demo Publication List" + } + ], + "SuppressTracking": false, + "TestEmailAddr": "", + "r__assetMessage_Key": "testExisting_asset_message", + "r__assetMessage_Name": "testExisting_asset_message", + "r__deliveryProfile_key": "Default", + "r__folder_Path": "User-Initiated", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_CustomerKey": "testExisting_senderProfile" +} diff --git a/test/resources/9999999/emailSend/template-expected.json b/test/resources/9999999/emailSend/template-expected.json new file mode 100644 index 000000000..122c43004 --- /dev/null +++ b/test/resources/9999999/emailSend/template-expected.json @@ -0,0 +1,43 @@ +{ + "Additional": "", + "AutoBccEmail": "", + "BccEmail": "", + "CCEmail": "", + "CreatedDate": "2022-11-14T12:27:29.963", + "CustomerKey": "{{{prefix}}}emailSend", + "DeduplicateByEmail": false, + "Description": "some description", + "DynamicEmailSubject": "someSubject", + "EmailSubject": "someSubject", + "ExclusionFilter": "Domain(emailaddr) != \"accenture.com\"", + "IsMultipart": true, + "IsSendLogging": false, + "IsWrapped": true, + "ModifiedDate": "2022-11-14T12:27:29.963", + "Name": "{{{prefix}}}emailSend", + "SendDefinitionList": [ + { + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "SendDefinitionListType": "ExclusionList", + "r__dataExtension_Key": "{{{prefix}}}dataExtension_exclusion" + }, + { + "DataSourceTypeID": "CustomObject", + "IsTestObject": false, + "Name": "", + "SendDefinitionListType": "SourceList", + "r__dataExtension_Key": "{{{prefix}}}dataExtension", + "r__list_PathName": "Publication Lists/Demo Publication List" + } + ], + "SuppressTracking": false, + "TestEmailAddr": "", + "r__assetMessage_Key": "{{{prefix}}}asset_message", + "r__assetMessage_Name": "{{{prefix}}}asset_message", + "r__deliveryProfile_key": "Default", + "r__folder_Path": "User-Initiated", + "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", + "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile" +} diff --git a/test/resources/9999999/emailSendDefinition/create-response.xml b/test/resources/9999999/emailSendDefinition/create-response.xml new file mode 100644 index 000000000..974b6ca59 --- /dev/null +++ b/test/resources/9999999/emailSendDefinition/create-response.xml @@ -0,0 +1,98 @@ + + + + CreateResponse + urn:uuid:a717abcf-ef43-42a9-af53-69d95f93cf4a + urn:uuid:38efc94c-5fea-43e3-8689-fd26ec03d091 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-17T12:57:44Z + 2024-04-17T13:02:44Z + + + + + + + OK + EmailSendDefinition created + 0 + 0 + ce281713-bafc-ee11-a5c8-5cba2c6fc270 + + + ce281713-bafc-ee11-a5c8-5cba2c6fc270 + testNew_emailSend + false + testNew_emailSend + created on deploy + 4691 + + + + testExisting_sendClassification + + + + + testExisting_senderProfile + + + + + Default + + false + false + + + + ExclusionList + 21711373-72c1-ec11-b83b-exclusion + CustomObject + false + + + + + + + + 114 + + + SourceList + 21711373-72c1-ec11-b83b-48df37d1deb7 + CustomObject + false + + + + + 531213 + + + + + + testExisting_asset_email + testExisting_asset_email + true + true + false + + + + + + 8a548392-c00a-4909-97d3-85b5a9305d35 + OK + + + diff --git a/test/resources/9999999/emailSendDefinition/delete-response.xml b/test/resources/9999999/emailSendDefinition/delete-response.xml new file mode 100644 index 000000000..224c1e5a3 --- /dev/null +++ b/test/resources/9999999/emailSendDefinition/delete-response.xml @@ -0,0 +1,36 @@ + + + + DeleteResponse + urn:uuid:b9803c4e-4d42-44c3-87fe-3b216ee29eb4 + urn:uuid:7b32fd02-7791-4e57-9a18-50936e575c9a + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-17T13:26:48Z + 2024-04-17T13:31:48Z + + + + + + + OK + EmailSendDefinition deleted + 0 + + + 748400fc-b3fc-ee11-a5c8-5cba2c6fc270 + testExisting_emailSend + + + 02ef6a83-36cc-402e-901e-c24d49cc0e3c + OK + + + diff --git a/test/resources/9999999/emailSendDefinition/retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml b/test/resources/9999999/emailSendDefinition/retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml index 88e1614f0..010771305 100644 --- a/test/resources/9999999/emailSendDefinition/retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml +++ b/test/resources/9999999/emailSendDefinition/retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml @@ -30,16 +30,16 @@ false testExisting_emailSend some description - 290820 + 4691 - test_send_classification + testExisting_sendClassification - Test_sender + testExisting_senderProfile @@ -48,16 +48,26 @@ false false + + + 9d1c7bf9-4964-ed11-b849-48df37d1de8c + ExclusionList + 21711373-72c1-ec11-b83b-exclusion + CustomObject + false + + + 9d1c7bf9-4964-ed11-b849-48df37d1de8b - 32308 + 114 SourceList - 2c19d707-743e-ed11-b848-48df37b24911 + 21711373-72c1-ec11-b83b-48df37d1deb7 CustomObject false @@ -65,7 +75,7 @@ - 676709 + 531213 @@ -76,10 +86,10 @@ true true false - + Domain(emailaddr) != "accenture.com" - \ No newline at end of file + diff --git a/test/resources/9999999/emailSendDefinition/update-response.xml b/test/resources/9999999/emailSendDefinition/update-response.xml new file mode 100644 index 000000000..75bb1a8f0 --- /dev/null +++ b/test/resources/9999999/emailSendDefinition/update-response.xml @@ -0,0 +1,97 @@ + + + + UpdateResponse + urn:uuid:166b4a28-09e8-444b-ac08-91a7fb32af13 + urn:uuid:95dd02cf-53a5-4bd7-acaf-4c0609f81912 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-17T12:55:18Z + 2024-04-17T13:00:18Z + + + + + + + OK + EmailSendDefinition updated + 0 + + + 748400fc-b3fc-ee11-a5c8-5cba2c6fc270 + testExisting_emailSend + false + testExisting_emailSend + updated on deploy + 4691 + + + + testExisting_sendClassification + + + + + testExisting_senderProfile + + + + + Default + + false + false + + + + ExclusionList + 21711373-72c1-ec11-b83b-exclusion + CustomObject + false + + + + + + + + 114 + + + SourceList + 21711373-72c1-ec11-b83b-48df37d1deb7 + CustomObject + false + + + + + 531213 + + testExisting_asset_email + + + + + someSubject + someSubject + true + true + false + + + + + + d961a829-bcbc-4f74-bbf3-66c3f391d471 + OK + + + diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index 6b2e1310f..c2bf5791d 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -28,8 +28,8 @@ describe('type: dataExtension', () => { const result = cache.getCache(); assert.equal( result.dataExtension ? Object.keys(result.dataExtension).length : 0, - 1, - 'only one dataExtension expected' + 2, + 'only 2 dataExtension expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_dataExtension', 'dataExtension'), @@ -119,8 +119,8 @@ describe('type: dataExtension', () => { const result = cache.getCache(); assert.equal( result.dataExtension ? Object.keys(result.dataExtension).length : 0, - 3, - 'three dataExtensions expected' + 4, + '4 dataExtensions expected' ); // insert assert.deepEqual( diff --git a/test/type.emailSend.test.js b/test/type.emailSend.test.js new file mode 100644 index 000000000..54d12e0ad --- /dev/null +++ b/test/type.emailSend.test.js @@ -0,0 +1,144 @@ +import * as chai from 'chai'; +const assert = chai.assert; + +import chaiFiles from 'chai-files'; +import cache from '../lib/util/cache.js'; +import * as testUtils from './utils.js'; +import handler from '../lib/index.js'; +chai.use(chaiFiles); + +describe('type: emailSend', () => { + beforeEach(() => { + testUtils.mockSetup(); + }); + + afterEach(() => { + testUtils.mockReset(); + }); + + describe('Retrieve ================', () => { + it('Should retrieve a emailSend', async () => { + // WHEN + await handler.retrieve('testInstance/testBU', ['emailSend']); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.emailSend ? Object.keys(result.emailSend).length : 0, + 1, + 'only 1 emailSend expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_emailSend', 'emailSend'), + await testUtils.getExpectedJson('9999999', 'emailSend', 'get'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 16, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Deploy ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + + it('Should create & upsert a emailSend', async () => { + // WHEN + + await handler.deploy('testInstance/testBU', ['emailSend']); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.emailSend ? Object.keys(result.emailSend).length : 0, + 2, + '2 emailSends expected' + ); + // confirm created item + assert.deepEqual( + await testUtils.getActualJson('testNew_emailSend', 'emailSend'), + await testUtils.getExpectedJson('9999999', 'emailSend', 'post'), + 'returned new-JSON was not equal expected for insert emailSend' + ); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson('testExisting_emailSend', 'emailSend'), + await testUtils.getExpectedJson('9999999', 'emailSend', 'patch'), + 'returned existing-JSON was not equal expected for update emailSend' + ); + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 18, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Templating ================', () => { + it('Should create a emailSend template via buildTemplate and build it', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['emailSend']); + // buildTemplate + const result = await handler.buildTemplate( + 'testInstance/testBU', + 'emailSend', + ['testExisting_emailSend'], + 'testSourceMarket' + ); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); + assert.equal( + result.emailSend ? Object.keys(result.emailSend).length : 0, + 1, + 'only one emailSend expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_emailSend', 'emailSend'), + await testUtils.getExpectedJson('9999999', 'emailSend', 'template'), + 'returned template JSON was not equal expected' + ); + // buildDefinition + await handler.buildDefinition( + 'testInstance/testBU', + 'emailSend', + 'testExisting_emailSend', + 'testTargetMarket' + ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_emailSend', 'emailSend'), + await testUtils.getExpectedJson('9999999', 'emailSend', 'build'), + 'returned deployment JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 16, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Delete ================', () => { + it('Should delete the item', async () => { + // WHEN + const isDeleted = await handler.deleteByKey( + 'testInstance/testBU', + 'emailSend', + 'testExisting_emailSend' + ); + // THEN + assert.equal(process.exitCode, 0, 'deleteByKey should not have thrown an error'); + assert.equal(isDeleted, true, 'deleteByKey should have returned true'); + return; + }); + }); +}); From df6ce4ebb8ee323d96c7106fcc92fada27bf5368 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 17 Apr 2024 15:30:32 +0200 Subject: [PATCH 135/359] #0: fix bad counter --- .../9999999/asset/v1/content/assets/query/post-response.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response.json b/test/resources/9999999/asset/v1/content/assets/query/post-response.json index 864d9b969..b022f0940 100644 --- a/test/resources/9999999/asset/v1/content/assets/query/post-response.json +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response.json @@ -1,5 +1,5 @@ { - "count": 2, + "count": 3, "page": 1, "pageSize": 50, "links": {}, From 15177548a07c772ead4c9f75aa646846cff8a5fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 17 Apr 2024 17:50:10 +0200 Subject: [PATCH 136/359] #62: resolve transactionalEmail & dataExtension for transactional journeys --- lib/metadataTypes/Journey.js | 64 ++++++++++++------- .../definitions/Journey.definition.js | 1 + 2 files changed, 42 insertions(+), 23 deletions(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 54dbd5fdd..56f7be633 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -457,6 +457,22 @@ class Journey extends MetadataType { }): metaData.highThroughput.definitionKey not matching key in configurationArguments.transactionalEmailKey` ); } + activity.configurationArguments.r__transactionalEmail_definitionKey = + activity.configurationArguments.triggeredSendKey; + delete activity.configurationArguments.triggeredSendKey; + delete activity.configurationArguments.triggeredSendId; + delete activity.metaData.highThroughput.definitionKey; + + if (activity.metaData?.highThroughput?.dataExtensionId) { + activity.metaData.highThroughput.r__dataExtension_CustomerKey = + cache.searchForField( + 'dataExtension', + activity.metaData.highThroughput.dataExtensionId, + 'ObjectID', + 'CustomerKey' + ); + delete activity.metaData.highThroughput.dataExtensionId; + } } catch (ex) { Util.logger.warn( ` - ${this.definition.type} ${ @@ -761,31 +777,33 @@ class Journey extends MetadataType { // ! transactional (email) journeys only have one activity (type=EMAILV2) which links back to the transactionalEmail () switch (metadata.channel) { case 'email': { - if ( - metadata.activities?.length > 0 && - metadata.activities[0].configurationArguments?.triggeredSendKey - ) { + const activity = metadata.activities[0]; + if (activity.configurationArguments?.r__transactionalEmail_definitionKey) { // trigger found; there can only be one entry in this array - metadata.activities[0].configurationArguments.triggeredSendId = - cache.searchForField( - 'transactionalEmail', - metadata.activities[0].configurationArguments?.triggeredSendKey, - 'definitionKey', - 'definitionId' - ); - if ( - metadata.activities[0].metaData?.highThroughput?.definitionKey && - metadata.activities[0].metaData?.highThroughput?.definitionKey != - metadata.activities[0].configurationArguments?.triggeredSendKey - ) { - throw new Error( - ` - ${this.definition.type} ${ - metadata[this.definition.nameField] - } (${ - metadata[this.definition.keyField] - }): metaData.highThroughput.definitionKey not matching key in configurationArguments.transactionalEmailKey` - ); + activity.configurationArguments.triggeredSendId = cache.searchForField( + 'transactionalEmail', + activity.configurationArguments.r__transactionalEmail_definitionKey, + 'definitionKey', + 'definitionId' + ); + activity.configurationArguments.triggeredSendKey = + activity.configurationArguments.r__transactionalEmail_definitionKey; + if (activity.metaData?.highThroughput) { + activity.metaData.highThroughput.definitionKey = + activity.configurationArguments.r__transactionalEmail_definitionKey; } + delete activity.configurationArguments + .r__transactionalEmail_definitionKey; + } + + if (activity.metaData?.highThroughput?.r__dataExtension_CustomerKey) { + activity.metaData.highThroughput.dataExtensionId = cache.searchForField( + 'dataExtension', + activity.metaData.highThroughput.r__dataExtension_CustomerKey, + 'CustomerKey', + 'ObjectID' + ); + delete activity.metaData.highThroughput.r__dataExtension_CustomerKey; } break; diff --git a/lib/metadataTypes/definitions/Journey.definition.js b/lib/metadataTypes/definitions/Journey.definition.js index 5a58ed9c5..2d0999c63 100644 --- a/lib/metadataTypes/definitions/Journey.definition.js +++ b/lib/metadataTypes/definitions/Journey.definition.js @@ -7,6 +7,7 @@ export default { dependencies: [ 'folder-journey', 'triggeredSend', // for EMAILV2-activity + 'dataExtension', // for transactionalEmails: EMAILV2-activity 'event', // for Multistep and Quicksend journeys 'mobileMessage', // for SMSSYNC-activity 'mobileCode', // for SMSSYNC-activity From b2234552888688d038ae6cbc938a7eca451a0b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 17 Apr 2024 17:52:57 +0200 Subject: [PATCH 137/359] #62: resolve list, email/asset, sendClassification & senderProfile for journeys --- lib/metadataTypes/Journey.js | 148 ++++++++++++++++++ .../definitions/Journey.definition.js | 5 + lib/util/cache.js | 4 +- 3 files changed, 155 insertions(+), 2 deletions(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 56f7be633..d03e22d3a 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -481,6 +481,9 @@ class Journey extends MetadataType { ); } } + // ~~~ ACTIVITIES ~~~~ + + this._postRetrieveTasks_activities(metadata); break; } @@ -551,6 +554,95 @@ class Journey extends MetadataType { ); } + const triggeredSend = activity.configurationArguments?.triggeredSend; + if (triggeredSend) { + // List (optional) + if (triggeredSend.publicationListId) { + try { + triggeredSend.r__list_PathName = cache.getListPathName( + triggeredSend.publicationListId, + 'ID' + ); + delete triggeredSend.publicationListId; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.typeName} '${metadata.name}'/'${metadata.key}': ${ex.message}` + ); + // save this TSD because it could be fixed by the user + } + } + + // sender profile + if (triggeredSend.senderProfileId) { + try { + triggeredSend.r__senderProfile_CustomerKey = cache.searchForField( + 'senderProfile', + triggeredSend.senderProfileId, + 'ObjectID', + 'CustomerKey' + ); + delete triggeredSend.senderProfileId; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata.key}: ${ex.message}` + ); + } + } + // send classification + if (triggeredSend.sendClassificationId) { + try { + triggeredSend.r__sendClassification_CustomerKey = + cache.searchForField( + 'sendClassification', + triggeredSend.sendClassificationId, + 'ObjectID', + 'CustomerKey' + ); + delete triggeredSend.sendClassificationId; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata.key}: ${ex.message}` + ); + } + } + // delivery profile + if (triggeredSend.deliveryProfileId) { + // remove it because we cannot resolve it and it should be set by selecting the sendClassification + delete triggeredSend.deliveryProfileId; + } + // email + try { + // content builder + triggeredSend.r__assetMessage_Name_readOnly = cache.searchForField( + 'asset', + triggeredSend.emailId, + 'legacyData.legacyId', + 'name' + ); + triggeredSend.r__assetMessage_Key = cache.searchForField( + 'asset', + triggeredSend.emailId, + 'legacyData.legacyId', + 'customerKey' + ); + delete triggeredSend.emailId; + } catch { + try { + // classic + triggeredSend.r__email_Name = cache.searchForField( + 'email', + triggeredSend.emailId, + 'ID', + 'Name' + ); + delete triggeredSend.emailId; + } catch { + Util.logger.warn( + ` - ${this.definition.typeName} '${metadata.Name}'/'${metadata.CustomerKey}': Could not find email with ID ${triggeredSend.emailId} in Classic nor in Content Builder. This TSD cannot be republished but potentially restarted with its cached version of the email.` + ); + } + } + } break; } case 'SMSSYNC': { @@ -856,6 +948,62 @@ class Journey extends MetadataType { 'ObjectID' ); } + + const triggeredSend = activity.configurationArguments?.triggeredSend; + if (triggeredSend) { + // List (optional) + if (triggeredSend.r__list_PathName) { + triggeredSend.publicationListId = cache.getListObjectId( + triggeredSend.r__list_PathName, + 'ID' + ); + + delete triggeredSend.r__list_PathName; + } + + // sender profile + if (triggeredSend.r__senderProfile_CustomerKey) { + triggeredSend.senderProfileId = cache.searchForField( + 'senderProfile', + triggeredSend.r__senderProfile_CustomerKey, + 'CustomerKey', + 'ObjectID' + ); + delete triggeredSend.r__senderProfile_CustomerKey; + } + // send classification + if (triggeredSend.r__sendClassification_CustomerKey) { + triggeredSend.sendClassificationId = cache.searchForField( + 'sendClassification', + triggeredSend.r__sendClassification_CustomerKey, + 'CustomerKey', + 'ObjectID' + ); + delete triggeredSend.r__sendClassification_CustomerKey; + } + + // email + if (triggeredSend.r__assetMessage_Key) { + triggeredSend.emailId = cache.searchForField( + 'asset', + triggeredSend.r__assetMessage_Key, + 'customerKey', + 'legacyData.legacyId' + ); + delete triggeredSend.r__assetMessage_Key; + delete triggeredSend.r__assetMessage_Name_readOnly; + } else if (triggeredSend.r__email_Name) { + // classic + triggeredSend.emailId = cache.searchForField( + 'email', + triggeredSend.r__email_Name, + 'Name', + 'ID' + ); + delete triggeredSend.r__email_Name; + } + } + break; } case 'SMSSYNC': { diff --git a/lib/metadataTypes/definitions/Journey.definition.js b/lib/metadataTypes/definitions/Journey.definition.js index 2d0999c63..f75df84e7 100644 --- a/lib/metadataTypes/definitions/Journey.definition.js +++ b/lib/metadataTypes/definitions/Journey.definition.js @@ -13,6 +13,11 @@ export default { 'mobileCode', // for SMSSYNC-activity 'mobileKeyword', // for SMSSYNC-activity 'asset-asset', // for SMSSYNC-activity (sub-subtype jsonmessage) + 'list', // for EMAILV2-activity + 'email', // for EMAILV2-activity + 'asset-message', // for EMAILV2-activity + 'sendClassification', // for EMAILV2-activity + 'senderProfile', // for EMAILV2-activity ], // ! interaction and transactionalEmail both link to each other. caching transactionalEmail here "manually" instead of via dependencies array, assuming that it is quicker than the other way round folderIdField: 'categoryId', hasExtended: false, diff --git a/lib/util/cache.js b/lib/util/cache.js index 9aa2cf8ed..e56088d9b 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -149,7 +149,7 @@ export default { * ! keeping this in util/cache.js rather than in metadataTypes/List.js to avoid potential circular dependencies * * @param {string} searchValue unique identifier of metadata being looked for - * @param {string} searchField ObjectID or ID + * @param {'ObjectID'|'ID'|'CustomerKey'} searchField ObjectID:string(uuid), ID:numeric, CustomerKey:string(name + folder ID) * @returns {string} unique folderPath/ListName combo of list */ getListPathName(searchValue, searchField) { @@ -186,7 +186,7 @@ export default { * ! keeping this in util/cache.js rather than in metadataTypes/List.js to avoid potential circular dependencies * * @param {string} listPathName folderPath/ListName combo of list - * @param {string} returnField ObjectID or ID + * @param {'ObjectID'|'ID'|'CustomerKey'} returnField ObjectID:string(uuid), ID:numeric, CustomerKey:string(name + folder ID) * @returns {string} unique ObjectId of list */ getListObjectId(listPathName, returnField) { From 5580961a6263058643c70c133811a6b3ba9a80bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 17 Apr 2024 18:58:53 +0200 Subject: [PATCH 138/359] #62: resolve details of journey subtype Quicksend --- lib/metadataTypes/Journey.js | 37 ++++-------------------------------- 1 file changed, 4 insertions(+), 33 deletions(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index d03e22d3a..7f5d946bc 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -358,11 +358,6 @@ class Journey extends MetadataType { } case 'Quicksend': { // Single Send Journey - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ - metadata[this.definition.keyField] - }): definitionType Quicksend is not fully supported yet.` - ); // ~~~ TRIGGERS ~~~~ // event && triggers[].type === 'ContactAudience' if ( @@ -397,17 +392,8 @@ class Journey extends MetadataType { } // ~~~ ACTIVITIES ~~~~ - try { - // TODO channel=='email' - // TODO channel=='sms' - // TODO channel=='push' / activities[].type === 'PUSHNOTIFICATIONACTIVITY' - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ - metadata[this.definition.keyField] - }): ${ex.message}.` - ); - } + this._postRetrieveTasks_activities(metadata); + break; } case 'Transactional': { @@ -813,12 +799,6 @@ class Journey extends MetadataType { break; } case 'Quicksend': { - // Single Send Journey - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ - metadata[this.definition.keyField] - }): definitionType Quicksend is not supported yet and might fail to deploy.` - ); // ~~~ TRIGGERS ~~~~ // event && triggers[].type === 'ContactAudience' if ( @@ -843,17 +823,8 @@ class Journey extends MetadataType { } // ~~~ ACTIVITIES ~~~~ - try { - // TODO channel=='email' - // TODO channel=='sms' - // TODO channel=='push' / activities[].type === 'PUSHNOTIFICATIONACTIVITY' - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ - metadata[this.definition.keyField] - }): ${ex.message}.` - ); - } + this._preDeployTasks_activities(metadata); + break; } case 'Transactional': { From 9d1d2f5c41e51c320440b3e732d070c4df23697b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 17 Apr 2024 19:00:08 +0200 Subject: [PATCH 139/359] #62: handle "event key not found" error gracefully --- lib/metadataTypes/Event.js | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index f0a0f415b..242a35266 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -37,14 +37,26 @@ class Event extends MetadataType { */ static retrieve(retrieveDir, _, __, key) { Util.logBeta(this.definition.type); - return super.retrieveREST( - retrieveDir, - `/interaction/v1/EventDefinitions${ - key ? '/key:' + encodeURIComponent(key) : '' - }?extras=all`, - null, - key - ); + try { + return super.retrieveREST( + retrieveDir, + `/interaction/v1/eventDefinitions${ + key ? '/key:' + encodeURIComponent(key) : '' + }?extras=all`, + null, + key + ); + } catch (ex) { + // if the event does not exist, the API returns the error "Request failed with status code 400 (ERR_BAD_REQUEST)" which would otherwise bring execution to a hold + if (key && ex.code === 'ERR_BAD_REQUEST') { + Util.logger.info( + `Downloaded: ${this.definition.type} (0)${Util.getKeysString(key)}` + ); + } else { + throw ex; + } + } + return; } /** @@ -53,7 +65,7 @@ class Event extends MetadataType { * @returns {Promise.} Promise of metadata */ static retrieveForCache() { - return super.retrieveREST(null, '/interaction/v1/EventDefinitions/'); + return this.retrieve(null); } /** @@ -67,7 +79,7 @@ class Event extends MetadataType { static async retrieveAsTemplate(templateDir, name, templateVariables) { Util.logBeta(this.definition.type); const res = await this.client.rest.get( - '/interaction/v1/EventDefinitions?name=' + encodeURIComponent(name) + '/interaction/v1/eventDefinitions?name=' + encodeURIComponent(name) ); const event = res.items.filter((item) => item.name === name); try { From b0a8acb680ca67fd330a22ca98dc9b20a63530de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 17 Apr 2024 19:22:10 +0200 Subject: [PATCH 140/359] #62: simplify type event json --- lib/metadataTypes/Event.js | 59 ++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 242a35266..f31720e3d 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -94,13 +94,13 @@ class Event extends MetadataType { const originalKey = event[0][this.definition.keyField]; const eventDef = JSON.parse( Util.replaceByObject( - JSON.stringify(this.parseMetadata(event[0])), + JSON.stringify(this.postRetrieveTasks(event[0])), templateVariables ) ); if (!eventDef.dataExtensionId) { throw new Error( - `Event.parseMetadata:: ` + + `Event.postRetrieveTasks:: ` + `No Data Extension found for ` + `event: ${eventDef.name}. ` + `This cannot be templated` @@ -129,17 +129,6 @@ class Event extends MetadataType { } } - /** - * manages post retrieve steps - * - * @param {MetadataTypeItem} eventDef a single item of Event Definition - * @returns {MetadataTypeItem} metadata - */ - static postRetrieveTasks(eventDef) { - const val = this.parseMetadata(eventDef); - this.keepRetrieveFields(val); - return val; - } /** * Delete a metadata item from the specified business unit * @@ -198,13 +187,21 @@ class Event extends MetadataType { * @returns {MetadataTypeItem} parsed version */ static preDeployTasks(metadata) { - metadata.dataExtensionId = cache.searchForField( - 'dataExtension', - metadata.dataExtensionName, - 'Name', - 'ObjectID' - ); - metadata.arguments.dataExtensionId = metadata.dataExtensionId; + if (metadata.r__dataExtension_CustomerKey) { + metadata.dataExtensionId = cache.searchForField( + 'dataExtension', + metadata.r__dataExtension_CustomerKey, + 'CustomerKey', + 'ObjectID' + ); + metadata.dataExtensionName = cache.searchForField( + 'dataExtension', + metadata.r__dataExtension_CustomerKey, + 'CustomerKey', + 'Name' + ); + metadata.arguments.dataExtensionId = metadata.dataExtensionId; + } return metadata; } @@ -214,25 +211,25 @@ class Event extends MetadataType { * @param {MetadataTypeItem} metadata a single event definition * @returns {MetadataTypeItem} parsed metadata */ - static parseMetadata(metadata) { + static postRetrieveTasks(metadata) { try { - metadata.dataExtensionId = cache.searchForField( + metadata.r__dataExtension_CustomerKey = cache.searchForField( 'dataExtension', metadata.dataExtensionId, 'ObjectID', 'CustomerKey' ); - metadata.arguments.dataExtensionId = metadata.dataExtensionId; - return JSON.parse(JSON.stringify(metadata)); - } catch { - Util.metadataLogger( - 'verbose', - this.definition.type, - 'parseMetadata', - `No related Data Extension found for Event '${metadata.name}'. Consider deleting the event definition` + delete metadata.dataExtensionId; + delete metadata.dataExtensionName; + delete metadata.arguments.dataExtensionId; + } catch (ex) { + Util.logger.verbose( + ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ + metadata[this.definition.keyField] + }): ${ex.message}.` ); - return metadata; } + return metadata; } } From bb1e7267debe8f51663ae419f79fb42417c926d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 18 Apr 2024 13:13:48 +0200 Subject: [PATCH 141/359] #62: improve warnings --- lib/metadataTypes/Journey.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 7f5d946bc..d86f6ea3a 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -570,7 +570,9 @@ class Journey extends MetadataType { delete triggeredSend.senderProfileId; } catch (ex) { Util.logger.warn( - ` - ${this.definition.type} ${metadata.key}: ${ex.message}` + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }): ${ex.message}` ); } } @@ -587,7 +589,9 @@ class Journey extends MetadataType { delete triggeredSend.sendClassificationId; } catch (ex) { Util.logger.warn( - ` - ${this.definition.type} ${metadata.key}: ${ex.message}` + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }): ${ex.message}` ); } } @@ -624,7 +628,9 @@ class Journey extends MetadataType { delete triggeredSend.emailId; } catch { Util.logger.warn( - ` - ${this.definition.typeName} '${metadata.Name}'/'${metadata.CustomerKey}': Could not find email with ID ${triggeredSend.emailId} in Classic nor in Content Builder. This TSD cannot be republished but potentially restarted with its cached version of the email.` + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }): Could not find email with ID ${triggeredSend.emailId} in Classic nor in Content Builder.` ); } } From 63e72353757234c8af7f8eab76718402743a2a45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 18 Apr 2024 13:30:16 +0200 Subject: [PATCH 142/359] #1270: baseline contentBlockByX replacement code --- lib/util/replaceContentBlockReference.js | 143 +++++++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 lib/util/replaceContentBlockReference.js diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js new file mode 100644 index 000000000..cc3441212 --- /dev/null +++ b/lib/util/replaceContentBlockReference.js @@ -0,0 +1,143 @@ +'use strict'; + +// import MetadataDefinitions from '../MetadataTypeDefinitions.js'; + +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').McdevLogger} McdevLogger + * @typedef {import('../../types/mcdev.d.js').Logger} Logger + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SkipInteraction} SkipInteraction + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError + */ + +/** + * Util that contains logger and simple util methods + */ +export const ReplaceContentBlockReference = { + /** + * + * @param {string} str full code string + * @param {'id'|'key'|'name'} from what to replace + * @param {'id'|'key'|'name'} to what to replace with + * @returns {string} replaced string + */ + replaceContentBlockReference(str, from, to) { + const regexById_double = /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim; + const regexByKey_double = /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim; + const regexByName_double = /ContentBlockByName\(\s*"([ a-z0-9-\\._]+)"\s*\)/gim; + + const regexById_single = /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim; + const regexByKey_single = /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim; + const regexByName_single = /ContentBlockByName\(\s*'([ a-z0-9-\\._]+)'\s*\)/gim; + + switch (from) { + case 'id': { + const doubleReplaced = str.replaceAll(regexById_double, (match, id) => { + const asset = this._getAssetById(id); + return this._replaceWith(asset, to); + }); + return doubleReplaced.replaceAll(regexById_single, (match, id) => { + const asset = this._getAssetById(id); + return this._replaceWith(asset, to); + }); + } + case 'key': { + const doubleReplaced = str.replaceAll(regexByKey_double, (match, key) => { + const asset = this._getAssetByKey(key); + return this._replaceWith(asset, to); + }); + return doubleReplaced.replaceAll(regexByKey_single, (match, key) => { + const asset = this._getAssetByKey(key); + return this._replaceWith(asset, to); + }); + } + case 'name': { + const doubleReplaced = str.replaceAll(regexByName_double, (match, pathName) => { + const asset = this._getAssetByPathName(pathName); + return this._replaceWith(asset, to); + }); + return doubleReplaced.replaceAll(regexByName_single, (match, pathName) => { + const asset = this._getAssetByPathName(pathName); + return this._replaceWith(asset, to); + }); + } + } + }, + /** + * + * @private + * @param {string} pathName r__folder_Path +'/'+ name + * @returns {{id: number, key: string, pathName: string}} asset object + */ + _getAssetByPathName(pathName) { + // TODO + return { id: 9999, key: 'my-key', pathName: pathName }; + }, + /** + * + * @private + * @param {number} id id of asset + * @returns {{id: number, key: string, pathName: string}} asset object + */ + _getAssetById(id) { + // TODO + return { + id: id, + key: 'my-key', + pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, + }; + }, + /** + * + * @private + * @param {string} key customerKey field of asset + * @returns {{id: number, key: string, pathName: string}} asset object + */ + _getAssetByKey(key) { + // TODO + return { + id: 9999, + key: key, + pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, + }; + }, + + /* const fixedString = testStringId.replaceAll(regexById, replaceIdWithName); + */ + /** + * + * @private + * @param {{id: number, key: string, pathName: string}} asset asset object + * @param {'id'|'key'|'name'} to replace with + * @returns {string} replaced string + */ + _replaceWith(asset, to) { + switch (to) { + case 'id': { + return `ContentBlockById("${asset.id}")`; + } + case 'key': { + return `ContentBlockByKey("${asset.key}")`; + } + case 'name': { + return `ContentBlockByName("${asset.pathName}")`; + } + } + }, +}; From 4c6be6d0ced48f82e8d329ec71ab4519fd02c86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 18 Apr 2024 13:51:00 +0200 Subject: [PATCH 143/359] #1270: refactoring --- lib/util/replaceContentBlockReference.js | 139 ++++++++++------------- 1 file changed, 60 insertions(+), 79 deletions(-) diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index cc3441212..04d12bfcf 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -38,88 +38,69 @@ export const ReplaceContentBlockReference = { * @returns {string} replaced string */ replaceContentBlockReference(str, from, to) { - const regexById_double = /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim; - const regexByKey_double = /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim; - const regexByName_double = /ContentBlockByName\(\s*"([ a-z0-9-\\._]+)"\s*\)/gim; - - const regexById_single = /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim; - const regexByKey_single = /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim; - const regexByName_single = /ContentBlockByName\(\s*'([ a-z0-9-\\._]+)'\s*\)/gim; - - switch (from) { - case 'id': { - const doubleReplaced = str.replaceAll(regexById_double, (match, id) => { - const asset = this._getAssetById(id); - return this._replaceWith(asset, to); - }); - return doubleReplaced.replaceAll(regexById_single, (match, id) => { - const asset = this._getAssetById(id); - return this._replaceWith(asset, to); - }); - } - case 'key': { - const doubleReplaced = str.replaceAll(regexByKey_double, (match, key) => { - const asset = this._getAssetByKey(key); - return this._replaceWith(asset, to); - }); - return doubleReplaced.replaceAll(regexByKey_single, (match, key) => { - const asset = this._getAssetByKey(key); - return this._replaceWith(asset, to); - }); - } - case 'name': { - const doubleReplaced = str.replaceAll(regexByName_double, (match, pathName) => { - const asset = this._getAssetByPathName(pathName); - return this._replaceWith(asset, to); - }); - return doubleReplaced.replaceAll(regexByName_single, (match, pathName) => { - const asset = this._getAssetByPathName(pathName); - return this._replaceWith(asset, to); - }); - } - } - }, - /** - * - * @private - * @param {string} pathName r__folder_Path +'/'+ name - * @returns {{id: number, key: string, pathName: string}} asset object - */ - _getAssetByPathName(pathName) { - // TODO - return { id: 9999, key: 'my-key', pathName: pathName }; - }, - /** - * - * @private - * @param {number} id id of asset - * @returns {{id: number, key: string, pathName: string}} asset object - */ - _getAssetById(id) { - // TODO - return { - id: id, - key: 'my-key', - pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, + const regexBy = { + id: [ + /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, + /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim, + ], + key: [ + /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, + /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim, + ], + name: [ + /ContentBlockByName\(\s*"([ a-z0-9-\\._]+)"\s*\)/gim, + /ContentBlockByName\(\s*'([ a-z0-9-\\._]+)'\s*\)/gim, + ], }; + let result = str; + for (const regex of regexBy[from]) { + result = result.replaceAll(regex, (match, identifier) => { + const asset = this.getAssetBy[from](identifier); + return this._replaceWith(asset, to); + }); + } + return result; }, - /** - * - * @private - * @param {string} key customerKey field of asset - * @returns {{id: number, key: string, pathName: string}} asset object - */ - _getAssetByKey(key) { - // TODO - return { - id: 9999, - key: key, - pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, - }; + _getAssetBy: { + /** + * + * @private + * @param {string} pathName r__folder_Path +'/'+ name + * @returns {{id: number, key: string, pathName: string}} asset object + */ + name(pathName) { + // TODO + return { id: 9999, key: 'my-key', pathName: pathName }; + }, + /** + * + * @private + * @param {number} id id of asset + * @returns {{id: number, key: string, pathName: string}} asset object + */ + id(id) { + // TODO + return { + id: id, + key: 'my-key', + pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, + }; + }, + /** + * + * @private + * @param {string} key customerKey field of asset + * @returns {{id: number, key: string, pathName: string}} asset object + */ + key(key) { + // TODO + return { + id: 9999, + key: key, + pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, + }; + }, }, - - /* const fixedString = testStringId.replaceAll(regexById, replaceIdWithName); - */ /** * * @private From c902c463b47a99bfa6ad59caa6ef478bf944ab77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 08:50:12 +0200 Subject: [PATCH 144/359] #1270: solidifying input/output types --- lib/util/replaceContentBlockReference.js | 30 ++++++++++++++++-------- types/mcdev.d.js | 5 ++++ 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 04d12bfcf..7550dd969 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -1,7 +1,5 @@ 'use strict'; -// import MetadataDefinitions from '../MetadataTypeDefinitions.js'; - /** * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -24,20 +22,32 @@ * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError + * @typedef {import('../../types/mcdev.d.js').AssetItemSimple} AssetItemSimple + * @typedef {import('../../types/mcdev.d.js').AssetItemSimpleMap} AssetItemSimpleMap + * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** * Util that contains logger and simple util methods */ export const ReplaceContentBlockReference = { + assetCacheMap: { + /** @type {AssetItemSimpleMap} */ + id: null, + /** @type {AssetItemSimpleMap} */ + key: null, + /** @type {AssetItemSimpleMap} */ + pathName: null, + }, /** * * @param {string} str full code string - * @param {'id'|'key'|'name'} from what to replace - * @param {'id'|'key'|'name'} to what to replace with + * @param {ContentBlockConversionTypes} from what to replace + * @param {ContentBlockConversionTypes} to what to replace with * @returns {string} replaced string */ replaceContentBlockReference(str, from, to) { + /** @type {Object.} */ const regexBy = { id: [ /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, @@ -66,7 +76,7 @@ export const ReplaceContentBlockReference = { * * @private * @param {string} pathName r__folder_Path +'/'+ name - * @returns {{id: number, key: string, pathName: string}} asset object + * @returns {AssetItemSimple} asset object */ name(pathName) { // TODO @@ -76,7 +86,7 @@ export const ReplaceContentBlockReference = { * * @private * @param {number} id id of asset - * @returns {{id: number, key: string, pathName: string}} asset object + * @returns {AssetItemSimple} asset object */ id(id) { // TODO @@ -90,7 +100,7 @@ export const ReplaceContentBlockReference = { * * @private * @param {string} key customerKey field of asset - * @returns {{id: number, key: string, pathName: string}} asset object + * @returns {AssetItemSimple} asset object */ key(key) { // TODO @@ -104,8 +114,8 @@ export const ReplaceContentBlockReference = { /** * * @private - * @param {{id: number, key: string, pathName: string}} asset asset object - * @param {'id'|'key'|'name'} to replace with + * @param {AssetItemSimple} asset asset object + * @param {ContentBlockConversionTypes} to replace with * @returns {string} replaced string */ _replaceWith(asset, to) { @@ -116,7 +126,7 @@ export const ReplaceContentBlockReference = { case 'key': { return `ContentBlockByKey("${asset.key}")`; } - case 'name': { + case 'pathName': { return `ContentBlockByName("${asset.pathName}")`; } } diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 6f8e1bd28..8f7186abe 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -444,5 +444,10 @@ complex * @property {Function} errorStack (ex, msg) print error with trace message * @typedef {import('winston').Logger & McdevLogger} Logger */ +/** + * @typedef {{id: number, key: string, pathName: string}} AssetItemSimple + * @typedef {Object.} AssetItemSimpleMap + * @typedef {'id'|'key'|'pathName'} ContentBlockConversionTypes + */ export default {}; From 383039977dc8216e171cade689d21530f6d70e2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 09:25:24 +0200 Subject: [PATCH 145/359] #1270: improve typing --- lib/util/replaceContentBlockReference.js | 14 +++++++------- types/mcdev.d.js | 3 ++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 7550dd969..f500f3c16 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -24,6 +24,7 @@ * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError * @typedef {import('../../types/mcdev.d.js').AssetItemSimple} AssetItemSimple * @typedef {import('../../types/mcdev.d.js').AssetItemSimpleMap} AssetItemSimpleMap + * @typedef {import('../../types/mcdev.d.js').AssetItemIdSimpleMap} AssetItemIdSimpleMap * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ @@ -31,12 +32,10 @@ * Util that contains logger and simple util methods */ export const ReplaceContentBlockReference = { + /** @type {{id: AssetItemIdSimpleMap, key: AssetItemSimpleMap, pathName: AssetItemSimpleMap}} */ assetCacheMap: { - /** @type {AssetItemSimpleMap} */ id: null, - /** @type {AssetItemSimpleMap} */ key: null, - /** @type {AssetItemSimpleMap} */ pathName: null, }, /** @@ -47,7 +46,7 @@ export const ReplaceContentBlockReference = { * @returns {string} replaced string */ replaceContentBlockReference(str, from, to) { - /** @type {Object.} */ + /** @type {{id: RegExp[], key: RegExp[], pathName: RegExp[]}} */ const regexBy = { id: [ /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, @@ -57,7 +56,7 @@ export const ReplaceContentBlockReference = { /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim, ], - name: [ + pathName: [ /ContentBlockByName\(\s*"([ a-z0-9-\\._]+)"\s*\)/gim, /ContentBlockByName\(\s*'([ a-z0-9-\\._]+)'\s*\)/gim, ], @@ -65,12 +64,13 @@ export const ReplaceContentBlockReference = { let result = str; for (const regex of regexBy[from]) { result = result.replaceAll(regex, (match, identifier) => { - const asset = this.getAssetBy[from](identifier); + const asset = this._getAssetBy[from](identifier); return this._replaceWith(asset, to); }); } return result; }, + /** @type {{id: Function, key: Function, pathName: Function}} */ _getAssetBy: { /** * @@ -78,7 +78,7 @@ export const ReplaceContentBlockReference = { * @param {string} pathName r__folder_Path +'/'+ name * @returns {AssetItemSimple} asset object */ - name(pathName) { + pathName(pathName) { // TODO return { id: 9999, key: 'my-key', pathName: pathName }; }, diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 8f7186abe..dbd388164 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -446,7 +446,8 @@ complex */ /** * @typedef {{id: number, key: string, pathName: string}} AssetItemSimple - * @typedef {Object.} AssetItemSimpleMap + * @typedef {Object.} AssetItemSimpleMap + * @typedef {Object.} AssetItemIdSimpleMap * @typedef {'id'|'key'|'pathName'} ContentBlockConversionTypes */ From 10c030ea489772db2e6543521d3cc023d320fd40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 10:34:13 +0200 Subject: [PATCH 146/359] #1270: refactored to class --- lib/util/replaceContentBlockReference.js | 55 +++++++++++------------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index f500f3c16..372f05404 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -31,13 +31,26 @@ /** * Util that contains logger and simple util methods */ -export const ReplaceContentBlockReference = { +export default class ReplaceContentBlockReference { /** @type {{id: AssetItemIdSimpleMap, key: AssetItemSimpleMap, pathName: AssetItemSimpleMap}} */ - assetCacheMap: { + static assetCacheMap = { id: null, key: null, pathName: null, - }, + }; + /** @type {{id: RegExp[], key: RegExp[], pathName: RegExp[]}} */ + static #regexBy = { + id: [/ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim], + key: [ + /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, + /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim, + ], + pathName: [ + /ContentBlockByName\(\s*"([ a-z0-9-\\._]+)"\s*\)/gim, + /ContentBlockByName\(\s*'([ a-z0-9-\\._]+)'\s*\)/gim, + ], + }; + /** * * @param {string} str full code string @@ -45,33 +58,18 @@ export const ReplaceContentBlockReference = { * @param {ContentBlockConversionTypes} to what to replace with * @returns {string} replaced string */ - replaceContentBlockReference(str, from, to) { - /** @type {{id: RegExp[], key: RegExp[], pathName: RegExp[]}} */ - const regexBy = { - id: [ - /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, - /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim, - ], - key: [ - /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, - /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim, - ], - pathName: [ - /ContentBlockByName\(\s*"([ a-z0-9-\\._]+)"\s*\)/gim, - /ContentBlockByName\(\s*'([ a-z0-9-\\._]+)'\s*\)/gim, - ], - }; + static replaceContentBlockReference(str, from, to) { let result = str; - for (const regex of regexBy[from]) { + for (const regex of this.#regexBy[from]) { result = result.replaceAll(regex, (match, identifier) => { - const asset = this._getAssetBy[from](identifier); - return this._replaceWith(asset, to); + const asset = this.#getAssetBy[from](identifier); + return this.#replaceWith(asset, to); }); } return result; - }, + } /** @type {{id: Function, key: Function, pathName: Function}} */ - _getAssetBy: { + static #getAssetBy = { /** * * @private @@ -110,15 +108,14 @@ export const ReplaceContentBlockReference = { pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, }; }, - }, + }; /** * - * @private * @param {AssetItemSimple} asset asset object * @param {ContentBlockConversionTypes} to replace with * @returns {string} replaced string */ - _replaceWith(asset, to) { + static #replaceWith(asset, to) { switch (to) { case 'id': { return `ContentBlockById("${asset.id}")`; @@ -130,5 +127,5 @@ export const ReplaceContentBlockReference = { return `ContentBlockByName("${asset.pathName}")`; } } - }, -}; + } +} From e66fdcd9c9f2ceb9a59ba71a7665ee9d6c938c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 15:32:33 +0200 Subject: [PATCH 147/359] #1272: base code for --metadata option, supporting mcdev retrieve --- lib/cli.js | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 105 insertions(+), 4 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index e46cc8ee7..fdf25b64e 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -9,6 +9,10 @@ import { Util } from './util/util.js'; import yargs from 'yargs'; import { hideBin } from 'yargs/helpers'; import Mcdev from './index.js'; + +/** + * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ yargs(hideBin(process.argv)) .scriptName('mcdev') .usage('$0 [options]') @@ -37,11 +41,22 @@ yargs(hideBin(process.argv)) group: 'Options for retrieve:', describe: 'filter metadata components (can include % as wildcard or _ for a single character)', + }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Options for retrieve:', + describe: + 'type or type:key or type:i:id or type:n:name to retrieve; if not provided, all metadata will be retrieved', }); }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.retrieve(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); + Mcdev.retrieve( + argv.BU, + csvToArray(argv.TYPE) || metadataToTypeKey(argv.metadata), + csvToArray(argv.KEY) + ); }, }) // @ts-expect-error @@ -104,6 +119,7 @@ yargs(hideBin(process.argv)) describe: "optionally ensure that updates to shared DataExtensions become visible in child BU's data designer (SF Known issue W-11031095)", }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -191,7 +207,7 @@ yargs(hideBin(process.argv)) }) // @ts-expect-error .command({ - command: 'delete ', + command: 'delete ', aliases: ['del'], desc: 'deletes metadata of selected type and external key', builder: (yargs) => { @@ -205,14 +221,15 @@ yargs(hideBin(process.argv)) type: 'string', describe: 'metadata type to delete from;', }) - .positional('EXTERNALKEY', { + .positional('KEY', { type: 'string', describe: 'the key to delete', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.EXTERNALKEY); + Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.KEY); }, }) // @ts-expect-error @@ -240,6 +257,7 @@ yargs(hideBin(process.argv)) group: 'Options for explainTypes:', describe: 'optionaly return info in json format', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -436,6 +454,7 @@ yargs(hideBin(process.argv)) type: 'string', describe: 'key(s) of the metadata component(s)', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -461,6 +480,7 @@ yargs(hideBin(process.argv)) type: 'string', describe: 'key(s) of the metadata component(s)', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -498,6 +518,7 @@ yargs(hideBin(process.argv)) describe: 'optionally start existing schedule instead of running item once immediately (only works for automations)', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -530,6 +551,7 @@ yargs(hideBin(process.argv)) describe: 'filter metadata components (can include % as wildcard or _ for a single character)', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -562,6 +584,7 @@ yargs(hideBin(process.argv)) describe: 'filter metadata components (can include % as wildcard or _ for a single character)', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -606,6 +629,7 @@ yargs(hideBin(process.argv)) describe: 'optionally start existing schedule instead of running item once immediately (only works for automations)', }); + // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -680,3 +704,80 @@ function csvToArray(csv) { .filter(Boolean) : [csv.trim()].filter(Boolean); } +/** + * helper to convert CSVs into an array. if only one value was given, it's also returned as an array + * + * @param {string|string[]} metadataOption potentially comma-separated value or null + * @param {string[]} [allowedIdentifiers] 'key', 'id', 'name' + * @param {boolean} [firstOnly] removes all but the first entry if enabled + * @returns {void|TypeKeyCombo} values split into an array. + */ +function metadataToTypeKey( + metadataOption, + allowedIdentifiers = ['key', 'id', 'name'], + firstOnly = false +) { + console.log('metadataToTypeKey-a', metadataOption); // eslint-disable-line no-console + if (!metadataOption) { + return; + } else if (!Array.isArray(metadataOption)) { + metadataOption = [metadataOption]; + } + if (firstOnly) { + // delete everything but the first entry + metadataOption.length = 1; + } + const metadataOptionMap = metadataOption.map((item) => { + const itemArr = item.split(':'); + switch (itemArr.length) { + case 1: { + return { type: itemArr[0] }; + } + case 2: { + if (allowedIdentifiers.includes('key')) { + return { type: itemArr[0], key: itemArr[1] }; + } + break; + } + case 3: { + switch (itemArr[1]) { + case 'k': { + if (allowedIdentifiers.includes('key')) { + return { type: itemArr[0], key: itemArr[2] }; + } + break; + } + case 'i': { + if (allowedIdentifiers.includes('id')) { + return { type: itemArr[0], id: itemArr[2] }; + } + break; + } + case 'n': { + if (allowedIdentifiers.includes('name')) { + return { type: itemArr[0], name: itemArr[2] }; + } + } + } + } + } + }); + const response = {}; + for (const item of metadataOptionMap) { + if (item.key || item.id || item.name) { + if (!response[item.type]) { + response[item.type] = []; + } + response[item.type].push( + item.key || (item.id ? 'id:' + item.id : item.name ? 'name:' + item.name : null) + ); + } else { + if (!response[item.type]) { + response[item.type] = null; + } + } + } + console.log('metadataToTypeKey-b', response); // eslint-disable-line no-console + + return response; +} From d947cdecd2907341c346d07c5214a48679d080c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 15:53:10 +0200 Subject: [PATCH 148/359] #1272: prioritize --metadata over old type/key parameters --- lib/cli.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index fdf25b64e..6c6ebfe91 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -52,11 +52,14 @@ yargs(hideBin(process.argv)) }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.retrieve( - argv.BU, - csvToArray(argv.TYPE) || metadataToTypeKey(argv.metadata), - csvToArray(argv.KEY) - ); + const typeKeyCombo = metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + console.log('type/key'); + Mcdev.retrieve(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); + } else { + console.log('typeKeyCombo', typeKeyCombo); + Mcdev.retrieve(argv.BU, typeKeyCombo); + } }, }) // @ts-expect-error From 1f315c11e370c63fc0c2c94b739d065165b8645e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 15:57:15 +0200 Subject: [PATCH 149/359] #1272: allow for easier result checking --- lib/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 6c6ebfe91..724ed5f4f 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -782,5 +782,5 @@ function metadataToTypeKey( } console.log('metadataToTypeKey-b', response); // eslint-disable-line no-console - return response; + return Object.keys(response).length >= 1 ? response : undefined; } From 56f2323b6a97d3ed9aca50fcb1cbf0a8a56b972f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 15:58:07 +0200 Subject: [PATCH 150/359] #0: ts check didnt like that --- lib/Retriever.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Retriever.js b/lib/Retriever.js index f86000e27..136a9594e 100644 --- a/lib/Retriever.js +++ b/lib/Retriever.js @@ -207,7 +207,7 @@ class Retriever { } /** - * helper for {@link Retriever.retrieve} to get all dependencies of the given types + * helper for Retriever.retrieve to get all dependencies of the given types * * @param {string[]} metadataTypes list of metadata types to retrieve; can include subtypes! * @returns {string[]} unique list dependent metadata types From 2eb99b9fa985a4ada2900448fea94869cafe241c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 16:26:07 +0200 Subject: [PATCH 151/359] #1272: allow extended identifier names "id", "key", "name" --- lib/cli.js | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 724ed5f4f..8b47d0969 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -744,18 +744,21 @@ function metadataToTypeKey( } case 3: { switch (itemArr[1]) { + case 'key': case 'k': { if (allowedIdentifiers.includes('key')) { return { type: itemArr[0], key: itemArr[2] }; } break; } + case 'id': case 'i': { if (allowedIdentifiers.includes('id')) { return { type: itemArr[0], id: itemArr[2] }; } break; } + case 'name': case 'n': { if (allowedIdentifiers.includes('name')) { return { type: itemArr[0], name: itemArr[2] }; @@ -767,16 +770,18 @@ function metadataToTypeKey( }); const response = {}; for (const item of metadataOptionMap) { - if (item.key || item.id || item.name) { - if (!response[item.type]) { - response[item.type] = []; - } - response[item.type].push( - item.key || (item.id ? 'id:' + item.id : item.name ? 'name:' + item.name : null) - ); - } else { - if (!response[item.type]) { - response[item.type] = null; + if (item) { + if (item.key || item.id || item.name) { + if (!response[item.type]) { + response[item.type] = []; + } + response[item.type].push( + item.key || (item.id ? 'id:' + item.id : item.name ? 'name:' + item.name : null) + ); + } else { + if (!response[item.type]) { + response[item.type] = null; + } } } } From 4caaad5458580c3bf35269fc219198a8b2154214 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 16:29:06 +0200 Subject: [PATCH 152/359] #1272: add --metadata option to mcdev delete --- lib/cli.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 8b47d0969..112838115 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -210,7 +210,7 @@ yargs(hideBin(process.argv)) }) // @ts-expect-error .command({ - command: 'delete ', + command: 'delete [TYPE] [KEY]', aliases: ['del'], desc: 'deletes metadata of selected type and external key', builder: (yargs) => { @@ -227,12 +227,26 @@ yargs(hideBin(process.argv)) .positional('KEY', { type: 'string', describe: 'the key to delete', + }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Options for retrieve:', + describe: + 'type or type:key or type:i:id or type:n:name to retrieve; if not provided, all metadata will be retrieved', }); - // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.KEY); + const typeKeyCombo = metadataToTypeKey(argv.metadata, ['key', 'id'], true); + if ('undefined' === typeof typeKeyCombo) { + if (argv.TYPE && argv.KEY) { + Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.KEY); + } + } else { + const type = Object.keys(typeKeyCombo)[0]; + Mcdev.deleteByKey(argv.BU, type, typeKeyCombo[type][0]); + } }, }) // @ts-expect-error From 4eaaf0b3a7790a6159ef1f7aa84ac6f16d49f1fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 19 Apr 2024 16:32:16 +0200 Subject: [PATCH 153/359] #1272: cleanup --- lib/cli.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 112838115..fdd0a3e0d 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -54,10 +54,8 @@ yargs(hideBin(process.argv)) Mcdev.setOptions(argv); const typeKeyCombo = metadataToTypeKey(argv.metadata); if ('undefined' === typeof typeKeyCombo) { - console.log('type/key'); Mcdev.retrieve(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); } else { - console.log('typeKeyCombo', typeKeyCombo); Mcdev.retrieve(argv.BU, typeKeyCombo); } }, @@ -734,7 +732,6 @@ function metadataToTypeKey( allowedIdentifiers = ['key', 'id', 'name'], firstOnly = false ) { - console.log('metadataToTypeKey-a', metadataOption); // eslint-disable-line no-console if (!metadataOption) { return; } else if (!Array.isArray(metadataOption)) { @@ -799,7 +796,6 @@ function metadataToTypeKey( } } } - console.log('metadataToTypeKey-b', response); // eslint-disable-line no-console return Object.keys(response).length >= 1 ? response : undefined; } From 003c9e126e6b421ba57be9e852b82a42747bd014 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Apr 2024 09:49:09 +0000 Subject: [PATCH 154/359] Bump eslint-plugin-mocha from 10.4.1 to 10.4.3 Bumps [eslint-plugin-mocha](https://github.com/lo1tuma/eslint-plugin-mocha) from 10.4.1 to 10.4.3. - [Release notes](https://github.com/lo1tuma/eslint-plugin-mocha/releases) - [Changelog](https://github.com/lo1tuma/eslint-plugin-mocha/blob/main/CHANGELOG.md) - [Commits](https://github.com/lo1tuma/eslint-plugin-mocha/compare/10.4.1...10.4.3) --- updated-dependencies: - dependency-name: eslint-plugin-mocha dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 773bb583f..d24906ad6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -45,7 +45,7 @@ "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.3", - "eslint-plugin-mocha": "10.4.1", + "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", "fast-xml-parser": "4.3.6", @@ -2330,9 +2330,9 @@ } }, "node_modules/eslint-plugin-mocha": { - "version": "10.4.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.1.tgz", - "integrity": "sha512-G85ALUgKaLzuEuHhoW3HVRgPTmia6njQC3qCG6CEvA8/Ja9PDZnRZOuzekMki+HaViEQXINuYsmhp5WR5/4MfA==", + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.4.3.tgz", + "integrity": "sha512-emc4TVjq5Ht0/upR+psftuz6IBG5q279p+1dSRDeHf+NS9aaerBi3lXKo1SEzwC29hFIW21gO89CEWSvRsi8IQ==", "dev": true, "dependencies": { "eslint-utils": "^3.0.0", diff --git a/package.json b/package.json index a9e746d2b..14505a517 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", "eslint-plugin-jsdoc": "48.2.3", - "eslint-plugin-mocha": "10.4.1", + "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", "fast-xml-parser": "4.3.6", From 668f9961718cf5b6c77f605c2492ea5b679c11ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sat, 20 Apr 2024 11:58:02 +0200 Subject: [PATCH 155/359] #1269: mention vscode extension & update copyright year --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ef2965f7..dd81adac7 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,10 @@ Run the following to install Accenture SFMC DevTools on your computer: npm install -g mcdev ``` +### VSCode Extension + +We also provide a [VSCode extension](https://marketplace.visualstudio.com/items?itemName=Accenture-oss.sfmc-devtools-vscode) that integrates SFMC DevTools into your IDE. You can install it from the [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=Accenture-oss.sfmc-devtools-vscode). + ### Include in your package First, install it as dependency: @@ -69,4 +73,4 @@ The people that lead this project: ## Copyright -Copyright (c) 2020-2023 Accenture. [MIT licensed](https://github.com/Accenture/sfmc-devtools/blob/main/LICENSE). +Copyright (c) 2020-2024 Accenture. [MIT licensed](https://github.com/Accenture/sfmc-devtools/blob/main/LICENSE). From 9970a09ebd4a0a253abf9211e95d7d47e6ebc0fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sat, 20 Apr 2024 12:16:20 +0200 Subject: [PATCH 156/359] #1273: disable wizard for wrong credential if --skipInteraction is set --- lib/util/cli.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/util/cli.js b/lib/util/cli.js index 7207510f5..5c9d3af56 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -172,7 +172,11 @@ const Cli = { } else if (!credential || !properties.credentials[credential]) { // no or unknown credential provided; BU either to be selected or pre-selected if (credential !== null) { - Util.logger.warn(`Credential '${credential}' not found`); + const msg = `Credential '${credential}' not found`; + if (Util.skipInteraction) { + throw new Error(msg); + } + Util.logger.warn(msg); } const response = await this._selectBU( properties, From 3d6def6807e9f0336088766849ea0aa259c224db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sat, 20 Apr 2024 12:18:19 +0200 Subject: [PATCH 157/359] #1273: disable wizard for wrong business unit if --skipInteraction is set --- lib/util/cli.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/util/cli.js b/lib/util/cli.js index 5c9d3af56..0626fe022 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -200,10 +200,13 @@ const Cli = { ) { // correct credential provided but BU still needed if (businessUnit && businessUnit !== 'undefined') { - Util.logger.warn( - `Business Unit '${businessUnit}' not found for credential '${credential}'` - ); + const msg = `Business Unit '${businessUnit}' not found for credential '${credential}'`; + if (Util.skipInteraction) { + throw new Error(msg); + } + Util.logger.warn(msg); } + const response = await this._selectBU(properties, credential, null, allowAll); businessUnit = response.businessUnit; Util.logger.info( From 74e9e7cd1f8c4f2a3efba5b046126dfde5c63d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sat, 20 Apr 2024 12:22:24 +0200 Subject: [PATCH 158/359] change package install instructions from retrieve to import --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dd81adac7..28083cdc4 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,10 @@ First, install it as dependency: npm install mcdev --save ``` -You can then include it in your code with: +You can then include it in your code with JavaScript/ES module imports: ```javascript -const mcdev = require('mcdev'); +import mcdev from 'mcdev'; ``` That will load `node_packages/mcdev/lib/index.js`. It can make sense to directly include other files if you have a special scenario. We've done that in our example for [retrieveChangelog.js](https://github.com/Accenture/sfmc-devtools/blob/main/lib/retrieveChangelog.js) or in more detail, in our child-project [sfmc-devtools-copado](https://github.com/Accenture/sfmc-devtools-copado) to get full control over certain aspects. From c116a8408a2fba8420a3a8e78d2cecefc41d76e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 14:06:30 +0200 Subject: [PATCH 159/359] #1281: add new global option --errorLog --- lib/cli.js | 6 +++++- lib/index.js | 1 + lib/util/util.js | 31 +++++++++++++++++-------------- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index fdd0a3e0d..a879f1d08 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -686,8 +686,12 @@ yargs(hideBin(process.argv)) description: 'Interactive questions where possible and go with defaults instead', }) .option('api', { - description: 'Print API calls to log ', choices: ['log', 'cli'], + description: 'Print API calls to log', + }) + .option('errorLog', { + type: 'boolean', + description: 'Create a second log file that only contains error messages', }) .demandCommand(1, 'Please enter a valid command') .strict() diff --git a/lib/index.js b/lib/index.js index 19d401ccc..8c76c6849 100644 --- a/lib/index.js +++ b/lib/index.js @@ -79,6 +79,7 @@ class Mcdev { 'changeKeyField', 'changeKeyValue', 'commitHistory', + 'errorLog', 'execute', 'filter', 'fixShared', diff --git a/lib/util/util.js b/lib/util/util.js index 89d2c63d6..82aeb541a 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -315,20 +315,23 @@ export const Util = { ) ), }); - transports.fileError = new winston.transports.File({ - // Write logs to additional error-logfile for better visibility of errors - filename: 'logs/' + logFileName + '-errors.log', - level: 'error', // only log errors - lazy: true, // if true, log files will be created on demand, not at the initialization time. - format: winston.format.combine( - winston.format.uncolorize(), - winston.format.timestamp({ format: 'HH:mm:ss.SSS' }), - winston.format.simple(), - winston.format.printf( - (info) => `${info.timestamp} ${info.level}: ${info.message}` - ) - ), - }); + if (Util.OPTIONS.errorLog) { + // used by CI/CD solutions like Copado to quickly show the error message to admins/users + transports.fileError = new winston.transports.File({ + // Write logs to additional error-logfile for better visibility of errors + filename: 'logs/' + logFileName + '-errors.log', + level: 'error', // only log errors + lazy: true, // if true, log files will be created on demand, not at the initialization time. + format: winston.format.combine( + winston.format.uncolorize(), + winston.format.timestamp({ format: 'HH:mm:ss.SSS' }), + winston.format.simple(), + winston.format.printf( + (info) => `${info.timestamp} ${info.level}: ${info.message}` + ) + ), + }); + } } return transports; }, From 8db51357fd5278008543165043a2af6283103c8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 15:56:52 +0200 Subject: [PATCH 160/359] #1275: add --metadata for deploy-method --- lib/Deployer.js | 67 +++++++++++++++++++++++++++++++++--------------- lib/cli.js | 11 +++++--- lib/index.js | 2 +- lib/util/util.js | 21 +++++++++++++++ 4 files changed, 77 insertions(+), 24 deletions(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index ef0a24824..ecae55a39 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -23,6 +23,7 @@ import auth from './util/auth.js'; * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo */ /** @@ -57,7 +58,7 @@ class Deployer { * Deploys all metadata located in the 'deploy' directory to the specified business unit * * @param {string} businessUnit references credentials from properties.json - * @param {string[]} [selectedTypesArr] limit deployment to given metadata type + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) */ @@ -73,25 +74,44 @@ class Deployer { if (Util.OPTIONS.fromRetrieve) { properties.directories.deploy = properties.directories.retrieve; } - if (Array.isArray(selectedTypesArr)) { - // types and keys can be provided but for each type all provided keys are applied as filter - for (const selectedType of selectedTypesArr) { + if (selectedTypesArr) { + for (const selectedType of Array.isArray(selectedTypesArr) + ? selectedTypesArr + : Object.keys(selectedTypesArr)) { if (!Util._isValidType(selectedType)) { return; } } } - if ( - Util.OPTIONS.fromRetrieve && - (!selectedTypesArr || - !Array.isArray(selectedTypesArr) || - !selectedTypesArr.length || - !keyArr || - !Array.isArray(keyArr) || - !keyArr.length) - ) { - Util.logger.error('type & key need to be defined to deploy from retrieve folder'); - return; + if (Util.OPTIONS.fromRetrieve) { + // check if either type & key or typeKeyCombo including keys was supplied + // we dont want to allow deploying without key from the retrieve dir for safety reasons + let keysFound = false; + if ( + Array.isArray(selectedTypesArr) && + selectedTypesArr.length && + Array.isArray(keyArr) && + keyArr.length + ) { + // check legacy way of passing in type(s) and key(s) + keysFound = true; + } else if ( + selectedTypesArr && + !Array.isArray(selectedTypesArr) && + Object.values(selectedTypesArr).length + ) { + // TypeKeyCombo - a single null value (== no keys for one type) should lead to the error + for (const keys of Object.values(selectedTypesArr)) { + if (!Array.isArray(keys)) { + keysFound = false; + break; + } + } + } + if (!keysFound) { + Util.logger.error('type & key need to be defined to deploy from retrieve folder'); + return; + } } let counter_credBu = 0; if (businessUnit === '*') { @@ -201,7 +221,7 @@ class Deployer { * @param {string} cred name of Credential * @param {string} bu name of BU * @param {Mcdevrc} properties General configuration to be used in retrieve - * @param {string[]} [typeArr] limit deployment to given metadata type + * @param {string[] | TypeKeyCombo} [typeArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.} ensure that BUs are worked on sequentially */ @@ -227,20 +247,27 @@ class Deployer { /** * Deploy all metadata that is located in the deployDir * - * @param {string[]} [typeArr] limit deployment to given metadata type (can include subtype) + * @param {string[] | TypeKeyCombo} [types] limit deployment to given metadata type (can include subtype) * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.} Promise of all deployed metadata */ - async _deploy(typeArr, keyArr) { + async _deploy(types, keyArr) { + const typeArr = !types || Array.isArray(types) ? types : Object.keys(types); + const typeKeyCombo = Array.isArray(types) + ? Util.createTypeKeyCombo(typeArr, keyArr) + : types; if (await File.pathExists(this.deployDir)) { /** @type {MultiMetadataTypeMap} */ this.metadata = Deployer.readBUMetadata(this.deployDir, typeArr); // filter found metadata by key if given - if (typeArr && Array.isArray(keyArr)) { + if (typeArr && Array.isArray(typeArr)) { for (const selectedType of typeArr) { const type = selectedType.split('-')[0]; - this.metadata[type] = Util.filterObjByKeys(this.metadata[type], keyArr); + this.metadata[type] = Util.filterObjByKeys( + this.metadata[type], + typeKeyCombo[selectedType] + ); } } } else { diff --git a/lib/cli.js b/lib/cli.js index a879f1d08..8fa1b9578 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -125,7 +125,12 @@ yargs(hideBin(process.argv)) handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.deploy(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); + const typeKeyCombo = metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + Mcdev.deploy(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); + } else { + Mcdev.deploy(argv.BU, typeKeyCombo); + } }, }) // @ts-expect-error @@ -729,7 +734,7 @@ function csvToArray(csv) { * @param {string|string[]} metadataOption potentially comma-separated value or null * @param {string[]} [allowedIdentifiers] 'key', 'id', 'name' * @param {boolean} [firstOnly] removes all but the first entry if enabled - * @returns {void|TypeKeyCombo} values split into an array. + * @returns {TypeKeyCombo} values split into an array. */ function metadataToTypeKey( metadataOption, @@ -737,7 +742,7 @@ function metadataToTypeKey( firstOnly = false ) { if (!metadataOption) { - return; + return undefined; // eslint-disable-line unicorn/no-useless-undefined } else if (!Array.isArray(metadataOption)) { metadataOption = [metadataOption]; } diff --git a/lib/index.js b/lib/index.js index 8c76c6849..863429fb1 100644 --- a/lib/index.js +++ b/lib/index.js @@ -447,7 +447,7 @@ class Mcdev { * Deploys all metadata located in the 'deploy' directory to the specified business unit * * @param {string} businessUnit references credentials from properties.json - * @param {string[]} [selectedTypesArr] limit deployment to given metadata type + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit deployment to given metadata type * @param {string[]} [keyArr] limit deployment to given metadata keys * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) */ diff --git a/lib/util/util.js b/lib/util/util.js index 82aeb541a..8f105b871 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -929,6 +929,27 @@ export const Util = { capitalizeFirstLetter(str) { return str.charAt(0).toUpperCase() + str.slice(1); }, + /** + * helper for Retriever and Deployer class + * + * @param {string[]} typeArr - + * @param {string[]} keyArr - + * @returns {TypeKeyCombo} - + */ + createTypeKeyCombo(typeArr, keyArr) { + if (!keyArr || (Array.isArray(keyArr) && !keyArr.length)) { + // no keys were provided, ensure we retrieve all + keyArr = [null]; + } + /** @type {TypeKeyCombo} */ + const typeKeyMap = {}; + // no keys or array of keys was provided (likely called via CLI or to retrieve all) + // transform into TypeKeyCombo to iterate over it + for (const type of typeArr) { + typeKeyMap[type] = keyArr; + } + return typeKeyMap; + }, }; Util.startLogger(false, true); From 31136bcfbc7c8333b05d52888990ab558cb6a9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 15:58:11 +0200 Subject: [PATCH 161/359] #0: add new types --- types/mcdev.d.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 6f8e1bd28..1197a87b7 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -10,7 +10,7 @@ */ /** * @typedef {Object.} TemplateMap - * @typedef {'asset'|'asset-archive'|'asset-asset'|'asset-audio'|'asset-block'|'asset-code'|'asset-document'|'asset-image'|'asset-message'|'asset-other'|'asset-rawimage'|'asset-template'|'asset-textfile'|'asset-video'|'attributeGroup'|'attributeSet'|'automation'|'campaign'|'contentArea'|'dataExtension'|'dataExtensionField'|'dataExtensionTemplate'|'dataExtract'|'dataExtractType'|'discovery'|'email'|'emailSend'|'event'|'fileLocation'|'fileTransfer'|'filter'|'folder'|'importFile'|'journey'|'list'|'mobileCode'|'mobileKeyword'|'mobileMessage'|'query'|'role'|'script'|'sendClassification'|'transactionalEmail'|'transactionalPush'|'transactionalSMS'|'triggeredSend'|'user'|'verification'} SupportedMetadataTypes + * @typedef {'asset'|'asset-archive'|'asset-asset'|'asset-audio'|'asset-block'|'asset-code'|'asset-document'|'asset-image'|'asset-message'|'asset-other'|'asset-rawimage'|'asset-template'|'asset-textfile'|'asset-video'|'attributeGroup'|'attributeSet'|'automation'|'campaign'|'contentArea'|'dataExtension'|'dataExtensionField'|'dataExtensionTemplate'|'dataExtract'|'dataExtractType'|'discovery'|'deliveryProfile'|'email'|'emailSend'|'event'|'fileLocation'|'fileTransfer'|'filter'|'folder'|'importFile'|'journey'|'list'|'mobileCode'|'mobileKeyword'|'mobileMessage'|'query'|'role'|'script'|'sendClassification'|'senderProfile'|'transactionalEmail'|'transactionalPush'|'transactionalSMS'|'triggeredSend'|'user'|'verification'} SupportedMetadataTypes * @typedef {Object.} TypeKeyCombo object-key=metadata type, value=array of external keys */ From 8fb1c672727f912162305a386f6e64bcba03e6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 15:59:32 +0200 Subject: [PATCH 162/359] #1275: upgrade retriever to use new central createTypeKeyCombo method --- lib/Retriever.js | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/Retriever.js b/lib/Retriever.js index 136a9594e..64b674826 100644 --- a/lib/Retriever.js +++ b/lib/Retriever.js @@ -60,22 +60,11 @@ class Retriever { * @type {MultiMetadataTypeList} */ const retrieveChangelog = {}; - if (!namesOrKeys || (Array.isArray(namesOrKeys) && !namesOrKeys.length)) { - // no keys were provided, ensure we retrieve all - namesOrKeys = [null]; - } /** @type {TypeKeyCombo} */ - let typeKeyMap = {}; - if (Array.isArray(namesOrKeys)) { - // no keys or array of keys was provided (likely called via CLI or to retrieve all) - // transform into TypeKeyCombo to iterate over it - for (const type of metadataTypes) { - typeKeyMap[type] = namesOrKeys; - } - } else { - // assuming TypeKeyCombo was provided - typeKeyMap = namesOrKeys; - } + const typeKeyMap = + !namesOrKeys || Array.isArray(namesOrKeys) + ? Util.createTypeKeyCombo(metadataTypes, namesOrKeys) + : namesOrKeys; // ensure we know which real dependencies we have to ensure we cache those completely const dependencies = this._getTypeDependencies(metadataTypes); const deployOrder = Util.getMetadataHierachy(metadataTypes); From 633afcb476f836c78a88a612b4eeec0fe16a1654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 17:57:15 +0200 Subject: [PATCH 163/359] #1275: add tests for retrieve --metadata --- lib/cli.js | 86 +------------ lib/index.js | 81 ++++++++++++ test/general.test.js | 115 ++++++++++++++++++ .../get-response.json | 17 +++ ...isting_query2ANDStatus=Active-response.xml | 30 +++++ .../retrieve-CustomerKey=Default-response.xml | 44 +++++++ 6 files changed, 290 insertions(+), 83 deletions(-) create mode 100644 test/resources/9999999/automation/v1/queries/abcde-607c-4940-afef-437965094dat/get-response.json create mode 100644 test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query2ANDStatus=Active-response.xml create mode 100644 test/resources/9999999/senderProfile/retrieve-CustomerKey=Default-response.xml diff --git a/lib/cli.js b/lib/cli.js index 8fa1b9578..f884fa226 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -52,7 +52,7 @@ yargs(hideBin(process.argv)) }, handler: (argv) => { Mcdev.setOptions(argv); - const typeKeyCombo = metadataToTypeKey(argv.metadata); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); if ('undefined' === typeof typeKeyCombo) { Mcdev.retrieve(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); } else { @@ -125,7 +125,7 @@ yargs(hideBin(process.argv)) handler: (argv) => { Mcdev.setOptions(argv); - const typeKeyCombo = metadataToTypeKey(argv.metadata); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); if ('undefined' === typeof typeKeyCombo) { Mcdev.deploy(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); } else { @@ -241,7 +241,7 @@ yargs(hideBin(process.argv)) }, handler: (argv) => { Mcdev.setOptions(argv); - const typeKeyCombo = metadataToTypeKey(argv.metadata, ['key', 'id'], true); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata, ['key', 'id'], true); if ('undefined' === typeof typeKeyCombo) { if (argv.TYPE && argv.KEY) { Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.KEY); @@ -728,83 +728,3 @@ function csvToArray(csv) { .filter(Boolean) : [csv.trim()].filter(Boolean); } -/** - * helper to convert CSVs into an array. if only one value was given, it's also returned as an array - * - * @param {string|string[]} metadataOption potentially comma-separated value or null - * @param {string[]} [allowedIdentifiers] 'key', 'id', 'name' - * @param {boolean} [firstOnly] removes all but the first entry if enabled - * @returns {TypeKeyCombo} values split into an array. - */ -function metadataToTypeKey( - metadataOption, - allowedIdentifiers = ['key', 'id', 'name'], - firstOnly = false -) { - if (!metadataOption) { - return undefined; // eslint-disable-line unicorn/no-useless-undefined - } else if (!Array.isArray(metadataOption)) { - metadataOption = [metadataOption]; - } - if (firstOnly) { - // delete everything but the first entry - metadataOption.length = 1; - } - const metadataOptionMap = metadataOption.map((item) => { - const itemArr = item.split(':'); - switch (itemArr.length) { - case 1: { - return { type: itemArr[0] }; - } - case 2: { - if (allowedIdentifiers.includes('key')) { - return { type: itemArr[0], key: itemArr[1] }; - } - break; - } - case 3: { - switch (itemArr[1]) { - case 'key': - case 'k': { - if (allowedIdentifiers.includes('key')) { - return { type: itemArr[0], key: itemArr[2] }; - } - break; - } - case 'id': - case 'i': { - if (allowedIdentifiers.includes('id')) { - return { type: itemArr[0], id: itemArr[2] }; - } - break; - } - case 'name': - case 'n': { - if (allowedIdentifiers.includes('name')) { - return { type: itemArr[0], name: itemArr[2] }; - } - } - } - } - } - }); - const response = {}; - for (const item of metadataOptionMap) { - if (item) { - if (item.key || item.id || item.name) { - if (!response[item.type]) { - response[item.type] = []; - } - response[item.type].push( - item.key || (item.id ? 'id:' + item.id : item.name ? 'name:' + item.name : null) - ); - } else { - if (!response[item.type]) { - response[item.type] = null; - } - } - } - } - - return Object.keys(response).length >= 1 ? response : undefined; -} diff --git a/lib/index.js b/lib/index.js index 863429fb1..33185d5b7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1257,6 +1257,87 @@ class Mcdev { Util.logger.info(`:: Done\n`); return resultArr; } + /** + * helper to convert CSVs into an array. if only one value was given, it's also returned as an array + * + * @param {string|string[]} metadataOption potentially comma-separated value or null + * @param {string[]} [allowedIdentifiers] 'key', 'id', 'name' + * @param {boolean} [firstOnly] removes all but the first entry if enabled + * @returns {TypeKeyCombo} values split into an array. + */ + static metadataToTypeKey( + metadataOption, + allowedIdentifiers = ['key', 'id', 'name'], + firstOnly = false + ) { + if (!metadataOption) { + return undefined; // eslint-disable-line unicorn/no-useless-undefined + } else if (!Array.isArray(metadataOption)) { + metadataOption = [metadataOption]; + } + if (firstOnly) { + // delete everything but the first entry + metadataOption.length = 1; + } + const metadataOptionMap = metadataOption.map((item) => { + const itemArr = item.split(':'); + switch (itemArr.length) { + case 1: { + return { type: itemArr[0] }; + } + case 2: { + if (allowedIdentifiers.includes('key')) { + return { type: itemArr[0], key: itemArr[1] }; + } + break; + } + case 3: { + switch (itemArr[1]) { + case 'key': + case 'k': { + if (allowedIdentifiers.includes('key')) { + return { type: itemArr[0], key: itemArr[2] }; + } + break; + } + case 'id': + case 'i': { + if (allowedIdentifiers.includes('id')) { + return { type: itemArr[0], id: itemArr[2] }; + } + break; + } + case 'name': + case 'n': { + if (allowedIdentifiers.includes('name')) { + return { type: itemArr[0], name: itemArr[2] }; + } + } + } + } + } + }); + const response = {}; + for (const item of metadataOptionMap) { + if (item) { + if (item.key || item.id || item.name) { + if (!response[item.type]) { + response[item.type] = []; + } + response[item.type].push( + item.key || + (item.id ? 'id:' + item.id : item.name ? 'name:' + item.name : null) + ); + } else { + if (!response[item.type]) { + response[item.type] = null; + } + } + } + } + + return Object.keys(response).length >= 1 ? response : undefined; + } } export default Mcdev; diff --git a/test/general.test.js b/test/general.test.js index 9c0a45c31..5eb101bce 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -16,6 +16,121 @@ describe('GENERAL', () => { testUtils.mockReset(); }); + describe('--metadata ================', () => { + it('retrieve single type without keys', async () => { + const argvMetadata = ['dataExtract']; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.retrieve(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 1, 'retrieve should have returned 1 type'); + assert.equal(retrievedTypes[0], 'dataExtract', 'retrieve should have returned 1 type'); + }); + + it('retrieve multiple type without keys', async () => { + const argvMetadata = ['dataExtension', 'senderProfile']; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.retrieve(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 2, 'retrieve should have returned 2 types'); + assert.equal( + retrievedTypes[0], + 'dataExtension', + 'retrieve should have returned dataExtension' + ); + assert.equal( + retrievedTypes[1], + 'senderProfile', + 'retrieve should have returned senderProfile' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 2, + 'retrieve should have returned 2 senderProfile' + ); + }); + + it('retrieve multiple type with keys', async () => { + const argvMetadata = [ + 'dataExtension', + 'dataExtract:wrong-key', + 'senderProfile:Default', + 'query:testExisting_query', + 'query:key:testExisting_query2', + ]; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.retrieve(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 4, 'retrieve should have returned 4 types'); + assert.equal( + retrievedTypes.includes('dataExtension'), + true, + 'retrieve should have returned dataExtension' + ); + assert.equal( + retrievedTypes.includes('dataExtract'), + true, + 'retrieve should have returned dataExtract' + ); + assert.equal( + retrievedTypes.includes('senderProfile'), + true, + 'retrieve should have returned senderProfile' + ); + assert.equal( + retrievedTypes.includes('query'), + true, + 'retrieve should have returned query' + ); + assert.equal( + Object.keys(result[buName]['dataExtension']).length, + 1, + 'retrieve should have returned 1 dataExtension' + ); + assert.equal( + Object.keys(result[buName]['dataExtract']).length, + 0, + 'retrieve should have returned 0 dataExtracts' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 1, + 'retrieve should have returned 1 senderProfile' + ); + assert.equal( + Object.keys(result[buName]['query']).length, + 2, + 'retrieve should have returned 2 query' + ); + }); + }); + describe('init ================', () => { it('should init a local project without downloading BUs'); diff --git a/test/resources/9999999/automation/v1/queries/abcde-607c-4940-afef-437965094dat/get-response.json b/test/resources/9999999/automation/v1/queries/abcde-607c-4940-afef-437965094dat/get-response.json new file mode 100644 index 000000000..9487f867d --- /dev/null +++ b/test/resources/9999999/automation/v1/queries/abcde-607c-4940-afef-437965094dat/get-response.json @@ -0,0 +1,17 @@ +{ + "queryDefinitionId": "abcde-607c-4940-afef-437965094dat", + "name": "testExisting_query2", + "key": "testExisting_query2", + "description": "bla bla", + "queryText": "Select\n SubscriberKey as testField, Trim(last_name) AS name\nfrom\n _Subscribers\nwhere\n country in ('test')\n", + "targetName": "testExisting_dataExtension", + "targetKey": "testExisting_dataExtension-WRONG", + "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "targetDescription": "", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:02:44.01", + "targetUpdateTypeId": 0, + "targetUpdateTypeName": "Overwrite", + "categoryId": 999, + "isFrozen": false +} diff --git a/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query2ANDStatus=Active-response.xml b/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query2ANDStatus=Active-response.xml new file mode 100644 index 000000000..d0132b483 --- /dev/null +++ b/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query2ANDStatus=Active-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:7ef0345e-b559-4fc4-8986-47e54e1a8a58 + urn:uuid:b2e814a6-517c-4882-9bbb-238bfce951ce + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-04-11T16:33:48Z + 2023-04-11T16:38:48Z + + + + + + OK + e8eb2988-2f43-4243-a6b0-6ab6b841a6ac + + + abcde-607c-4940-afef-437965094dat + + + + diff --git a/test/resources/9999999/senderProfile/retrieve-CustomerKey=Default-response.xml b/test/resources/9999999/senderProfile/retrieve-CustomerKey=Default-response.xml new file mode 100644 index 000000000..9a446856b --- /dev/null +++ b/test/resources/9999999/senderProfile/retrieve-CustomerKey=Default-response.xml @@ -0,0 +1,44 @@ + + + + RetrieveResponse + urn:uuid:cbecb68a-7bdf-417e-8fce-bef6c72febbd + urn:uuid:2e88f8d2-82e7-4e2d-b780-b885a2205a0f + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-12T12:20:37Z + 2024-04-12T12:25:37Z + + + + + + OK + 4c6f37a1-7ab4-47a1-b341-f9912462ee97 + + + 2016-07-22T11:53:00 + 2016-07-22T11:53:00 + 7acfb80f-3550-e611-96fe-38eaa7142c61 + Default + Default + Account defaults + Accenture + joern.berkefeld@accenture.com + true + + + false + false + + + + + + From 96a4dbd19067f1ba94f63550f34549f4ec671caa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 18:24:37 +0200 Subject: [PATCH 164/359] #1275: add a retrieve test for multiple types & keys without --metadata --- test/general.test.js | 36 +++++++++++++++++++ ...etrieve-CustomerKey=wrong-key-response.xml | 26 ++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 test/resources/9999999/senderProfile/retrieve-CustomerKey=wrong-key-response.xml diff --git a/test/general.test.js b/test/general.test.js index 5eb101bce..2db42befd 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -131,6 +131,42 @@ describe('GENERAL', () => { }); }); + describe('without --metadata ================', () => { + it('retrieve multiple type with keys', async () => { + const buName = 'testInstance/testBU'; + const result = await handler.retrieve( + buName, + ['dataExtract', 'senderProfile'], + ['wrong-key', 'Default'] + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 2, 'retrieve should have returned 2 types'); + assert.equal( + retrievedTypes.includes('dataExtract'), + true, + 'retrieve should have returned dataExtract' + ); + assert.equal( + retrievedTypes.includes('senderProfile'), + true, + 'retrieve should have returned senderProfile' + ); + assert.equal( + Object.keys(result[buName]['dataExtract']).length, + 0, + 'retrieve should have returned 0 dataExtracts' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 1, + 'retrieve should have returned 1 senderProfile' + ); + }); + }); + describe('init ================', () => { it('should init a local project without downloading BUs'); diff --git a/test/resources/9999999/senderProfile/retrieve-CustomerKey=wrong-key-response.xml b/test/resources/9999999/senderProfile/retrieve-CustomerKey=wrong-key-response.xml new file mode 100644 index 000000000..e85b1c7a7 --- /dev/null +++ b/test/resources/9999999/senderProfile/retrieve-CustomerKey=wrong-key-response.xml @@ -0,0 +1,26 @@ + + + + RetrieveResponse + urn:uuid:d88db970-f769-4bf0-b883-e019d4324499 + urn:uuid:044b42db-b7c3-4286-be0c-b3420efb6c3a + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2024-04-23T16:10:56Z + 2024-04-23T16:15:56Z + + + + + + OK + 4e5087e1-0ee3-4e6a-bd6f-76824abe451f + + + From 02435a8728b4d89d6afde0ef5da93eb87e5b0c62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 18:28:45 +0200 Subject: [PATCH 165/359] #60: ensure downloading senderProfile filtered by key is properly logged --- lib/metadataTypes/SenderProfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadataTypes/SenderProfile.js b/lib/metadataTypes/SenderProfile.js index edd5d46d5..91d331e54 100644 --- a/lib/metadataTypes/SenderProfile.js +++ b/lib/metadataTypes/SenderProfile.js @@ -43,7 +43,7 @@ class SenderProfile extends MetadataType { }, }; } - return super.retrieveSOAP(retrieveDir, requestParams); + return super.retrieveSOAP(retrieveDir, requestParams, key); } /** * Updates a single item From e67e606784d94e6ab6996feed32af3d44ab6d338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 23 Apr 2024 18:45:24 +0200 Subject: [PATCH 166/359] #1275: ensure Deployer and Retriever class get a slightly different no-key-set value --- lib/Deployer.js | 3 +-- lib/util/util.js | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index ecae55a39..1c8a63eeb 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -254,12 +254,11 @@ class Deployer { async _deploy(types, keyArr) { const typeArr = !types || Array.isArray(types) ? types : Object.keys(types); const typeKeyCombo = Array.isArray(types) - ? Util.createTypeKeyCombo(typeArr, keyArr) + ? Util.createTypeKeyCombo(typeArr, keyArr, true) : types; if (await File.pathExists(this.deployDir)) { /** @type {MultiMetadataTypeMap} */ this.metadata = Deployer.readBUMetadata(this.deployDir, typeArr); - // filter found metadata by key if given if (typeArr && Array.isArray(typeArr)) { for (const selectedType of typeArr) { diff --git a/lib/util/util.js b/lib/util/util.js index 8f105b871..71b891306 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -934,12 +934,13 @@ export const Util = { * * @param {string[]} typeArr - * @param {string[]} keyArr - + * @param {boolean} [returnEmpty] returns array with null element if false/not set; Retriever needs this to be false; Deployer needs it to be true * @returns {TypeKeyCombo} - */ - createTypeKeyCombo(typeArr, keyArr) { + createTypeKeyCombo(typeArr, keyArr, returnEmpty = false) { if (!keyArr || (Array.isArray(keyArr) && !keyArr.length)) { // no keys were provided, ensure we retrieve all - keyArr = [null]; + keyArr = returnEmpty ? null : [null]; } /** @type {TypeKeyCombo} */ const typeKeyMap = {}; From 5ee307dac496b1cc045bd572e7fc4f823aa1e1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 13:45:38 +0200 Subject: [PATCH 167/359] #0: ensure we don't try to deploy types that have nothing to deploy --- lib/Deployer.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Deployer.js b/lib/Deployer.js index 1c8a63eeb..cf923fb95 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -267,6 +267,12 @@ class Deployer { this.metadata[type], typeKeyCombo[selectedType] ); + if (!Object.keys(this.metadata[type]).length) { + Util.logger.warn( + `No deployable metadata found for type ${type} for selected keys` + ); + delete this.metadata[type]; + } } } } else { From f9a4527c948143ea3b2fc2a6925df5d402c80774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 13:51:05 +0200 Subject: [PATCH 168/359] #1275: add deploy tests and rework retrieve tests with/out --metadata --- test/general.test.js | 529 ++++++++++++++++++++++++++++++++----------- 1 file changed, 391 insertions(+), 138 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index 2db42befd..20ecdd413 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -16,154 +16,407 @@ describe('GENERAL', () => { testUtils.mockReset(); }); - describe('--metadata ================', () => { - it('retrieve single type without keys', async () => { - const argvMetadata = ['dataExtract']; - const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); - assert.notEqual( - typeof typeKeyCombo, - 'undefined', - 'typeKeyCombo should not be undefined' - ); - const buName = 'testInstance/testBU'; - const result = await handler.retrieve(buName, typeKeyCombo); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); - - const retrievedTypes = Object.keys(result[buName]); - assert.equal(retrievedTypes.length, 1, 'retrieve should have returned 1 type'); - assert.equal(retrievedTypes[0], 'dataExtract', 'retrieve should have returned 1 type'); - }); + describe('with --metadata ================', () => { + describe('retrieve --metadata ~~~', () => { + it('retrieve single type without keys', async () => { + const argvMetadata = ['dataExtract']; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.retrieve(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); - it('retrieve multiple type without keys', async () => { - const argvMetadata = ['dataExtension', 'senderProfile']; - const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); - assert.notEqual( - typeof typeKeyCombo, - 'undefined', - 'typeKeyCombo should not be undefined' - ); - const buName = 'testInstance/testBU'; - const result = await handler.retrieve(buName, typeKeyCombo); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 1, 'retrieve should have returned 1 type'); + assert.equal( + retrievedTypes[0], + 'dataExtract', + 'retrieve should have returned 1 type' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 6, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); - const retrievedTypes = Object.keys(result[buName]); - assert.equal(retrievedTypes.length, 2, 'retrieve should have returned 2 types'); - assert.equal( - retrievedTypes[0], - 'dataExtension', - 'retrieve should have returned dataExtension' - ); - assert.equal( - retrievedTypes[1], - 'senderProfile', - 'retrieve should have returned senderProfile' - ); - assert.equal( - Object.keys(result[buName]['senderProfile']).length, - 2, - 'retrieve should have returned 2 senderProfile' - ); + it('retrieve multiple type without keys', async () => { + const argvMetadata = ['dataExtension', 'senderProfile']; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.retrieve(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 2, 'retrieve should have returned 2 types'); + assert.equal( + retrievedTypes[0], + 'dataExtension', + 'retrieve should have returned dataExtension' + ); + assert.equal( + retrievedTypes[1], + 'senderProfile', + 'retrieve should have returned senderProfile' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 2, + 'retrieve should have returned 2 senderProfile' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 6, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); + + it('retrieve multiple type with keys', async () => { + const argvMetadata = [ + 'dataExtension', + 'dataExtract:wrong-key', + 'senderProfile:Default', + 'query:testExisting_query', + 'query:key:testExisting_query2', + ]; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.retrieve(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 4, 'retrieve should have returned 4 types'); + assert.equal( + retrievedTypes.includes('dataExtension'), + true, + 'retrieve should have returned dataExtension' + ); + assert.equal( + retrievedTypes.includes('dataExtract'), + true, + 'retrieve should have returned dataExtract' + ); + assert.equal( + retrievedTypes.includes('senderProfile'), + true, + 'retrieve should have returned senderProfile' + ); + assert.equal( + retrievedTypes.includes('query'), + true, + 'retrieve should have returned query' + ); + assert.equal( + Object.keys(result[buName]['dataExtension']).length, + 1, + 'retrieve should have returned 1 dataExtension' + ); + assert.equal( + Object.keys(result[buName]['dataExtract']).length, + 0, + 'retrieve should have returned 0 dataExtracts' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 1, + 'retrieve should have returned 1 senderProfile' + ); + assert.equal( + Object.keys(result[buName]['query']).length, + 2, + 'retrieve should have returned 2 query' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 12, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); }); - it('retrieve multiple type with keys', async () => { - const argvMetadata = [ - 'dataExtension', - 'dataExtract:wrong-key', - 'senderProfile:Default', - 'query:testExisting_query', - 'query:key:testExisting_query2', - ]; - const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); - assert.notEqual( - typeof typeKeyCombo, - 'undefined', - 'typeKeyCombo should not be undefined' - ); - const buName = 'testInstance/testBU'; - const result = await handler.retrieve(buName, typeKeyCombo); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + describe('deploy --metadata ~~~', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); - const retrievedTypes = Object.keys(result[buName]); - assert.equal(retrievedTypes.length, 4, 'retrieve should have returned 4 types'); - assert.equal( - retrievedTypes.includes('dataExtension'), - true, - 'retrieve should have returned dataExtension' - ); - assert.equal( - retrievedTypes.includes('dataExtract'), - true, - 'retrieve should have returned dataExtract' - ); - assert.equal( - retrievedTypes.includes('senderProfile'), - true, - 'retrieve should have returned senderProfile' - ); - assert.equal( - retrievedTypes.includes('query'), - true, - 'retrieve should have returned query' - ); - assert.equal( - Object.keys(result[buName]['dataExtension']).length, - 1, - 'retrieve should have returned 1 dataExtension' - ); - assert.equal( - Object.keys(result[buName]['dataExtract']).length, - 0, - 'retrieve should have returned 0 dataExtracts' - ); - assert.equal( - Object.keys(result[buName]['senderProfile']).length, - 1, - 'retrieve should have returned 1 senderProfile' - ); - assert.equal( - Object.keys(result[buName]['query']).length, - 2, - 'retrieve should have returned 2 query' - ); + it('deploy single type without keys', async () => { + const argvMetadata = ['dataExtract']; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.deploy(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + const deployedTypes = Object.keys(result[buName]); + assert.equal(deployedTypes.length, 1, 'deploy should have returned 1 type'); + assert.equal(deployedTypes[0], 'dataExtract', 'deploy should have returned 1 type'); + assert.equal( + testUtils.getAPIHistoryLength(), + 8, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); + + it('deploy multiple type without keys', async () => { + const argvMetadata = ['dataExtension', 'senderProfile']; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.deploy(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + const deployedTypes = Object.keys(result[buName]); + assert.equal(deployedTypes.length, 2, 'deploy should have returned 2 types'); + assert.equal( + deployedTypes[0], + 'dataExtension', + 'deploy should have returned dataExtension' + ); + assert.equal( + deployedTypes[1], + 'senderProfile', + 'deploy should have returned senderProfile' + ); + assert.equal( + Object.keys(result[buName]['dataExtension']).length, + 2, + 'deploy should have returned 2 dataExtension' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 2, + 'deploy should have returned 2 senderProfile' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 14, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); + + it('deploy multiple type with keys', async () => { + const argvMetadata = [ + 'dataExtension', + 'dataExtract:wrong-key', + 'senderProfile:testExisting_senderProfile', + 'query:testExisting_query', + 'query:key:wrong-key2', + ]; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + const result = await handler.deploy(buName, typeKeyCombo); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + const deployedTypes = Object.keys(result[buName]); + assert.equal(deployedTypes.length, 3, 'deploy should have returned 3 types'); + assert.equal( + deployedTypes.includes('dataExtension'), + true, + 'deploy should have returned dataExtension' + ); + assert.equal( + deployedTypes.includes('dataExtract'), + false, + 'deploy should have returned dataExtract' + ); + assert.equal( + deployedTypes.includes('senderProfile'), + true, + 'deploy should have returned senderProfile' + ); + assert.equal( + deployedTypes.includes('query'), + true, + 'deploy should have returned query' + ); + assert.equal( + Object.keys(result[buName]['dataExtension']).length, + 2, + 'deploy should have returned 2 dataExtension' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 1, + 'deploy should have returned 1 senderProfile' + ); + assert.equal( + Object.keys(result[buName]['query']).length, + 1, + 'deploy should have returned 1 query' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 15, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); }); }); describe('without --metadata ================', () => { - it('retrieve multiple type with keys', async () => { - const buName = 'testInstance/testBU'; - const result = await handler.retrieve( - buName, - ['dataExtract', 'senderProfile'], - ['wrong-key', 'Default'] - ); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + describe('retrieve without --metadata ~~~', () => { + it('retrieve multiple type with keys', async () => { + const buName = 'testInstance/testBU'; + const result = await handler.retrieve( + buName, + ['dataExtract', 'senderProfile'], + ['wrong-key', 'Default'] + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); - const retrievedTypes = Object.keys(result[buName]); - assert.equal(retrievedTypes.length, 2, 'retrieve should have returned 2 types'); - assert.equal( - retrievedTypes.includes('dataExtract'), - true, - 'retrieve should have returned dataExtract' - ); - assert.equal( - retrievedTypes.includes('senderProfile'), - true, - 'retrieve should have returned senderProfile' - ); - assert.equal( - Object.keys(result[buName]['dataExtract']).length, - 0, - 'retrieve should have returned 0 dataExtracts' - ); - assert.equal( - Object.keys(result[buName]['senderProfile']).length, - 1, - 'retrieve should have returned 1 senderProfile' - ); + const retrievedTypes = Object.keys(result[buName]); + assert.equal(retrievedTypes.length, 2, 'retrieve should have returned 2 types'); + assert.equal( + retrievedTypes.includes('dataExtract'), + true, + 'retrieve should have returned dataExtract' + ); + assert.equal( + retrievedTypes.includes('senderProfile'), + true, + 'retrieve should have returned senderProfile' + ); + assert.equal( + Object.keys(result[buName]['dataExtract']).length, + 0, + 'retrieve should have returned 0 dataExtracts' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 1, + 'retrieve should have returned 1 senderProfile' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 8, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); + }); + + describe('deploy without --metadata ~~~', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + + it('deploy multiple type without keys', async () => { + const argvMetadata = ['dataExtension', 'senderProfile']; + const buName = 'testInstance/testBU'; + const result = await handler.deploy(buName, argvMetadata); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + const deployedTypes = Object.keys(result[buName]); + assert.equal(deployedTypes.length, 2, 'deploy should have returned 2 types'); + assert.equal( + deployedTypes[0], + 'dataExtension', + 'deploy should have returned dataExtension' + ); + assert.equal( + deployedTypes[1], + 'senderProfile', + 'deploy should have returned senderProfile' + ); + assert.equal( + Object.keys(result[buName]['dataExtension']).length, + 2, + 'deploy should have returned 2 dataExtension' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 2, + 'deploy should have returned 2 senderProfile' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 14, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); + + it('deploy multiple type with keys', async () => { + const buName = 'testInstance/testBU'; + const result = await handler.deploy( + buName, + ['dataExtension', 'dataExtract', 'senderProfile', 'query'], + ['wrong-key', 'wrong-key2', 'testExisting_senderProfile', 'testExisting_query'] + ); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + const deployedTypes = Object.keys(result[buName]); + assert.equal(deployedTypes.length, 2, 'deploy should have returned 2 types'); + assert.equal( + deployedTypes.includes('dataExtension'), + false, + 'deploy should have returned dataExtension' + ); + assert.equal( + deployedTypes.includes('dataExtract'), + false, + 'deploy should have returned dataExtract' + ); + assert.equal( + deployedTypes.includes('senderProfile'), + true, + 'deploy should have returned senderProfile' + ); + assert.equal( + deployedTypes.includes('query'), + true, + 'deploy should have returned query' + ); + assert.equal( + Object.keys(result[buName]['senderProfile']).length, + 1, + 'deploy should have returned 1 senderProfile' + ); + assert.equal( + Object.keys(result[buName]['query']).length, + 1, + 'deploy should have returned 1 query' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 9, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); }); }); From f2d71d926f4872e2f4cd46179d80d9b34867a650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 18:22:20 +0200 Subject: [PATCH 169/359] #1275: actually add --metadata option to deploy method --- lib/cli.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/cli.js b/lib/cli.js index f884fa226..5c200fac0 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -80,6 +80,13 @@ yargs(hideBin(process.argv)) type: 'string', describe: 'metadata key that shall be exclusively uploaded', }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Options for deploy:', + describe: + 'type or type:key or type:i:id or type:n:name to deploy; if not provided, all metadata will be deploy', + }) .option('changeKeyField', { type: 'string', group: 'Options for deploy:', From ecceb8187bf7432838ee2f65581ad4ac4007408f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 18:24:06 +0200 Subject: [PATCH 170/359] #1275: cleanup --- lib/cli.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 5c200fac0..d79d73cd3 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -36,18 +36,18 @@ yargs(hideBin(process.argv)) type: 'string', describe: 'metadata keys that shall be exclusively downloaded', }) - .option('like', { + .option('metadata', { type: 'string', + alias: 'm', group: 'Options for retrieve:', describe: - 'filter metadata components (can include % as wildcard or _ for a single character)', + 'type or type:key or type:i:id or type:n:name to retrieve; if not provided, all metadata will be retrieved', }) - .option('metadata', { + .option('like', { type: 'string', - alias: 'm', group: 'Options for retrieve:', describe: - 'type or type:key or type:i:id or type:n:name to retrieve; if not provided, all metadata will be retrieved', + 'filter metadata components (can include % as wildcard or _ for a single character)', }); }, handler: (argv) => { @@ -281,7 +281,7 @@ yargs(hideBin(process.argv)) }) .option('json', { type: 'boolean', - group: 'Options for explainTypes:', + group: 'Options for resolveId:', describe: 'optionaly return info in json format', }); // TODO: add option --metadata From 229851b57a0501d44b97234f8875e8bbe690e87a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 18:25:45 +0200 Subject: [PATCH 171/359] #1275: ensure we require a key if we deploy with ---fromRetrieve and --metadata --- lib/Deployer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index cf923fb95..3c3ee8df0 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -101,8 +101,9 @@ class Deployer { Object.values(selectedTypesArr).length ) { // TypeKeyCombo - a single null value (== no keys for one type) should lead to the error + keysFound = true; for (const keys of Object.values(selectedTypesArr)) { - if (!Array.isArray(keys)) { + if (!Array.isArray(keys) || keys[0] === null) { keysFound = false; break; } From dfd81bf6447800b5781a99492e5e0abc3079d886 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 18:46:10 +0200 Subject: [PATCH 172/359] #1275: simplify logic --- lib/Deployer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index 3c3ee8df0..839ab0c07 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -103,7 +103,7 @@ class Deployer { // TypeKeyCombo - a single null value (== no keys for one type) should lead to the error keysFound = true; for (const keys of Object.values(selectedTypesArr)) { - if (!Array.isArray(keys) || keys[0] === null) { + if (keys === null) { keysFound = false; break; } From 5384295fd761e45f875f6eb8e54cc852726f35ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 19:15:10 +0200 Subject: [PATCH 173/359] #1284: fix script.definition file --- .../definitions/Script.definition.js | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/metadataTypes/definitions/Script.definition.js b/lib/metadataTypes/definitions/Script.definition.js index b88b68ebc..8200150ec 100644 --- a/lib/metadataTypes/definitions/Script.definition.js +++ b/lib/metadataTypes/definitions/Script.definition.js @@ -19,8 +19,8 @@ export default { typeName: 'Automation: Script Activity', fields: { categoryId: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, @@ -37,8 +37,8 @@ export default { template: false, }, description: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, @@ -49,8 +49,8 @@ export default { template: false, }, key: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, @@ -67,20 +67,20 @@ export default { template: false, }, name: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, script: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: true, }, ssjsActivityId: { - isCreateable: null, - isUpdateable: null, + isCreateable: true, + isUpdateable: true, retrieving: true, template: false, }, @@ -91,8 +91,8 @@ export default { template: false, }, statusId: { - isCreateable: null, - isUpdateable: null, + isCreateable: false, + isUpdateable: false, retrieving: false, template: false, }, From cca38a16728b13bd3eb68742f957a364da8f7a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 24 Apr 2024 19:20:42 +0200 Subject: [PATCH 174/359] #1284: add proper typing for explainTypes --- lib/index.js | 3 ++- lib/util/cli.js | 4 +++- types/mcdev.d.js | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/lib/index.js b/lib/index.js index 33185d5b7..87171109c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -33,6 +33,7 @@ import cache from './util/cache.js'; * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../types/mcdev.d.js').ExplainType} ExplainType */ /** @@ -154,7 +155,7 @@ class Mcdev { await Cli.selectTypes(properties); } /** - * @returns {object[]} list of supported types with their apiNames + * @returns {ExplainType[]} list of supported types with their apiNames */ static explainTypes() { return Cli.explainTypes(); diff --git a/lib/util/cli.js b/lib/util/cli.js index 0626fe022..e69c33745 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -29,6 +29,7 @@ import TransactionalMessage from './../metadataTypes/TransactionalMessage.js'; * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../../types/mcdev.d.js').ExplainType} ExplainType */ /** @@ -603,9 +604,10 @@ const Cli = { /** * shows metadata type descriptions * - * @returns {object[]} list of supported types with their apiNames + * @returns {ExplainType[]} list of supported types with their apiNames */ explainTypes() { + /** @type {ExplainType[]} */ const json = []; const apiNameArr = Object.keys(MetadataDefinitions); diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 1197a87b7..15a4e934b 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -444,5 +444,20 @@ complex * @property {Function} errorStack (ex, msg) print error with trace message * @typedef {import('winston').Logger & McdevLogger} Logger */ +/** + * @typedef {object} ExplainType + * @property {string} name readable name of type + * @property {string} apiName api parameter name for type + * @property {string} description more info on what this type is about + * @property {boolean | string[]} retrieveByDefault is it retrieved by default OR list of subtypes that are retrieved by default + * @property {object} supports supported features + * @property {boolean} supports.retrieve can you download this type + * @property {boolean} supports.create can you create new records of this type + * @property {boolean} supports.update can you update records of this type + * @property {boolean} supports.delete can you delete records of this type + * @property {boolean} supports.changeKey can you change the key of existing records of this type + * @property {boolean} supports.buildTemplate can you apply templating on downloaded records of this type + * @property {boolean} supports.retrieveAsTemplate can you retrieve & template in one step + */ export default {}; From 5c69451cc74bde69930dcd7cfdc60b82dc1dfaf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 09:47:59 +0200 Subject: [PATCH 175/359] #1289: auto-exclude dataExtension _MobileAddressApplication during retrieve --- lib/metadataTypes/definitions/DataExtension.definition.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/metadataTypes/definitions/DataExtension.definition.js b/lib/metadataTypes/definitions/DataExtension.definition.js index 80c8b8b89..064f5fb5c 100644 --- a/lib/metadataTypes/definitions/DataExtension.definition.js +++ b/lib/metadataTypes/definitions/DataExtension.definition.js @@ -36,6 +36,7 @@ export default { '_ChatMessagingSubscription', '_EnterpriseAttribute', '_MobileAddress', + '_MobileAddressApplication', '_MobileLineAddress', '_MobileLineAddressContact', '_MobileLineProfile', From ad874d6abe1a16b549d9d7b61a1babbc991fbb13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 17:13:14 +0200 Subject: [PATCH 176/359] #1292: add c__retentionPolicy and c__retainUntil --- lib/metadataTypes/DataExtension.js | 76 ++++++++++++++++++++++++++++++ types/mcdev.d.js | 14 +++--- 2 files changed, 84 insertions(+), 6 deletions(-) diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index c6eabb63c..493909b9e 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -950,6 +950,45 @@ class DataExtension extends MetadataType { delete metadata.CreatedDate; delete metadata.ModifiedDate; + // Retention policy + if ( + metadata.RowBasedRetention === false && + metadata.DeleteAtEndOfRetentionPeriod === false && + metadata.RetainUntil === '' + ) { + // Note: RetainUntil expected to NOT have a value + metadata.c__retentionPolicy = 'none'; + delete metadata.RetainUntil; + delete metadata.ResetRetentionPeriodOnImport; + } else if ( + metadata.RowBasedRetention === false && + metadata.DeleteAtEndOfRetentionPeriod === false + ) { + // Note: RetainUntil expected to have a value + metadata.c__retentionPolicy = 'allRecordsAndDataextension'; + } else if ( + metadata.RowBasedRetention === false && + metadata.DeleteAtEndOfRetentionPeriod === true + ) { + // Note: RetainUntil expected to have a value + metadata.c__retentionPolicy = 'allRecords'; + } else if ( + metadata.RowBasedRetention === true && + metadata.DeleteAtEndOfRetentionPeriod === false + ) { + // Note: RetainUntil expected to NOT have a value + metadata.c__retentionPolicy = 'individialRecords'; + delete metadata.RetainUntil; + } + delete metadata.RowBasedRetention; + delete metadata.DeleteAtEndOfRetentionPeriod; + + if (metadata.RetainUntil) { + const retainUntil = new Date(metadata.RetainUntil); + metadata.c__retainUntil = `${retainUntil.getFullYear()}-${retainUntil.getMonth() + 1}-${retainUntil.getDate()}`; + } + delete metadata.RetainUntil; + return metadata; } @@ -1095,6 +1134,43 @@ class DataExtension extends MetadataType { metadata.SendableSubscriberField.Name = 'Subscriber Key'; } + // Retention policy + switch (metadata.c__retentionPolicy) { + case 'none': { + metadata.RowBasedRetention = false; + metadata.DeleteAtEndOfRetentionPeriod = false; + metadata.ResetRetentionPeriodOnImport = false; + break; + } + case 'allRecordsAndDataextension': { + metadata.RowBasedRetention = false; + metadata.DeleteAtEndOfRetentionPeriod = false; + break; + } + case 'allRecords': { + metadata.RowBasedRetention = false; + metadata.DeleteAtEndOfRetentionPeriod = true; + break; + } + case 'individialRecords': { + metadata.RowBasedRetention = true; + metadata.DeleteAtEndOfRetentionPeriod = false; + break; + } + default: { + throw new Error(`Unknown retention policy: ${metadata.c__retentionPolicy}`); + } + } + delete metadata.c__retentionPolicy; + + if (metadata.c__retainUntil) { + const retainUntil = new Date(metadata.c__retainUntil); + metadata.RetainUntil = `${retainUntil.getMonth() + 1}/${retainUntil.getDate()}/${retainUntil.getFullYear()} 12:00:00 AM`; + delete metadata.c__retainUntil; + } else { + metadata.RetainUntil = ''; + } + return metadata; } diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 15a4e934b..c6c4d7385 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -115,12 +115,14 @@ * @property {string} [r__dataExtensionTemplate_Name] name of optionally associated DE template * @property {object} [Template] - * @property {string} [Template.CustomerKey] key of optionally associated DE teplate - * @property {string} [RetainUntil] ? - * @property {any} [DataRetentionPeriodLength] ? - * @property {any} [DataRetentionPeriodUnitOfMeasure] ? - * @property {any} [RowBasedRetention] ? - * @property {any} [ResetRetentionPeriodOnImport] ? - * @property {any} [DeleteAtEndOfRetentionPeriod] ? + * @property {string} [RetainUntil] empty string or US date + 12:00:00 AM + * @property {string} [c__retainUntil] YYYY-MM-DD + * @property {'none'|'allRecordsAndDataextension'|'allRecords'|'individialRecords'} [c__retentionPolicy] readable name of retention policy + * @property {number} [DataRetentionPeriodLength] number of days/weeks/months/years before retention kicks in + * @property {3|4|5|6} [DataRetentionPeriodUnitOfMeasure] 3:days, 4:weeks, 5:months, 6:years + * @property {boolean} [RowBasedRetention] true for retention policy individialRecords + * @property {boolean} [ResetRetentionPeriodOnImport] ? + * @property {boolean} [DeleteAtEndOfRetentionPeriod] true for retention policy allRecords */ /** * @typedef {Object.} DataExtensionMap From ce3d85acb54c52c858195e2c63af70b9862708dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 17:27:14 +0200 Subject: [PATCH 177/359] #1292: add c__dataRetentionPeriodUnitOfMeasure --- lib/metadataTypes/DataExtension.js | 15 +++++++++++++++ .../definitions/DataExtension.definition.js | 15 +++++++++++++++ types/mcdev.d.js | 9 +++++---- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index 493909b9e..f1d44bd6e 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -988,6 +988,13 @@ class DataExtension extends MetadataType { metadata.c__retainUntil = `${retainUntil.getFullYear()}-${retainUntil.getMonth() + 1}-${retainUntil.getDate()}`; } delete metadata.RetainUntil; + if (metadata.DataRetentionPeriodUnitOfMeasure) { + metadata.c__dataRetentionPeriodUnitOfMeasure = Util.inverseGet( + this.definition.dataRetentionPeriodUnitOfMeasureMapping, + metadata.DataRetentionPeriodUnitOfMeasure + ); + delete metadata.DataRetentionPeriodUnitOfMeasure; + } return metadata; } @@ -1171,6 +1178,14 @@ class DataExtension extends MetadataType { metadata.RetainUntil = ''; } + if (metadata.c__dataRetentionPeriodUnitOfMeasure) { + metadata.DataRetentionPeriodUnitOfMeasure = + this.definition.dataRetentionPeriodUnitOfMeasureMapping[ + metadata.c__dataRetentionPeriodUnitOfMeasure + ]; + delete metadata.c__dataRetentionPeriodUnitOfMeasure; + } + return metadata; } diff --git a/lib/metadataTypes/definitions/DataExtension.definition.js b/lib/metadataTypes/definitions/DataExtension.definition.js index 064f5fb5c..f6e2bb6c5 100644 --- a/lib/metadataTypes/definitions/DataExtension.definition.js +++ b/lib/metadataTypes/definitions/DataExtension.definition.js @@ -86,6 +86,12 @@ export default { SMSSubscriptionLog: null, // CustomerKey cannot be retrieved TriggeredSendDataExtension: ['SubscriberKey', 'EmailAddress'], }, + dataRetentionPeriodUnitOfMeasureMapping: { + Days: 3, + Weeks: 4, + Months: 5, + Years: 6, + }, hasExtended: false, idField: 'ObjectID', keyIsFixed: false, @@ -284,5 +290,14 @@ export default { r__dataExtensionTemplate_Name: { skipValidation: true, }, + c__retentionPolicy: { + skipValidation: true, + }, + c__retainUntil: { + skipValidation: true, + }, + c__dataRetentionPeriodUnitOfMeasure: { + skipValidation: true, + }, }, }; diff --git a/types/mcdev.d.js b/types/mcdev.d.js index c6c4d7385..b60364ce2 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -115,13 +115,14 @@ * @property {string} [r__dataExtensionTemplate_Name] name of optionally associated DE template * @property {object} [Template] - * @property {string} [Template.CustomerKey] key of optionally associated DE teplate - * @property {string} [RetainUntil] empty string or US date + 12:00:00 AM - * @property {string} [c__retainUntil] YYYY-MM-DD + * @property {string} RetainUntil empty string or US date + 12:00:00 AM + * @property {string} c__retainUntil YYYY-MM-DD * @property {'none'|'allRecordsAndDataextension'|'allRecords'|'individialRecords'} [c__retentionPolicy] readable name of retention policy * @property {number} [DataRetentionPeriodLength] number of days/weeks/months/years before retention kicks in - * @property {3|4|5|6} [DataRetentionPeriodUnitOfMeasure] 3:days, 4:weeks, 5:months, 6:years + * @property {number} [DataRetentionPeriodUnitOfMeasure] 3:Days, 4:Weeks, 5:Months, 6:Years + * @property {string} [c__dataRetentionPeriodUnitOfMeasure] 3:Days, 4:Weeks, 5:Months, 6:Years * @property {boolean} [RowBasedRetention] true for retention policy individialRecords - * @property {boolean} [ResetRetentionPeriodOnImport] ? + * @property {boolean} ResetRetentionPeriodOnImport ? * @property {boolean} [DeleteAtEndOfRetentionPeriod] true for retention policy allRecords */ /** From 53209d826e21121520d55ae1146ced7ad549e181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 18:08:11 +0200 Subject: [PATCH 178/359] #1292: updated dataExtension tests for new retention policy handling --- lib/metadataTypes/DataExtension.js | 6 +++++- ...ing_dataExtensionShared.dataExtension-meta.json | 7 +++---- ...New_dataExtensionShared.dataExtension-meta.json | 5 +---- ...tExisting_dataExtension.dataExtension-meta.json | 7 +++---- .../testNew_dataExtension.dataExtension-meta.json | 5 +---- .../1111111/dataExtension/create-expected.json | 11 ++++------- .../1111111/dataExtension/retrieve-expected.json | 6 ++---- .../1111111/dataExtension/update-expected.json | 14 +++++++------- .../1111111/dataExtension/update-response.xml | 4 +++- .../9999999/dataExtension/build-expected.json | 7 +++---- .../9999999/dataExtension/create-expected.json | 5 +---- ...ve-Name=testExisting_dataExtension-response.xml | 8 ++++---- .../9999999/dataExtension/retrieve-expected.json | 7 +++---- .../9999999/dataExtension/retrieve-response.xml | 8 ++++---- .../9999999/dataExtension/template-expected.json | 7 +++---- .../9999999/dataExtension/update-expected.json | 7 ++++--- .../9999999/dataExtension/update-response.xml | 8 +++++--- 17 files changed, 56 insertions(+), 66 deletions(-) diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index f1d44bd6e..68a2261f4 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -1165,7 +1165,11 @@ class DataExtension extends MetadataType { break; } default: { - throw new Error(`Unknown retention policy: ${metadata.c__retentionPolicy}`); + Util.logger.debug( + ` - dataExtension '${ + metadata[this.definition.nameField] + }': Unknown retention policy: ${metadata.c__retentionPolicy}` + ); } } delete metadata.c__retentionPolicy; diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json b/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json index 9af73620a..2314d37a5 100644 --- a/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json @@ -7,11 +7,7 @@ "SendableDataExtensionField": { "Name": "ContactKey" }, "SendableSubscriberField": { "Name": "Subscriber Key" }, "DataRetentionPeriodLength": 6, - "DataRetentionPeriodUnitOfMeasure": 5, - "RowBasedRetention": true, "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "FirstName", @@ -54,6 +50,9 @@ "FieldType": "Text" } ], + "c__dataRetentionPeriodUnitOfMeasure": "Days", + "c__retainUntil": "2024-5-9", + "c__retentionPolicy": "allRecords", "r__folder_ContentType": "shared_dataextension", "r__folder_Path": "Shared Items/Shared Data Extensions" } diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testNew_dataExtensionShared.dataExtension-meta.json b/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testNew_dataExtensionShared.dataExtension-meta.json index daf504e7c..8770af6d2 100644 --- a/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testNew_dataExtensionShared.dataExtension-meta.json +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testNew_dataExtensionShared.dataExtension-meta.json @@ -4,10 +4,6 @@ "Description": "", "IsSendable": false, "IsTestable": false, - "RowBasedRetention": false, - "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "testField", @@ -18,6 +14,7 @@ "FieldType": "Text" } ], + "c__retentionPolicy": "none", "r__folder_ContentType": "shared_dataextension", "r__folder_Path": "Shared Items/Shared Data Extensions" } diff --git a/test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json b/test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json index ccd840273..7e78e6468 100644 --- a/test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json @@ -7,11 +7,7 @@ "SendableDataExtensionField": { "Name": "ContactKey" }, "SendableSubscriberField": { "Name": "Subscriber Key" }, "DataRetentionPeriodLength": 6, - "DataRetentionPeriodUnitOfMeasure": 5, - "RowBasedRetention": true, "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "FirstName", @@ -55,6 +51,9 @@ "FieldType": "Text" } ], + "c__dataRetentionPeriodUnitOfMeasure": "Days", + "c__retainUntil": "2024-5-9", + "c__retentionPolicy": "allRecords", "r__folder_ContentType": "dataextension", "r__folder_Path": "Data Extensions" } diff --git a/test/mockRoot/deploy/testInstance/testBU/dataExtension/testNew_dataExtension.dataExtension-meta.json b/test/mockRoot/deploy/testInstance/testBU/dataExtension/testNew_dataExtension.dataExtension-meta.json index a4e4ef7aa..5701a0f7b 100644 --- a/test/mockRoot/deploy/testInstance/testBU/dataExtension/testNew_dataExtension.dataExtension-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/dataExtension/testNew_dataExtension.dataExtension-meta.json @@ -4,10 +4,6 @@ "Description": "", "IsSendable": false, "IsTestable": false, - "RowBasedRetention": false, - "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "testField", @@ -18,6 +14,7 @@ "FieldType": "Text" } ], + "c__retentionPolicy": "none", "r__folder_ContentType": "dataextension", "r__folder_Path": "Data Extensions" } diff --git a/test/resources/1111111/dataExtension/create-expected.json b/test/resources/1111111/dataExtension/create-expected.json index 222e46023..9aad7ca07 100644 --- a/test/resources/1111111/dataExtension/create-expected.json +++ b/test/resources/1111111/dataExtension/create-expected.json @@ -1,7 +1,9 @@ { "CustomerKey": "testNew_dataExtensionShared", - "DeleteAtEndOfRetentionPeriod": false, + "Name": "testNew_dataExtensionShared", "Description": "", + "IsSendable": false, + "IsTestable": false, "Fields": [ { "DefaultValue": "", @@ -12,12 +14,7 @@ "Name": "testField" } ], - "IsSendable": false, - "IsTestable": false, - "Name": "testNew_dataExtensionShared", - "ResetRetentionPeriodOnImport": false, - "RetainUntil": "", - "RowBasedRetention": false, + "c__retentionPolicy": "none", "r__folder_ContentType": "shared_dataextension", "r__folder_Path": "Shared Items/Shared Data Extensions" } diff --git a/test/resources/1111111/dataExtension/retrieve-expected.json b/test/resources/1111111/dataExtension/retrieve-expected.json index f64ad16df..d15755909 100644 --- a/test/resources/1111111/dataExtension/retrieve-expected.json +++ b/test/resources/1111111/dataExtension/retrieve-expected.json @@ -1,8 +1,6 @@ { "CustomerKey": "testExisting_dataExtensionShared", "DataRetentionPeriodLength": 6, - "DataRetentionPeriodUnitOfMeasure": 5, - "DeleteAtEndOfRetentionPeriod": false, "Description": "bla bla", "Fields": [ { @@ -42,14 +40,14 @@ "IsTestable": true, "Name": "testExisting_dataExtensionShared", "ResetRetentionPeriodOnImport": false, - "RetainUntil": "", - "RowBasedRetention": true, "SendableDataExtensionField": { "Name": "ContactKey" }, "SendableSubscriberField": { "Name": "Subscriber Key" }, + "c__dataRetentionPeriodUnitOfMeasure": "Months", + "c__retentionPolicy": "individialRecords", "r__folder_ContentType": "shared_dataextension", "r__folder_Path": "Shared Items/Shared Data Extensions" } diff --git a/test/resources/1111111/dataExtension/update-expected.json b/test/resources/1111111/dataExtension/update-expected.json index bd074f2ad..8f9c83f8c 100644 --- a/test/resources/1111111/dataExtension/update-expected.json +++ b/test/resources/1111111/dataExtension/update-expected.json @@ -1,7 +1,11 @@ { "CustomerKey": "testExisting_dataExtensionShared", - "DeleteAtEndOfRetentionPeriod": false, + "Name": "testExisting_dataExtensionShared", "Description": "Container for my test emails", + "IsSendable": false, + "IsTestable": false, + "DataRetentionPeriodLength": 6, + "ResetRetentionPeriodOnImport": false, "Fields": [ { "DefaultValue": "", @@ -44,12 +48,8 @@ "Name": "newField" } ], - "IsSendable": false, - "IsTestable": false, - "Name": "testExisting_dataExtensionShared", - "ResetRetentionPeriodOnImport": false, - "RetainUntil": "", - "RowBasedRetention": true, + "c__dataRetentionPeriodUnitOfMeasure": "Months", + "c__retentionPolicy": "individialRecords", "r__folder_ContentType": "shared_dataextension", "r__folder_Path": "Shared Items/Shared Data Extensions" } diff --git a/test/resources/1111111/dataExtension/update-response.xml b/test/resources/1111111/dataExtension/update-response.xml index f2122b7e1..7016a65db 100644 --- a/test/resources/1111111/dataExtension/update-response.xml +++ b/test/resources/1111111/dataExtension/update-response.xml @@ -31,9 +31,11 @@ Container for my test emails false false + 6 + 5 false false - false + true diff --git a/test/resources/9999999/dataExtension/build-expected.json b/test/resources/9999999/dataExtension/build-expected.json index 21d43fdbf..d54b9bbf9 100644 --- a/test/resources/9999999/dataExtension/build-expected.json +++ b/test/resources/9999999/dataExtension/build-expected.json @@ -7,11 +7,7 @@ "SendableDataExtensionField": { "Name": "ContactKey" }, "SendableSubscriberField": { "Name": "Subscriber Key" }, "DataRetentionPeriodLength": 6, - "DataRetentionPeriodUnitOfMeasure": 5, - "RowBasedRetention": true, "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "FirstName", @@ -62,6 +58,9 @@ "FieldType": "Number" } ], + "c__dataRetentionPeriodUnitOfMeasure": "Months", + "c__retainUntil": "2024-5-9", + "c__retentionPolicy": "allRecords", "r__folder_ContentType": "dataextension", "r__folder_Path": "Data Extensions" } diff --git a/test/resources/9999999/dataExtension/create-expected.json b/test/resources/9999999/dataExtension/create-expected.json index a4e4ef7aa..5701a0f7b 100644 --- a/test/resources/9999999/dataExtension/create-expected.json +++ b/test/resources/9999999/dataExtension/create-expected.json @@ -4,10 +4,6 @@ "Description": "", "IsSendable": false, "IsTestable": false, - "RowBasedRetention": false, - "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "testField", @@ -18,6 +14,7 @@ "FieldType": "Text" } ], + "c__retentionPolicy": "none", "r__folder_ContentType": "dataextension", "r__folder_Path": "Data Extensions" } diff --git a/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml b/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml index e7cf0d2ef..d2f4ace4a 100644 --- a/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml +++ b/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml @@ -41,12 +41,12 @@ 6 5 - true + false false - false - + true + 5/9/2024 12:00:00 AM 2 - \ No newline at end of file + diff --git a/test/resources/9999999/dataExtension/retrieve-expected.json b/test/resources/9999999/dataExtension/retrieve-expected.json index c8c945cc3..4049fe48d 100644 --- a/test/resources/9999999/dataExtension/retrieve-expected.json +++ b/test/resources/9999999/dataExtension/retrieve-expected.json @@ -7,11 +7,7 @@ "SendableDataExtensionField": { "Name": "ContactKey" }, "SendableSubscriberField": { "Name": "Subscriber Key" }, "DataRetentionPeriodLength": 6, - "DataRetentionPeriodUnitOfMeasure": 5, - "RowBasedRetention": true, "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "FirstName", @@ -62,6 +58,9 @@ "FieldType": "Number" } ], + "c__dataRetentionPeriodUnitOfMeasure": "Months", + "c__retainUntil": "2024-5-9", + "c__retentionPolicy": "allRecords", "r__folder_ContentType": "dataextension", "r__folder_Path": "Data Extensions" } diff --git a/test/resources/9999999/dataExtension/retrieve-response.xml b/test/resources/9999999/dataExtension/retrieve-response.xml index e7cf0d2ef..d2f4ace4a 100644 --- a/test/resources/9999999/dataExtension/retrieve-response.xml +++ b/test/resources/9999999/dataExtension/retrieve-response.xml @@ -41,12 +41,12 @@ 6 5 - true + false false - false - + true + 5/9/2024 12:00:00 AM 2 - \ No newline at end of file + diff --git a/test/resources/9999999/dataExtension/template-expected.json b/test/resources/9999999/dataExtension/template-expected.json index c2513cfa0..439050ea5 100644 --- a/test/resources/9999999/dataExtension/template-expected.json +++ b/test/resources/9999999/dataExtension/template-expected.json @@ -7,11 +7,7 @@ "SendableDataExtensionField": { "Name": "ContactKey" }, "SendableSubscriberField": { "Name": "Subscriber Key" }, "DataRetentionPeriodLength": 6, - "DataRetentionPeriodUnitOfMeasure": 5, - "RowBasedRetention": true, "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "FirstName", @@ -62,6 +58,9 @@ "FieldType": "Number" } ], + "c__dataRetentionPeriodUnitOfMeasure": "Months", + "c__retainUntil": "2024-5-9", + "c__retentionPolicy": "allRecords", "r__folder_ContentType": "dataextension", "r__folder_Path": "Data Extensions" } diff --git a/test/resources/9999999/dataExtension/update-expected.json b/test/resources/9999999/dataExtension/update-expected.json index 7106168c8..51b603741 100644 --- a/test/resources/9999999/dataExtension/update-expected.json +++ b/test/resources/9999999/dataExtension/update-expected.json @@ -4,10 +4,8 @@ "Description": "Container for my test emails", "IsSendable": false, "IsTestable": false, - "RowBasedRetention": true, + "DataRetentionPeriodLength": 6, "ResetRetentionPeriodOnImport": false, - "DeleteAtEndOfRetentionPeriod": false, - "RetainUntil": "", "Fields": [ { "Name": "FirstName", @@ -66,6 +64,9 @@ "FieldType": "Text" } ], + "c__dataRetentionPeriodUnitOfMeasure": "Months", + "c__retainUntil": "2024-5-9", + "c__retentionPolicy": "allRecords", "r__folder_ContentType": "dataextension", "r__folder_Path": "Data Extensions" } diff --git a/test/resources/9999999/dataExtension/update-response.xml b/test/resources/9999999/dataExtension/update-response.xml index dd30fc28f..f08b00787 100644 --- a/test/resources/9999999/dataExtension/update-response.xml +++ b/test/resources/9999999/dataExtension/update-response.xml @@ -31,10 +31,12 @@ Container for my test emails false false + 6 + 5 false false - false - + true + 5/9/2024 12:00:00 AM @@ -54,4 +56,4 @@ OK - \ No newline at end of file + From 201e897ae0cb22feff01a9037163cbd8167e2aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 18:09:15 +0200 Subject: [PATCH 179/359] #1292: fix eventDefinition test cases on Windows machines --- lib/metadataTypes/Event.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index f0a0f415b..8de56b1bd 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -26,8 +26,8 @@ import cache from '../util/cache.js'; class Event extends MetadataType { /** * Retrieves Metadata of Event Definition. - * Endpoint /interaction/v1/EventDefinitions return all Event Definitions with all details. - * Currently it is not needed to loop over Imports with endpoint /interaction/v1/EventDefinitions/{id} + * Endpoint /interaction/v1/eventDefinitions return all Event Definitions with all details. + * Currently it is not needed to loop over Imports with endpoint /interaction/v1/eventDefinitions/{id} * * @param {string} retrieveDir Directory where retrieved metadata directory will be saved * @param {void | string[]} [_] unused parameter @@ -39,7 +39,7 @@ class Event extends MetadataType { Util.logBeta(this.definition.type); return super.retrieveREST( retrieveDir, - `/interaction/v1/EventDefinitions${ + `/interaction/v1/eventDefinitions${ key ? '/key:' + encodeURIComponent(key) : '' }?extras=all`, null, @@ -53,7 +53,7 @@ class Event extends MetadataType { * @returns {Promise.} Promise of metadata */ static retrieveForCache() { - return super.retrieveREST(null, '/interaction/v1/EventDefinitions/'); + return super.retrieveREST(null, '/interaction/v1/eventDefinitions/'); } /** @@ -67,7 +67,7 @@ class Event extends MetadataType { static async retrieveAsTemplate(templateDir, name, templateVariables) { Util.logBeta(this.definition.type); const res = await this.client.rest.get( - '/interaction/v1/EventDefinitions?name=' + encodeURIComponent(name) + '/interaction/v1/eventDefinitions?name=' + encodeURIComponent(name) ); const event = res.items.filter((item) => item.name === name); try { @@ -162,7 +162,7 @@ class Event extends MetadataType { * @returns {Promise} Promise */ static create(metadata) { - return super.createREST(metadata, '/interaction/v1/EventDefinitions/'); + return super.createREST(metadata, '/interaction/v1/eventDefinitions/'); } /** @@ -174,7 +174,7 @@ class Event extends MetadataType { static async update(metadataEntry) { return super.updateREST( metadataEntry, - '/interaction/v1/EventDefinitions/' + metadataEntry.id, + '/interaction/v1/eventDefinitions/' + metadataEntry.id, 'put' ); } From 848015c38cdc65d40242dff691d17af78fd4bf7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 22:14:37 +0200 Subject: [PATCH 180/359] #1292: fix case in path of eventDefinition test response --- .../v1/eventDefinitions/get-response.json | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/resources/9999999/interaction/v1/eventDefinitions/get-response.json diff --git a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json new file mode 100644 index 000000000..4cecd2da9 --- /dev/null +++ b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json @@ -0,0 +1,43 @@ +{ + "count": 1, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [ + { + "id": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", + "type": "APIEvent", + "name": "TestContact_Event", + "description": "", + "createdDate": "2018-08-03T07:55:27.38", + "createdBy": 7586085, + "modifiedDate": "2018-08-03T08:22:03.76", + "modifiedBy": 7586085, + "mode": "Production", + "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", + "dataExtensionName": "Contact_Data", + "sourceApplicationExtensionId": "7db1f972-f8b7-49b6-91b5-fa218e13953d", + "filterDefinitionTemplate": "", + "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", + "arguments": { + "serializedObjectType": 11, + "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", + "dataExtensionId": "C25D5A59-5EBC-40C9-8D27-149831881D89", + "automationId": "00000000-0000-0000-0000-000000000000", + "criteria": "", + "useHighWatermark": false + }, + "metaData": { + "scheduleState": "No Schedule", + "criteriaDescription": "" + }, + "interactionCount": 1, + "isVisibleInPicker": true, + "isPlatformObject": false, + "category": "Event", + "publishedInteractionCount": 1, + "automationId": "00000000-0000-0000-0000-000000000000", + "disableDEDataLogging": false + } + ] +} From 8c0a2f57ddcd4a41b7a427fea8624223932562c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 22:17:01 +0200 Subject: [PATCH 181/359] Delete test/resources/9999999/interaction/v1/EventDefinitions/get-response.json wrong case in path --- .../v1/EventDefinitions/get-response.json | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 test/resources/9999999/interaction/v1/EventDefinitions/get-response.json diff --git a/test/resources/9999999/interaction/v1/EventDefinitions/get-response.json b/test/resources/9999999/interaction/v1/EventDefinitions/get-response.json deleted file mode 100644 index 4cecd2da9..000000000 --- a/test/resources/9999999/interaction/v1/EventDefinitions/get-response.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "count": 1, - "page": 1, - "pageSize": 50, - "links": {}, - "items": [ - { - "id": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", - "type": "APIEvent", - "name": "TestContact_Event", - "description": "", - "createdDate": "2018-08-03T07:55:27.38", - "createdBy": 7586085, - "modifiedDate": "2018-08-03T08:22:03.76", - "modifiedBy": 7586085, - "mode": "Production", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "dataExtensionName": "Contact_Data", - "sourceApplicationExtensionId": "7db1f972-f8b7-49b6-91b5-fa218e13953d", - "filterDefinitionTemplate": "", - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "arguments": { - "serializedObjectType": 11, - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "dataExtensionId": "C25D5A59-5EBC-40C9-8D27-149831881D89", - "automationId": "00000000-0000-0000-0000-000000000000", - "criteria": "", - "useHighWatermark": false - }, - "metaData": { - "scheduleState": "No Schedule", - "criteriaDescription": "" - }, - "interactionCount": 1, - "isVisibleInPicker": true, - "isPlatformObject": false, - "category": "Event", - "publishedInteractionCount": 1, - "automationId": "00000000-0000-0000-0000-000000000000", - "disableDEDataLogging": false - } - ] -} From cd46d356a22a51d95759464273f763d779ba5dcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 22:29:06 +0200 Subject: [PATCH 182/359] #1292: fix weird git behavior by removing & re-adding this --- .../v1/eventDefinitions/get-response.json | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 test/resources/9999999/interaction/v1/eventDefinitions/get-response.json diff --git a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json deleted file mode 100644 index 4cecd2da9..000000000 --- a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "count": 1, - "page": 1, - "pageSize": 50, - "links": {}, - "items": [ - { - "id": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", - "type": "APIEvent", - "name": "TestContact_Event", - "description": "", - "createdDate": "2018-08-03T07:55:27.38", - "createdBy": 7586085, - "modifiedDate": "2018-08-03T08:22:03.76", - "modifiedBy": 7586085, - "mode": "Production", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "dataExtensionName": "Contact_Data", - "sourceApplicationExtensionId": "7db1f972-f8b7-49b6-91b5-fa218e13953d", - "filterDefinitionTemplate": "", - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "arguments": { - "serializedObjectType": 11, - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "dataExtensionId": "C25D5A59-5EBC-40C9-8D27-149831881D89", - "automationId": "00000000-0000-0000-0000-000000000000", - "criteria": "", - "useHighWatermark": false - }, - "metaData": { - "scheduleState": "No Schedule", - "criteriaDescription": "" - }, - "interactionCount": 1, - "isVisibleInPicker": true, - "isPlatformObject": false, - "category": "Event", - "publishedInteractionCount": 1, - "automationId": "00000000-0000-0000-0000-000000000000", - "disableDEDataLogging": false - } - ] -} From 648d31b802655b1b83f6db6cf186fea3397acb02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 3 May 2024 22:29:41 +0200 Subject: [PATCH 183/359] Revert "#1292: fix weird git behavior by removing & re-adding this" This reverts commit cd46d356a22a51d95759464273f763d779ba5dcd. --- .../v1/eventDefinitions/get-response.json | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 test/resources/9999999/interaction/v1/eventDefinitions/get-response.json diff --git a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json new file mode 100644 index 000000000..4cecd2da9 --- /dev/null +++ b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json @@ -0,0 +1,43 @@ +{ + "count": 1, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [ + { + "id": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", + "type": "APIEvent", + "name": "TestContact_Event", + "description": "", + "createdDate": "2018-08-03T07:55:27.38", + "createdBy": 7586085, + "modifiedDate": "2018-08-03T08:22:03.76", + "modifiedBy": 7586085, + "mode": "Production", + "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", + "dataExtensionName": "Contact_Data", + "sourceApplicationExtensionId": "7db1f972-f8b7-49b6-91b5-fa218e13953d", + "filterDefinitionTemplate": "", + "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", + "arguments": { + "serializedObjectType": 11, + "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", + "dataExtensionId": "C25D5A59-5EBC-40C9-8D27-149831881D89", + "automationId": "00000000-0000-0000-0000-000000000000", + "criteria": "", + "useHighWatermark": false + }, + "metaData": { + "scheduleState": "No Schedule", + "criteriaDescription": "" + }, + "interactionCount": 1, + "isVisibleInPicker": true, + "isPlatformObject": false, + "category": "Event", + "publishedInteractionCount": 1, + "automationId": "00000000-0000-0000-0000-000000000000", + "disableDEDataLogging": false + } + ] +} From de0437335139a8151d5ca42aca0388cc7fc614be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sat, 4 May 2024 14:10:53 +0200 Subject: [PATCH 184/359] #62: add test for retrieve quicksend journey --- lib/metadataTypes/Journey.js | 139 ++- test/general.test.js | 4 +- .../dataExtension/retrieve-response.xml | 21 + .../v1/eventDefinitions/get-response.json | 42 + .../delete-response.json | 1 - .../v1/interactions/get-response.json | 827 ------------------ .../get-response.json | 592 ------------- .../put-response.json | 592 ------------- .../get-response.json | 317 +++++++ .../get-response.json | 253 ++++++ .../v1/interactions/post-response.json | 280 ------ .../9999999/journey/get-expected.json | 576 ------------ .../get-quicksend-expected.json} | 101 ++- .../9999999/list/retrieve-response.xml | 13 + test/type.dataExtension.test.js | 8 +- test/type.journey.test.js | 118 +-- 16 files changed, 785 insertions(+), 3099 deletions(-) delete mode 100644 test/resources/9999999/interaction/v1/interactions/233d4413-922c-4568-85a5-e5cc77efc3be/delete-response.json delete mode 100644 test/resources/9999999/interaction/v1/interactions/get-response.json delete mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json delete mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/put-response.json create mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json create mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json delete mode 100644 test/resources/9999999/interaction/v1/interactions/post-response.json delete mode 100644 test/resources/9999999/journey/get-expected.json rename test/resources/9999999/{interaction/v1/interactions/key_0b76dccf-594c-b6dc-1acf-10c4493dcb84/get-response.json => journey/get-quicksend-expected.json} (66%) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index d86f6ea3a..1430bd673 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -318,7 +318,11 @@ class Journey extends MetadataType { super.setFolderPath(metadata); switch (metadata.definitionType) { + case 'Quicksend': // Single Send Journey case 'Multistep': { + // Single Send Journey + // ~~~ TRIGGERS ~~~~ + // event && triggers[].type === 'ContactAudience' // Multi-Step Journey // ~~~ TRIGGERS ~~~~ // event / definitionType==='Multistep' && channel==='' && triggers[].type === 'EmailAudience'|'APIEvent' @@ -356,46 +360,6 @@ class Journey extends MetadataType { // TODO: journey template id? / metaData.templateId break; } - case 'Quicksend': { - // Single Send Journey - // ~~~ TRIGGERS ~~~~ - // event && triggers[].type === 'ContactAudience' - if ( - metadata.triggers?.length > 0 && - metadata.triggers[0].metaData?.eventDefinitionKey - ) { - // trigger found; there can only be one entry in this array - try { - const edId = cache.searchForField( - 'event', - metadata.triggers[0].metaData.eventDefinitionKey, - 'eventDefinitionKey', - 'id' - ); - if (metadata.triggers[0].metaData.eventDefinitionId !== edId) { - throw new Error( - ` - ${this.definition.type} ${ - metadata[this.definition.nameField] - } (${ - metadata[this.definition.keyField] - }): eventDefinitionId not matching Id found on event with key in eventDefinitionKey` - ); - } - delete metadata.triggers[0].metaData.eventDefinitionId; - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ - metadata[this.definition.keyField] - }): ${ex.message}.` - ); - } - } - - // ~~~ ACTIVITIES ~~~~ - this._postRetrieveTasks_activities(metadata); - - break; - } case 'Transactional': { // Transactional Send Journey // ~~~ TRIGGERS ~~~~ @@ -543,12 +507,11 @@ class Journey extends MetadataType { const triggeredSend = activity.configurationArguments?.triggeredSend; if (triggeredSend) { // List (optional) + triggeredSend.r__list_PathName = {}; if (triggeredSend.publicationListId) { try { - triggeredSend.r__list_PathName = cache.getListPathName( - triggeredSend.publicationListId, - 'ID' - ); + triggeredSend.r__list_PathName.publicationList = + cache.getListPathName(triggeredSend.publicationListId, 'ID'); delete triggeredSend.publicationListId; } catch (ex) { Util.logger.warn( @@ -557,6 +520,62 @@ class Journey extends MetadataType { // save this TSD because it could be fixed by the user } } + if ( + triggeredSend.suppressionLists && + Array.isArray(triggeredSend.suppressionLists) && + triggeredSend.suppressionLists.length + ) { + triggeredSend.r__list_PathName.suppressionLists = + triggeredSend.suppressionLists.map((sList) => { + try { + return cache.getListPathName(sList.id, 'ID'); + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.typeName} '${metadata.name}'/'${metadata.key}': ${ex.message}` + ); + // save this TSD because it could be fixed by the user + } + }); + delete triggeredSend.suppressionLists; + } + if (!Object.keys(triggeredSend.r__list_PathName).length) { + // in case we found no linked lists, remove this empty shell + delete triggeredSend.r__list_PathName; + } + + // DataExtension (optional) + triggeredSend.r__dataExtension_CustomerKey = {}; + if ( + triggeredSend.domainExclusions && + Array.isArray(triggeredSend.domainExclusions) && + triggeredSend.domainExclusions.length + ) { + let errors = 0; + triggeredSend.r__dataExtension_CustomerKey.domainExclusions = + triggeredSend.domainExclusions.map((de) => { + try { + return cache.searchForField( + 'dataExtension', + de.id, + 'ObjectID', + 'CustomerKey' + ); + } catch (ex) { + errors++; + Util.logger.warn( + ` - ${this.definition.typeName} '${metadata.name}'/'${metadata.key}': ${ex.message}` + ); + // save this TSD because it could be fixed by the user + } + }); + if (!errors) { + delete triggeredSend.domainExclusions; // array with id & name of DE + } + } + if (!Object.keys(triggeredSend.r__dataExtension_CustomerKey).length) { + // in case we found no linked dataExtensions, remove this empty shell + delete triggeredSend.r__dataExtension_CustomerKey; + } // sender profile if (triggeredSend.senderProfileId) { @@ -764,13 +783,14 @@ class Journey extends MetadataType { */ static async preDeployTasks(metadata) { if (metadata.status !== 'Draft') { - metadata.status !== 'Draft'; + metadata.status = 'Draft'; } // folder super.setFolderId(metadata); switch (metadata.definitionType) { + case 'Quicksend': case 'Multistep': { // Multi-Step Journey // ~~~ TRIGGERS ~~~~ @@ -804,35 +824,6 @@ class Journey extends MetadataType { // TODO: journey template id? / metaData.templateId break; } - case 'Quicksend': { - // ~~~ TRIGGERS ~~~~ - // event && triggers[].type === 'ContactAudience' - if ( - metadata.triggers?.length > 0 && - metadata.triggers[0].metaData?.eventDefinitionKey - ) { - // trigger found; there can only be one entry in this array - try { - metadata.triggers[0].metaData.eventDefinitionId = cache.searchForField( - 'event', - metadata.triggers[0].metaData?.eventDefinitionKey, - 'eventDefinitionKey', - 'id' - ); - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ - metadata[this.definition.keyField] - }): ${ex.message}.` - ); - } - } - - // ~~~ ACTIVITIES ~~~~ - this._preDeployTasks_activities(metadata); - - break; - } case 'Transactional': { // Transactional Send Journey // ~~~ TRIGGERS ~~~~ diff --git a/test/general.test.js b/test/general.test.js index 20ecdd413..e847adccc 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -125,8 +125,8 @@ describe('GENERAL', () => { ); assert.equal( Object.keys(result[buName]['dataExtension']).length, - 1, - 'retrieve should have returned 1 dataExtension' + 3, + 'retrieve should have returned 3 dataExtension' ); assert.equal( Object.keys(result[buName]['dataExtract']).length, diff --git a/test/resources/9999999/dataExtension/retrieve-response.xml b/test/resources/9999999/dataExtension/retrieve-response.xml index eb099050f..60c96bb57 100644 --- a/test/resources/9999999/dataExtension/retrieve-response.xml +++ b/test/resources/9999999/dataExtension/retrieve-response.xml @@ -73,6 +73,27 @@ 2 + + + 2024-04-24T12:15:55.853 + 2024-04-24T12:15:55.853 + 5a7194ad-6602-ef11-a5c8-5cba2c702db8 + testExisting_DomainExclusion + testExisting_DomainExclusion + Domain Exclusion Data Extension Template + false + false + + false + false + false + + 2 + diff --git a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json index 4cecd2da9..75af49234 100644 --- a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json +++ b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json @@ -38,6 +38,48 @@ "publishedInteractionCount": 1, "automationId": "00000000-0000-0000-0000-000000000000", "disableDEDataLogging": false + }, + { + "id": "9e1995f8-951d-4019-855c-826b45e5b028", + "type": "EmailAudience", + "name": "testExisting_journey_Quicksend", + "description": "", + "createdDate": "2024-04-24T12:18:40.573", + "createdBy": 700301950, + "modifiedDate": "2024-04-24T12:18:40.573", + "modifiedBy": 700301950, + "mode": "Production", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "dataExtensionId": "1c8064d5-6502-ef11-a5c8-5cba2c702db8", + "dataExtensionName": "testExisting_journey_Quicksend", + "sourceApplicationExtensionId": "97e942ee-6914-4d3d-9e52-37ecb71f79ed", + "filterDefinitionId": "00000000-0000-0000-0000-000000000000", + "filterDefinitionTemplate": "", + "iconUrl": "/images/icon-data-extension.svg", + "arguments": { + "serializedObjectType": 3, + "useHighWatermark": false, + "eventDefinitionId": "9e1995f8-951d-4019-855c-826b45e5b028", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "dataExtensionId": "1c8064d5-6502-ef11-a5c8-5cba2c702db8", + "criteria": "" + }, + "configurationArguments": { + "unconfigured": false + }, + "metaData": { + "criteriaDescription": "", + "scheduleFlowMode": "runOnce", + "runOnceScheduleMode": "onPublish", + "scheduleState": "No Schedule" + }, + "interactionCount": 1, + "isVisibleInPicker": false, + "isPlatformObject": false, + "category": "Audience", + "publishedInteractionCount": 0, + "automationId": "0fc8f605-bca8-4f24-8b46-b43e06bf271c", + "disableDEDataLogging": false } ] } diff --git a/test/resources/9999999/interaction/v1/interactions/233d4413-922c-4568-85a5-e5cc77efc3be/delete-response.json b/test/resources/9999999/interaction/v1/interactions/233d4413-922c-4568-85a5-e5cc77efc3be/delete-response.json deleted file mode 100644 index db5917a02..000000000 --- a/test/resources/9999999/interaction/v1/interactions/233d4413-922c-4568-85a5-e5cc77efc3be/delete-response.json +++ /dev/null @@ -1 +0,0 @@ -233d4413-922c-4568-85a5-e5cc77efc3be \ No newline at end of file diff --git a/test/resources/9999999/interaction/v1/interactions/get-response.json b/test/resources/9999999/interaction/v1/interactions/get-response.json deleted file mode 100644 index 2ea74f441..000000000 --- a/test/resources/9999999/interaction/v1/interactions/get-response.json +++ /dev/null @@ -1,827 +0,0 @@ -{ - "count": 2, - "page": 1, - "pageSize": 50, - "links": {}, - "summary": { - "totalInteractions": 371, - "totalRunningVersionsWithDefinedGoal": 1, - "totalRunningVersionsMeetingGoal": 0, - "cumulativePopulation": 961860 - }, - "items": [ - { - "id": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be", - "key": "0b76dccf-594c-b6dc-1acf-10c4493dcb84", - "name": "testExisting_temail", - "lastPublishedDate": "0001-01-01T00:00:00", - "description": "", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2022-03-24T02:20:32.74", - "modifiedDate": "2022-03-24T02:20:40.45", - "activities": [ - { - "id": "9606bcb0-9246-4610-9800-963bc77fc20a", - "key": "EMAILV2-4", - "name": "testExisting_temail", - "description": "", - "type": "EMAILV2", - "outcomes": [ - { - "key": "1f44021a-74ac-49be-a07c-67862228214d", - "arguments": {}, - "metaData": { - "invalid": false - } - } - ], - "arguments": {}, - "configurationArguments": { - "applicationExtensionKey": "jb-email-activity", - "isModified": true, - "triggeredSend": { - "autoAddSubscribers": true, - "autoUpdateSubscribers": true, - "bccEmail": "", - "ccEmail": "", - "created": {}, - "domainExclusions": [], - "dynamicEmailSubject": "test email", - "emailId": 25923, - "emailSubject": "test email", - "exclusionFilter": "", - "isSalesforceTracking": true, - "isMultipart": true, - "isSendLogging": false, - "isStoppedOnJobError": false, - "modified": {}, - "preHeader": "", - "priority": 4, - "sendClassificationId": "1284e9b2-a7b8-e711-80cf-1402ec721c9d", - "throttleOpens": "1/1/0001 12:00:00 AM", - "throttleCloses": "1/1/0001 12:00:00 AM", - "deliveryProfileId": "1084e9b2-a7b8-e711-80cf-1402ec721c9d", - "senderProfileId": "0f84e9b2-a7b8-e711-80cf-1402ec721c9d", - "isTrackingClicks": true, - "publicationListId": 15 - }, - "triggeredSendId": "0a650d90-755e-ed11-b852-48df37d1df5b", - "triggeredSendKey": "testExisting_temail" - }, - "metaData": { - "highThroughput": { - "definitionKey": "testExisting_temail", - "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7" - }, - "sections": {}, - "isConfigured": true - }, - "schema": { - "arguments": { - "requestID": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "messageKey": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "activityId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": true, - "access": "Hidden" - }, - "emailSubjectDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": true, - "access": "Hidden" - }, - "contactId": { - "dataType": "Number", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "emailAddress": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "sourceCustomObjectId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "sourceCustomObjectKey": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "fieldType": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "obfuscationProperties": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "customObjectKey": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": true, - "access": "Hidden" - }, - "definitionInstanceId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "key": "TRIGGER", - "name": "TRIGGER", - "description": "", - "type": "transactional-api", - "outcomes": [], - "arguments": {}, - "configurationArguments": {}, - "metaData": { - "chainType": "none", - "configurationRequired": false, - "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", - "title": "Transactional API Event", - "category": "Transactional", - "entrySourceGroupConfigUrl": "null" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "entryMode": "MultipleEntries", - "definitionType": "Transactional", - "channel": "email", - "defaults": { - "properties": { - "analyticsTracking": { - "enabled": false, - "analyticsType": "google", - "urlDomainsToTrack": [] - } - } - }, - "metaData": {}, - "executionMode": "Production", - "categoryId": 6298, - "status": "Published", - "scheduledStatus": "Draft", - "definitionId": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be" - }, - { - "id": "233d4413-922c-4568-85a5-e5cc77efc3be", - "key": "testExisting_interaction", - "name": "testExisting_interaction", - "lastPublishedDate": "2017-04-12T08:07:48", - "description": "bla bla", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2017-04-12T05:38:05.837", - "modifiedDate": "2017-04-12T08:07:48.333", - "activities": [ - { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "next": "SMSSYNC-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "79213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-3", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "cfc3ec53-4314-4504-9f9d-1fe53fdf0bcf", - "key": "SMSSYNC-1", - "name": "Kate Test SMS", - "description": "", - "type": "SMSSYNC", - "outcomes": [ - { - "key": "d4d46c46-bf8c-4c62-bd34-4979548796cd", - "next": "WAIT-3", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "contactKey": "{{Contact.Key}}", - "defaultSMSAddress": "{{Contact.Default.SMS}}", - "mobileNumber": "{{InteractionDefaults.MobileNumber}}", - "contactId": "{{Contact.Id}}", - "definitionInstanceId": "{{Context.DefinitionInstanceId}}", - "definitionId": "{{Context.DefinitionId}}" - }, - "configurationArguments": { - "messageId": "NTIzOjc4OjA", - "keywordId": "cTVJaG5oSDJPVUNHcUh6Z3pQT2tVdzo4Njow", - "isOptIn": false, - "honorBlackoutWindowEnum": 0, - "mobileBlackoutWindowStartTime": "", - "mobileBlackoutWindowEndTime": "", - "applicationExtensionKey": "jb-mobile-connect-send-sms-sync" - }, - "metaData": { - "isConfigured": true - }, - "schema": { - "arguments": { - "smsJobId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isAddressCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isSubscriptionCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isTriggeredSend": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isWithinBlackout": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isValidMobileNumber": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMessageId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outKeywordId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsOptIn": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outHonorBlackoutWindowEnum": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowStartTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowEndTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outUtcOffset": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowStart": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowEnd": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outTimeZoneId": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsTZValid": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsMobileBlackoutWindowEnabled": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsUsingDEAttributesForPersonalization": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outCountProcessedSingletonDuringBatchMethod": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "defaultSMSAddress": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "mobileNumber": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "contactId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionInstanceId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "id": "a7f8cd93-e0a6-40a5-8557-5bd6fa76c0ea", - "key": "TRIGGER", - "name": "test_TESTDataentry", - "description": "", - "type": "APIEvent", - "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, - "metaData": { - "scheduleState": "No Schedule", - "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionId": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "chainType": "None", - "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "stats": { - "currentPopulation": 5848, - "cumulativePopulation": 3019, - "metGoal": 0, - "metExitCriteria": 0, - "goalPerformance": 0 - }, - "healthStats": { - "currentlyInCount": 0, - "delayedContactCount": 0, - "delayedMinuteInterval": 60 - }, - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", - "defaults": { - "email": [ - "{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}" - ], - "properties": {} - }, - "metaData": {}, - "executionMode": "Production", - "categoryId": 6298, - "status": "Draft", - "definitionId": "233d4413-922c-4568-85a5-e5cc77efc3be", - "scheduledStatus": "Draft" - } - ] -} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json deleted file mode 100644 index 5030c8fa2..000000000 --- a/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/get-response.json +++ /dev/null @@ -1,592 +0,0 @@ -{ - "id": "233d4413-922c-4568-85a5-e5cc77efc3be", - "key": "testExisting_interaction", - "name": "testExisting_interaction", - "lastPublishedDate": "2017-04-12T08:07:48", - "description": "bla bla", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2017-04-12T05:38:05.837", - "modifiedDate": "2017-04-12T08:07:48.333", - "activities": [ - { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "next": "SMSSYNC-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "79213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-3", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "cfc3ec53-4314-4504-9f9d-1fe53fdf0bcf", - "key": "SMSSYNC-1", - "name": "Kate Test SMS", - "description": "", - "type": "SMSSYNC", - "outcomes": [ - { - "key": "d4d46c46-bf8c-4c62-bd34-4979548796cd", - "next": "WAIT-3", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "contactKey": "{{Contact.Key}}", - "defaultSMSAddress": "{{Contact.Default.SMS}}", - "mobileNumber": "{{InteractionDefaults.MobileNumber}}", - "contactId": "{{Contact.Id}}", - "definitionInstanceId": "{{Context.DefinitionInstanceId}}", - "definitionId": "{{Context.DefinitionId}}" - }, - "configurationArguments": { - "messageId": "NTIzOjc4OjA", - "keywordId": "cTVJaG5oSDJPVUNHcUh6Z3pQT2tVdzo4Njow", - "isOptIn": false, - "honorBlackoutWindowEnum": 0, - "mobileBlackoutWindowStartTime": "", - "mobileBlackoutWindowEndTime": "", - "applicationExtensionKey": "jb-mobile-connect-send-sms-sync" - }, - "metaData": { - "isConfigured": true - }, - "schema": { - "arguments": { - "smsJobId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isAddressCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isSubscriptionCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isTriggeredSend": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isWithinBlackout": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isValidMobileNumber": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMessageId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outKeywordId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsOptIn": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outHonorBlackoutWindowEnum": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowStartTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowEndTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outUtcOffset": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowStart": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowEnd": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outTimeZoneId": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsTZValid": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsMobileBlackoutWindowEnabled": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsUsingDEAttributesForPersonalization": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outCountProcessedSingletonDuringBatchMethod": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "defaultSMSAddress": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "mobileNumber": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "contactId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionInstanceId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "id": "a7f8cd93-e0a6-40a5-8557-5bd6fa76c0ea", - "key": "TRIGGER", - "name": "test_TESTDataentry", - "description": "", - "type": "APIEvent", - "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, - "metaData": { - "scheduleState": "No Schedule", - "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionId": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "chainType": "None", - "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "stats": { - "currentPopulation": 5848, - "cumulativePopulation": 3019, - "metGoal": 0, - "metExitCriteria": 0, - "goalPerformance": 0 - }, - "healthStats": { - "currentlyInCount": 0, - "delayedContactCount": 0, - "delayedMinuteInterval": 60 - }, - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", - "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} - }, - "metaData": {}, - "executionMode": "Production", - "categoryId": 6298, - "status": "Draft", - "definitionId": "233d4413-922c-4568-85a5-e5cc77efc3be", - "scheduledStatus": "Draft" -} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/put-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/put-response.json deleted file mode 100644 index 4e9aeb8de..000000000 --- a/test/resources/9999999/interaction/v1/interactions/key_testExisting_interaction/put-response.json +++ /dev/null @@ -1,592 +0,0 @@ -{ - "id": "233d4413-922c-4568-85a5-e5cc77efc3be", - "key": "testExisting_interaction", - "name": "testExisting_interaction", - "lastPublishedDate": "2017-04-12T08:07:48", - "description": "updated via deploy - test", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2017-04-12T05:38:05.837", - "modifiedDate": "2017-04-12T08:07:48.333", - "activities": [ - { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "next": "SMSSYNC-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "79213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-3", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "cfc3ec53-4314-4504-9f9d-1fe53fdf0bcf", - "key": "SMSSYNC-1", - "name": "Kate Test SMS", - "description": "", - "type": "SMSSYNC", - "outcomes": [ - { - "key": "d4d46c46-bf8c-4c62-bd34-4979548796cd", - "next": "WAIT-3", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "contactKey": "{{Contact.Key}}", - "defaultSMSAddress": "{{Contact.Default.SMS}}", - "mobileNumber": "{{InteractionDefaults.MobileNumber}}", - "contactId": "{{Contact.Id}}", - "definitionInstanceId": "{{Context.DefinitionInstanceId}}", - "definitionId": "{{Context.DefinitionId}}" - }, - "configurationArguments": { - "messageId": "NTIzOjc4OjA", - "keywordId": "cTVJaG5oSDJPVUNHcUh6Z3pQT2tVdzo4Njow", - "isOptIn": false, - "honorBlackoutWindowEnum": 0, - "mobileBlackoutWindowStartTime": "", - "mobileBlackoutWindowEndTime": "", - "applicationExtensionKey": "jb-mobile-connect-send-sms-sync" - }, - "metaData": { - "isConfigured": true - }, - "schema": { - "arguments": { - "smsJobId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isAddressCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isSubscriptionCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isTriggeredSend": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isWithinBlackout": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isValidMobileNumber": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMessageId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outKeywordId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsOptIn": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outHonorBlackoutWindowEnum": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowStartTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowEndTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outUtcOffset": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowStart": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowEnd": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outTimeZoneId": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsTZValid": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsMobileBlackoutWindowEnabled": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsUsingDEAttributesForPersonalization": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outCountProcessedSingletonDuringBatchMethod": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "defaultSMSAddress": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "mobileNumber": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "contactId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionInstanceId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "id": "a7f8cd93-e0a6-40a5-8557-5bd6fa76c0ea", - "key": "TRIGGER", - "name": "test_TESTDataentry", - "description": "", - "type": "APIEvent", - "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, - "metaData": { - "scheduleState": "No Schedule", - "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionId": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "chainType": "None", - "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "stats": { - "currentPopulation": 5848, - "cumulativePopulation": 3019, - "metGoal": 0, - "metExitCriteria": 0, - "goalPerformance": 0 - }, - "healthStats": { - "currentlyInCount": 0, - "delayedContactCount": 0, - "delayedMinuteInterval": 60 - }, - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", - "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} - }, - "metaData": {}, - "executionMode": "Production", - "categoryId": 6298, - "status": "Draft", - "definitionId": "233d4413-922c-4568-85a5-e5cc77efc3be", - "scheduledStatus": "Draft" -} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json new file mode 100644 index 000000000..4f3b61e80 --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json @@ -0,0 +1,317 @@ +{ + "id": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", + "key": "ada246f2-dfb8-51d3-a2ce-3622317ea31a", + "name": "testExisting_journey_Multistep", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-05-04T05:54:48.027", + "modifiedDate": "2024-05-04T05:54:48.027", + "activities": [ + { + "id": "749e7bef-c87f-483e-bcbf-74d6619d56cc", + "key": "EMAILV2-1", + "name": "my custom activity name", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "ff60a294-3804-4165-85cd-c7c19c8e3a6d", + "next": "WAITBYDURATION-1", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "description": "my custom description", + "domainExclusions": [], + "dynamicEmailSubject": "testExisting_ email subject", + "emailId": 707139, + "emailSubject": "testExisting_ email subject", + "exclusionFilter": "", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "testExisting_ email preheader", + "priority": 4, + "sendClassificationId": "88d65dda-b8e3-ea11-a2eb-1402ec937095", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", + "senderProfileId": "5a1dfa1f-6402-ef11-a5c8-5cba2c702db8", + "isTrackingClicks": true, + "publicationListId": 32308 + } + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "90970a04-e71c-437d-83ed-8158f33719cd", + "key": "WAITBYDURATION-1", + "name": "", + "description": "", + "type": "WAIT", + "outcomes": [ + { + "key": "97af222a-450a-429e-8925-649b72f01ccf", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "waitDuration": 1, + "waitUnit": "DAYS" + }, + "metaData": { + "isConfigured": true, + "uiType": "WAITBYDURATION" + }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "id": "4462b819-c18c-4d99-957c-7e5a10adb3fd", + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "eventDefinitionId": "649d512b-4d08-4eca-a14e-fc7b64b4ada8", + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json", + "sourceInteractionId": "00000000-0000-0000-0000-000000000000" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "stats": { + "currentPopulation": 0, + "cumulativePopulation": 0, + "metGoal": 0, + "metExitCriteria": 0, + "goalPerformance": 0 + }, + "entryMode": "NotSet", + "definitionType": "Multistep", + "channel": "", + "defaults": { + "email": ["{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "highThroughputSending": { + "email": false + } + }, + "executionMode": "Production", + "categoryId": 290832, + "status": "Draft", + "definitionId": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", + "scheduledStatus": "Draft" +} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json new file mode 100644 index 000000000..dadcd9ed5 --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json @@ -0,0 +1,253 @@ +{ + "id": "3c3f4112-9b43-43ca-8a89-aa0375b2c1a2", + "key": "testExisting_journey_Quicksend", + "name": "testExisting_journey_Quicksend", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", + "activities": [ + { + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testExisting_asset_mail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "description": "my activity info text", + "domainExclusions": [ + { + "id": "5a7194ad-6602-ef11-a5c8-5cba2c702db8", + "name": "testExisting_DomainExclusion" + } + ], + "dynamicEmailSubject": "testExisting_ email subject", + "emailId": 531213, + "emailSubject": "testExisting_ email subject", + "exclusionFilter": "/* insert ampscript here */", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "testExisting_ email preheader", + "priority": 3, + "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", + "suppressionLists": [ + { + "id": 75520, + "name": "testExisting_suppressionList" + } + ], + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", + "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95", + "isTrackingClicks": true, + "publicationListId": 15 + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "id": "abe42b4d-736d-4d26-a8f0-ce67d410782f", + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "sourceInteractionId": "00000000-0000-0000-0000-000000000000", + "eventDefinitionId": "9e1995f8-951d-4019-855c-826b45e5b028", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "stats": { + "currentPopulation": 0, + "cumulativePopulation": 0, + "metGoal": 0, + "metExitCriteria": 0, + "goalPerformance": 0 + }, + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", + "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { + "email": false + } + }, + "executionMode": "Production", + "categoryId": 6298, + "status": "Draft", + "definitionId": "3c3f4112-9b43-43ca-8a89-aa0375b2c1a2", + "scheduledStatus": "Draft" +} diff --git a/test/resources/9999999/interaction/v1/interactions/post-response.json b/test/resources/9999999/interaction/v1/interactions/post-response.json deleted file mode 100644 index a40be257c..000000000 --- a/test/resources/9999999/interaction/v1/interactions/post-response.json +++ /dev/null @@ -1,280 +0,0 @@ -{ - "id": "233d4413-922c-4568-85a5-e5cc77efc3be", - "key": "testNew_interaction", - "name": "testNew_interaction", - "lastPublishedDate": "2017-04-12T08:07:48", - "description": "created on deploy", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2017-04-12T05:38:05.837", - "modifiedDate": "2017-04-12T08:07:48.333", - "activities": [ - { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "id": "a7f8cd93-e0a6-40a5-8557-5bd6fa76c0ea", - "key": "TRIGGER", - "name": "test_TESTDataentry", - "description": "", - "type": "APIEvent", - "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, - "metaData": { - "scheduleState": "No Schedule", - "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionId": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "chainType": "None", - "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "stats": { - "currentPopulation": 5848, - "cumulativePopulation": 3019, - "metGoal": 0, - "metExitCriteria": 0, - "goalPerformance": 0 - }, - "healthStats": { - "currentlyInCount": 0, - "delayedContactCount": 0, - "delayedMinuteInterval": 60 - }, - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", - "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} - }, - "metaData": {}, - "executionMode": "Production", - "categoryId": 6298, - "status": "Draft", - "definitionId": "233d4413-922c-4568-85a5-e5cc77efc3be", - "scheduledStatus": "Draft" -} diff --git a/test/resources/9999999/journey/get-expected.json b/test/resources/9999999/journey/get-expected.json deleted file mode 100644 index 19b1f9330..000000000 --- a/test/resources/9999999/journey/get-expected.json +++ /dev/null @@ -1,576 +0,0 @@ -{ - "key": "testExisting_interaction", - "name": "testExisting_interaction", - "lastPublishedDate": "2017-04-12T08:07:48", - "description": "bla bla", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2017-04-12T05:38:05.837", - "modifiedDate": "2017-04-12T08:07:48.333", - "activities": [ - { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "next": "SMSSYNC-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "79213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-3", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "cfc3ec53-4314-4504-9f9d-1fe53fdf0bcf", - "key": "SMSSYNC-1", - "name": "Kate Test SMS", - "description": "", - "type": "SMSSYNC", - "outcomes": [ - { - "key": "d4d46c46-bf8c-4c62-bd34-4979548796cd", - "next": "WAIT-3", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "contactKey": "{{Contact.Key}}", - "defaultSMSAddress": "{{Contact.Default.SMS}}", - "mobileNumber": "{{InteractionDefaults.MobileNumber}}", - "contactId": "{{Contact.Id}}", - "definitionInstanceId": "{{Context.DefinitionInstanceId}}", - "definitionId": "{{Context.DefinitionId}}" - }, - "configurationArguments": { - "c__mobileMessage_id": "NTIzOjc4OjA", - "r__mobileKeyword_codeKeyword": "4912312345678.TESTEXISTING_KEYWORD", - "isOptIn": false, - "honorBlackoutWindowEnum": 0, - "mobileBlackoutWindowStartTime": "", - "mobileBlackoutWindowEndTime": "", - "applicationExtensionKey": "jb-mobile-connect-send-sms-sync" - }, - "metaData": { - "isConfigured": true - }, - "schema": { - "arguments": { - "smsJobId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isAddressCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isSubscriptionCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isTriggeredSend": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isWithinBlackout": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isValidMobileNumber": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMessageId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outKeywordId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsOptIn": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outHonorBlackoutWindowEnum": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowStartTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowEndTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outUtcOffset": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowStart": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowEnd": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outTimeZoneId": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsTZValid": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsMobileBlackoutWindowEnabled": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsUsingDEAttributesForPersonalization": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outCountProcessedSingletonDuringBatchMethod": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "defaultSMSAddress": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "mobileNumber": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "contactId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionInstanceId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "key": "TRIGGER", - "name": "test_TESTDataentry", - "description": "", - "type": "APIEvent", - "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, - "metaData": { - "scheduleState": "No Schedule", - "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "chainType": "None", - "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", - "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} - }, - "metaData": {}, - "executionMode": "Production", - "status": "Draft", - "scheduledStatus": "Draft", - "r__folder_Path": "my journeys" -} diff --git a/test/resources/9999999/interaction/v1/interactions/key_0b76dccf-594c-b6dc-1acf-10c4493dcb84/get-response.json b/test/resources/9999999/journey/get-quicksend-expected.json similarity index 66% rename from test/resources/9999999/interaction/v1/interactions/key_0b76dccf-594c-b6dc-1acf-10c4493dcb84/get-response.json rename to test/resources/9999999/journey/get-quicksend-expected.json index b3411e458..dc4253f9d 100644 --- a/test/resources/9999999/interaction/v1/interactions/key_0b76dccf-594c-b6dc-1acf-10c4493dcb84/get-response.json +++ b/test/resources/9999999/journey/get-quicksend-expected.json @@ -1,67 +1,75 @@ { - "id": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be", - "key": "0b76dccf-594c-b6dc-1acf-10c4493dcb84", - "name": "testExisting_temail", + "key": "testExisting_journey_Quicksend", + "name": "testExisting_journey_Quicksend", "lastPublishedDate": "0001-01-01T00:00:00", "description": "", "version": 1, "workflowApiVersion": 1, - "createdDate": "2022-03-24T02:20:32.74", - "modifiedDate": "2022-03-24T02:20:40.45", + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", "activities": [ { - "id": "9606bcb0-9246-4610-9800-963bc77fc20a", - "key": "EMAILV2-4", - "name": "testExisting_temail", + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testExisting_asset_mail", "description": "", "type": "EMAILV2", "outcomes": [ { - "key": "1f44021a-74ac-49be-a07c-67862228214d", + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", "arguments": {}, - "metaData": { - "invalid": false - } + "metaData": { "invalid": false } } ], "arguments": {}, "configurationArguments": { - "applicationExtensionKey": "jb-email-activity", "isModified": true, + "googleAnalyticsCampaignName": "", "triggeredSend": { "autoAddSubscribers": true, "autoUpdateSubscribers": true, "bccEmail": "", "ccEmail": "", "created": {}, - "domainExclusions": [], - "dynamicEmailSubject": "test email", - "emailId": 25923, - "emailSubject": "test email", - "exclusionFilter": "", - "isSalesforceTracking": true, + "description": "my activity info text", + "dynamicEmailSubject": "testExisting_ email subject", + "emailSubject": "testExisting_ email subject", + "exclusionFilter": "/* insert ampscript here */", + "isSalesforceTracking": false, "isMultipart": true, - "isSendLogging": false, + "isSendLogging": true, "isStoppedOnJobError": false, + "keyword": "", "modified": {}, - "preHeader": "", - "priority": 4, - "sendClassificationId": "1284e9b2-a7b8-e711-80cf-1402ec721c9d", + "preHeader": "testExisting_ email preheader", + "priority": 3, + "suppressTracking": true, + "throttleLimit": 0, "throttleOpens": "1/1/0001 12:00:00 AM", "throttleCloses": "1/1/0001 12:00:00 AM", - "deliveryProfileId": "1084e9b2-a7b8-e711-80cf-1402ec721c9d", - "senderProfileId": "0f84e9b2-a7b8-e711-80cf-1402ec721c9d", "isTrackingClicks": true, - "publicationListId": 15 + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers", + "suppressionLists": ["Suppression Lists/testExisting_suppressionList"] + }, + "r__dataExtension_CustomerKey": { + "domainExclusions": ["testExisting_DomainExclusion"] + }, + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__assetMessage_Name_readOnly": "testExisting_asset_message", + "r__assetMessage_Key": "testExisting_asset_message" }, - "triggeredSendId": "0a650d90-755e-ed11-b852-48df37d1df5b", - "triggeredSendKey": "testExisting_temail" + "applicationExtensionKey": "jb-email-activity" }, "metaData": { - "highThroughput": { - "definitionKey": "testExisting_temail", - "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7" - }, + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", "sections": {}, "isConfigured": true }, @@ -181,17 +189,18 @@ "key": "TRIGGER", "name": "TRIGGER", "description": "", - "type": "transactional-api", + "type": "EmailAudience", "outcomes": [], "arguments": {}, "configurationArguments": {}, "metaData": { - "chainType": "none", + "sourceInteractionId": "00000000-0000-0000-0000-000000000000", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "chainType": "None", "configurationRequired": false, - "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", - "title": "Transactional API Event", - "category": "Transactional", - "entrySourceGroupConfigUrl": "null" + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" } } ], @@ -199,21 +208,25 @@ "exits": [], "notifiers": [], "entryMode": "MultipleEntries", - "definitionType": "Transactional", + "definitionType": "Quicksend", "channel": "email", "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], "properties": { "analyticsTracking": { - "enabled": false, + "enabled": true, "analyticsType": "google", "urlDomainsToTrack": [] } } }, - "metaData": {}, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { "email": false } + }, "executionMode": "Production", - "categoryId": 6298, - "status": "Published", + "status": "Draft", "scheduledStatus": "Draft", - "definitionId": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be" + "r__folder_Path": "my journeys" } diff --git a/test/resources/9999999/list/retrieve-response.xml b/test/resources/9999999/list/retrieve-response.xml index a90976cae..2cfa2a4c9 100644 --- a/test/resources/9999999/list/retrieve-response.xml +++ b/test/resources/9999999/list/retrieve-response.xml @@ -73,6 +73,19 @@ SuppressionList + + + 2024-04-24T12:17:15.423 + 2024-04-24T12:17:15.423 + 75520 + 97382359-b292-49aa-97a1-e53cedc18911 + testExisting_suppressionList - 419 + testExisting_suppressionList + 419 + Public + blabla + SuppressionList + diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index c2bf5791d..3a09ab7a8 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -28,8 +28,8 @@ describe('type: dataExtension', () => { const result = cache.getCache(); assert.equal( result.dataExtension ? Object.keys(result.dataExtension).length : 0, - 2, - 'only 2 dataExtension expected' + 3, + 'only 3 dataExtension expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_dataExtension', 'dataExtension'), @@ -119,8 +119,8 @@ describe('type: dataExtension', () => { const result = cache.getCache(); assert.equal( result.dataExtension ? Object.keys(result.dataExtension).length : 0, - 4, - '4 dataExtensions expected' + 5, + '5 dataExtensions expected' ); // insert assert.deepEqual( diff --git a/test/type.journey.test.js b/test/type.journey.test.js index c3a04f028..da7dfa6fb 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -17,126 +17,30 @@ describe('type: journey', () => { }); describe('Retrieve ================', () => { - it('Should retrieve a journey', async () => { + it('Should retrieve a Quicksend journey with key', async () => { // WHEN - await handler.retrieve('testInstance/testBU', ['journey']); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); - // get results from cache - const result = cache.getCache(); - assert.equal( - result.journey ? Object.keys(result.journey).length : 0, - 2, - 'only 2 journeys expected' - ); - assert.deepEqual( - await testUtils.getActualJson('testExisting_interaction', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'get'), - 'returned JSON was not equal expected' - ); - assert.equal( - testUtils.getAPIHistoryLength(), - 13, - 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + await handler.retrieve( + 'testInstance/testBU', + ['journey'], + ['testExisting_journey_Quicksend'] ); - return; - }); - }); - - describe('Deploy ================', () => { - beforeEach(() => { - testUtils.mockSetup(true); - }); - - it('Should create & upsert a journey', async () => { - // WHEN - await handler.deploy('testInstance/testBU', ['journey']); // THEN - assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); // get results from cache const result = cache.getCache(); - assert.equal( - result.journey ? Object.keys(result.journey).length : 0, - 3, - '3 journeys expected' - ); - // confirm created item - assert.deepEqual( - await testUtils.getActualJson('testNew_interaction', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'post'), - 'returned JSON was not equal expected for insert journey' - ); - - // confirm updated item - assert.deepEqual( - await testUtils.getActualJson('testExisting_interaction', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'put'), // watch out - journey api wants put instead of patch for updates - 'returned JSON was not equal expected for update journey' - ); - - // check number of API calls - assert.equal( - testUtils.getAPIHistoryLength(), - 11, - 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' - ); - return; - }); - - it('Should NOT change the key during update with --changeKeyValue and instead fail due to missing support', async () => { - // WHEN - handler.setOptions({ changeKeyValue: 'updatedKey' }); - await handler.deploy('testInstance/testBU', ['journey'], ['testExisting_interaction']); - // THEN - assert.equal( - process.exitCode, - 1, - 'deploy should have thrown an error due to lack of support' - ); - return; - }); - }); - - describe('Templating ================', () => { - it('Should create a journey template via buildTemplate and build it', async () => { - // download first before we test buildTemplate - await handler.retrieve('testInstance/testBU', ['journey']); - // buildTemplate - const result = await handler.buildTemplate( - 'testInstance/testBU', - 'journey', - ['testExisting_interaction'], - 'testSourceMarket' - ); - assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); assert.equal( result.journey ? Object.keys(result.journey).length : 0, 1, - 'only one journey expected' - ); - assert.deepEqual( - await testUtils.getActualTemplateJson('testExisting_interaction', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'template'), - 'returned template JSON was not equal expected' + 'only 1 journeys expected' ); - - // buildDefinition - await handler.buildDefinition( - 'testInstance/testBU', - 'journey', - 'testExisting_interaction', - 'testTargetMarket' - ); - assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); assert.deepEqual( - await testUtils.getActualDeployJson('testTemplated_interaction', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'build'), - 'returned deployment JSON was not equal expected' + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend'), + 'returned JSON was not equal expected' ); - assert.equal( testUtils.getAPIHistoryLength(), - 13, + 21, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; From b58668a70a063e53b077fe301a4ab400e4917137 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 5 May 2024 00:55:54 +0200 Subject: [PATCH 185/359] #62: add message priority mapping --- lib/metadataTypes/Journey.js | 14 ++++++++++++++ .../definitions/Journey.definition.js | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 1430bd673..1e4c15194 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -619,6 +619,14 @@ class Journey extends MetadataType { // remove it because we cannot resolve it and it should be set by selecting the sendClassification delete triggeredSend.deliveryProfileId; } + // message priority + if (triggeredSend.priority) { + triggeredSend.c__priority = Util.inverseGet( + this.definition.priorityMapping, + triggeredSend.priority + ); + delete triggeredSend.priority; + } // email try { // content builder @@ -949,6 +957,12 @@ class Journey extends MetadataType { ); delete triggeredSend.r__sendClassification_CustomerKey; } + // message priority + if (triggeredSend.c__priority) { + triggeredSend.priority = + this.definition.priorityMapping[triggeredSend.c__priority]; + delete triggeredSend.c__priority; + } // email if (triggeredSend.r__assetMessage_Key) { diff --git a/lib/metadataTypes/definitions/Journey.definition.js b/lib/metadataTypes/definitions/Journey.definition.js index f75df84e7..6b402dc1d 100644 --- a/lib/metadataTypes/definitions/Journey.definition.js +++ b/lib/metadataTypes/definitions/Journey.definition.js @@ -35,6 +35,11 @@ export default { typeDescription: 'Journey (internally called "Interaction").', typeRetrieveByDefault: true, typeName: 'Journey', + priorityMapping: { + High: 3, + Medium: 4, // not inherited on Asset Types + Low: 5, + }, fields: { activities: { skipValidation: true, From 33b0200d6e32992d15389587e348e98900eb86d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 5 May 2024 01:24:06 +0200 Subject: [PATCH 186/359] #62: added test for basic multi-step journey --- test/general.test.js | 4 +- .../dataExtension/retrieve-response.xml | 48 +++ .../dataExtensionField/retrieve-response.xml | 72 +++++ .../v1/eventDefinitions/get-response.json | 39 +++ .../v1/interactions/get-response.json | 99 ++++++ .../get-response.json | 12 +- .../journey/get-multistep-expected.json | 291 ++++++++++++++++++ .../journey/get-quicksend-expected.json | 2 +- test/type.dataExtension.test.js | 8 +- test/type.journey.test.js | 30 ++ 10 files changed, 592 insertions(+), 13 deletions(-) create mode 100644 test/resources/9999999/interaction/v1/interactions/get-response.json create mode 100644 test/resources/9999999/journey/get-multistep-expected.json diff --git a/test/general.test.js b/test/general.test.js index e847adccc..735fb9c4d 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -125,8 +125,8 @@ describe('GENERAL', () => { ); assert.equal( Object.keys(result[buName]['dataExtension']).length, - 3, - 'retrieve should have returned 3 dataExtension' + 5, + 'retrieve should have returned 5 dataExtension' ); assert.equal( Object.keys(result[buName]['dataExtract']).length, diff --git a/test/resources/9999999/dataExtension/retrieve-response.xml b/test/resources/9999999/dataExtension/retrieve-response.xml index 60c96bb57..973e3f571 100644 --- a/test/resources/9999999/dataExtension/retrieve-response.xml +++ b/test/resources/9999999/dataExtension/retrieve-response.xml @@ -94,6 +94,54 @@ 2 + + + 2024-04-24T12:09:53.527 + 2024-04-24T12:09:53.527 + 1c8064d5-6502-ef11-a5c8-5cba2c702db8 + testExisting_journey_Quicksend + testExisting_journey_Quicksend + + true + false + + + + ContactId + + + _SubscriberKey + + false + false + false + + 290821 + + + + 2024-04-24T12:10:46.457 + 2024-04-24T12:10:46.457 + ed305df3-6502-ef11-a5c8-5cba2c702db8 + testExisting_journey_Multistep + testExisting_journey_Multistep + + true + false + + + + ContactId + + + _SubscriberKey + + false + false + false + + 2 + diff --git a/test/resources/9999999/dataExtensionField/retrieve-response.xml b/test/resources/9999999/dataExtensionField/retrieve-response.xml index c927c2258..9b80cbfb2 100644 --- a/test/resources/9999999/dataExtensionField/retrieve-response.xml +++ b/test/resources/9999999/dataExtensionField/retrieve-response.xml @@ -128,6 +128,78 @@ testExisting_dataExtension + + + 78b6d411-a5a3-42ac-b9ef-4b5b31db861d + [testExisting_journey_Multistep].[Email] + Email + 0 + + 254 + true + 1 + false + EmailAddress + + + + testExisting_journey_Multistep + + + + + d38a445a-34b4-499d-9764-ce46cfc675a2 + [testExisting_journey_Multistep].[ContactId] + ContactId + 0 + + 50 + true + 0 + true + Text + + + + testExisting_journey_Multistep + + + + + f8c11314-49fc-4e9b-8971-5d6a50705195 + [testExisting_journey_Quicksend].[ContactId] + ContactId + 0 + + 50 + true + 0 + true + Text + + + + testExisting_journey_Quicksend + + + + + 633ca953-b614-4715-8310-91cdadd085c6 + [testExisting_journey_Quicksend].[Email] + Email + 0 + + 254 + true + 1 + false + EmailAddress + + + + testExisting_journey_Quicksend + + diff --git a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json index 75af49234..eee23eeca 100644 --- a/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json +++ b/test/resources/9999999/interaction/v1/eventDefinitions/get-response.json @@ -80,6 +80,45 @@ "publishedInteractionCount": 0, "automationId": "0fc8f605-bca8-4f24-8b46-b43e06bf271c", "disableDEDataLogging": false + }, + { + "id": "649d512b-4d08-4eca-a14e-fc7b64b4ada8", + "type": "EmailAudience", + "name": "testExisting_journey_Multistep", + "description": "", + "createdDate": "2024-05-04T05:54:44.95", + "createdBy": 700301950, + "modifiedDate": "2024-05-04T05:54:44.95", + "modifiedBy": 700301950, + "mode": "Production", + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "dataExtensionId": "ed305df3-6502-ef11-a5c8-5cba2c702db8", + "dataExtensionName": "testExisting_journey_Multistep", + "sourceApplicationExtensionId": "97e942ee-6914-4d3d-9e52-37ecb71f79ed", + "filterDefinitionId": "00000000-0000-0000-0000-000000000000", + "filterDefinitionTemplate": "", + "iconUrl": "/images/icon-data-extension.svg", + "arguments": { + "serializedObjectType": 3, + "eventDefinitionId": "649d512b-4d08-4eca-a14e-fc7b64b4ada8", + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "dataExtensionId": "ed305df3-6502-ef11-a5c8-5cba2c702db8", + "criteria": "" + }, + "configurationArguments": { + "unconfigured": true + }, + "metaData": { + "criteriaDescription": "", + "scheduleState": "No Schedule" + }, + "interactionCount": 1, + "isVisibleInPicker": false, + "isPlatformObject": false, + "category": "Audience", + "publishedInteractionCount": 0, + "automationId": "a3c606a8-19d7-4866-8804-5f43dc4502ea", + "disableDEDataLogging": false } ] } diff --git a/test/resources/9999999/interaction/v1/interactions/get-response.json b/test/resources/9999999/interaction/v1/interactions/get-response.json new file mode 100644 index 000000000..6599ef2b1 --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/get-response.json @@ -0,0 +1,99 @@ +{ + "count": 2, + "page": 1, + "pageSize": 500, + "links": {}, + "items": [ + { + "id": "3c3f4112-9b43-43ca-8a89-aa0375b2c1a2", + "key": "c3a4736c-bbaa-e8ab-b61e-7d811bf0898f", + "name": "testExisting_journey_Quicksend", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", + "goals": [], + "exits": [], + "notifiers": [], + "stats": { + "currentPopulation": 0, + "cumulativePopulation": 0, + "metGoal": 0, + "metExitCriteria": 0, + "goalPerformance": 0 + }, + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", + "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { + "email": false + } + }, + "executionMode": "Production", + "categoryId": 6298, + "status": "Draft", + "definitionId": "3c3f4112-9b43-43ca-8a89-aa0375b2c1a2", + "scheduledStatus": "Draft" + }, + { + "id": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", + "key": "testExisting_journey_Multistep", + "name": "testExisting_journey_Multistep", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-05-04T05:54:48.027", + "modifiedDate": "2024-05-04T05:54:48.027", + "goals": [], + "exits": [], + "notifiers": [], + "stats": { + "currentPopulation": 0, + "cumulativePopulation": 0, + "metGoal": 0, + "metExitCriteria": 0, + "goalPerformance": 0 + }, + "entryMode": "NotSet", + "definitionType": "Multistep", + "channel": "", + "defaults": { + "email": ["{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "highThroughputSending": { + "email": false + } + }, + "executionMode": "Production", + "categoryId": 6298, + "status": "Draft", + "definitionId": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", + "scheduledStatus": "Draft" + } + ] +} diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json index 4f3b61e80..099c982b9 100644 --- a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json @@ -1,6 +1,6 @@ { "id": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", - "key": "ada246f2-dfb8-51d3-a2ce-3622317ea31a", + "key": "testExisting_journey_Multistep", "name": "testExisting_journey_Multistep", "lastPublishedDate": "0001-01-01T00:00:00", "description": "", @@ -39,7 +39,7 @@ "description": "my custom description", "domainExclusions": [], "dynamicEmailSubject": "testExisting_ email subject", - "emailId": 707139, + "emailId": 531213, "emailSubject": "testExisting_ email subject", "exclusionFilter": "", "isSalesforceTracking": false, @@ -49,13 +49,13 @@ "modified": {}, "preHeader": "testExisting_ email preheader", "priority": 4, - "sendClassificationId": "88d65dda-b8e3-ea11-a2eb-1402ec937095", + "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", "throttleOpens": "1/1/0001 12:00:00 AM", "throttleCloses": "1/1/0001 12:00:00 AM", "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", - "senderProfileId": "5a1dfa1f-6402-ef11-a5c8-5cba2c702db8", + "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95", "isTrackingClicks": true, - "publicationListId": 32308 + "publicationListId": 15 } }, "metaData": { @@ -310,7 +310,7 @@ } }, "executionMode": "Production", - "categoryId": 290832, + "categoryId": 6298, "status": "Draft", "definitionId": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", "scheduledStatus": "Draft" diff --git a/test/resources/9999999/journey/get-multistep-expected.json b/test/resources/9999999/journey/get-multistep-expected.json new file mode 100644 index 000000000..c038c0ccb --- /dev/null +++ b/test/resources/9999999/journey/get-multistep-expected.json @@ -0,0 +1,291 @@ +{ + "key": "testExisting_journey_Multistep", + "name": "testExisting_journey_Multistep", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-05-04T05:54:48.027", + "modifiedDate": "2024-05-04T05:54:48.027", + "activities": [ + { + "id": "749e7bef-c87f-483e-bcbf-74d6619d56cc", + "key": "EMAILV2-1", + "name": "my custom activity name", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "ff60a294-3804-4165-85cd-c7c19c8e3a6d", + "next": "WAITBYDURATION-1", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "description": "my custom description", + "domainExclusions": [], + "dynamicEmailSubject": "testExisting_ email subject", + "emailSubject": "testExisting_ email subject", + "exclusionFilter": "", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "testExisting_ email preheader", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { "publicationList": "my subscribers/All Subscribers" }, + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "c__priority": "Medium", + "r__assetMessage_Name_readOnly": "testExisting_asset_message", + "r__assetMessage_Key": "testExisting_asset_message" + } + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "90970a04-e71c-437d-83ed-8158f33719cd", + "key": "WAITBYDURATION-1", + "name": "", + "description": "", + "type": "WAIT", + "outcomes": [ + { + "key": "97af222a-450a-429e-8925-649b72f01ccf", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { "waitDuration": 1, "waitUnit": "DAYS" }, + "metaData": { "isConfigured": true, "uiType": "WAITBYDURATION" }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "eventDefinitionKey": "DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json", + "sourceInteractionId": "00000000-0000-0000-0000-000000000000" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "NotSet", + "definitionType": "Multistep", + "channel": "", + "defaults": { + "email": ["{{Event.DEAudience-2e3c73b6-48cc-2ec0-5522-48636e1a236e.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { "dataSource": "ContactsModel", "highThroughputSending": { "email": false } }, + "executionMode": "Production", + "status": "Draft", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/resources/9999999/journey/get-quicksend-expected.json b/test/resources/9999999/journey/get-quicksend-expected.json index dc4253f9d..bc8a9e17e 100644 --- a/test/resources/9999999/journey/get-quicksend-expected.json +++ b/test/resources/9999999/journey/get-quicksend-expected.json @@ -42,7 +42,6 @@ "keyword": "", "modified": {}, "preHeader": "testExisting_ email preheader", - "priority": 3, "suppressTracking": true, "throttleLimit": 0, "throttleOpens": "1/1/0001 12:00:00 AM", @@ -57,6 +56,7 @@ }, "r__senderProfile_CustomerKey": "testExisting_senderProfile", "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "c__priority": "High", "r__assetMessage_Name_readOnly": "testExisting_asset_message", "r__assetMessage_Key": "testExisting_asset_message" }, diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index 3a09ab7a8..d615f0d95 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -28,8 +28,8 @@ describe('type: dataExtension', () => { const result = cache.getCache(); assert.equal( result.dataExtension ? Object.keys(result.dataExtension).length : 0, - 3, - 'only 3 dataExtension expected' + 5, + 'only 5 dataExtension expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_dataExtension', 'dataExtension'), @@ -119,8 +119,8 @@ describe('type: dataExtension', () => { const result = cache.getCache(); assert.equal( result.dataExtension ? Object.keys(result.dataExtension).length : 0, - 5, - '5 dataExtensions expected' + 7, + '7 dataExtensions expected' ); // insert assert.deepEqual( diff --git a/test/type.journey.test.js b/test/type.journey.test.js index da7dfa6fb..bc8d6b8d0 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -45,6 +45,36 @@ describe('type: journey', () => { ); return; }); + + it('Should retrieve a Multistep journey with key', async () => { + // WHEN + await handler.retrieve( + 'testInstance/testBU', + ['journey'], + ['testExisting_journey_Multistep'] + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.journey ? Object.keys(result.journey).length : 0, + 1, + 'only 1 journeys expected' + ); + + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Multistep', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-multistep'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 21, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); }); describe('Delete ================', () => { From 3936c086a1e549143b4ab0dd0a70cd96c7536372 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 5 May 2024 01:48:33 +0200 Subject: [PATCH 187/359] #62: added decision split to multistep journey test --- .../get-response.json | 154 +++++++++++++++++- .../journey/get-multistep-expected.json | 134 ++++++++++++++- 2 files changed, 275 insertions(+), 13 deletions(-) diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json index 099c982b9..2abf7e8fd 100644 --- a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Multistep/get-response.json @@ -7,10 +7,66 @@ "version": 1, "workflowApiVersion": 1, "createdDate": "2024-05-04T05:54:48.027", - "modifiedDate": "2024-05-04T05:54:48.027", + "modifiedDate": "2024-05-04T17:25:57.9", "activities": [ { - "id": "749e7bef-c87f-483e-bcbf-74d6619d56cc", + "id": "342dd0aa-a6be-401e-8614-3538800bfd7c", + "key": "MULTICRITERIADECISIONV2-1", + "name": "", + "description": "", + "type": "MULTICRITERIADECISION", + "outcomes": [ + { + "key": "default_path_1", + "next": "EMAILV2-1", + "arguments": {}, + "metaData": { + "label": "send message", + "skipI18n": true, + "isLabelFromConversion": false, + "criteriaDescription": "Email is not null" + } + }, + { + "key": "remainder_path", + "next": "WAITBYDURATION-2", + "arguments": {}, + "metaData": { + "label": null + } + } + ], + "arguments": {}, + "configurationArguments": { + "criteria": { + "default_path_1": "" + }, + "schemaVersionId": "252" + }, + "metaData": { + "isConfigured": true + }, + "schema": { + "arguments": { + "actualChoice": { + "dataType": "Number", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "filterResult": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": true, + "access": "Hidden" + } + } + } + }, + { + "id": "7ba1e59a-6be4-46c7-b76f-4c06feb1268a", "key": "EMAILV2-1", "name": "my custom activity name", "description": "", @@ -35,7 +91,10 @@ "autoUpdateSubscribers": true, "bccEmail": "", "ccEmail": "", - "created": {}, + "created": { + "name": "", + "date": "" + }, "description": "my custom description", "domainExclusions": [], "dynamicEmailSubject": "testExisting_ email subject", @@ -46,7 +105,10 @@ "isMultipart": true, "isSendLogging": true, "isStoppedOnJobError": false, - "modified": {}, + "modified": { + "name": "", + "date": "" + }, "preHeader": "testExisting_ email preheader", "priority": 4, "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", @@ -180,11 +242,89 @@ } }, { - "id": "90970a04-e71c-437d-83ed-8158f33719cd", - "key": "WAITBYDURATION-1", + "id": "70572b1a-e274-4f09-a3fa-6fc0732ec52b", + "key": "WAITBYDURATION-2", "name": "", "description": "", "type": "WAIT", + "outcomes": [ + { + "key": "a0908f9f-bc3c-47f7-9489-7fef5af25ce3", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "waitDuration": 1, + "waitUnit": "DAYS" + }, + "metaData": { + "isConfigured": true, + "uiType": "WAITBYDURATION" + }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "e2a486cf-c85f-4543-88a2-d579cac1e0de", + "key": "WAITBYDURATION-1", + "name": "1 day", + "description": "", + "type": "WAIT", "outcomes": [ { "key": "97af222a-450a-429e-8925-649b72f01ccf", @@ -260,7 +400,7 @@ ], "triggers": [ { - "id": "4462b819-c18c-4d99-957c-7e5a10adb3fd", + "id": "92753481-1258-49bd-8a84-921ed63bcc2e", "key": "TRIGGER", "name": "TRIGGER", "description": "", diff --git a/test/resources/9999999/journey/get-multistep-expected.json b/test/resources/9999999/journey/get-multistep-expected.json index c038c0ccb..8434f0e86 100644 --- a/test/resources/9999999/journey/get-multistep-expected.json +++ b/test/resources/9999999/journey/get-multistep-expected.json @@ -6,10 +6,62 @@ "version": 1, "workflowApiVersion": 1, "createdDate": "2024-05-04T05:54:48.027", - "modifiedDate": "2024-05-04T05:54:48.027", + "modifiedDate": "2024-05-04T17:25:57.9", "activities": [ { - "id": "749e7bef-c87f-483e-bcbf-74d6619d56cc", + "id": "342dd0aa-a6be-401e-8614-3538800bfd7c", + "key": "MULTICRITERIADECISIONV2-1", + "name": "", + "description": "", + "type": "MULTICRITERIADECISION", + "outcomes": [ + { + "key": "default_path_1", + "next": "EMAILV2-1", + "arguments": {}, + "metaData": { + "label": "send message", + "skipI18n": true, + "isLabelFromConversion": false, + "criteriaDescription": "Email is not null" + } + }, + { + "key": "remainder_path", + "next": "WAITBYDURATION-2", + "arguments": {}, + "metaData": { "label": null } + } + ], + "arguments": {}, + "configurationArguments": { + "criteria": { + "default_path_1": "" + }, + "schemaVersionId": "252" + }, + "metaData": { "isConfigured": true }, + "schema": { + "arguments": { + "actualChoice": { + "dataType": "Number", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "filterResult": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": true, + "access": "Hidden" + } + } + } + }, + { + "id": "7ba1e59a-6be4-46c7-b76f-4c06feb1268a", "key": "EMAILV2-1", "name": "my custom activity name", "description": "", @@ -32,7 +84,7 @@ "autoUpdateSubscribers": true, "bccEmail": "", "ccEmail": "", - "created": {}, + "created": { "name": "", "date": "" }, "description": "my custom description", "domainExclusions": [], "dynamicEmailSubject": "testExisting_ email subject", @@ -42,7 +94,7 @@ "isMultipart": true, "isSendLogging": true, "isStoppedOnJobError": false, - "modified": {}, + "modified": { "name": "", "date": "" }, "preHeader": "testExisting_ email preheader", "throttleOpens": "1/1/0001 12:00:00 AM", "throttleCloses": "1/1/0001 12:00:00 AM", @@ -177,11 +229,81 @@ } }, { - "id": "90970a04-e71c-437d-83ed-8158f33719cd", - "key": "WAITBYDURATION-1", + "id": "70572b1a-e274-4f09-a3fa-6fc0732ec52b", + "key": "WAITBYDURATION-2", "name": "", "description": "", "type": "WAIT", + "outcomes": [ + { + "key": "a0908f9f-bc3c-47f7-9489-7fef5af25ce3", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { "waitDuration": 1, "waitUnit": "DAYS" }, + "metaData": { "isConfigured": true, "uiType": "WAITBYDURATION" }, + "schema": { + "arguments": { + "endDate": { + "dataType": "Date", + "isNullable": false, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "waitEndDateAttributeDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitDefinitionId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitForEventId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "executionMode": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "startActivityKey": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "waitQueueId": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + }, + { + "id": "e2a486cf-c85f-4543-88a2-d579cac1e0de", + "key": "WAITBYDURATION-1", + "name": "1 day", + "description": "", + "type": "WAIT", "outcomes": [ { "key": "97af222a-450a-429e-8925-649b72f01ccf", From 5e4e99b3074c8473798e59f0bfb822ef6d38435d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 5 May 2024 02:14:42 +0200 Subject: [PATCH 188/359] #62: added retrieve test for transactional email journey --- .../v1/interactions/get-response.json | 219 ++++++++++++++++++ .../key_testExisting_temail/get-response.json | 219 ++++++++++++++++++ .../get-transactionalEmail-expected.json | 211 +++++++++++++++++ .../testExisting_temail/get-response.json | 2 +- .../testExisting_temail/patch-response.json | 2 +- .../transactionalEmail/build-expected.json | 2 +- .../transactionalEmail/get-expected.json | 2 +- .../transactionalEmail/patch-expected.json | 2 +- .../transactionalEmail/template-expected.json | 2 +- test/type.journey.test.js | 26 +++ 10 files changed, 681 insertions(+), 6 deletions(-) create mode 100644 test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/get-response.json create mode 100644 test/resources/9999999/journey/get-transactionalEmail-expected.json diff --git a/test/resources/9999999/interaction/v1/interactions/get-response.json b/test/resources/9999999/interaction/v1/interactions/get-response.json index 6599ef2b1..ef44adeda 100644 --- a/test/resources/9999999/interaction/v1/interactions/get-response.json +++ b/test/resources/9999999/interaction/v1/interactions/get-response.json @@ -94,6 +94,225 @@ "status": "Draft", "definitionId": "0175b971-71a3-4d8e-98ac-48121f3fbf4f", "scheduledStatus": "Draft" + }, + { + "id": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be", + "key": "testExisting_temail", + "name": "testExisting_temail", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2022-03-24T02:20:32.74", + "modifiedDate": "2022-03-24T02:20:40.45", + "activities": [ + { + "id": "9606bcb0-9246-4610-9800-963bc77fc20a", + "key": "EMAILV2-4", + "name": "testExisting_temail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "1f44021a-74ac-49be-a07c-67862228214d", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "test email", + "emailId": 25923, + "emailSubject": "test email", + "exclusionFilter": "", + "isSalesforceTracking": true, + "isMultipart": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "", + "priority": 4, + "sendClassificationId": "1284e9b2-a7b8-e711-80cf-1402ec721c9d", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "1084e9b2-a7b8-e711-80cf-1402ec721c9d", + "senderProfileId": "0f84e9b2-a7b8-e711-80cf-1402ec721c9d", + "isTrackingClicks": true, + "publicationListId": 15 + }, + "triggeredSendId": "0a650d90-755e-ed11-b852-48df37d1df5b", + "triggeredSendKey": "testExisting_temail" + }, + "metaData": { + "highThroughput": { + "definitionKey": "testExisting_temail", + "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7" + }, + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "transactional-api", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "chainType": "none", + "configurationRequired": false, + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event", + "category": "Transactional", + "entrySourceGroupConfigUrl": "null" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Transactional", + "channel": "email", + "defaults": { + "properties": { + "analyticsTracking": { + "enabled": false, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": {}, + "executionMode": "Production", + "categoryId": 6298, + "status": "Published", + "scheduledStatus": "Draft", + "definitionId": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be" } ] } diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/get-response.json new file mode 100644 index 000000000..8427da85d --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_temail/get-response.json @@ -0,0 +1,219 @@ +{ + "id": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be", + "key": "testExisting_temail", + "name": "testExisting_temail", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2022-03-24T02:20:32.74", + "modifiedDate": "2022-03-24T02:20:40.45", + "activities": [ + { + "id": "9606bcb0-9246-4610-9800-963bc77fc20a", + "key": "EMAILV2-4", + "name": "testExisting_temail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "1f44021a-74ac-49be-a07c-67862228214d", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "test email", + "emailId": 531213, + "emailSubject": "test email", + "exclusionFilter": "", + "isSalesforceTracking": true, + "isMultipart": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "", + "priority": 4, + "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", + "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95", + "isTrackingClicks": true, + "publicationListId": 15 + }, + "triggeredSendId": "0a650d90-755e-ed11-b852-48df37d1df5b", + "triggeredSendKey": "testExisting_temail" + }, + "metaData": { + "highThroughput": { + "definitionKey": "testExisting_temail", + "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7" + }, + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "transactional-api", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "chainType": "none", + "configurationRequired": false, + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event", + "category": "Transactional", + "entrySourceGroupConfigUrl": "null" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Transactional", + "channel": "email", + "defaults": { + "properties": { + "analyticsTracking": { + "enabled": false, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": {}, + "executionMode": "Production", + "categoryId": 6298, + "status": "Published", + "scheduledStatus": "Draft", + "definitionId": "dsfdsafdsa-922c-4568-85a5-e5cc77efc3be" +} diff --git a/test/resources/9999999/journey/get-transactionalEmail-expected.json b/test/resources/9999999/journey/get-transactionalEmail-expected.json new file mode 100644 index 000000000..8fbcc318c --- /dev/null +++ b/test/resources/9999999/journey/get-transactionalEmail-expected.json @@ -0,0 +1,211 @@ +{ + "key": "testExisting_temail", + "name": "testExisting_temail", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2022-03-24T02:20:32.74", + "modifiedDate": "2022-03-24T02:20:40.45", + "activities": [ + { + "id": "9606bcb0-9246-4610-9800-963bc77fc20a", + "key": "EMAILV2-4", + "name": "testExisting_temail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "1f44021a-74ac-49be-a07c-67862228214d", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "applicationExtensionKey": "jb-email-activity", + "isModified": true, + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "domainExclusions": [], + "dynamicEmailSubject": "test email", + "emailSubject": "test email", + "exclusionFilter": "", + "isSalesforceTracking": true, + "isMultipart": true, + "isSendLogging": false, + "isStoppedOnJobError": false, + "modified": {}, + "preHeader": "", + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { "publicationList": "my subscribers/All Subscribers" }, + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "c__priority": "Medium", + "r__assetMessage_Name_readOnly": "testExisting_asset_message", + "r__assetMessage_Key": "testExisting_asset_message" + }, + "r__transactionalEmail_definitionKey": "testExisting_temail" + }, + "metaData": { + "highThroughput": { "r__dataExtension_CustomerKey": "testExisting_dataExtension" }, + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "transactional-api", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "chainType": "none", + "configurationRequired": false, + "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", + "title": "Transactional API Event", + "category": "Transactional", + "entrySourceGroupConfigUrl": "null" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Transactional", + "channel": "email", + "defaults": { + "properties": { + "analyticsTracking": { + "enabled": false, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": {}, + "executionMode": "Production", + "status": "Published", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/get-response.json b/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/get-response.json index d4cc5a8ef..f24ad6578 100644 --- a/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/get-response.json +++ b/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/get-response.json @@ -21,6 +21,6 @@ "trackLinks": true }, "journey": { - "interactionKey": "testExisting_interaction" + "interactionKey": "testExisting_temail" } } diff --git a/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/patch-response.json b/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/patch-response.json index 10168f5f2..f961f6385 100644 --- a/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/patch-response.json +++ b/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/patch-response.json @@ -21,6 +21,6 @@ "trackLinks": true }, "journey": { - "interactionKey": "testExisting_interaction" + "interactionKey": "testExisting_temail" } } diff --git a/test/resources/9999999/transactionalEmail/build-expected.json b/test/resources/9999999/transactionalEmail/build-expected.json index bbc27cc4a..72f881cc6 100644 --- a/test/resources/9999999/transactionalEmail/build-expected.json +++ b/test/resources/9999999/transactionalEmail/build-expected.json @@ -14,5 +14,5 @@ "trackLinks": true }, "r__asset_customerKey": "testTemplated_asset_message", - "r__journey_key": "testTemplated_interaction" + "r__journey_key": "testTemplated_temail" } diff --git a/test/resources/9999999/transactionalEmail/get-expected.json b/test/resources/9999999/transactionalEmail/get-expected.json index 4cfc61fa2..6a4e1f88f 100644 --- a/test/resources/9999999/transactionalEmail/get-expected.json +++ b/test/resources/9999999/transactionalEmail/get-expected.json @@ -16,5 +16,5 @@ "trackLinks": true }, "r__asset_customerKey": "testExisting_asset_message", - "r__journey_key": "testExisting_interaction" + "r__journey_key": "testExisting_temail" } diff --git a/test/resources/9999999/transactionalEmail/patch-expected.json b/test/resources/9999999/transactionalEmail/patch-expected.json index 18fb2d317..625911658 100644 --- a/test/resources/9999999/transactionalEmail/patch-expected.json +++ b/test/resources/9999999/transactionalEmail/patch-expected.json @@ -16,5 +16,5 @@ "trackLinks": true }, "r__asset_customerKey": "testExisting_asset_message", - "r__journey_key": "testExisting_interaction" + "r__journey_key": "testExisting_temail" } diff --git a/test/resources/9999999/transactionalEmail/template-expected.json b/test/resources/9999999/transactionalEmail/template-expected.json index b32da26a4..482d7ae37 100644 --- a/test/resources/9999999/transactionalEmail/template-expected.json +++ b/test/resources/9999999/transactionalEmail/template-expected.json @@ -14,5 +14,5 @@ "trackLinks": true }, "r__asset_customerKey": "{{{prefix}}}asset_message", - "r__journey_key": "{{{prefix}}}interaction" + "r__journey_key": "{{{prefix}}}temail" } diff --git a/test/type.journey.test.js b/test/type.journey.test.js index bc8d6b8d0..0f2c9e5a9 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -75,6 +75,32 @@ describe('type: journey', () => { ); return; }); + + it('Should retrieve a Transactional Email journey with key', async () => { + // WHEN + await handler.retrieve('testInstance/testBU', ['journey'], ['testExisting_temail']); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.journey ? Object.keys(result.journey).length : 0, + 1, + 'only 1 journeys expected' + ); + + assert.deepEqual( + await testUtils.getActualJson('testExisting_temail', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-transactionalEmail'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 23, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); }); describe('Delete ================', () => { From a82ed1d557339ba73b883b7c3aa10f62dc99811b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 5 May 2024 02:25:11 +0200 Subject: [PATCH 189/359] #62: add journey tests for retrieve without key and for retrieve with id --- .../get-response.json | 253 ++++++++++++++++++ .../v1/interactions/get-response.json | 189 +------------ test/type.journey.test.js | 64 +++++ 3 files changed, 318 insertions(+), 188 deletions(-) create mode 100644 test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json diff --git a/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json b/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json new file mode 100644 index 000000000..dadcd9ed5 --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json @@ -0,0 +1,253 @@ +{ + "id": "3c3f4112-9b43-43ca-8a89-aa0375b2c1a2", + "key": "testExisting_journey_Quicksend", + "name": "testExisting_journey_Quicksend", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", + "activities": [ + { + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testExisting_asset_mail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", + "arguments": {}, + "metaData": { + "invalid": false + } + } + ], + "arguments": {}, + "configurationArguments": { + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "description": "my activity info text", + "domainExclusions": [ + { + "id": "5a7194ad-6602-ef11-a5c8-5cba2c702db8", + "name": "testExisting_DomainExclusion" + } + ], + "dynamicEmailSubject": "testExisting_ email subject", + "emailId": 531213, + "emailSubject": "testExisting_ email subject", + "exclusionFilter": "/* insert ampscript here */", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "testExisting_ email preheader", + "priority": 3, + "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", + "suppressionLists": [ + { + "id": 75520, + "name": "testExisting_suppressionList" + } + ], + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "deliveryProfileId": "163f8417-13f7-e911-a2d8-1402ec938a35", + "senderProfileId": "a75d452b-7ef4-eb11-b82d-48df37d1da95", + "isTrackingClicks": true, + "publicationListId": 15 + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "id": "abe42b4d-736d-4d26-a8f0-ce67d410782f", + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "sourceInteractionId": "00000000-0000-0000-0000-000000000000", + "eventDefinitionId": "9e1995f8-951d-4019-855c-826b45e5b028", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "stats": { + "currentPopulation": 0, + "cumulativePopulation": 0, + "metGoal": 0, + "metExitCriteria": 0, + "goalPerformance": 0 + }, + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", + "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { + "email": false + } + }, + "executionMode": "Production", + "categoryId": 6298, + "status": "Draft", + "definitionId": "3c3f4112-9b43-43ca-8a89-aa0375b2c1a2", + "scheduledStatus": "Draft" +} diff --git a/test/resources/9999999/interaction/v1/interactions/get-response.json b/test/resources/9999999/interaction/v1/interactions/get-response.json index ef44adeda..b238519a9 100644 --- a/test/resources/9999999/interaction/v1/interactions/get-response.json +++ b/test/resources/9999999/interaction/v1/interactions/get-response.json @@ -6,7 +6,7 @@ "items": [ { "id": "3c3f4112-9b43-43ca-8a89-aa0375b2c1a2", - "key": "c3a4736c-bbaa-e8ab-b61e-7d811bf0898f", + "key": "testExisting_journey_Quicksend", "name": "testExisting_journey_Quicksend", "lastPublishedDate": "0001-01-01T00:00:00", "description": "", @@ -105,193 +105,6 @@ "workflowApiVersion": 1, "createdDate": "2022-03-24T02:20:32.74", "modifiedDate": "2022-03-24T02:20:40.45", - "activities": [ - { - "id": "9606bcb0-9246-4610-9800-963bc77fc20a", - "key": "EMAILV2-4", - "name": "testExisting_temail", - "description": "", - "type": "EMAILV2", - "outcomes": [ - { - "key": "1f44021a-74ac-49be-a07c-67862228214d", - "arguments": {}, - "metaData": { - "invalid": false - } - } - ], - "arguments": {}, - "configurationArguments": { - "applicationExtensionKey": "jb-email-activity", - "isModified": true, - "triggeredSend": { - "autoAddSubscribers": true, - "autoUpdateSubscribers": true, - "bccEmail": "", - "ccEmail": "", - "created": {}, - "domainExclusions": [], - "dynamicEmailSubject": "test email", - "emailId": 25923, - "emailSubject": "test email", - "exclusionFilter": "", - "isSalesforceTracking": true, - "isMultipart": true, - "isSendLogging": false, - "isStoppedOnJobError": false, - "modified": {}, - "preHeader": "", - "priority": 4, - "sendClassificationId": "1284e9b2-a7b8-e711-80cf-1402ec721c9d", - "throttleOpens": "1/1/0001 12:00:00 AM", - "throttleCloses": "1/1/0001 12:00:00 AM", - "deliveryProfileId": "1084e9b2-a7b8-e711-80cf-1402ec721c9d", - "senderProfileId": "0f84e9b2-a7b8-e711-80cf-1402ec721c9d", - "isTrackingClicks": true, - "publicationListId": 15 - }, - "triggeredSendId": "0a650d90-755e-ed11-b852-48df37d1df5b", - "triggeredSendKey": "testExisting_temail" - }, - "metaData": { - "highThroughput": { - "definitionKey": "testExisting_temail", - "dataExtensionId": "21711373-72c1-ec11-b83b-48df37d1deb7" - }, - "sections": {}, - "isConfigured": true - }, - "schema": { - "arguments": { - "requestID": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "messageKey": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "activityId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": true, - "access": "Hidden" - }, - "emailSubjectDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": true, - "access": "Hidden" - }, - "contactId": { - "dataType": "Number", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "emailAddress": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "sourceCustomObjectId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "sourceCustomObjectKey": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "fieldType": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "obfuscationProperties": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "customObjectKey": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": true, - "access": "Hidden" - }, - "definitionInstanceId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "key": "TRIGGER", - "name": "TRIGGER", - "description": "", - "type": "transactional-api", - "outcomes": [], - "arguments": {}, - "configurationArguments": {}, - "metaData": { - "chainType": "none", - "configurationRequired": false, - "iconUrl": "/images/icon_journeyBuilder-event-transactional-blue.svg", - "title": "Transactional API Event", - "category": "Transactional", - "entrySourceGroupConfigUrl": "null" - } - } - ], "goals": [], "exits": [], "notifiers": [], diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 0f2c9e5a9..55cab7acb 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -17,6 +17,41 @@ describe('type: journey', () => { }); describe('Retrieve ================', () => { + it('Should retrieve a journey w/o keys', async () => { + // WHEN + await handler.retrieve('testInstance/testBU', ['journey']); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.journey ? Object.keys(result.journey).length : 0, + 3, + 'only 3 journeys expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Multistep', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-multistep'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_temail', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-transactionalEmail'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 26, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should retrieve a Quicksend journey with key', async () => { // WHEN await handler.retrieve( @@ -101,6 +136,35 @@ describe('type: journey', () => { ); return; }); + + it('Should retrieve a journey with id', async () => { + // WHEN + await handler.retrieve( + 'testInstance/testBU', + ['journey'], + ['id:3c3f4112-9b43-43ca-8a89-aa0375b2c1a2'] + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.journey ? Object.keys(result.journey).length : 0, + 1, + 'only 1 journeys expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend'), + 'returned JSON was not equal expected' + ); + assert.equal( + testUtils.getAPIHistoryLength(), + 21, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); }); describe('Delete ================', () => { From 8f34313873c82a4fd5315f9c64e1d0bcff93d2fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 5 May 2024 02:31:52 +0200 Subject: [PATCH 190/359] #62: fix journey deletion test --- .../delete-response.txt | 1 + test/type.journey.test.js | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/delete-response.txt diff --git a/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/delete-response.txt b/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/delete-response.txt new file mode 100644 index 000000000..ea0c6d67a --- /dev/null +++ b/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/delete-response.txt @@ -0,0 +1 @@ +3c3f4112-9b43-43ca-8a89-aa0375b2c1a2 \ No newline at end of file diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 55cab7acb..4c18b0034 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -173,7 +173,7 @@ describe('type: journey', () => { const isDeleted = await handler.deleteByKey( 'testInstance/testBU', 'journey', - 'testExisting_interaction' + 'testExisting_journey_Quicksend' ); // THEN assert.equal(process.exitCode, 1, 'delete should have thrown an error'); @@ -187,7 +187,7 @@ describe('type: journey', () => { const isDeleted = await handler.deleteByKey( 'testInstance/testBU', 'journey', - 'testExisting_interaction/2' + 'testExisting_journey_Quicksend/2' ); // THEN assert.equal(process.exitCode, 1, 'delete should have thrown an error'); @@ -201,7 +201,7 @@ describe('type: journey', () => { const isDeleted = await handler.deleteByKey( 'testInstance/testBU', 'journey', - 'testExisting_interaction/1' + 'testExisting_journey_Quicksend/1' ); // THEN assert.equal(process.exitCode, 0, 'delete should not have thrown an error'); From 336bc38af77c7af540cdcecaaa31eb0b886c21b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 5 May 2024 02:46:01 +0200 Subject: [PATCH 191/359] #62: fix templating test for journeys --- .../9999999/journey/build-expected.json | 554 ++++-------------- .../9999999/journey/template-expected.json | 554 ++++-------------- test/type.journey.test.js | 46 ++ 3 files changed, 256 insertions(+), 898 deletions(-) diff --git a/test/resources/9999999/journey/build-expected.json b/test/resources/9999999/journey/build-expected.json index b3e4d5489..0c0f6dc3b 100644 --- a/test/resources/9999999/journey/build-expected.json +++ b/test/resources/9999999/journey/build-expected.json @@ -1,506 +1,173 @@ { - "key": "testTemplated_interaction", - "name": "testTemplated_interaction", - "description": "foobar", + "key": "testTemplated_journey_Quicksend", + "name": "testTemplated_journey_Quicksend", + "description": "", "workflowApiVersion": 1, - "modifiedDate": "2017-04-12T08:07:48.333", + "modifiedDate": "2024-04-24T12:19:12.803", "activities": [ { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testTemplated_asset_mail", "description": "", - "type": "WAIT", + "type": "EMAILV2", "outcomes": [ { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", "arguments": {}, - "metaData": {} + "metaData": { "invalid": false } } ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, + "arguments": {}, "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "description": "my activity info text", + "dynamicEmailSubject": "testTemplated_ email subject", + "emailSubject": "testTemplated_ email subject", + "exclusionFilter": "/* insert ampscript here */", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "testTemplated_ email preheader", + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers", + "suppressionLists": ["Suppression Lists/testTemplated_suppressionList"] + }, + "r__dataExtension_CustomerKey": { + "domainExclusions": ["testTemplated_DomainExclusion"] + }, + "r__senderProfile_CustomerKey": "testTemplated_senderProfile", + "r__sendClassification_CustomerKey": "testTemplated_sendClassification", + "c__priority": "High", + "r__assetMessage_Name_readOnly": "testTemplated_asset_message", + "r__assetMessage_Key": "testTemplated_asset_message" + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true }, - "metaData": { "waitType": "duration" }, "schema": { "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { + "requestID": { "dataType": "Text", "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", + "direction": "Out", "readOnly": false, "access": "Hidden" }, - "startActivityKey": { + "messageKey": { "dataType": "Text", "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "next": "SMSSYNC-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, "direction": "Out", "readOnly": false, "access": "Hidden" }, - "waitEndDateAttributeDataBound": { + "activityId": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { + "definitionId": { "dataType": "Text", "isNullable": true, "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, + "readOnly": true, "access": "Hidden" }, - "startActivityKey": { + "emailSubjectDataBound": { "dataType": "Text", "isNullable": true, "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "79213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-3", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, + "readOnly": true, "access": "Hidden" }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", + "contactId": { + "dataType": "Number", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitDefinitionId": { + "contactKey": { "dataType": "Text", "isNullable": false, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { + "emailAddress": { "dataType": "Text", "isNullable": false, "direction": "In", "readOnly": false, "access": "Hidden" }, - "startActivityKey": { + "sourceCustomObjectId": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitQueueId": { + "sourceCustomObjectKey": { "dataType": "LongNumber", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "cfc3ec53-4314-4504-9f9d-1fe53fdf0bcf", - "key": "SMSSYNC-1", - "name": "Kate Test SMS", - "description": "", - "type": "SMSSYNC", - "outcomes": [ - { - "key": "d4d46c46-bf8c-4c62-bd34-4979548796cd", - "next": "WAIT-3", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "contactKey": "{{Contact.Key}}", - "defaultSMSAddress": "{{Contact.Default.SMS}}", - "mobileNumber": "{{InteractionDefaults.MobileNumber}}", - "contactId": "{{Contact.Id}}", - "definitionInstanceId": "{{Context.DefinitionInstanceId}}", - "definitionId": "{{Context.DefinitionId}}" - }, - "configurationArguments": { - "c__mobileMessage_id": "NTIzOjc4OjA", - "r__mobileKeyword_codeKeyword": "4912312345678.TESTTEMPLATED_KEYWORD", - "isOptIn": false, - "honorBlackoutWindowEnum": 0, - "mobileBlackoutWindowStartTime": "", - "mobileBlackoutWindowEndTime": "", - "applicationExtensionKey": "jb-mobile-connect-send-sms-sync" - }, - "metaData": { - "isConfigured": true - }, - "schema": { - "arguments": { - "smsJobId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isAddressCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isSubscriptionCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isTriggeredSend": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isWithinBlackout": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isValidMobileNumber": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMessageId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outKeywordId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsOptIn": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outHonorBlackoutWindowEnum": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowStartTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowEndTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outUtcOffset": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowStart": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" }, - "outWindowEnd": { + "fieldType": { "dataType": "Text", "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outTimeZoneId": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsTZValid": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsMobileBlackoutWindowEnabled": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsUsingDEAttributesForPersonalization": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outCountProcessedSingletonDuringBatchMethod": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, "direction": "In", "readOnly": false, "access": "Hidden" }, - "defaultSMSAddress": { + "eventData": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "mobileNumber": { + "obfuscationProperties": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "contactId": { - "dataType": "Text", - "isNullable": false, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, "direction": "In", - "readOnly": false, + "readOnly": true, "access": "Hidden" }, "definitionInstanceId": { @@ -509,20 +176,6 @@ "direction": "In", "readOnly": false, "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" } } } @@ -531,41 +184,44 @@ "triggers": [ { "key": "TRIGGER", - "name": "test_TESTDataentry", + "name": "TRIGGER", "description": "", - "type": "APIEvent", + "type": "EmailAudience", "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, + "arguments": {}, + "configurationArguments": {}, "metaData": { - "scheduleState": "No Schedule", "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", "chainType": "None", "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" } } ], "goals": [], "exits": [], "notifiers": [], - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { "email": false } }, - "metaData": {}, "executionMode": "Production", "scheduledStatus": "Draft", "r__folder_Path": "my journeys" diff --git a/test/resources/9999999/journey/template-expected.json b/test/resources/9999999/journey/template-expected.json index ec0b7e58f..8cc6812bf 100644 --- a/test/resources/9999999/journey/template-expected.json +++ b/test/resources/9999999/journey/template-expected.json @@ -1,506 +1,173 @@ { - "key": "{{{prefix}}}interaction", - "name": "{{{prefix}}}interaction", - "description": "{{{description}}}", + "key": "{{{prefix}}}journey_Quicksend", + "name": "{{{prefix}}}journey_Quicksend", + "description": "", "workflowApiVersion": 1, - "modifiedDate": "2017-04-12T08:07:48.333", + "modifiedDate": "2024-04-24T12:19:12.803", "activities": [ { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "{{{prefix}}}asset_mail", "description": "", - "type": "WAIT", + "type": "EMAILV2", "outcomes": [ { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", "arguments": {}, - "metaData": {} + "metaData": { "invalid": false } } ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, + "arguments": {}, "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "description": "my activity info text", + "dynamicEmailSubject": "{{{prefix}}} email subject", + "emailSubject": "{{{prefix}}} email subject", + "exclusionFilter": "/* insert ampscript here */", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "{{{prefix}}} email preheader", + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers", + "suppressionLists": ["Suppression Lists/{{{prefix}}}suppressionList"] + }, + "r__dataExtension_CustomerKey": { + "domainExclusions": ["{{{prefix}}}DomainExclusion"] + }, + "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile", + "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", + "c__priority": "High", + "r__assetMessage_Name_readOnly": "{{{prefix}}}asset_message", + "r__assetMessage_Key": "{{{prefix}}}asset_message" + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true }, - "metaData": { "waitType": "duration" }, "schema": { "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { + "requestID": { "dataType": "Text", "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", + "direction": "Out", "readOnly": false, "access": "Hidden" }, - "startActivityKey": { + "messageKey": { "dataType": "Text", "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "next": "SMSSYNC-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, "direction": "Out", "readOnly": false, "access": "Hidden" }, - "waitEndDateAttributeDataBound": { + "activityId": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { + "definitionId": { "dataType": "Text", "isNullable": true, "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, + "readOnly": true, "access": "Hidden" }, - "startActivityKey": { + "emailSubjectDataBound": { "dataType": "Text", "isNullable": true, "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "79213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-3", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, + "readOnly": true, "access": "Hidden" }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", + "contactId": { + "dataType": "Number", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitDefinitionId": { + "contactKey": { "dataType": "Text", "isNullable": false, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { + "emailAddress": { "dataType": "Text", "isNullable": false, "direction": "In", "readOnly": false, "access": "Hidden" }, - "startActivityKey": { + "sourceCustomObjectId": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "waitQueueId": { + "sourceCustomObjectKey": { "dataType": "LongNumber", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "cfc3ec53-4314-4504-9f9d-1fe53fdf0bcf", - "key": "SMSSYNC-1", - "name": "Kate Test SMS", - "description": "", - "type": "SMSSYNC", - "outcomes": [ - { - "key": "d4d46c46-bf8c-4c62-bd34-4979548796cd", - "next": "WAIT-3", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "contactKey": "{{Contact.Key}}", - "defaultSMSAddress": "{{Contact.Default.SMS}}", - "mobileNumber": "{{InteractionDefaults.MobileNumber}}", - "contactId": "{{Contact.Id}}", - "definitionInstanceId": "{{Context.DefinitionInstanceId}}", - "definitionId": "{{Context.DefinitionId}}" - }, - "configurationArguments": { - "c__mobileMessage_id": "NTIzOjc4OjA", - "r__mobileKeyword_codeKeyword": "4912312345678.{{{prefixUpper}}}KEYWORD", - "isOptIn": false, - "honorBlackoutWindowEnum": 0, - "mobileBlackoutWindowStartTime": "", - "mobileBlackoutWindowEndTime": "", - "applicationExtensionKey": "jb-mobile-connect-send-sms-sync" - }, - "metaData": { - "isConfigured": true - }, - "schema": { - "arguments": { - "smsJobId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isAddressCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isSubscriptionCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isTriggeredSend": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isWithinBlackout": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isValidMobileNumber": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMessageId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outKeywordId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsOptIn": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outHonorBlackoutWindowEnum": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowStartTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowEndTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outUtcOffset": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowStart": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" }, - "outWindowEnd": { + "fieldType": { "dataType": "Text", "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outTimeZoneId": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsTZValid": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsMobileBlackoutWindowEnabled": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsUsingDEAttributesForPersonalization": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outCountProcessedSingletonDuringBatchMethod": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, "direction": "In", "readOnly": false, "access": "Hidden" }, - "defaultSMSAddress": { + "eventData": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "mobileNumber": { + "obfuscationProperties": { "dataType": "Text", "isNullable": true, "direction": "In", "readOnly": false, "access": "Hidden" }, - "contactId": { - "dataType": "Text", - "isNullable": false, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, "direction": "In", - "readOnly": false, + "readOnly": true, "access": "Hidden" }, "definitionInstanceId": { @@ -509,20 +176,6 @@ "direction": "In", "readOnly": false, "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" } } } @@ -531,41 +184,44 @@ "triggers": [ { "key": "TRIGGER", - "name": "test_TESTDataentry", + "name": "TRIGGER", "description": "", - "type": "APIEvent", + "type": "EmailAudience", "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, + "arguments": {}, + "configurationArguments": {}, "metaData": { - "scheduleState": "No Schedule", "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", "chainType": "None", "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" } } ], "goals": [], "exits": [], "notifiers": [], - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { "email": false } }, - "metaData": {}, "executionMode": "Production", "scheduledStatus": "Draft", "r__folder_Path": "my journeys" diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 4c18b0034..ad5b8370d 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -167,6 +167,52 @@ describe('type: journey', () => { }); }); + describe('Templating ================', () => { + it('Should create a journey template via buildTemplate and build it', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['journey']); + // buildTemplate + const result = await handler.buildTemplate( + 'testInstance/testBU', + 'journey', + ['testExisting_journey_Quicksend'], + 'testSourceMarket' + ); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); + assert.equal( + result.journey ? Object.keys(result.journey).length : 0, + 1, + 'only one journey expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'template'), + 'returned template JSON was not equal expected' + ); + + // buildDefinition + await handler.buildDefinition( + 'testInstance/testBU', + 'journey', + 'testExisting_journey_Quicksend', + 'testTargetMarket' + ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'build'), + 'returned deployment JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 26, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + describe('Delete ================', () => { it('Should NOT delete the item due to missing version', async () => { // WHEN From f701d5d6873b3d6f0bb070bffc77b251a125ac34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 6 May 2024 20:43:52 +0200 Subject: [PATCH 192/359] #1302: define max key length for deliveryProfile, SendClassification and SenderProfile --- lib/metadataTypes/definitions/DeliveryProfile.definition.js | 2 ++ lib/metadataTypes/definitions/SendClassification.definition.js | 3 ++- lib/metadataTypes/definitions/SenderProfile.definition.js | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/metadataTypes/definitions/DeliveryProfile.definition.js b/lib/metadataTypes/definitions/DeliveryProfile.definition.js index fefbe0059..c0b8fafb3 100644 --- a/lib/metadataTypes/definitions/DeliveryProfile.definition.js +++ b/lib/metadataTypes/definitions/DeliveryProfile.definition.js @@ -5,6 +5,8 @@ export default { hasExtended: false, idField: 'id', keyField: 'key', + keyIsFixed: false, + maxKeyLength: 36, // confirmed max length nameField: 'name', createdDateField: 'createdDate', createdNameField: null, diff --git a/lib/metadataTypes/definitions/SendClassification.definition.js b/lib/metadataTypes/definitions/SendClassification.definition.js index 11f0c87f7..2e67e4168 100644 --- a/lib/metadataTypes/definitions/SendClassification.definition.js +++ b/lib/metadataTypes/definitions/SendClassification.definition.js @@ -5,8 +5,9 @@ export default { filter: {}, hasExtended: false, idField: 'ObjectID', - keyIsFixed: null, keyField: 'CustomerKey', + keyIsFixed: false, + maxKeyLength: 36, // confirmed max length nameField: 'Name', createdDateField: 'CreatedDate', createdNameField: null, diff --git a/lib/metadataTypes/definitions/SenderProfile.definition.js b/lib/metadataTypes/definitions/SenderProfile.definition.js index ea98f6d9a..2fdc023fc 100644 --- a/lib/metadataTypes/definitions/SenderProfile.definition.js +++ b/lib/metadataTypes/definitions/SenderProfile.definition.js @@ -4,8 +4,9 @@ export default { filter: {}, hasExtended: false, idField: 'ObjectID', - keyIsFixed: false, keyField: 'CustomerKey', + keyIsFixed: false, + maxKeyLength: 36, // confirmed max length nameField: 'Name', createdDateField: 'CreatedDate', createdNameField: null, From 1673197dc45642b7a1cc139b67f8c7d7e3587f24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 6 May 2024 20:45:11 +0200 Subject: [PATCH 193/359] #1302, #1298: --addKeySuffix logic for fixKeys and deploy --- lib/cli.js | 12 +++++ lib/index.js | 1 + lib/metadataTypes/MetadataType.js | 73 +++++++++++++++++++++---------- 3 files changed, 64 insertions(+), 22 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index d79d73cd3..24154b665 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -87,6 +87,12 @@ yargs(hideBin(process.argv)) describe: 'type or type:key or type:i:id or type:n:name to deploy; if not provided, all metadata will be deploy', }) + .option('addKeySuffix', { + type: 'string', + group: 'Options for deploy:', + describe: + 'allows you to add a suffix to the key of the metadata to be deployed. Only works together with changeKeyField', + }) .option('changeKeyField', { type: 'string', group: 'Options for deploy:', @@ -644,6 +650,12 @@ yargs(hideBin(process.argv)) describe: 'filter metadata components (can include % as wildcard or _ for a single character)', }) + .option('addKeySuffix', { + type: 'string', + group: 'Options for fixKeys:', + describe: + 'allows you to add a suffix to the key of the metadata to be deployed.', + }) .option('execute', { type: 'boolean', group: 'Options for fixKeys:', diff --git a/lib/index.js b/lib/index.js index 87171109c..d5444717c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -77,6 +77,7 @@ class Mcdev { static setOptions(argv) { const knownOptions = [ 'api', + 'addKeySuffix', 'changeKeyField', 'changeKeyValue', 'commitHistory', diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 0159a1a84..cd5a3d657 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -739,11 +739,14 @@ class MetadataType { ); } else if (metadataMap[metadataKey][Util.OPTIONS.changeKeyField]) { // NOTE: trim twice while getting the newKey value to remove leading spaces before limiting the length - const newKey = (metadataMap[metadataKey][Util.OPTIONS.changeKeyField] + '') - .trim() - .slice(0, maxKeyLength) - .trim(); - if (metadataMap[metadataKey][Util.OPTIONS.changeKeyField] + '' > maxKeyLength) { + const newKey = this.getNewKey(metadataMap[metadataKey], maxKeyLength); + + if ( + metadataMap[metadataKey][Util.OPTIONS.changeKeyField] + + '' + + Util.OPTIONS.addKeySuffix > + maxKeyLength + ) { Util.logger.warn( `${this.definition.type} ${this.definition.keyField} may not exceed ${maxKeyLength} characters. Truncated the value in field ${Util.OPTIONS.changeKeyField} to ${newKey}` ); @@ -2166,30 +2169,33 @@ class MetadataType { Util.logger.info( `Searching for ${this.definition.type} keys among downloaded items that need fixing:` ); + Util.OPTIONS.addKeySuffix = Util.OPTIONS.addKeySuffix + ? Util.OPTIONS.addKeySuffix.trim() + : ''; + const maxKeyLength = this.definition.maxKeyLength || 36; + for (const item of Object.values(metadataMap)) { - if (item[this.definition.nameField].length > this.definition.maxKeyLength) { + if ( + (item[this.definition.nameField].endsWith(Util.OPTIONS.addKeySuffix) && + item[this.definition.nameField].length > maxKeyLength) || + (!item[this.definition.nameField].endsWith(Util.OPTIONS.addKeySuffix) && + item[this.definition.nameField].length + Util.OPTIONS.addKeySuffix.length > + maxKeyLength) + ) { Util.logger.warn( - `Name of the item ${ - item[this.definition.keyField] - } is too long for a key. Consider renaming your item. Key will be equal first ${ - this.definition.maxKeyLength - } characters of the name` - ); - item[this.definition.nameField] = item[this.definition.nameField].slice( - 0, - this.definition.maxKeyLength + `Name of the item ${item[this.definition.keyField]} (${ + item[this.definition.nameField] + }) is too long for a key${Util.OPTIONS.addKeySuffix.length ? ' (including the suffix ' + Util.OPTIONS.addKeySuffix + ')' : ''}. Consider renaming your item. Key will be equal first ${maxKeyLength} characters of the name` ); } - - if ( - item[this.definition.nameField] != item[this.definition.keyField] && - !this.definition.keyIsFixed - ) { - keysForDeploy.push(item[this.definition.keyField]); + const newKey = this.getNewKey(item, maxKeyLength); + if (newKey != item[this.definition.keyField] && !this.definition.keyIsFixed) { + // add key but make sure to turn it into string or else numeric keys will be filtered later + keysForDeploy.push(item[this.definition.keyField] + ''); Util.logger.info( ` - added ${this.definition.type} to fixKey queue: ${ item[this.definition.keyField] - }` + } >> ${newKey}` ); } else { Util.logger.info( @@ -2205,6 +2211,29 @@ class MetadataType { } return keysForDeploy; } + /** + * helper for getKeysForFixing and createOrUpdate + * + * @param {MetadataTypeItem} metadataItem - + * @param {number} maxKeyLength - + * @returns {string} newKey + */ + static getNewKey(metadataItem, maxKeyLength) { + let newKey; + newKey = (metadataItem[this.definition.nameField] + '') + .trim() + .slice(0, maxKeyLength) + .trim(); + if (Util.OPTIONS.addKeySuffix.length && !newKey.endsWith(Util.OPTIONS.addKeySuffix)) { + newKey = + (metadataItem[this.definition.nameField] + '') + .trim() + .slice(0, maxKeyLength - Util.OPTIONS.addKeySuffix.length) + .trim() + Util.OPTIONS.addKeySuffix; + } + + return newKey; + } } MetadataType.definition = { From 69b67349612164a06bcfe50a0d7cc3ff39c17371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 6 May 2024 20:47:24 +0200 Subject: [PATCH 194/359] #1302: rename new option to --keySuffix --- lib/cli.js | 4 ++-- lib/index.js | 2 +- lib/metadataTypes/MetadataType.js | 20 +++++++++----------- 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 24154b665..80867a4ee 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -87,7 +87,7 @@ yargs(hideBin(process.argv)) describe: 'type or type:key or type:i:id or type:n:name to deploy; if not provided, all metadata will be deploy', }) - .option('addKeySuffix', { + .option('keySuffix', { type: 'string', group: 'Options for deploy:', describe: @@ -650,7 +650,7 @@ yargs(hideBin(process.argv)) describe: 'filter metadata components (can include % as wildcard or _ for a single character)', }) - .option('addKeySuffix', { + .option('keySuffix', { type: 'string', group: 'Options for fixKeys:', describe: diff --git a/lib/index.js b/lib/index.js index d5444717c..d2ac822e6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -77,7 +77,7 @@ class Mcdev { static setOptions(argv) { const knownOptions = [ 'api', - 'addKeySuffix', + 'keySuffix', 'changeKeyField', 'changeKeyValue', 'commitHistory', diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index cd5a3d657..3811ce782 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -744,7 +744,7 @@ class MetadataType { if ( metadataMap[metadataKey][Util.OPTIONS.changeKeyField] + '' + - Util.OPTIONS.addKeySuffix > + Util.OPTIONS.keySuffix > maxKeyLength ) { Util.logger.warn( @@ -2169,23 +2169,21 @@ class MetadataType { Util.logger.info( `Searching for ${this.definition.type} keys among downloaded items that need fixing:` ); - Util.OPTIONS.addKeySuffix = Util.OPTIONS.addKeySuffix - ? Util.OPTIONS.addKeySuffix.trim() - : ''; + Util.OPTIONS.keySuffix = Util.OPTIONS.keySuffix ? Util.OPTIONS.keySuffix.trim() : ''; const maxKeyLength = this.definition.maxKeyLength || 36; for (const item of Object.values(metadataMap)) { if ( - (item[this.definition.nameField].endsWith(Util.OPTIONS.addKeySuffix) && + (item[this.definition.nameField].endsWith(Util.OPTIONS.keySuffix) && item[this.definition.nameField].length > maxKeyLength) || - (!item[this.definition.nameField].endsWith(Util.OPTIONS.addKeySuffix) && - item[this.definition.nameField].length + Util.OPTIONS.addKeySuffix.length > + (!item[this.definition.nameField].endsWith(Util.OPTIONS.keySuffix) && + item[this.definition.nameField].length + Util.OPTIONS.keySuffix.length > maxKeyLength) ) { Util.logger.warn( `Name of the item ${item[this.definition.keyField]} (${ item[this.definition.nameField] - }) is too long for a key${Util.OPTIONS.addKeySuffix.length ? ' (including the suffix ' + Util.OPTIONS.addKeySuffix + ')' : ''}. Consider renaming your item. Key will be equal first ${maxKeyLength} characters of the name` + }) is too long for a key${Util.OPTIONS.keySuffix.length ? ' (including the suffix ' + Util.OPTIONS.keySuffix + ')' : ''}. Consider renaming your item. Key will be equal first ${maxKeyLength} characters of the name` ); } const newKey = this.getNewKey(item, maxKeyLength); @@ -2224,12 +2222,12 @@ class MetadataType { .trim() .slice(0, maxKeyLength) .trim(); - if (Util.OPTIONS.addKeySuffix.length && !newKey.endsWith(Util.OPTIONS.addKeySuffix)) { + if (Util.OPTIONS.keySuffix.length && !newKey.endsWith(Util.OPTIONS.keySuffix)) { newKey = (metadataItem[this.definition.nameField] + '') .trim() - .slice(0, maxKeyLength - Util.OPTIONS.addKeySuffix.length) - .trim() + Util.OPTIONS.addKeySuffix; + .slice(0, maxKeyLength - Util.OPTIONS.keySuffix.length) + .trim() + Util.OPTIONS.keySuffix; } return newKey; From 84dabf900efa1305d007854e97a55f422fc0ea37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 6 May 2024 20:53:56 +0200 Subject: [PATCH 195/359] #1302: add aliases to deploy+fixKeys options --- lib/cli.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 80867a4ee..df3af46aa 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -89,41 +89,48 @@ yargs(hideBin(process.argv)) }) .option('keySuffix', { type: 'string', + alias: 'ks', group: 'Options for deploy:', describe: 'allows you to add a suffix to the key of the metadata to be deployed. Only works together with changeKeyField', }) .option('changeKeyField', { type: 'string', + alias: 'ckf', group: 'Options for deploy:', describe: 'enables updating the key of the deployed metadata with the value in provided field (e.g. c__newKey). Can be used to sync name and key fields.', }) .option('changeKeyValue', { type: 'string', + alias: 'ckv', group: 'Options for deploy:', describe: 'allows updating the key of the metadata to the provided value. Only available if a single type and key is deployed', }) .option('fromRetrieve', { type: 'boolean', + alias: 'fr', group: 'Options for deploy:', describe: 'optionally deploy from retrieve folder', }) .option('refresh', { type: 'boolean', + alias: 'r', group: 'Options for deploy:', describe: 'optional for asset-message: runs refresh command for related triggeredSends after deploy', }) .option('execute', { type: 'boolean', + alias: 'e', group: 'Options for deploy:', describe: 'optional: executes item after deploy; this will run the item once immediately', }) .option('schedule', { type: 'boolean', + alias: 's', group: 'Options for deploy:', describe: 'optionally start existing schedule instead of running item once immediately (only works for automations)', @@ -133,7 +140,6 @@ yargs(hideBin(process.argv)) describe: "optionally ensure that updates to shared DataExtensions become visible in child BU's data designer (SF Known issue W-11031095)", }); - // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); @@ -652,18 +658,21 @@ yargs(hideBin(process.argv)) }) .option('keySuffix', { type: 'string', + alias: 'ks', group: 'Options for fixKeys:', describe: 'allows you to add a suffix to the key of the metadata to be deployed.', }) .option('execute', { type: 'boolean', + alias: 'e', group: 'Options for fixKeys:', describe: 'optional: executes item after deploy; this will run the item once immediately', }) .option('schedule', { type: 'boolean', + alias: 's', group: 'Options for fixKeys:', describe: 'optionally start existing schedule instead of running item once immediately (only works for automations)', From 12233069ba1702a1908639d4eb8018f19559c67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 6 May 2024 21:07:21 +0200 Subject: [PATCH 196/359] #1302: add missing reset --- lib/metadataTypes/MetadataType.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 3811ce782..2e9b2349e 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -738,7 +738,9 @@ class MetadataType { ` - --changeKeyField is set to the same value as the keyField for ${this.definition.type}. Skipping change.` ); } else if (metadataMap[metadataKey][Util.OPTIONS.changeKeyField]) { - // NOTE: trim twice while getting the newKey value to remove leading spaces before limiting the length + Util.OPTIONS.keySuffix = Util.OPTIONS.keySuffix + ? Util.OPTIONS.keySuffix.trim() + : ''; const newKey = this.getNewKey(metadataMap[metadataKey], maxKeyLength); if ( From 5cd639664eaf61ffcdd25291bbb817b4a40ce0bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 6 May 2024 21:26:57 +0200 Subject: [PATCH 197/359] #1302: add tests for deploy --keySuffix and fixKeys --keySuffix --- .../get-response.json | 17 ++++ .../patch-response.json | 18 ++++ .../automation/v1/queries/get-response.json | 17 ++++ .../query/patch_fixKeysSuffix-expected.json | 11 +++ .../query/patch_fixKeysSuffix-expected.sql | 6 ++ ...fixKeysSuffixANDStatus=Active-response.xml | 30 ++++++ test/type.query.test.js | 91 +++++++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/get-response.json create mode 100644 test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/patch-response.json create mode 100644 test/resources/9999999/query/patch_fixKeysSuffix-expected.json create mode 100644 test/resources/9999999/query/patch_fixKeysSuffix-expected.sql create mode 100644 test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query_fixKeysSuffixANDStatus=Active-response.xml diff --git a/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/get-response.json b/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/get-response.json new file mode 100644 index 000000000..b3cbc33ee --- /dev/null +++ b/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/get-response.json @@ -0,0 +1,17 @@ +{ + "queryDefinitionId": "549f0568-607c-4940-afef-437965094dat_fixKeysSuffix", + "name": "testExisting_query_fixedKeys", + "key": "testExisting_query_fixKeysSuffix", + "description": "bla bla", + "queryText": "Select\n SubscriberKey as testField, Trim(last_name) AS name\nfrom\n _Subscribers\nwhere\n country in ('test')\n", + "targetName": "testExisting_dataExtension", + "targetKey": "testExisting_dataExtension", + "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "targetDescription": "", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:02:44.01", + "targetUpdateTypeId": 0, + "targetUpdateTypeName": "Overwrite", + "categoryId": 999, + "isFrozen": false +} diff --git a/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/patch-response.json b/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/patch-response.json new file mode 100644 index 000000000..fae619936 --- /dev/null +++ b/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeysSuffix/patch-response.json @@ -0,0 +1,18 @@ +{ + "queryDefinitionId": "549f0568-607c-4940-afef-437965094dat_fixKeys", + "name": "testExisting_query_fixedKeys", + "key": "testExisting_query_fixedKeys_DEV", + "description": "updated on deploy", + "queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\nWHERE\n country IN ('test')\n", + "targetName": "testExisting_dataExtension", + "targetKey": "testExisting_dataExtension", + "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "targetDescription": "", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:04:15.88", + "targetUpdateTypeId": 0, + "targetUpdateTypeName": "Overwrite", + "validatedQueryText": "SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\r\n\r\nINSERT INTO C518001158.[testDataExtension] ([testField])\r\nSELECT querydef.[testField]\r\nFROM (SELECT SubscriberKey as testField FROM C518001158._Subscribers ) AS querydef \r\nSELECT @rcInsert = @@ROWCOUNT;;\r\n", + "categoryId": 999, + "isFrozen": false +} diff --git a/test/resources/9999999/automation/v1/queries/get-response.json b/test/resources/9999999/automation/v1/queries/get-response.json index d07088bac..3da91d772 100644 --- a/test/resources/9999999/automation/v1/queries/get-response.json +++ b/test/resources/9999999/automation/v1/queries/get-response.json @@ -53,6 +53,23 @@ "targetUpdateTypeName": "Overwrite", "categoryId": 999, "isFrozen": false + }, + { + "queryDefinitionId": "549f0568-607c-4940-afef-437965094dat_fixKeysSuffix", + "name": "testExisting_query_fixedKeys", + "key": "testExisting_query_fixKeysSuffix", + "description": "bla bla", + "queryText": "Select\n SubscriberKey as testField, Trim(last_name) AS name\nfrom\n _Subscribers\nwhere\n country in ('test')\n", + "targetName": "testExisting_dataExtension", + "targetKey": "testExisting_dataExtension", + "targetId": "21711373-72c1-ec11-b83b-48df37d1deb7", + "targetDescription": "", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:02:44.01", + "targetUpdateTypeId": 0, + "targetUpdateTypeName": "Overwrite", + "categoryId": 999, + "isFrozen": false } ] } diff --git a/test/resources/9999999/query/patch_fixKeysSuffix-expected.json b/test/resources/9999999/query/patch_fixKeysSuffix-expected.json new file mode 100644 index 000000000..7a7c4bee2 --- /dev/null +++ b/test/resources/9999999/query/patch_fixKeysSuffix-expected.json @@ -0,0 +1,11 @@ +{ + "name": "testExisting_query_fixedKeys", + "key": "testExisting_query_fixedKeys_DEV", + "description": "updated on deploy", + "targetKey": "testExisting_dataExtension", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:04:15.88", + "targetUpdateTypeName": "Overwrite", + "isFrozen": false, + "r__folder_Path": "Query" +} diff --git a/test/resources/9999999/query/patch_fixKeysSuffix-expected.sql b/test/resources/9999999/query/patch_fixKeysSuffix-expected.sql new file mode 100644 index 000000000..2a32f5fad --- /dev/null +++ b/test/resources/9999999/query/patch_fixKeysSuffix-expected.sql @@ -0,0 +1,6 @@ +SELECT + SubscriberKey AS testField +FROM + _Subscribers +WHERE + country IN ('test') diff --git a/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query_fixKeysSuffixANDStatus=Active-response.xml b/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query_fixKeysSuffixANDStatus=Active-response.xml new file mode 100644 index 000000000..af515b27e --- /dev/null +++ b/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query_fixKeysSuffixANDStatus=Active-response.xml @@ -0,0 +1,30 @@ + + + + RetrieveResponse + urn:uuid:7ef0345e-b559-4fc4-8986-47e54e1a8a58 + urn:uuid:b2e814a6-517c-4882-9bbb-238bfce951ce + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2023-04-11T16:33:48Z + 2023-04-11T16:38:48Z + + + + + + OK + e8eb2988-2f43-4243-a6b0-6ab6b841a6ab + + + 549f0568-607c-4940-afef-437965094dat_fixKeysSuffix + + + + diff --git a/test/type.query.test.js b/test/type.query.test.js index 826c3314b..6633fbc0c 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -332,6 +332,55 @@ describe('type: query', () => { return; }); + it('Should change the key during update with --changeKeyField and --keySuffix', async () => { + // WHEN + await handler.retrieve( + 'testInstance/testBU', + ['query'], + ['testExisting_query_fixKeysSuffix'] + ); + handler.setOptions({ changeKeyField: 'name', keySuffix: '_DEV', fromRetrieve: true }); + const deployed = await handler.deploy( + 'testInstance/testBU', + ['query'], + ['testExisting_query_fixKeysSuffix'] + ); + // THEN + assert.equal( + process.exitCode, + 0, + 'deploy --changeKeyValue --keySuffix should not have thrown an error' + ); + assert.equal( + Object.keys(deployed['testInstance/testBU'].query).length, + 1, + 'returned number of keys does not correspond to number of expected fixed keys' + ); + assert.equal( + Object.keys(deployed['testInstance/testBU'].query)[0], + 'testExisting_query_fixedKeys_DEV', + 'returned keys do not correspond to expected fixed keys' + ); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson('testExisting_query_fixedKeys_DEV', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'patch_fixKeysSuffix'), + 'returned metadata was not equal expected for update query' + ); + expect( + file(testUtils.getActualFile('testExisting_query_fixedKeys_DEV', 'query', 'sql')) + ).to.equal( + file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeysSuffix', 'sql')) + ); + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 14, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should run fixKeys but not find fixable keys and hence stop', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); @@ -400,6 +449,48 @@ describe('type: query', () => { return; }); + it('Should fixKeys by key with --keySuffix WITHOUT re-retrieving dependent types', async () => { + // WHEN + handler.setOptions({ + keySuffix: '_DEV', + skipInteraction: { fixKeysReretrieve: false }, + }); + const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query', [ + 'testExisting_query_fixKeysSuffix', + 'testExisting_query', + ]); + assert.equal( + resultFixKeys['testInstance/testBU'].length, + 1, + 'returned number of keys does not correspond to number of expected fixed keys' + ); + assert.equal( + resultFixKeys['testInstance/testBU'][0], + 'testExisting_query_fixedKeys_DEV', + 'returned keys do not correspond to expected fixed keys' + ); + // THEN + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson('testExisting_query_fixedKeys_DEV', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'patch_fixKeysSuffix'), + 'returned metadata was not equal expected for update query' + ); + expect( + file(testUtils.getActualFile('testExisting_query_fixedKeys_DEV', 'query', 'sql')) + ).to.equal( + file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeysSuffix', 'sql')) + ); + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 16, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should fixKeys by key WITHOUT re-retrieving dependent types and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); From a2838390aced8fd21454977981bb933a79c4a7cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 6 May 2024 21:30:08 +0200 Subject: [PATCH 198/359] #1302: fix dependent tests --- test/type.query.test.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/test/type.query.test.js b/test/type.query.test.js index 6633fbc0c..f001b7d55 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -28,8 +28,8 @@ describe('type: query', () => { const result = cache.getCache(); assert.equal( result.query ? Object.keys(result.query).length : 0, - 3, - 'only three queries expected' + 4, + 'only 4 queries expected' ); // normal test assert.deepEqual( @@ -93,8 +93,8 @@ describe('type: query', () => { const result = cache.getCache(); assert.equal( result.query ? Object.keys(result.query).length : 0, - 3, - 'three queries in cache expected' + 4, + '4 queries in cache expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_query', 'query'), @@ -124,8 +124,8 @@ describe('type: query', () => { const result = cache.getCache(); assert.equal( result.query ? Object.keys(result.query).length : 0, - 3, - 'three queries in cache expected' + 4, + '4 queries in cache expected' ); expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.not @@ -166,8 +166,8 @@ describe('type: query', () => { const result = cache.getCache(); assert.equal( result.query ? Object.keys(result.query).length : 0, - 4, - 'four queries expected in cache' + 5, + '5 queries expected in cache' ); // confirm created item assert.deepEqual( @@ -619,7 +619,7 @@ describe('type: query', () => { const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query'); assert.equal( resultFixKeys['testInstance/testBU'].length, - 1, + 2, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( @@ -641,7 +641,7 @@ describe('type: query', () => { // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), - 13, + 14, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; From 47f09eb3e6e95bec130dcd762d3c68b06564544f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 11:14:23 +0200 Subject: [PATCH 199/359] #1301: add deploy option --noMidSuffix --- lib/cli.js | 6 ++++++ lib/index.js | 1 + lib/metadataTypes/Asset.js | 1 + 3 files changed, 8 insertions(+) diff --git a/lib/cli.js b/lib/cli.js index df3af46aa..fdcb2fc7f 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -94,6 +94,12 @@ yargs(hideBin(process.argv)) describe: 'allows you to add a suffix to the key of the metadata to be deployed. Only works together with changeKeyField', }) + .option('noMidSuffix', { + type: 'boolean', + group: 'Options for deploy:', + describe: + 'for asset: disables the automatic addition of the MID to the key of the deployed metadata when deploying cross-BU. Should be used with --keySuffix or with templating-based suffixes', + }) .option('changeKeyField', { type: 'string', alias: 'ckf', diff --git a/lib/index.js b/lib/index.js index d2ac822e6..5f0134877 100644 --- a/lib/index.js +++ b/lib/index.js @@ -90,6 +90,7 @@ class Mcdev { 'like', 'noLogColors', 'noLogFile', + 'noMidSuffix', 'refresh', '_runningTest', 'schedule', diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 9a03db12a..40a8aeadc 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -620,6 +620,7 @@ class Asset extends MetadataType { // only execute #3 if we are deploying / copying from one BU to another, not while using mcdev as a developer tool if ( + !Util.OPTIONS.noMidSuffix && this.buObject.mid && metadata.memberId !== this.buObject.mid && !metadata[this.definition.keyField].endsWith(this.buObject.mid) From 4069ded576dfb2c007608645daa8fc1fe1964026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 11:59:33 +0200 Subject: [PATCH 200/359] #1302: allow --keySuffix to be used for CREATE and without --changeKeyField --- lib/cli.js | 2 +- lib/metadataTypes/MetadataType.js | 76 +++++++++++++++++++++++++------ 2 files changed, 62 insertions(+), 16 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index fdcb2fc7f..d04538b79 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -92,7 +92,7 @@ yargs(hideBin(process.argv)) alias: 'ks', group: 'Options for deploy:', describe: - 'allows you to add a suffix to the key of the metadata to be deployed. Only works together with changeKeyField', + 'allows you to add a suffix to the key of the metadata to be deployed', }) .option('noMidSuffix', { type: 'boolean', diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 2e9b2349e..6e403c920 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -683,11 +683,25 @@ class MetadataType { metadataToUpdate, metadataToCreate ) { - const normalizedKey = File.reverseFilterIllegalFilenames( + let normalizedKey = File.reverseFilterIllegalFilenames( metadataMap[metadataKey][this.definition.keyField] ); + // Update if it already exists; Create it if not const maxKeyLength = this.definition.maxKeyLength || 36; + + // make sure keySuffix always has a string value + Util.OPTIONS.keySuffix = Util.OPTIONS.keySuffix ? Util.OPTIONS.keySuffix.trim() : ''; + if (Util.OPTIONS.keySuffix && !cache.getByKey(this.definition.type, normalizedKey)) { + // to ensure we go into update mode like we would with appending the MID to asset-keys, recreated the normalized key here + const newKey = this.getNewKey( + this.definition.keyField, + metadataMap[metadataKey], + maxKeyLength + ); + + normalizedKey = File.reverseFilterIllegalFilenames(newKey); + } if ( Util.logger.level === 'debug' && metadataMap[metadataKey][this.definition.idField] && @@ -716,6 +730,7 @@ class MetadataType { if (!this.hasChanged(cachedVersion, metadataMap[metadataKey])) { hasError = true; } + if (Util.OPTIONS.changeKeyField) { if (this.definition.keyField == this.definition.idField) { Util.logger.error( @@ -738,10 +753,11 @@ class MetadataType { ` - --changeKeyField is set to the same value as the keyField for ${this.definition.type}. Skipping change.` ); } else if (metadataMap[metadataKey][Util.OPTIONS.changeKeyField]) { - Util.OPTIONS.keySuffix = Util.OPTIONS.keySuffix - ? Util.OPTIONS.keySuffix.trim() - : ''; - const newKey = this.getNewKey(metadataMap[metadataKey], maxKeyLength); + const newKey = this.getNewKey( + Util.OPTIONS.changeKeyField, + metadataMap[metadataKey], + maxKeyLength + ); if ( metadataMap[metadataKey][Util.OPTIONS.changeKeyField] + @@ -769,6 +785,9 @@ class MetadataType { } } } else if (Util.OPTIONS.changeKeyValue) { + if (Util.OPTIONS.keySuffix !== '') { + Util.logger.warn(`Ignoring --keySuffix as --changeKeyValue is set.`); + } // NOTE: trim twice while getting the newKey value to remove leading spaces before limiting the length const newKey = Util.OPTIONS.changeKeyValue.trim().slice(0, maxKeyLength).trim(); if (Util.OPTIONS.changeKeyValue.trim().length > maxKeyLength) { @@ -800,6 +819,21 @@ class MetadataType { Util.changedKeysMap[this.definition.type] ||= {}; Util.changedKeysMap[this.definition.type][newKey] = metadataKey; } + } else if (Util.OPTIONS.keySuffix && Util.OPTIONS.keySuffix !== '') { + // assume we simply want to append a suffix + const newKey = this.getNewKey( + this.definition.keyField, + metadataMap[metadataKey], + maxKeyLength + ); + Util.logger.info( + ` - Changing ${this.definition.type} key from ${metadataKey} to ${newKey} via --keySuffix=${Util.OPTIONS.keySuffix}` + ); + metadataMap[metadataKey][this.definition.keyField] = newKey; + + // ensure we can delete the old file(s) after the successful update + Util.changedKeysMap[this.definition.type] ||= {}; + Util.changedKeysMap[this.definition.type][newKey] = metadataKey; } if (hasError) { @@ -824,6 +858,19 @@ class MetadataType { metadataToCreate.push(null); return 'skip'; } else { + if (Util.OPTIONS.keySuffix && Util.OPTIONS.keySuffix !== '') { + // assume we simply want to append a suffix + const newKey = this.getNewKey( + this.definition.keyField, + metadataMap[metadataKey], + maxKeyLength + ); + Util.logger.info( + ` - Changing ${this.definition.type} key from ${metadataKey} to ${newKey} via --keySuffix=${Util.OPTIONS.keySuffix}` + ); + metadataMap[metadataKey][this.definition.keyField] = newKey; + } + metadataToCreate.push(metadataMap[metadataKey]); return 'create'; } @@ -2188,7 +2235,7 @@ class MetadataType { }) is too long for a key${Util.OPTIONS.keySuffix.length ? ' (including the suffix ' + Util.OPTIONS.keySuffix + ')' : ''}. Consider renaming your item. Key will be equal first ${maxKeyLength} characters of the name` ); } - const newKey = this.getNewKey(item, maxKeyLength); + const newKey = this.getNewKey(this.definition.nameField, item, maxKeyLength); if (newKey != item[this.definition.keyField] && !this.definition.keyIsFixed) { // add key but make sure to turn it into string or else numeric keys will be filtered later keysForDeploy.push(item[this.definition.keyField] + ''); @@ -2214,22 +2261,21 @@ class MetadataType { /** * helper for getKeysForFixing and createOrUpdate * + * @param {string} baseField name of the field to start the new key with * @param {MetadataTypeItem} metadataItem - * @param {number} maxKeyLength - * @returns {string} newKey */ - static getNewKey(metadataItem, maxKeyLength) { + static getNewKey(baseField, metadataItem, maxKeyLength) { + const keySuffix = Util.OPTIONS.keySuffix; let newKey; - newKey = (metadataItem[this.definition.nameField] + '') - .trim() - .slice(0, maxKeyLength) - .trim(); - if (Util.OPTIONS.keySuffix.length && !newKey.endsWith(Util.OPTIONS.keySuffix)) { + newKey = (metadataItem[baseField] + '').trim().slice(0, maxKeyLength).trim(); + if (keySuffix.length && !newKey.endsWith(keySuffix)) { newKey = - (metadataItem[this.definition.nameField] + '') + (metadataItem[baseField] + '') .trim() - .slice(0, maxKeyLength - Util.OPTIONS.keySuffix.length) - .trim() + Util.OPTIONS.keySuffix; + .slice(0, maxKeyLength - keySuffix.length) + .trim() + keySuffix; } return newKey; From ae01fc27365f0da143a77bed8ffc882859be8c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 12:04:33 +0200 Subject: [PATCH 201/359] #0: shorten descriptions of deploy options --- lib/cli.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index d04538b79..47d389015 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -118,33 +118,32 @@ yargs(hideBin(process.argv)) type: 'boolean', alias: 'fr', group: 'Options for deploy:', - describe: 'optionally deploy from retrieve folder', + describe: 'deploy from retrieve folder', }) .option('refresh', { type: 'boolean', alias: 'r', group: 'Options for deploy:', describe: - 'optional for asset-message: runs refresh command for related triggeredSends after deploy', + 'for asset-message: runs refresh command for related triggeredSends after deploy', }) .option('execute', { type: 'boolean', alias: 'e', group: 'Options for deploy:', - describe: - 'optional: executes item after deploy; this will run the item once immediately', + describe: 'executes item after deploy; this will run the item once immediately', }) .option('schedule', { type: 'boolean', alias: 's', group: 'Options for deploy:', describe: - 'optionally start existing schedule instead of running item once immediately (only works for automations)', + 'start existing schedule instead of running item once immediately (only works for automations)', }) .option('fixShared', { group: 'Options for deploy:', describe: - "optionally ensure that updates to shared DataExtensions become visible in child BU's data designer (SF Known issue W-11031095)", + "ensure that updates to shared DataExtensions become visible in child BU's data designer (SF Known issue W-11031095)", }); }, handler: (argv) => { From de99de8dd6b43d750bab4872fcd2fdd7bb37bda9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 12:53:49 +0200 Subject: [PATCH 202/359] #905: allow testing for details of outgoing calls --- lib/util/auth.js | 49 ++++++++++++++++++++++++++++++++++-------------- lib/util/util.js | 1 + test/utils.js | 2 +- 3 files changed, 37 insertions(+), 15 deletions(-) diff --git a/lib/util/auth.js b/lib/util/auth.js index 803e29616..46c8d5656 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -149,22 +149,43 @@ function setupSDK(sessionKey, authObject) { } else if (msg.headers?.Authorization) { msg.headers.Authorization = 'Bearer *** TOKEN REMOVED ***'; } - if (Util.OPTIONS.api === 'cli') { - console.log(`${Util.color.fgMagenta}API REQUEST >>${Util.color.reset}`, msg); // eslint-disable-line no-console - } else if (Util.OPTIONS.api === 'log') { - let data; - if (msg.data) { - data = msg.data; - delete msg.data; - } - Util.logger.debug('API REQUEST >> ' + JSON.stringify(msg, null, 2)); - if (data) { - // printing it separately leads to better formatting - Util.logger.debug( - 'API REQUEST body >> \n ' + - (typeof data === 'string' ? data : JSON.stringify(data, null, 2)) + switch (Util.OPTIONS.api) { + case 'cli': { + /* eslint-disable no-console */ + console.log( + `${Util.color.fgMagenta}API REQUEST >>${Util.color.reset}`, + msg ); + /* eslint-enable no-console */ + + break; + } + case 'log': { + let data; + if (msg.data) { + data = msg.data; + delete msg.data; + } + Util.logger.debug('API REQUEST >> ' + JSON.stringify(msg, null, 2)); + if (data) { + // printing it separately leads to better formatting + Util.logger.debug( + 'API REQUEST body >> \n ' + + (typeof data === 'string' + ? data + : JSON.stringify(data, null, 2)) + ); + } + + break; + } + case 'test': { + // only used for test cases + Util.requestLog.push(msg); + + break; } + // No default } }, logResponse: (res) => { diff --git a/lib/util/util.js b/lib/util/util.js index 71b891306..717cea3c9 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -47,6 +47,7 @@ export const Util = { configFileName: '.mcdevrc.json', defaultGitBranch: 'main', parentBuName: '_ParentBU_', + requestLog: [], standardizedSplitChar: '/', /** @type {SkipInteraction} */ skipInteraction: null, diff --git a/test/utils.js b/test/utils.js index 4f4f6bcc2..02529d8b0 100644 --- a/test/utils.js +++ b/test/utils.js @@ -129,7 +129,7 @@ export function getExpectedFile(mid, type, action, ext) { export function mockSetup(isDeploy) { if (!isDeploy) { // no need to execute this again - already done in standard setup - handler.setOptions({ debug: true, noLogFile: true }); + handler.setOptions({ debug: true, noLogFile: true, api: 'test' }); } // @ts-expect-error somehow, MockAdapter does not expect type AxiosInstance apimock = new MockAdapter(axiosInstance, { onNoMatch: 'throwException' }); From 9a77946892497d76129ab96ad587e43828f69686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 12:55:36 +0200 Subject: [PATCH 203/359] #1302: test for --keySuffix on CREATE --- .../query/testNew_query.query-meta.json | 11 +++++ .../query/testNew_query.query-meta.sql | 4 ++ .../automation/v1/queries/get-response.json | 6 +++ .../automation/v1/queries/post-response.json | 18 +++++++ ...eve-ContentType=queryactivity-response.xml | 48 +++++++++++++++++++ .../query/patch_keySuffix-expected.json | 11 +++++ .../query/patch_keySuffix-expected.sql | 4 ++ test/type.query.test.js | 45 +++++++++++++++++ test/utils.js | 10 ++-- 9 files changed, 153 insertions(+), 4 deletions(-) create mode 100644 test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json create mode 100644 test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.sql create mode 100644 test/resources/1111111/automation/v1/queries/get-response.json create mode 100644 test/resources/1111111/automation/v1/queries/post-response.json create mode 100644 test/resources/1111111/dataFolder/retrieve-ContentType=queryactivity-response.xml create mode 100644 test/resources/1111111/query/patch_keySuffix-expected.json create mode 100644 test/resources/1111111/query/patch_keySuffix-expected.sql diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json new file mode 100644 index 000000000..688e58db5 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json @@ -0,0 +1,11 @@ +{ + "name": "testNew_query", + "key": "testNew_query", + "description": "created on deploy", + "targetKey": "testExisting_dataExtensionShared", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:04:15.88", + "targetUpdateTypeName": "Overwrite", + "isFrozen": false, + "r__folder_Path": "Query" +} diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.sql b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.sql new file mode 100644 index 000000000..8020314ea --- /dev/null +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.sql @@ -0,0 +1,4 @@ +SELECT + SubscriberKey as testField +FROM + _Subscribers diff --git a/test/resources/1111111/automation/v1/queries/get-response.json b/test/resources/1111111/automation/v1/queries/get-response.json new file mode 100644 index 000000000..48f76672e --- /dev/null +++ b/test/resources/1111111/automation/v1/queries/get-response.json @@ -0,0 +1,6 @@ +{ + "count": 0, + "page": 1, + "pageSize": 50, + "items": [] +} diff --git a/test/resources/1111111/automation/v1/queries/post-response.json b/test/resources/1111111/automation/v1/queries/post-response.json new file mode 100644 index 000000000..566d55169 --- /dev/null +++ b/test/resources/1111111/automation/v1/queries/post-response.json @@ -0,0 +1,18 @@ +{ + "queryDefinitionId": "549f0568-607c-4940-afef-437965094d-keySuffix", + "name": "testNew_query", + "key": "testNew_query_DEV", + "description": "created on deploy", + "queryText": "SELECT\n SubscriberKey as testField\nFROM\n _Subscribers\n", + "targetName": "testExisting_dataExtensionShared", + "targetKey": "testExisting_dataExtensionShared", + "targetId": "21711373-72c1-ec11-b83b-shared", + "targetDescription": "", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:04:15.88", + "targetUpdateTypeId": 0, + "targetUpdateTypeName": "Overwrite", + "validatedQueryText": "SET NOCOUNT ON; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;\r\n\r\nINSERT INTO C518001158.[testDataExtension] ([testField])\r\nSELECT querydef.[testField]\r\nFROM (SELECT SubscriberKey as testField FROM C518001158._Subscribers ) AS querydef \r\nSELECT @rcInsert = @@ROWCOUNT;;\r\n", + "categoryId": 9991, + "isFrozen": false +} diff --git a/test/resources/1111111/dataFolder/retrieve-ContentType=queryactivity-response.xml b/test/resources/1111111/dataFolder/retrieve-ContentType=queryactivity-response.xml new file mode 100644 index 000000000..03d2eeac5 --- /dev/null +++ b/test/resources/1111111/dataFolder/retrieve-ContentType=queryactivity-response.xml @@ -0,0 +1,48 @@ + + + + RetrieveResponse + urn:uuid:f36f3303-3b5a-4641-8109-b26447634d91 + urn:uuid:33983968-28c4-4379-bb5f-f80ae32eb988 + http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous + + + 2022-04-19T20:03:41Z + 2022-04-19T20:08:41Z + + + + + + OK + 02cd5ccb-8f84-4651-826f-71169eeecf05 + + + 1111111 + + + 2016-07-22T11:52:20.407 + 2016-07-22T11:52:20.407 + 9991 + + queryactivity_default + + + 0 + + + Query + + queryactivity + true + false + true + + + + diff --git a/test/resources/1111111/query/patch_keySuffix-expected.json b/test/resources/1111111/query/patch_keySuffix-expected.json new file mode 100644 index 000000000..a69695ef8 --- /dev/null +++ b/test/resources/1111111/query/patch_keySuffix-expected.json @@ -0,0 +1,11 @@ +{ + "name": "testNew_query", + "key": "testNew_query_DEV", + "description": "created on deploy", + "targetKey": "testExisting_dataExtensionShared", + "createdDate": "2022-04-26T15:21:16.453", + "modifiedDate": "2022-04-26T16:04:15.88", + "targetUpdateTypeName": "Overwrite", + "isFrozen": false, + "r__folder_Path": "Query" +} diff --git a/test/resources/1111111/query/patch_keySuffix-expected.sql b/test/resources/1111111/query/patch_keySuffix-expected.sql new file mode 100644 index 000000000..4148833c4 --- /dev/null +++ b/test/resources/1111111/query/patch_keySuffix-expected.sql @@ -0,0 +1,4 @@ +SELECT + SubscriberKey AS testField +FROM + _Subscribers diff --git a/test/type.query.test.js b/test/type.query.test.js index f001b7d55..a9bd98294 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -6,6 +6,7 @@ import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; +import { Util } from '../lib/util/util.js'; chai.use(chaiFiles); const file = chaiFiles.file; @@ -381,6 +382,50 @@ describe('type: query', () => { return; }); + it('Should change the key during create with and --keySuffix', async () => { + handler.setOptions({ keySuffix: '_DEV' }); + const deployed = await handler.deploy( + 'testInstance/_ParentBU_', + ['query'], + ['testNew_query'] + ); + // THEN + assert.equal(process.exitCode, 0, 'deploy --keySuffix should not have thrown an error'); + assert.equal( + Object.keys(deployed['testInstance/_ParentBU_'].query).length, + 1, + 'returned number of keys does not correspond to number of expected fixed keys' + ); + assert.equal( + Object.keys(deployed['testInstance/_ParentBU_'].query)[0], + 'testNew_query_DEV', + 'returned keys do not correspond to expected fixed keys' + ); + const createCallout = Util.requestLog.find( + (item) => item.method === 'POST' && item.url === '/automation/v1/queries/' + ); + assert.equal( + createCallout?.data?.key, + 'testNew_query_DEV', + 'key in create callout was not as expected' + ); + + // confirm updated item + assert.deepEqual( + await testUtils.getActualJson('testNew_query_DEV', 'query', '_ParentBU_'), + await testUtils.getExpectedJson('1111111', 'query', 'patch_keySuffix'), + 'returned metadata was not equal expected for update query' + ); + + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 4, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + it('Should run fixKeys but not find fixable keys and hence stop', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); diff --git a/test/utils.js b/test/utils.js index 02529d8b0..0d5d98de1 100644 --- a/test/utils.js +++ b/test/utils.js @@ -47,10 +47,11 @@ export function getActualDoc(customerKey, type, buName = 'testBU') { * @param {string} customerKey of metadata * @param {string} type of metadata * @param {string} ext file extension + * @param {string} [buName] used when we need to test on ParentBU * @returns {string} file path */ -export function getActualFile(customerKey, type, ext) { - return `./retrieve/testInstance/testBU/${type}/${customerKey}.${type}-meta.${ext}`; +export function getActualFile(customerKey, type, ext, buName = 'testBU') { + return `./retrieve/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`; } /** * gets file from Deploy folder @@ -71,10 +72,11 @@ export function getActualDeployJson(customerKey, type, buName = 'testBU') { * @param {string} customerKey of metadata * @param {string} type of metadata * @param {string} ext file extension + * @param {string} [buName] used when we need to test on ParentBU * @returns {string} file path */ -export function getActualDeployFile(customerKey, type, ext) { - return `./deploy/testInstance/testBU/${type}/${customerKey}.${type}-meta.${ext}`; +export function getActualDeployFile(customerKey, type, ext, buName = 'testBU') { + return `./deploy/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`; } /** * gets file from Template folder From 6027f171fbc02ad46e9b22541bdd6a7033e69925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 14:02:47 +0200 Subject: [PATCH 204/359] #1301: add tests for --noMidSuffix --- .../block/testNew_asset.asset-block-meta.html | 12 ++ .../block/testNew_asset.asset-block-meta.json | 39 ++++++ .../9999999/asset/create-expected.json | 18 +++ .../v1/content/assets/post-response.json | 59 ++++++++ test/type.asset.test.js | 126 +++++++++++++++++- test/utils.js | 25 +++- 6 files changed, 276 insertions(+), 3 deletions(-) create mode 100644 test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.html create mode 100644 test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.json create mode 100644 test/resources/9999999/asset/create-expected.json create mode 100644 test/resources/9999999/asset/v1/content/assets/post-response.json diff --git a/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.html b/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.html new file mode 100644 index 000000000..fc775a5d5 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.html @@ -0,0 +1,12 @@ + + + + + diff --git a/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.json b/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.json new file mode 100644 index 000000000..3498923a0 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/asset/block/testNew_asset.asset-block-meta.json @@ -0,0 +1,39 @@ +{ + "customerKey": "testNew_asset", + "assetType": { + "name": "textblock", + "displayName": "Text Block" + }, + "fileProperties": { + "fileName": "testNew_asset" + }, + "name": "testNew_asset", + "description": "bla bla", + "owner": { + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld" + }, + "createdDate": "2022-10-14T08:54:26.643-06:00", + "createdBy": { + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld" + }, + "modifiedDate": "2024-05-06T07:18:33.787-06:00", + "modifiedBy": { + "name": "SFMC DEVOPS app user" + }, + "memberId": 1111111, + "status": { + "name": "Draft" + }, + "meta": { + "wrapperStyles": { + "mobile": { + "visible": true + } + } + }, + "availableViews": [], + "modelVersion": 2, + "r__folder_Path": "Content Builder" +} diff --git a/test/resources/9999999/asset/create-expected.json b/test/resources/9999999/asset/create-expected.json new file mode 100644 index 000000000..b76355d23 --- /dev/null +++ b/test/resources/9999999/asset/create-expected.json @@ -0,0 +1,18 @@ +{ + "customerKey": "testNew_asset-9999999", + "assetType": { "name": "textblock", "displayName": "Text Block" }, + "fileProperties": { "fileName": "testNew_asset" }, + "name": "testNew_asset", + "description": "bla bla", + "owner": { "email": "", "name": "SFMC DEVOPS app user" }, + "createdDate": "2024-05-07T05:08:46.927-06:00", + "createdBy": { "email": "", "name": "SFMC DEVOPS app user" }, + "modifiedDate": "2024-05-07T05:08:46.927-06:00", + "modifiedBy": { "email": "", "name": "SFMC DEVOPS app user" }, + "memberId": 9999999, + "status": { "name": "Draft" }, + "meta": { "wrapperStyles": { "mobile": { "visible": true } } }, + "availableViews": [], + "modelVersion": 2, + "r__folder_Path": "Content Builder" +} diff --git a/test/resources/9999999/asset/v1/content/assets/post-response.json b/test/resources/9999999/asset/v1/content/assets/post-response.json new file mode 100644 index 000000000..ae952b77d --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/post-response.json @@ -0,0 +1,59 @@ +{ + "id": 1324776, + "customerKey": "testNew_asset-9999999", + "objectID": "26fdf503-eeed-49eb-b428-cb3b4bc2ba48", + "assetType": { + "id": 196, + "name": "textblock", + "displayName": "Text Block" + }, + "fileProperties": { + "fileName": "testNew_asset" + }, + "name": "testNew_asset", + "description": "bla bla", + "owner": { + "id": 700304523, + "email": "", + "name": "SFMC DEVOPS app user", + "userId": "700304523" + }, + "createdDate": "2024-05-07T05:08:46.927-06:00", + "createdBy": { + "id": 700304523, + "email": "", + "name": "SFMC DEVOPS app user", + "userId": "700304523" + }, + "modifiedDate": "2024-05-07T05:08:46.927-06:00", + "modifiedBy": { + "id": 700304523, + "email": "", + "name": "SFMC DEVOPS app user", + "userId": "700304523" + }, + "enterpriseId": 1111111, + "memberId": 9999999, + "status": { + "id": 1, + "name": "Draft" + }, + "thumbnail": { + "thumbnailUrl": "/v1/assets/1324776/thumbnail" + }, + "category": { + "id": 89397, + "name": "Content Builder", + "parentId": 0 + }, + "content": "\n \n foobar\n \n\n", + "meta": { + "wrapperStyles": { + "mobile": { + "visible": true + } + } + }, + "availableViews": [], + "modelVersion": 2 +} diff --git a/test/type.asset.test.js b/test/type.asset.test.js index d1daf9ee9..da85c2ad0 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -8,6 +8,7 @@ import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; +import { Util } from '../lib/util/util.js'; chai.use(chaiFiles); const file = chaiFiles.file; @@ -32,10 +33,11 @@ function getActualJson(customerKey, type, subtype, buName = 'testBU') { * @param {string} type of metadata * @param {string} subtype of metadata * @param {string} ext file extension + * @param {string} [buName] used when we need to test on ParentBU * @returns {string} file path */ -function getActualFile(customerKey, type, subtype, ext) { - return `./retrieve/testInstance/testBU/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; +function getActualFile(customerKey, type, subtype, ext, buName = 'testBU') { + return `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; } describe('type: asset', () => { @@ -87,6 +89,126 @@ describe('type: asset', () => { }); }); + describe('Deploy ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + + it('Should create an asset with mis-matching memberId, automatically adding the MID suffix', async () => { + // WHEN + const deployResult = await handler.deploy( + 'testInstance/testBU', + ['asset'], + ['testNew_asset'] + ); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + // check how many items were deployed + assert.equal( + deployResult['testInstance/testBU']?.asset + ? Object.keys(deployResult['testInstance/testBU']?.asset).length + : 0, + 1, + '1 assets to be deployed' + ); + const createCallout = Util.requestLog.find( + (item) => item.method === 'POST' && item.url === '/asset/v1/content/assets/' + ); + assert.equal( + createCallout?.data?.customerKey, + 'testNew_asset-9999999', + 'customerKey should be testNew_asset-9999999 due to automatic MID suffix' + ); + + // insert + assert.deepEqual( + await getActualJson('testNew_asset-9999999', 'asset', 'block'), + await testUtils.getExpectedJson('9999999', 'asset', 'create'), + 'returned metadata was not equal expected for create' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 10, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should create an assetwith mis-matching memberId, --noMidSuffix and --keySuffix', async () => { + handler.setOptions({ keySuffix: '_DEV', noMidSuffix: true }); + // WHEN + const deployResult = await handler.deploy( + 'testInstance/testBU', + ['asset'], + ['testNew_asset'] + ); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + // check how many items were deployed + assert.equal( + deployResult['testInstance/testBU']?.asset + ? Object.keys(deployResult['testInstance/testBU']?.asset).length + : 0, + 1, + '1 assets to be deployed' + ); + const createCallout = Util.requestLog.find( + (item) => item.method === 'POST' && item.url === '/asset/v1/content/assets/' + ); + assert.equal( + createCallout?.data?.customerKey, + 'testNew_asset_DEV', + 'customerKey should be testNew_asset_DEV due to noMidSuffix and keySuffix' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 10, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should create an assetwith mis-matching memberId, --noMidSuffix', async () => { + handler.setOptions({ noMidSuffix: true }); + // WHEN + const deployResult = await handler.deploy( + 'testInstance/testBU', + ['asset'], + ['testNew_asset'] + ); + // THEN + assert.equal(process.exitCode, 0, 'deploy should not have thrown an error'); + + // check how many items were deployed + assert.equal( + deployResult['testInstance/testBU']?.asset + ? Object.keys(deployResult['testInstance/testBU']?.asset).length + : 0, + 1, + '1 assets to be deployed' + ); + const createCallout = Util.requestLog.find( + (item) => item.method === 'POST' && item.url === '/asset/v1/content/assets/' + ); + assert.equal( + createCallout?.data?.customerKey, + 'testNew_asset', + 'customerKey should be testNew_asset due to noMidSuffix' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 10, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN diff --git a/test/utils.js b/test/utils.js index 0d5d98de1..1aeffa7ae 100644 --- a/test/utils.js +++ b/test/utils.js @@ -131,7 +131,30 @@ export function getExpectedFile(mid, type, action, ext) { export function mockSetup(isDeploy) { if (!isDeploy) { // no need to execute this again - already done in standard setup - handler.setOptions({ debug: true, noLogFile: true, api: 'test' }); + handler.setOptions({ + // test config + debug: true, + noLogFile: true, + api: 'test', + // reset + keySuffix: null, + changeKeyField: null, + changeKeyValue: null, + commitHistory: null, + errorLog: null, + execute: null, + filter: null, + fixShared: null, + fromRetrieve: null, + json: null, + like: null, + noLogColors: null, + noMidSuffix: null, + refresh: null, + _runningTest: null, + schedule: null, + skipInteraction: null, + }); } // @ts-expect-error somehow, MockAdapter does not expect type AxiosInstance apimock = new MockAdapter(axiosInstance, { onNoMatch: 'throwException' }); From 4845319adafda994fcd304dd55988e314c1bb47d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 18:11:01 +0200 Subject: [PATCH 205/359] #1301: improve test reset logic --- test/utils.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/test/utils.js b/test/utils.js index 1aeffa7ae..a1060c0ea 100644 --- a/test/utils.js +++ b/test/utils.js @@ -137,23 +137,22 @@ export function mockSetup(isDeploy) { noLogFile: true, api: 'test', // reset - keySuffix: null, - changeKeyField: null, - changeKeyValue: null, - commitHistory: null, - errorLog: null, - execute: null, - filter: null, - fixShared: null, - fromRetrieve: null, - json: null, - like: null, - noLogColors: null, - noMidSuffix: null, - refresh: null, - _runningTest: null, - schedule: null, - skipInteraction: null, + keySuffix: undefined, + changeKeyField: undefined, + changeKeyValue: undefined, + commitHistory: undefined, + errorLog: undefined, + execute: undefined, + filter: undefined, + fixShared: undefined, + fromRetrieve: undefined, + json: undefined, + like: undefined, + noMidSuffix: undefined, + refresh: undefined, + _runningTest: undefined, + schedule: undefined, + skipInteraction: undefined, }); } // @ts-expect-error somehow, MockAdapter does not expect type AxiosInstance From 4ccc3b1ca0c07e4f58af0d1e51641071357a731c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 18:27:04 +0200 Subject: [PATCH 206/359] #905: reset request log before each test --- test/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/utils.js b/test/utils.js index a1060c0ea..897f6b636 100644 --- a/test/utils.js +++ b/test/utils.js @@ -129,8 +129,11 @@ export function getExpectedFile(mid, type, action, ext) { * @returns {void} */ export function mockSetup(isDeploy) { + // no need to execute this again if we ran it a 2nd time for deploy - already done in standard setup if (!isDeploy) { - // no need to execute this again - already done in standard setup + // truncate request log before each test + Util.requestLog.length = 0; + // reset all options to default handler.setOptions({ // test config debug: true, From 1b54ebf2b137da867143e9db21d5b5f0732bc108 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 18:33:47 +0200 Subject: [PATCH 207/359] #1302: enhance fixKeys test cases with checks on callout payload --- test/type.query.test.js | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/test/type.query.test.js b/test/type.query.test.js index a9bd98294..c17079132 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -257,6 +257,15 @@ describe('type: query', () => { 0, 'deploy --changeKeyValue should not have thrown an error' ); + const upsertCallout = Util.requestLog.find( + (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') + ); + assert.equal( + upsertCallout?.data?.key, + 'testExisting_query_fixedKeys', + 'key in create callout was not as expected' + ); + assert.equal( Object.keys(deployed['testInstance/testBU'].query).length, 1, @@ -305,6 +314,15 @@ describe('type: query', () => { 0, 'deploy --changeKeyValue should not have thrown an error' ); + const upsertCallout = Util.requestLog.find( + (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') + ); + assert.equal( + upsertCallout?.data?.key, + 'testExisting_query_fixedKeys', + 'key in create callout was not as expected' + ); + assert.equal( Object.keys(deployed['testInstance/testBU'].query).length, 1, @@ -357,6 +375,15 @@ describe('type: query', () => { 1, 'returned number of keys does not correspond to number of expected fixed keys' ); + + const upsertCallout = Util.requestLog.find( + (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') + ); + assert.equal( + upsertCallout?.data?.key, + 'testExisting_query_fixedKeys_DEV', + 'key in create callout was not as expected' + ); assert.equal( Object.keys(deployed['testInstance/testBU'].query)[0], 'testExisting_query_fixedKeys_DEV', @@ -504,6 +531,18 @@ describe('type: query', () => { 'testExisting_query_fixKeysSuffix', 'testExisting_query', ]); + // THEN + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); + + const upsertCallout = Util.requestLog.find( + (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') + ); + assert.equal( + upsertCallout?.data?.key, + 'testExisting_query_fixedKeys_DEV', + 'key in create callout was not as expected' + ); + assert.equal( resultFixKeys['testInstance/testBU'].length, 1, @@ -514,8 +553,6 @@ describe('type: query', () => { 'testExisting_query_fixedKeys_DEV', 'returned keys do not correspond to expected fixed keys' ); - // THEN - assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // confirm updated item assert.deepEqual( await testUtils.getActualJson('testExisting_query_fixedKeys_DEV', 'query'), From 69f8990587f99b0182b9a09a224ab61fa58ad49d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 7 May 2024 21:35:50 +0200 Subject: [PATCH 208/359] #905: revert previous attempt and falling back to axios-mock internal offering for api call history --- lib/util/auth.js | 6 ------ lib/util/util.js | 1 - test/type.asset.test.js | 19 ++++++------------- test/type.query.test.js | 32 +++++++++++--------------------- test/utils.js | 17 ++++++++++++++--- 5 files changed, 31 insertions(+), 44 deletions(-) diff --git a/lib/util/auth.js b/lib/util/auth.js index 46c8d5656..8931d3c9c 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -179,12 +179,6 @@ function setupSDK(sessionKey, authObject) { break; } - case 'test': { - // only used for test cases - Util.requestLog.push(msg); - - break; - } // No default } }, diff --git a/lib/util/util.js b/lib/util/util.js index 717cea3c9..71b891306 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -47,7 +47,6 @@ export const Util = { configFileName: '.mcdevrc.json', defaultGitBranch: 'main', parentBuName: '_ParentBU_', - requestLog: [], standardizedSplitChar: '/', /** @type {SkipInteraction} */ skipInteraction: null, diff --git a/test/type.asset.test.js b/test/type.asset.test.js index da85c2ad0..2620df185 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -8,7 +8,6 @@ import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; -import { Util } from '../lib/util/util.js'; chai.use(chaiFiles); const file = chaiFiles.file; @@ -112,11 +111,9 @@ describe('type: asset', () => { 1, '1 assets to be deployed' ); - const createCallout = Util.requestLog.find( - (item) => item.method === 'POST' && item.url === '/asset/v1/content/assets/' - ); + const upsertCallout = testUtils.getRestCallout('post', '/asset/v1/content/assets/'); assert.equal( - createCallout?.data?.customerKey, + upsertCallout?.customerKey, 'testNew_asset-9999999', 'customerKey should be testNew_asset-9999999 due to automatic MID suffix' ); @@ -155,11 +152,9 @@ describe('type: asset', () => { 1, '1 assets to be deployed' ); - const createCallout = Util.requestLog.find( - (item) => item.method === 'POST' && item.url === '/asset/v1/content/assets/' - ); + const upsertCallout = testUtils.getRestCallout('post', '/asset/v1/content/assets/'); assert.equal( - createCallout?.data?.customerKey, + upsertCallout?.customerKey, 'testNew_asset_DEV', 'customerKey should be testNew_asset_DEV due to noMidSuffix and keySuffix' ); @@ -191,11 +186,9 @@ describe('type: asset', () => { 1, '1 assets to be deployed' ); - const createCallout = Util.requestLog.find( - (item) => item.method === 'POST' && item.url === '/asset/v1/content/assets/' - ); + const upsertCallout = testUtils.getRestCallout('post', '/asset/v1/content/assets/'); assert.equal( - createCallout?.data?.customerKey, + upsertCallout?.customerKey, 'testNew_asset', 'customerKey should be testNew_asset due to noMidSuffix' ); diff --git a/test/type.query.test.js b/test/type.query.test.js index c17079132..c4f5fb744 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -6,7 +6,6 @@ import chaiFiles from 'chai-files'; import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; -import { Util } from '../lib/util/util.js'; chai.use(chaiFiles); const file = chaiFiles.file; @@ -257,11 +256,9 @@ describe('type: query', () => { 0, 'deploy --changeKeyValue should not have thrown an error' ); - const upsertCallout = Util.requestLog.find( - (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') - ); + const upsertCallout = testUtils.getRestCallout('patch', '/automation/v1/queries/%'); assert.equal( - upsertCallout?.data?.key, + upsertCallout?.key, 'testExisting_query_fixedKeys', 'key in create callout was not as expected' ); @@ -314,11 +311,9 @@ describe('type: query', () => { 0, 'deploy --changeKeyValue should not have thrown an error' ); - const upsertCallout = Util.requestLog.find( - (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') - ); + const upsertCallout = testUtils.getRestCallout('patch', '/automation/v1/queries/%'); assert.equal( - upsertCallout?.data?.key, + upsertCallout?.key, 'testExisting_query_fixedKeys', 'key in create callout was not as expected' ); @@ -375,12 +370,10 @@ describe('type: query', () => { 1, 'returned number of keys does not correspond to number of expected fixed keys' ); + const upsertCallout = testUtils.getRestCallout('patch', '/automation/v1/queries/%'); - const upsertCallout = Util.requestLog.find( - (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') - ); assert.equal( - upsertCallout?.data?.key, + upsertCallout?.key, 'testExisting_query_fixedKeys_DEV', 'key in create callout was not as expected' ); @@ -428,11 +421,10 @@ describe('type: query', () => { 'testNew_query_DEV', 'returned keys do not correspond to expected fixed keys' ); - const createCallout = Util.requestLog.find( - (item) => item.method === 'POST' && item.url === '/automation/v1/queries/' - ); + + const createCallout = testUtils.getRestCallout('post', '/automation/v1/queries/'); assert.equal( - createCallout?.data?.key, + createCallout?.key, 'testNew_query_DEV', 'key in create callout was not as expected' ); @@ -534,11 +526,9 @@ describe('type: query', () => { // THEN assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); - const upsertCallout = Util.requestLog.find( - (item) => item.method === 'PATCH' && item.url.startsWith('/automation/v1/queries/') - ); + const upsertCallout = testUtils.getRestCallout('patch', '/automation/v1/queries/%'); assert.equal( - upsertCallout?.data?.key, + upsertCallout?.key, 'testExisting_query_fixedKeys_DEV', 'key in create callout was not as expected' ); diff --git a/test/utils.js b/test/utils.js index 897f6b636..cdbe0529c 100644 --- a/test/utils.js +++ b/test/utils.js @@ -131,15 +131,13 @@ export function getExpectedFile(mid, type, action, ext) { export function mockSetup(isDeploy) { // no need to execute this again if we ran it a 2nd time for deploy - already done in standard setup if (!isDeploy) { - // truncate request log before each test - Util.requestLog.length = 0; // reset all options to default handler.setOptions({ // test config debug: true, noLogFile: true, - api: 'test', // reset + api: undefined, keySuffix: undefined, changeKeyField: undefined, changeKeyValue: undefined, @@ -250,6 +248,19 @@ export function getAPIHistoryLength(includeToken) { export function getAPIHistory() { return apimock.history; } +/** + * + * @param {'patch'|'delete'|'post'|'get'|'put'} method http method + * @param {string} url url without domain, end on % if you want to search with startsWith() + * @returns {object} json payload of the request + */ +export function getRestCallout(method, url) { + const subset = apimock.history[method]; + const myCallout = subset.find((item) => + url.endsWith('%') ? item.url.startsWith(url.slice(0, -1)) : item.url === url + ); + return JSON.parse(myCallout.data); +} /** * helper to return most important fields for each api call * From 9169c1d3711f9e305fea4dc20618beb5db5e1f4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 8 May 2024 15:31:55 +0200 Subject: [PATCH 209/359] #1306: remove empty entry from explainTypes json response --- lib/util/cli.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/util/cli.js b/lib/util/cli.js index e69c33745..fbbeff12c 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -613,6 +613,10 @@ const Cli = { for (const apiName of apiNameArr) { const details = MetadataDefinitions[apiName]; + if (!details.type) { + // we created the main type transactional message but don't want to show it here + continue; + } const supportCheckClass = apiName.startsWith('transactional') ? TransactionalMessage : MetadataTypeInfo[apiName]; From cbc1ad9a39981909d7b579daf8ec5f4742a040a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 13 May 2024 21:23:14 +0200 Subject: [PATCH 210/359] #62: convert triggeredSend Priority (number) to c__priority (enum) --- lib/metadataTypes/TriggeredSend.js | 14 ++++++++++++++ .../definitions/TriggeredSend.definition.js | 8 +++++++- .../9999999/triggeredSend/build-expected.json | 2 +- .../9999999/triggeredSend/get-expected.json | 2 +- .../9999999/triggeredSend/patch-expected.json | 2 +- .../9999999/triggeredSend/post-expected.json | 2 +- .../9999999/triggeredSend/template-expected.json | 2 +- 7 files changed, 26 insertions(+), 6 deletions(-) diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 3f9929371..5800d44e7 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -144,6 +144,15 @@ class TriggeredSend extends MetadataType { // save this TSD because it could be fixed by the user or potentially restarted without a fix; also, it might be used by a journey } } + // message priority + if (metadata.Priority) { + metadata.c__priority = Util.inverseGet( + this.definition.priorityMapping, + metadata.Priority + ); + delete metadata.Priority; + } + // List (optional) if (metadata.List) { try { @@ -240,6 +249,11 @@ class TriggeredSend extends MetadataType { `r__assetMessage_Key / r__email_Name not defined but instead found Email.ID. Please try re-retrieving this TSD from your BU.` ); } + // message priority + if (metadata.c__priority) { + metadata.Priority = this.definition.priorityMapping[metadata.c__priority]; + delete metadata.c__priority; + } // get List (optional) if (metadata.r__list_PathName) { metadata.List = { diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index 2870164d1..6c4c1b88c 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -29,6 +29,11 @@ export default { typeDescription: 'DEPRECATED: Sends emails via API or DataExtension Event.', typeRetrieveByDefault: true, typeName: 'Triggered Send', + priorityMapping: { + High: 3, + Medium: 4, + Low: 5, + }, fields: { AllowedSlots: { isCreateable: true, @@ -534,11 +539,12 @@ export default { retrieving: false, templating: false, }, - r__folder_Path: { skipValidation: true }, r__assetMessage_Name_readOnly: { skipValidation: true }, r__assetMessage_Key: { skipValidation: true }, r__email_Name: { skipValidation: true }, + r__folder_Path: { skipValidation: true }, r__list_PathName: { skipValidation: true }, + c__priority: { skipValidation: true }, r__sendClassification_CustomerKey: { skipValidation: true }, r__senderProfile_CustomerKey: { skipValidation: true }, }, diff --git a/test/resources/9999999/triggeredSend/build-expected.json b/test/resources/9999999/triggeredSend/build-expected.json index 2e8d859e1..84ca3b304 100644 --- a/test/resources/9999999/triggeredSend/build-expected.json +++ b/test/resources/9999999/triggeredSend/build-expected.json @@ -17,7 +17,7 @@ "ModifiedDate": "2018-06-25T05:58:00", "Name": "testTemplated_triggeredSend", "NewSlotTrigger": 0, - "Priority": 4, + "c__priority": "Medium", "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", diff --git a/test/resources/9999999/triggeredSend/get-expected.json b/test/resources/9999999/triggeredSend/get-expected.json index 5902b45ac..422ebc048 100644 --- a/test/resources/9999999/triggeredSend/get-expected.json +++ b/test/resources/9999999/triggeredSend/get-expected.json @@ -17,7 +17,7 @@ "ModifiedDate": "2018-06-25T05:58:00", "Name": "testExisting_triggeredSend", "NewSlotTrigger": 0, - "Priority": 4, + "c__priority": "Medium", "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", diff --git a/test/resources/9999999/triggeredSend/patch-expected.json b/test/resources/9999999/triggeredSend/patch-expected.json index 43d0fc8fa..925ffc957 100644 --- a/test/resources/9999999/triggeredSend/patch-expected.json +++ b/test/resources/9999999/triggeredSend/patch-expected.json @@ -17,7 +17,7 @@ "ModifiedDate": "2018-06-25T05:58:00", "Name": "testExisting_triggeredSend", "NewSlotTrigger": 0, - "Priority": 4, + "c__priority": "Medium", "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", diff --git a/test/resources/9999999/triggeredSend/post-expected.json b/test/resources/9999999/triggeredSend/post-expected.json index 535df8ee7..764a61695 100644 --- a/test/resources/9999999/triggeredSend/post-expected.json +++ b/test/resources/9999999/triggeredSend/post-expected.json @@ -17,7 +17,7 @@ "ModifiedDate": "2018-06-25T05:58:00", "Name": "testNew_triggeredSend", "NewSlotTrigger": 0, - "Priority": 4, + "c__priority": "Medium", "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", diff --git a/test/resources/9999999/triggeredSend/template-expected.json b/test/resources/9999999/triggeredSend/template-expected.json index f69ed0d3c..c1d85b166 100644 --- a/test/resources/9999999/triggeredSend/template-expected.json +++ b/test/resources/9999999/triggeredSend/template-expected.json @@ -17,7 +17,7 @@ "ModifiedDate": "2018-06-25T05:58:00", "Name": "{{{prefix}}}triggeredSend", "NewSlotTrigger": 0, - "Priority": 4, + "c__priority": "Medium", "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", From 861877f3057b7896e5f1e1c7a880721ef769dd65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 13 May 2024 22:27:33 +0200 Subject: [PATCH 211/359] #62: fixed test that confirms you cannot use changeKeyValue/changeKeyField on journey --- lib/metadataTypes/Journey.js | 45 +- lib/util/cache.js | 2 +- ...Existing_interaction.interaction-meta.json | 576 ------------------ ...isting_journey_Quicksend.journey-meta.json | 232 +++++++ .../testNew_interaction.interaction-meta.json | 266 -------- test/type.journey.test.js | 23 + 6 files changed, 296 insertions(+), 848 deletions(-) delete mode 100644 test/mockRoot/deploy/testInstance/testBU/journey/testExisting_interaction.interaction-meta.json create mode 100644 test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json delete mode 100644 test/mockRoot/deploy/testInstance/testBU/journey/testNew_interaction.interaction-meta.json diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 1e4c15194..6330e6cb8 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -506,6 +506,8 @@ class Journey extends MetadataType { const triggeredSend = activity.configurationArguments?.triggeredSend; if (triggeredSend) { + // this section is likely only relevant for QuickSends and not for Multi-Step Journeys + // List (optional) triggeredSend.r__list_PathName = {}; if (triggeredSend.publicationListId) { @@ -929,13 +931,46 @@ class Journey extends MetadataType { if (triggeredSend) { // List (optional) if (triggeredSend.r__list_PathName) { - triggeredSend.publicationListId = cache.getListObjectId( - triggeredSend.r__list_PathName, - 'ID' - ); - + if (triggeredSend.r__list_PathName.publicationList) { + triggeredSend.publicationListId = cache.getListObjectId( + triggeredSend.r__list_PathName.publicationList, + 'ID' + ); + } + if (triggeredSend.r__list_PathName.suppressionLists?.length) { + triggeredSend.suppressionLists = + triggeredSend.r__list_PathName.suppressionLists.map( + (listPathName) => { + const id = cache.getListObjectId(listPathName, 'ID'); + const name = cache.getListObjectId( + listPathName, + 'ListName' + ); + return { id, name }; + } + ); + } delete triggeredSend.r__list_PathName; } + // DataExtension (optional) + if (triggeredSend.r__dataExtension_CustomerKey?.length) { + triggeredSend.domainExclusions = + triggeredSend.r__dataExtension_CustomerKey.map((key) => { + const id = cache.searchForField( + 'dataExtension', + key, + 'CustomerKey', + 'ObjectID' + ); + const name = cache.searchForField( + 'dataExtension', + key, + 'CustomerKey', + 'Name' + ); + return { id, name }; + }); + } // sender profile if (triggeredSend.r__senderProfile_CustomerKey) { diff --git a/lib/util/cache.js b/lib/util/cache.js index e56088d9b..1085bb726 100644 --- a/lib/util/cache.js +++ b/lib/util/cache.js @@ -186,7 +186,7 @@ export default { * ! keeping this in util/cache.js rather than in metadataTypes/List.js to avoid potential circular dependencies * * @param {string} listPathName folderPath/ListName combo of list - * @param {'ObjectID'|'ID'|'CustomerKey'} returnField ObjectID:string(uuid), ID:numeric, CustomerKey:string(name + folder ID) + * @param {'ObjectID'|'ID'|'CustomerKey'|'ListName'} returnField ObjectID:string(uuid), ID:numeric, CustomerKey:string(name + folder ID) * @returns {string} unique ObjectId of list */ getListObjectId(listPathName, returnField) { diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_interaction.interaction-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_interaction.interaction-meta.json deleted file mode 100644 index 97efdfebd..000000000 --- a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_interaction.interaction-meta.json +++ /dev/null @@ -1,576 +0,0 @@ -{ - "key": "testExisting_interaction", - "name": "testExisting_interaction", - "lastPublishedDate": "2017-04-12T08:07:48", - "description": "updated via deploy", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2017-04-12T05:38:05.837", - "modifiedDate": "2017-04-12T08:07:48.333", - "activities": [ - { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "next": "SMSSYNC-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "79213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-3", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "cfc3ec53-4314-4504-9f9d-1fe53fdf0bcf", - "key": "SMSSYNC-1", - "name": "Kate Test SMS", - "description": "", - "type": "SMSSYNC", - "outcomes": [ - { - "key": "d4d46c46-bf8c-4c62-bd34-4979548796cd", - "next": "WAIT-3", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "contactKey": "{{Contact.Key}}", - "defaultSMSAddress": "{{Contact.Default.SMS}}", - "mobileNumber": "{{InteractionDefaults.MobileNumber}}", - "contactId": "{{Contact.Id}}", - "definitionInstanceId": "{{Context.DefinitionInstanceId}}", - "definitionId": "{{Context.DefinitionId}}" - }, - "configurationArguments": { - "c__mobileMessage_id": "NTIzOjc4OjA", - "keywordId": "cTVJaG5oSDJPVUNHcUh6Z3pQT2tVdzo4Njow", - "isOptIn": false, - "honorBlackoutWindowEnum": 0, - "mobileBlackoutWindowStartTime": "", - "mobileBlackoutWindowEndTime": "", - "applicationExtensionKey": "jb-mobile-connect-send-sms-sync" - }, - "metaData": { - "isConfigured": true - }, - "schema": { - "arguments": { - "smsJobId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isAddressCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isSubscriptionCreated": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isTriggeredSend": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isWithinBlackout": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "isValidMobileNumber": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMessageId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outKeywordId": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsOptIn": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outHonorBlackoutWindowEnum": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowStartTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outMobileBlackoutWindowEndTime": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outUtcOffset": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowStart": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outWindowEnd": { - "dataType": "Text", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outTimeZoneId": { - "dataType": "Number", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsTZValid": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsMobileBlackoutWindowEnabled": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outIsUsingDEAttributesForPersonalization": { - "dataType": "Boolean", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "outCountProcessedSingletonDuringBatchMethod": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "defaultSMSAddress": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "mobileNumber": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "contactId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionInstanceId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "definitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "eventData": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "key": "TRIGGER", - "name": "test_TESTDataentry", - "description": "", - "type": "APIEvent", - "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, - "metaData": { - "scheduleState": "No Schedule", - "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "chainType": "None", - "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", - "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} - }, - "metaData": {}, - "executionMode": "Production", - "status": "Draft", - "scheduledStatus": "Draft", - "r__folder_Path": "my journeys" -} diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json new file mode 100644 index 000000000..0b75e6127 --- /dev/null +++ b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json @@ -0,0 +1,232 @@ +{ + "key": "testExisting_journey_Quicksend", + "name": "testExisting_journey_Quicksend", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "updated on deploy", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", + "activities": [ + { + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testExisting_asset_mail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "", + "ccEmail": "", + "created": {}, + "description": "my activity info text", + "dynamicEmailSubject": "testExisting_ email subject", + "emailSubject": "testExisting_ email subject", + "exclusionFilter": "/* insert ampscript here */", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "testExisting_ email preheader", + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers", + "suppressionLists": ["Suppression Lists/testExisting_suppressionList"] + }, + "r__dataExtension_CustomerKey": { + "domainExclusions": ["testExisting_DomainExclusion"] + }, + "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "c__priority": "High", + "r__assetMessage_Name_readOnly": "testExisting_asset_message", + "r__assetMessage_Key": "testExisting_asset_message" + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "sourceInteractionId": "00000000-0000-0000-0000-000000000000", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", + "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { "email": false } + }, + "executionMode": "Production", + "status": "Draft", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testNew_interaction.interaction-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testNew_interaction.interaction-meta.json deleted file mode 100644 index a9a5e0f27..000000000 --- a/test/mockRoot/deploy/testInstance/testBU/journey/testNew_interaction.interaction-meta.json +++ /dev/null @@ -1,266 +0,0 @@ -{ - "key": "testNew_interaction", - "name": "testNew_interaction", - "lastPublishedDate": "2017-04-12T08:07:48", - "description": "created on deploy", - "version": 1, - "workflowApiVersion": 1, - "createdDate": "2017-04-12T05:38:05.837", - "modifiedDate": "2017-04-12T08:07:48.333", - "activities": [ - { - "id": "69213026-bd2c-433b-8332-5f52d3e87ca5", - "key": "WAIT-1", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "bd3dff6b-565c-4b56-b9cb-60cd5b6d080b", - "next": "DATAEXTENSIONUPDATE-1", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "546704c0-9384-4a41-b20e-97615cc6cc6a", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "5d93cda9-2015-4c07-a1db-0d5853d25bf6", - "key": "WAIT-2", - "name": "", - "description": "", - "type": "WAIT", - "outcomes": [ - { - "key": "e3d3258a-891b-4838-b5a6-af37f8cb769a", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { - "waitDefinitionId": "deed4c9d-f487-4371-bfd9-76fca44ec49b", - "waitForEventId": "", - "executionMode": "{{Context.ExecutionMode}}", - "startActivityKey": "{{Context.StartActivityKey}}", - "waitQueueId": "{{Context.WaitQueueId}}" - }, - "configurationArguments": { - "waitDuration": 1, - "waitUnit": "DAYS", - "specifiedTime": "", - "timeZone": "", - "description": "", - "waitForEventKey": "" - }, - "metaData": { "waitType": "duration" }, - "schema": { - "arguments": { - "endDate": { - "dataType": "Date", - "isNullable": false, - "direction": "Out", - "readOnly": false, - "access": "Hidden" - }, - "waitEndDateAttributeDataBound": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitDefinitionId": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitForEventId": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "executionMode": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "startActivityKey": { - "dataType": "Text", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "waitQueueId": { - "dataType": "LongNumber", - "isNullable": true, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - }, - { - "id": "ef4db13e-83f0-4d41-981d-4bf5810c0daa", - "key": "DATAEXTENSIONUPDATE-1", - "name": "", - "description": "", - "type": "DATAEXTENSIONUPDATE", - "outcomes": [ - { - "key": "a49ecf04-4612-4582-85fe-d7193f872fa8", - "next": "WAIT-2", - "arguments": {}, - "metaData": {} - } - ], - "arguments": { "contactKey": "{{Contact.Key}}", "value": "{{DateTime.Now}}" }, - "configurationArguments": { - "dataExtensionId": "ace267f0-b81d-e711-80cc-1402ec7222b4", - "field": "4e875b26-0317-4525-bfa0-50c8d1b7a7b5" - }, - "metaData": { - "dataExtensionName": "test_TestData", - "cachedFieldName": "JourneyConfirmed", - "cachedDisplayValue": "" - }, - "schema": { - "arguments": { - "contactKey": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - }, - "value": { - "dataType": "Text", - "isNullable": false, - "direction": "In", - "readOnly": false, - "access": "Hidden" - } - } - } - } - ], - "triggers": [ - { - "key": "TRIGGER", - "name": "test_TESTDataentry", - "description": "", - "type": "APIEvent", - "outcomes": [], - "arguments": { - "filterResult": "{{Contact.FilterId.e4ddb887-6f2d-46b1-9f64-9a020f217339}}" - }, - "configurationArguments": { - "schemaVersionId": 133, - "criteria": "", - "filterDefinitionId": "e4ddb887-6f2d-46b1-9f64-9a020f217339" - }, - "metaData": { - "scheduleState": "No Schedule", - "sourceInteractionId": "00000000-0000-0000-0000-000000000000", - "eventDefinitionId": "33b4dbc5-4b58-4a54-ab57-24388f1eefe4", - "eventDefinitionKey": "APIEvent-60130566-e2fe-eb29-4140-15c27093a80b", - "chainType": "None", - "configurationRequired": false, - "iconUrl": "/events/images/icon_journeyBuilder-event-api-blue.svg", - "title": "", - "category": "Event" - } - } - ], - "goals": [], - "exits": [], - "notifiers": [], - "entryMode": "OnceAndDone", - "definitionType": "Multistep", - "channel": "", - "defaults": { - "email": ["{{Event.APIEvent-60130566-e2fe-eb29-4140-15c27093a80b.\"emailAddress\"}}"], - "properties": {} - }, - "metaData": {}, - "executionMode": "Production", - "status": "Draft", - "definitionId": "233d4413-922c-4568-85a5-e5cc77efc3be", - "scheduledStatus": "Draft", - "r__folder_Path": "my journeys" -} diff --git a/test/type.journey.test.js b/test/type.journey.test.js index ad5b8370d..421d06c19 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -167,6 +167,29 @@ describe('type: journey', () => { }); }); + describe('Deploy ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + + it('Should NOT change the key during update with --changeKeyValue and instead fail due to missing support', async () => { + // WHEN + handler.setOptions({ changeKeyValue: 'updatedKey' }); + await handler.deploy( + 'testInstance/testBU', + ['journey'], + ['testExisting_journey_Quicksend'] + ); + // THEN + assert.equal( + process.exitCode, + 1, + 'deploy should have thrown an error due to lack of support' + ); + return; + }); + }); + describe('Templating ================', () => { it('Should create a journey template via buildTemplate and build it', async () => { // download first before we test buildTemplate From 466a38d413a2636d6c01b163bc456633d525c6a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 13 May 2024 22:50:03 +0200 Subject: [PATCH 212/359] #1314: make sure we always cache all email-templates if template-based emails were found --- lib/metadataTypes/Asset.js | 99 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 40a8aeadc..c5ef19c98 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -62,6 +62,44 @@ class Asset extends MetadataType { } return { metadata: metadata, type: this.definition.type }; } + /** + * Helper for writing Metadata to disk, used for Retrieve and deploy + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve + * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata + */ + static async saveResults(results, retrieveDir, overrideType, templateVariables) { + if (Object.keys(results).length) { + // only execute the following if records were found + await this._postRetrieveTasksBulk(results); + } + return super.saveResults(results, retrieveDir, overrideType, templateVariables); + } + /** + * helper for Journey's {@link Asset.saveResults}. Gets executed after retreive of metadata type and + * + * @param {MetadataTypeMap} metadataMap key=customer key, value=metadata + */ + static async _postRetrieveTasksBulk(metadataMap) { + // Template-Based Email + let needTemplates = false; + for (const key in metadataMap) { + if (metadataMap[key].assetType.name == 'templatebasedemail') { + needTemplates = true; + break; + } + } + + if (needTemplates && !cache.getCache()?.asset) { + // for + Util.logger.info(' - Caching dependent Metadata: asset-template'); + const result = await this.retrieveForCache(undefined, ['template']); + cache.setMetadata('asset', result.metadata); + } + } /** * Retrieves asset metadata for caching @@ -514,6 +552,34 @@ class Asset extends MetadataType { static postRetrieveTasks(metadata) { // folder this.setFolderPath(metadata); + + // template-based emails + if (metadata.assetType.name === 'templatebasedemail') { + // get template + try { + if (metadata.views?.html?.template?.id) { + metadata.views.html.template.r__assetTemplate_Key = cache.searchForField( + 'asset', + metadata.views?.html?.template?.id, + 'id', + 'customerKey' + ); + delete metadata.views.html.template.id; + delete metadata.views.html.template.name; + delete metadata.views.html.template.assetType; + delete metadata.views.html.template.availableViews; + delete metadata.views.html.template.data; + delete metadata.views.html.template.modelVersion; + } + } catch { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }): Could not find email template with id (${metadata.views.html.template.id})` + ); + } + } + // extract HTML for selected subtypes and convert payload for easier processing in MetadataType.saveResults() return this._extractCode(metadata); } @@ -606,6 +672,39 @@ class Asset extends MetadataType { // folder this.setFolderId(metadata); + // template-based emails + if ( + metadata.assetType.name === 'templatebasedemail' && + metadata.views?.html?.template?.r__assetTemplate_Key + ) { + // template + metadata.views.html.template.id = cache.searchForField( + 'asset', + metadata.views.html.template.r__assetTemplate_Key, + 'customerKey', + 'id' + ); + metadata.views.html.template.name = cache.searchForField( + 'asset', + metadata.views.html.template.r__assetTemplate_Key, + 'customerKey', + 'name' + ); + metadata.views.html.template.assetType = { + id: 4, + name: 'template', + displayName: 'Template', + }; + + metadata.views.html.template.data = { + email: { options: {} }, + }; + + metadata.views.html.template.availableViews = []; + metadata.views.html.template.modelVersion = 2; + delete metadata.views.html.template.r__assetTemplate_Key; + } + // restore asset type id which is needed for deploy metadata.assetType.id = this.definition.typeMapping[metadata.assetType.name]; From 7fb672baef8afd95ba49c36312ca689bce46c3b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Mon, 13 May 2024 22:51:26 +0200 Subject: [PATCH 213/359] #1314: ensure selected subtypes actually exist --- lib/metadataTypes/Asset.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index c5ef19c98..66f91530f 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -43,6 +43,15 @@ class Asset extends MetadataType { */ static async retrieve(retrieveDir, _, subTypeArr, key) { const items = []; + if (subTypeArr) { + // check if elements in subTypeArr exist in this.definition.subTypes + const invalidSubTypes = subTypeArr.filter( + (subType) => !this.definition.subTypes.includes(subType) + ); + if (invalidSubTypes.length) { + throw new Error(`Invalid subType(s) found: ${invalidSubTypes.join(', ')}`); + } + } subTypeArr ||= this._getSubTypes(); if (retrieveDir) { await File.initPrettier(); From f5b415fd83784cd2d44d3f3e86ae589f378e42bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 00:11:53 +0200 Subject: [PATCH 214/359] #1314: enable more on point REST test responses --- test/resourceFactory.js | 56 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/test/resourceFactory.js b/test/resourceFactory.js index 39281b09e..ba7302c58 100644 --- a/test/resourceFactory.js +++ b/test/resourceFactory.js @@ -239,6 +239,7 @@ export const handleRESTRequest = async (config) => { config.baseURL + (config.url.startsWith('/') ? config.url.slice(1) : config.url) ); let filterName; + let filterBody; if (urlObj.searchParams.get('$filter')) { filterName = urlObj.searchParams.get('$filter').split(' eq ')[1]; } @@ -256,6 +257,18 @@ export const handleRESTRequest = async (config) => { '-' + urlObj.searchParams.get('$filter').replaceAll(' eq ', '=').replaceAll(' ', '') : null; + + if (!testPathFilter && config.method === 'post' && config.data) { + const simpleOperators = { equal: '=', in: 'IN' }; + const data = JSON.parse(config.data); + const myObj = data.query?.rightOperand || data.query; + if (myObj) { + const op = simpleOperators[myObj.simpleOperator]; + filterBody = `${myObj.property}${op}${op === 'IN' ? myObj.value.join(',') : myObj.value}`; + } + } + const testPathFilterBody = filterBody ? testPath + '-' + filterBody : null; + if (testPathFilter && (await fs.pathExists(testPathFilter + '.json'))) { // build filter logic to ensure templating works if (filterName) { @@ -282,6 +295,20 @@ export const handleRESTRequest = async (config) => { encoding: 'utf8', }), ]; + } else if (testPathFilterBody && (await fs.pathExists(testPathFilterBody + '.json'))) { + return [ + 200, + await fs.readFile(testPathFilterBody + '.json', { + encoding: 'utf8', + }), + ]; + } else if (testPathFilterBody && (await fs.pathExists(testPathFilterBody + '.txt'))) { + return [ + 200, + await fs.readFile(testPathFilterBody + '.txt', { + encoding: 'utf8', + }), + ]; } else if (await fs.pathExists(testPath + '.json')) { if (testPathFilter) { /* eslint-disable no-console */ @@ -297,6 +324,20 @@ export const handleRESTRequest = async (config) => { /* eslint-enable no-console */ } + if (testPathFilterBody) { + /* eslint-disable no-console */ + console.log( + `${color.bgYellow}${color.fgBlack}TEST-WARNING${ + color.reset + }: You are loading your reponse from ${ + testPath + '.json' + } instead of the more specific ${ + testPathFilterBody + '.json' + }. Make sure this is intended` + ); + /* eslint-enable no-console */ + } + // build filter logic to ensure templating works if (filterName) { const response = JSON.parse( @@ -329,6 +370,19 @@ export const handleRESTRequest = async (config) => { ); /* eslint-enable no-console */ } + if (testPathFilterBody) { + /* eslint-disable no-console */ + console.log( + `${color.bgYellow}${color.fgBlack}TEST-WARNING${ + color.reset + }: You are loading your reponse from ${ + testPath + '.txt' + } instead of the more specific ${ + testPathFilterBody + '.txt' + }. Make sure this is intended` + ); + /* eslint-enable no-console */ + } return [ 200, @@ -339,7 +393,7 @@ export const handleRESTRequest = async (config) => { } else { /* eslint-disable no-console */ console.log( - `${color.bgRed}${color.fgBlack}TEST-ERROR${color.reset}: Please create file ${testPath}.json/.txt${filterName ? ` or ${testPathFilter}.json/.txt` : ''}` + `${color.bgRed}${color.fgBlack}TEST-ERROR${color.reset}: Please create file ${testPath}.json/.txt${filterName ? ` or ${testPathFilter}.json/.txt` : testPathFilterBody ? ` or ${testPathFilterBody}.json/.txt` : ''}` ); /* eslint-enable no-console */ process.exitCode = 404; From 06daff7220c8dd4038e454678ee1371dafb1434f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 00:13:34 +0200 Subject: [PATCH 215/359] #1314: test for resolving templates and better mock api responses --- .../retrieve-templatebasedemail-expected.json | 85 ++++++++ .../v1/content/assets/5286/get-response.json | 48 +++++ .../v1/content/assets/5289/get-response.json | 198 ++++++++++++++++++ ...84,185,186,187,188,189,190,191,192,14.json | 7 + ...ost-response-assetType.idIN193,194,15.json | 7 + ...199,200,201,202,203,210,211,212,213,3.json | 46 ++++ ...ponse-assetType.idIN205,206,230,232,1.json | 32 +++ ...response-assetType.idIN207,208,209,5.json} | 90 ++++---- .../post-response-assetType.idIN214,4.json | 35 ++++ ...9,220,221,222,223,224,225,226,227,228.json | 7 + ...response-customerKey=mcdev-issue-1157.json | 46 ++++ test/type.asset.test.js | 30 ++- 12 files changed, 576 insertions(+), 55 deletions(-) create mode 100644 test/resources/9999999/asset/retrieve-templatebasedemail-expected.json create mode 100644 test/resources/9999999/asset/v1/content/assets/5286/get-response.json create mode 100644 test/resources/9999999/asset/v1/content/assets/5289/get-response.json create mode 100644 test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14.json create mode 100644 test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN193,194,15.json create mode 100644 test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN195,196,197,198,199,200,201,202,203,210,211,212,213,3.json create mode 100644 test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN205,206,230,232,1.json rename test/resources/9999999/asset/v1/content/assets/query/{post-response.json => post-response-assetType.idIN207,208,209,5.json} (52%) create mode 100644 test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN214,4.json create mode 100644 test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN215,216,217,218,219,220,221,222,223,224,225,226,227,228.json create mode 100644 test/resources/9999999/asset/v1/content/assets/query/post-response-customerKey=mcdev-issue-1157.json diff --git a/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json new file mode 100644 index 000000000..1bfc09130 --- /dev/null +++ b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json @@ -0,0 +1,85 @@ +{ + "customerKey": "testExisting_asset_templatebasedemail", + "contentType": "application/vnd.etmc.email.Message; kind=template", + "assetType": { "name": "templatebasedemail", "displayName": "Template-Based Email" }, + "name": " testExisting_asset_templatebasedemail", + "owner": { "email": "joern.berkefeld@accenture.com", "name": "Jörn Berkefeld" }, + "createdDate": "2024-04-22T06:36:03.117-06:00", + "createdBy": { "email": "joern.berkefeld@accenture.com", "name": "Jörn Berkefeld" }, + "modifiedDate": "2024-05-13T07:15:29.77-06:00", + "modifiedBy": { "name": "IDE - joern.berkefeld app user" }, + "memberId": 9999999, + "status": { "name": "Draft" }, + "views": { + "subjectline": { + "contentType": "application/vnd.etmc.email.View; kind=subjectline", + "thumbnail": {}, + "content": "my subject line", + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "preheader": { + "contentType": "application/vnd.etmc.email.View; kind=preheader", + "thumbnail": {}, + "content": "my custom preheader text", + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "text": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": "html" } } }, + "generateFrom": "html", + "modelVersion": 2 + }, + "viewAsAWebPage": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "subscriptioncenter": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "forwardHTML": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "forwardText": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "html": { + "thumbnail": {}, + "availableViews": [], + "template": { + "meta": { "contentHash": -166410261 }, + "r__assetTemplate_Key": "testExisting_asset_template" + }, + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + } + }, + "availableViews": [ + "subjectline", + "preheader", + "text", + "viewAsAWebPage", + "subscriptioncenter", + "forwardHTML", + "forwardText", + "html" + ], + "data": { "email": { "options": { "characterEncoding": "utf-8" } } }, + "modelVersion": 2, + "r__folder_Path": "Content Builder" +} diff --git a/test/resources/9999999/asset/v1/content/assets/5286/get-response.json b/test/resources/9999999/asset/v1/content/assets/5286/get-response.json new file mode 100644 index 000000000..df910f095 --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/5286/get-response.json @@ -0,0 +1,48 @@ +{ + "id": 5286, + "customerKey": "testExisting_asset_template", + "objectID": "50855339-3f87-47a7-8677-a8c63eb36a43", + "assetType": { + "id": 4, + "name": "template", + "displayName": "Template" + }, + "fileProperties": { + "fileName": " testExisting_asset_template" + }, + "name": " testExisting_asset_template", + "owner": { + "id": 710411605, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld", + "userId": "710411605" + }, + "createdDate": "2024-04-22T03:33:08.253-06:00", + "createdBy": { + "id": 710411605, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld", + "userId": "710411605" + }, + "modifiedDate": "2024-05-13T07:12:13.117-06:00", + "modifiedBy": { + "id": 710420432, + "name": "joern.berkefeld app user", + "userId": "710420432" + }, + "enterpriseId": 510004860, + "memberId": 510009653, + "status": { + "id": 1, + "name": "Draft" + }, + "thumbnail": { + "thumbnailUrl": "/v1/assets/5286/thumbnail" + }, + "category": { + "id": 89397 + }, + "content": "Update Profile\n\n \n \n \n
\n This email was sent by: %%Member_Busname%%
%%Member_Addr%%\n %%Member_City%%, %%Member_State%%, %%Member_PostalCode%%, %%Member_Country%%
\n
\nManage Subscriptions\n", + "availableViews": [], + "modelVersion": 2 +} diff --git a/test/resources/9999999/asset/v1/content/assets/5289/get-response.json b/test/resources/9999999/asset/v1/content/assets/5289/get-response.json new file mode 100644 index 000000000..3f85ddaac --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/5289/get-response.json @@ -0,0 +1,198 @@ +{ + "id": 5289, + "customerKey": "testExisting_asset_templatebasedemail", + "objectID": "26c925ba-af6e-4c2a-a04a-a67f39cceeee", + "contentType": "application/vnd.etmc.email.Message; kind=template", + "assetType": { + "id": 207, + "name": "templatebasedemail", + "displayName": "Template-Based Email" + }, + "name": " testExisting_asset_templatebasedemail", + "owner": { + "id": 710369861, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld", + "userId": "710369861" + }, + "createdDate": "2024-04-22T06:36:03.117-06:00", + "createdBy": { + "id": 710369861, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld", + "userId": "710369861" + }, + "modifiedDate": "2024-05-13T07:15:29.77-06:00", + "modifiedBy": { + "id": 710420432, + "name": "IDE - joern.berkefeld app user", + "userId": "710420432" + }, + "enterpriseId": 1111111, + "memberId": 9999999, + "status": { + "id": 1, + "name": "Draft" + }, + "thumbnail": { + "thumbnailUrl": "/v1/assets/5289/thumbnail" + }, + "category": { + "id": 89397 + }, + "views": { + "subjectline": { + "contentType": "application/vnd.etmc.email.View; kind=subjectline", + "thumbnail": {}, + "content": "my subject line", + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + }, + "preheader": { + "contentType": "application/vnd.etmc.email.View; kind=preheader", + "thumbnail": {}, + "content": "my custom preheader text", + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + }, + "text": { + "thumbnail": {}, + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": "html" + } + } + }, + "generateFrom": "html", + "modelVersion": 2 + }, + "viewAsAWebPage": { + "thumbnail": {}, + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + }, + "subscriptioncenter": { + "thumbnail": {}, + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + }, + "forwardHTML": { + "thumbnail": {}, + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + }, + "forwardText": { + "thumbnail": {}, + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + }, + "html": { + "thumbnail": {}, + "content": "Update Profile\n\n \n \n \n
\n This email was sent by: %%Member_Busname%%
%%Member_Addr%%\n %%Member_City%%, %%Member_State%%, %%Member_PostalCode%%, %%Member_Country%%
\n
\nManage Subscriptions\n", + "availableViews": [], + "template": { + "id": 5286, + "assetType": { + "id": 4, + "name": "template", + "displayName": "Template" + }, + "name": "testExisting_asset_template", + "meta": { + "contentHash": -166410261 + }, + "availableViews": [], + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + }, + "data": { + "email": { + "options": { + "generateFrom": null + } + } + }, + "modelVersion": 2 + } + }, + "availableViews": [ + "subjectline", + "preheader", + "text", + "viewAsAWebPage", + "subscriptioncenter", + "forwardHTML", + "forwardText", + "html" + ], + "data": { + "email": { + "options": { + "characterEncoding": "utf-8" + }, + "legacy": { + "legacyId": 1643, + "legacyKey": "9b6edc22-d19a-429a-a705-da88c3a16543", + "legacyType": "email", + "legacyCategoryId": 10251 + } + } + }, + "legacyData": { + "legacyId": 1643, + "legacyKey": "9b6edc22-d19a-429a-a705-da88c3a16543", + "legacyType": "email", + "legacyCategoryId": 10251 + }, + "modelVersion": 2 +} diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14.json new file mode 100644 index 000000000..347c7bc35 --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,14.json @@ -0,0 +1,7 @@ +{ + "count": 0, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [] +} diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN193,194,15.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN193,194,15.json new file mode 100644 index 000000000..347c7bc35 --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN193,194,15.json @@ -0,0 +1,7 @@ +{ + "count": 0, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [] +} diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN195,196,197,198,199,200,201,202,203,210,211,212,213,3.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN195,196,197,198,199,200,201,202,203,210,211,212,213,3.json new file mode 100644 index 000000000..89f2115cf --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN195,196,197,198,199,200,201,202,203,210,211,212,213,3.json @@ -0,0 +1,46 @@ +{ + "count": 1, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [ + { + "id": 1295064, + "customerKey": "mcdev-issue-1157", + "assetType": { + "id": 197, + "name": "htmlblock", + "displayName": "HTML Block" + }, + "fileProperties": { + "fileName": "dont strip non ssjs content" + }, + "name": "dont strip non ssjs content", + "createdDate": "2024-01-08T08:26:58.277-06:00", + "createdBy": { + "id": 700301950, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld (ASGR)", + "userId": "700301950" + }, + "modifiedDate": "2024-01-08T08:28:01.6-06:00", + "modifiedBy": { + "id": 700301950, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld (ASGR)", + "userId": "700301950" + }, + "status": { + "id": 1, + "name": "Draft" + }, + "category": { + "id": 89397, + "name": "Content Builder", + "parentId": 0 + }, + "availableViews": [], + "modelVersion": 2 + } + ] +} diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN205,206,230,232,1.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN205,206,230,232,1.json new file mode 100644 index 000000000..eef3b5b61 --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN205,206,230,232,1.json @@ -0,0 +1,32 @@ +{ + "count": 1, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [ + { + "id": 1209971, + "customerKey": "mobileMessage_test", + "assetType": { "id": 230, "name": "jsonmessage", "displayName": "JSON Message" }, + "name": "mobileMessage_test", + "createdDate": "2022-12-07T02:49:36.857-06:00", + "createdBy": { + "id": 700301950, + "email": "joern.berkefeld@accenture.com", + "name": "J├Ârn Berkefeld (ASGR)", + "userId": "700301950" + }, + "modifiedDate": "2022-12-07T02:49:57.44-06:00", + "modifiedBy": { + "id": 700301950, + "email": "joern.berkefeld@accenture.com", + "name": "J├Ârn Berkefeld (ASGR)", + "userId": "700301950" + }, + "status": { "id": 1, "name": "Draft" }, + "category": { "id": 89397, "name": "Content Builder", "parentId": 0 }, + "availableViews": ["push"], + "modelVersion": 2 + } + ] +} diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN207,208,209,5.json similarity index 52% rename from test/resources/9999999/asset/v1/content/assets/query/post-response.json rename to test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN207,208,209,5.json index 864d9b969..567a6b0cd 100644 --- a/test/resources/9999999/asset/v1/content/assets/query/post-response.json +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN207,208,209,5.json @@ -45,65 +45,63 @@ "modelVersion": 2 }, { - "id": 1209971, - "customerKey": "mobileMessage_test", - "assetType": { "id": 230, "name": "jsonmessage", "displayName": "JSON Message" }, - "name": "mobileMessage_test", - "createdDate": "2022-12-07T02:49:36.857-06:00", - "createdBy": { - "id": 700301950, - "email": "joern.berkefeld@accenture.com", - "name": "J├Ârn Berkefeld (ASGR)", - "userId": "700301950" - }, - "modifiedDate": "2022-12-07T02:49:57.44-06:00", - "modifiedBy": { - "id": 700301950, - "email": "joern.berkefeld@accenture.com", - "name": "J├Ârn Berkefeld (ASGR)", - "userId": "700301950" - }, - "status": { "id": 1, "name": "Draft" }, - "category": { "id": 89397, "name": "Content Builder", "parentId": 0 }, - "availableViews": ["push"], - "modelVersion": 2 - }, - { - "id": 1295064, - "customerKey": "mcdev-issue-1157", + "id": 5289, + "customerKey": "testExisting_asset_templatebasedemail", "assetType": { - "id": 197, - "name": "htmlblock", - "displayName": "HTML Block" - }, - "fileProperties": { - "fileName": "dont strip non ssjs content" + "id": 207, + "name": "templatebasedemail", + "displayName": "Template-Based Email" }, - "name": "dont strip non ssjs content", - "createdDate": "2024-01-08T08:26:58.277-06:00", + "name": " testExisting_asset_templatebasedemail", + "createdDate": "2024-04-22T06:36:03.117-06:00", "createdBy": { - "id": 700301950, + "id": 710369861, "email": "joern.berkefeld@accenture.com", - "name": "Jörn Berkefeld (ASGR)", - "userId": "700301950" + "name": "Jörn Berkefeld", + "userId": "710369861" }, - "modifiedDate": "2024-01-08T08:28:01.6-06:00", + "modifiedDate": "2024-05-13T07:15:29.77-06:00", "modifiedBy": { - "id": 700301950, - "email": "joern.berkefeld@accenture.com", - "name": "Jörn Berkefeld (ASGR)", - "userId": "700301950" + "id": 710420432, + "name": "joern.berkefeld app user", + "userId": "710420432" }, "status": { "id": 1, "name": "Draft" }, "category": { - "id": 89397, - "name": "Content Builder", - "parentId": 0 + "id": 89397 + }, + "availableViews": [ + "subjectline", + "preheader", + "text", + "viewAsAWebPage", + "subscriptioncenter", + "forwardHTML", + "forwardText", + "html" + ], + "data": { + "email": { + "options": { + "characterEncoding": "utf-8" + }, + "legacy": { + "legacyId": 1643, + "legacyKey": "9b6edc22-d19a-429a-a705-da88c3a16543", + "legacyType": "email", + "legacyCategoryId": 10251 + } + } + }, + "legacyData": { + "legacyId": 1643, + "legacyKey": "9b6edc22-d19a-429a-a705-da88c3a16543", + "legacyType": "email", + "legacyCategoryId": 10251 }, - "availableViews": [], "modelVersion": 2 } ] diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN214,4.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN214,4.json new file mode 100644 index 000000000..a7ac464db --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN214,4.json @@ -0,0 +1,35 @@ +{ + "count": 1, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [ + { + "id": 5286, + "customerKey": "testExisting_asset_template", + "assetType": { + "id": 4, + "name": "template", + "displayName": "Template" + }, + "name": " testExisting_asset_template", + "createdDate": "2024-04-22T03:33:08.253-06:00", + "createdBy": { + "id": 710411605, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld", + "userId": "710411605" + }, + "modifiedDate": "2024-05-13T07:12:13.117-06:00", + "modifiedBy": { + "id": 710420432, + "name": "joern.berkefeld app user", + "userId": "710420432" + }, + "category": { + "id": 89397 + }, + "modelVersion": 2 + } + ] +} diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN215,216,217,218,219,220,221,222,223,224,225,226,227,228.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN215,216,217,218,219,220,221,222,223,224,225,226,227,228.json new file mode 100644 index 000000000..347c7bc35 --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-assetType.idIN215,216,217,218,219,220,221,222,223,224,225,226,227,228.json @@ -0,0 +1,7 @@ +{ + "count": 0, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [] +} diff --git a/test/resources/9999999/asset/v1/content/assets/query/post-response-customerKey=mcdev-issue-1157.json b/test/resources/9999999/asset/v1/content/assets/query/post-response-customerKey=mcdev-issue-1157.json new file mode 100644 index 000000000..89f2115cf --- /dev/null +++ b/test/resources/9999999/asset/v1/content/assets/query/post-response-customerKey=mcdev-issue-1157.json @@ -0,0 +1,46 @@ +{ + "count": 1, + "page": 1, + "pageSize": 50, + "links": {}, + "items": [ + { + "id": 1295064, + "customerKey": "mcdev-issue-1157", + "assetType": { + "id": 197, + "name": "htmlblock", + "displayName": "HTML Block" + }, + "fileProperties": { + "fileName": "dont strip non ssjs content" + }, + "name": "dont strip non ssjs content", + "createdDate": "2024-01-08T08:26:58.277-06:00", + "createdBy": { + "id": 700301950, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld (ASGR)", + "userId": "700301950" + }, + "modifiedDate": "2024-01-08T08:28:01.6-06:00", + "modifiedBy": { + "id": 700301950, + "email": "joern.berkefeld@accenture.com", + "name": "Jörn Berkefeld (ASGR)", + "userId": "700301950" + }, + "status": { + "id": 1, + "name": "Draft" + }, + "category": { + "id": 89397, + "name": "Content Builder", + "parentId": 0 + }, + "availableViews": [], + "modelVersion": 2 + } + ] +} diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 2620df185..89ddce466 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -20,10 +20,16 @@ const file = chaiFiles.file; * @param {string} [buName] used when we need to test on ParentBU * @returns {Promise.} file in string form */ -function getActualJson(customerKey, type, subtype, buName = 'testBU') { - return File.readJSON( - `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.json` - ); +async function getActualJson(customerKey, type, subtype, buName = 'testBU') { + try { + return await File.readJSON( + `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.json` + ); + } catch { + return await File.readJSON( + `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}/${customerKey}.${type}-${subtype}-meta.json` + ); + } } /** * gets file from Retrieve folder @@ -59,15 +65,15 @@ describe('type: asset', () => { retrieve['testInstance/testBU'].asset ? Object.keys(retrieve['testInstance/testBU'].asset).length : 0, - 3, - 'only 3 assets expected in retrieve response' + 5, + 'only 5 assets expected in retrieve response' ); // get results from cache const result = cache.getCache(); assert.equal( result.asset ? Object.keys(result.asset).length : 0, - 3, - 'only 3 assets expected in cache' + 5, + 'only 5 assets expected in cache' ); assert.deepEqual( @@ -79,9 +85,15 @@ describe('type: asset', () => { file(testUtils.getExpectedFile('9999999', 'asset', 'block-1157-retrieve', 'html')) ); + assert.deepEqual( + await getActualJson('testExisting_asset_templatebasedemail', 'asset', 'message'), + await testUtils.getExpectedJson('9999999', 'asset', 'retrieve-templatebasedemail'), + 'returned metadata was not equal expected' + ); + assert.equal( testUtils.getAPIHistoryLength(), - 30, + 15, 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); return; From 53996d6e9fdaa15958c51d6691525c006ea27182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 11:36:59 +0200 Subject: [PATCH 216/359] #1316: define keyIsFixed --- lib/metadataTypes/definitions/AttributeGroup.definition.js | 2 +- lib/metadataTypes/definitions/AttributeSet.definition.js | 2 +- lib/metadataTypes/definitions/Campaign.definition.js | 2 +- lib/metadataTypes/definitions/ContentArea.definition.js | 2 +- .../definitions/DataExtensionTemplate.definition.js | 2 +- lib/metadataTypes/definitions/DataExtractType.definition.js | 2 +- lib/metadataTypes/definitions/Discovery.definition.js | 2 +- lib/metadataTypes/definitions/Email.definition.js | 2 +- lib/metadataTypes/definitions/FileLocation.definition.js | 2 +- lib/metadataTypes/definitions/Filter.definition.js | 2 +- lib/metadataTypes/definitions/List.definition.js | 2 +- lib/metadataTypes/definitions/MobileCode.definition.js | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/metadataTypes/definitions/AttributeGroup.definition.js b/lib/metadataTypes/definitions/AttributeGroup.definition.js index 66742fce8..8883b43c2 100644 --- a/lib/metadataTypes/definitions/AttributeGroup.definition.js +++ b/lib/metadataTypes/definitions/AttributeGroup.definition.js @@ -3,7 +3,7 @@ export default { dependencies: ['attributeSet'], // future may have dependency on Data Extensions hasExtended: false, idField: 'definitionID', - keyIsFixed: null, + keyIsFixed: true, keyField: 'definitionKey', nameField: 'definitionName.value', restPagination: false, // Hub API does not support pagination and returns everything instead diff --git a/lib/metadataTypes/definitions/AttributeSet.definition.js b/lib/metadataTypes/definitions/AttributeSet.definition.js index 79e758f35..011e0a6d8 100644 --- a/lib/metadataTypes/definitions/AttributeSet.definition.js +++ b/lib/metadataTypes/definitions/AttributeSet.definition.js @@ -12,7 +12,7 @@ export default { ], hasExtended: false, idField: 'definitionID', - keyIsFixed: null, + keyIsFixed: true, keyField: 'definitionKey', nameField: 'name', folderIdField: 'categoryID', diff --git a/lib/metadataTypes/definitions/Campaign.definition.js b/lib/metadataTypes/definitions/Campaign.definition.js index d4162929b..5372ee145 100644 --- a/lib/metadataTypes/definitions/Campaign.definition.js +++ b/lib/metadataTypes/definitions/Campaign.definition.js @@ -4,7 +4,7 @@ export default { hasExtended: false, idField: 'id', keepId: true, - keyIsFixed: null, + keyIsFixed: true, keyField: 'name', nameField: 'name', createdDateField: 'createdDate', diff --git a/lib/metadataTypes/definitions/ContentArea.definition.js b/lib/metadataTypes/definitions/ContentArea.definition.js index 97ac8ef91..8588f874a 100644 --- a/lib/metadataTypes/definitions/ContentArea.definition.js +++ b/lib/metadataTypes/definitions/ContentArea.definition.js @@ -4,7 +4,7 @@ export default { hasExtended: false, idField: 'ID', keepId: true, - keyIsFixed: null, + keyIsFixed: true, keyField: 'CustomerKey', nameField: 'Name', folderIdField: 'CategoryID', diff --git a/lib/metadataTypes/definitions/DataExtensionTemplate.definition.js b/lib/metadataTypes/definitions/DataExtensionTemplate.definition.js index 4f89a5296..7542048aa 100644 --- a/lib/metadataTypes/definitions/DataExtensionTemplate.definition.js +++ b/lib/metadataTypes/definitions/DataExtensionTemplate.definition.js @@ -4,7 +4,7 @@ export default { filter: {}, hasExtended: false, idField: 'ObjectID', - keyIsFixed: null, + keyIsFixed: true, keyField: 'CustomerKey', nameField: 'Name', restPagination: false, diff --git a/lib/metadataTypes/definitions/DataExtractType.definition.js b/lib/metadataTypes/definitions/DataExtractType.definition.js index 188c376d7..5724066c0 100644 --- a/lib/metadataTypes/definitions/DataExtractType.definition.js +++ b/lib/metadataTypes/definitions/DataExtractType.definition.js @@ -3,7 +3,7 @@ export default { dependencies: [], hasExtended: false, idField: 'extractId', - keyIsFixed: null, + keyIsFixed: true, keyField: 'name', nameField: 'name', restPagination: false, diff --git a/lib/metadataTypes/definitions/Discovery.definition.js b/lib/metadataTypes/definitions/Discovery.definition.js index 56a01a807..c7222dc9c 100644 --- a/lib/metadataTypes/definitions/Discovery.definition.js +++ b/lib/metadataTypes/definitions/Discovery.definition.js @@ -26,7 +26,7 @@ export default { }, hasExtended: false, idField: '', - keyIsFixed: null, + keyIsFixed: true, keyField: 'key', nameField: 'name', restPagination: false, diff --git a/lib/metadataTypes/definitions/Email.definition.js b/lib/metadataTypes/definitions/Email.definition.js index 98107c94b..a13bfcb78 100644 --- a/lib/metadataTypes/definitions/Email.definition.js +++ b/lib/metadataTypes/definitions/Email.definition.js @@ -4,7 +4,7 @@ export default { hasExtended: false, idField: 'ID', keepId: true, - keyIsFixed: null, + keyIsFixed: true, keyField: 'CustomerKey', nameField: 'Name', folderIdField: 'CategoryID', diff --git a/lib/metadataTypes/definitions/FileLocation.definition.js b/lib/metadataTypes/definitions/FileLocation.definition.js index 24879cc6f..2b23e08f2 100644 --- a/lib/metadataTypes/definitions/FileLocation.definition.js +++ b/lib/metadataTypes/definitions/FileLocation.definition.js @@ -3,7 +3,7 @@ export default { dependencies: [], hasExtended: false, idField: 'id', - keyIsFixed: null, + keyIsFixed: true, keyField: 'name', nameField: 'name', createdDateField: null, diff --git a/lib/metadataTypes/definitions/Filter.definition.js b/lib/metadataTypes/definitions/Filter.definition.js index aa5f5f0e8..c04b65c36 100644 --- a/lib/metadataTypes/definitions/Filter.definition.js +++ b/lib/metadataTypes/definitions/Filter.definition.js @@ -3,7 +3,7 @@ export default { dependencies: [], hasExtended: false, idField: 'id', - keyIsFixed: null, + keyIsFixed: false, keyField: 'customerKey', nameField: 'name', createdDateField: 'createdDate', diff --git a/lib/metadataTypes/definitions/List.definition.js b/lib/metadataTypes/definitions/List.definition.js index 69b8c8655..be9678e24 100644 --- a/lib/metadataTypes/definitions/List.definition.js +++ b/lib/metadataTypes/definitions/List.definition.js @@ -4,7 +4,7 @@ export default { folderType: 'list', hasExtended: false, idField: 'ObjectID', - keyIsFixed: null, + keyIsFixed: true, keyField: 'CustomerKey', nameField: 'ListName', restPagination: null, diff --git a/lib/metadataTypes/definitions/MobileCode.definition.js b/lib/metadataTypes/definitions/MobileCode.definition.js index 07a48c07f..faa325c38 100644 --- a/lib/metadataTypes/definitions/MobileCode.definition.js +++ b/lib/metadataTypes/definitions/MobileCode.definition.js @@ -3,7 +3,7 @@ export default { dependencies: [], hasExtended: false, idField: 'id', - keyIsFixed: null, + keyIsFixed: true, keyField: 'code', nameField: 'code', createdDateField: 'createdDate', From fee3e04721da43382894d364c46e93a0c35926e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 11:40:58 +0200 Subject: [PATCH 217/359] #1316: enable --metadata and multi-type for fixKeys --- lib/cli.js | 15 +++++++++++++-- lib/index.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 60 insertions(+), 6 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 47d389015..ece283ce5 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -638,7 +638,7 @@ yargs(hideBin(process.argv)) }) // @ts-expect-error .command({ - command: 'fixKeys [KEY]', + command: 'fixKeys [TYPE] [KEY]', aliases: ['fx'], desc: 'changes the key of the items to match the name', builder: (yargs) => { @@ -655,6 +655,12 @@ yargs(hideBin(process.argv)) type: 'string', describe: 'key(s) of the metadata component(s)', }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Options for fixKeys:', + describe: 'type or type:key or type:i:id or type:n:name to fix', + }) .option('like', { type: 'string', group: 'Options for fixKeys:', @@ -686,7 +692,12 @@ yargs(hideBin(process.argv)) }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.fixKeys(argv.BU, argv.TYPE, csvToArray(argv.KEY)); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + Mcdev.fixKeys(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY)); + } else { + Mcdev.fixKeys(argv.BU, typeKeyCombo); + } }, }) // @ts-expect-error diff --git a/lib/index.js b/lib/index.js index 5f0134877..8d0d3252e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -884,12 +884,55 @@ class Mcdev { * Updates the key to match the name field * * @param {string} businessUnit name of BU - * @param {string} selectedType limit to given metadata types + * @param {string[] | TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type * @param {string[]} [keys] customerkey of the metadata - * @returns {Promise.>} key: business unit name, value: list of paused item keys + * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys */ - static async fixKeys(businessUnit, selectedType, keys) { - return this.#runMethod('fixKeys', businessUnit, selectedType, keys); + static async fixKeys(businessUnit, selectedTypesArr, keys) { + if (selectedTypesArr) { + // check if types are valid + for (const selectedType of Array.isArray(selectedTypesArr) + ? selectedTypesArr + : Object.keys(selectedTypesArr)) { + if (!Util._isValidType(selectedType)) { + return; + } + } + } else { + // do it for all standard retrieve types + const properties = await config.getProperties(); + selectedTypesArr = []; + selectedTypesArr.push( + ...new Set( + properties.metaDataTypes.retrieve + .map((type) => type.split('-')[0]) + .filter( + (type) => + !MetadataTypeDefinitions[type].keyIsFixed && + MetadataTypeDefinitions[type].keyField !== + MetadataTypeDefinitions[type].nameField && + MetadataTypeDefinitions[type].keyField !== + MetadataTypeDefinitions[type].idField + ) + ) + ); + Util.logger.info(`:: Fixing keys for ${selectedTypesArr.join(', ')}`); + } + + const response = {}; + for (const selectedType of Array.isArray(selectedTypesArr) + ? selectedTypesArr + : Object.keys(selectedTypesArr)) { + const temp = await this.#runMethod( + 'fixKeys', + businessUnit, + selectedType, + Array.isArray(selectedTypesArr) ? keys : selectedTypesArr[selectedType] + ); + response[businessUnit] ||= {}; + response[businessUnit][selectedType] = temp[businessUnit]; + } + return response; } /** * run a method across BUs From 7a2a3de9f878f771764acb8a59cb36a61a4097c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 11:50:23 +0200 Subject: [PATCH 218/359] #1316: make sure we dont try to fix keys of filtered items --- lib/metadataTypes/MetadataType.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 6e403c920..91912406a 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -2222,6 +2222,11 @@ class MetadataType { const maxKeyLength = this.definition.maxKeyLength || 36; for (const item of Object.values(metadataMap)) { + if (this.isFiltered(item, true) || this.isFiltered(item, false)) { + // we would not have saved these items to disk but they exist in the cache and hence need to be skipped here + + continue; + } if ( (item[this.definition.nameField].endsWith(Util.OPTIONS.keySuffix) && item[this.definition.nameField].length > maxKeyLength) || From e4a716785fa32374e498fd48697f2e20358aaef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 11:52:30 +0200 Subject: [PATCH 219/359] #1316: adapt test cases for new return value of fixKeys --- test/type.automation.test.js | 87 ++++++++++++++++++++---------------- test/type.query.test.js | 81 ++++++++++++++++++--------------- 2 files changed, 92 insertions(+), 76 deletions(-) diff --git a/test/type.automation.test.js b/test/type.automation.test.js index f299f8292..5e143625b 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -280,14 +280,16 @@ describe('type: automation', () => { it('Should run fixKeys but not find fixable keys and hence stop', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation'] + ); // THEN assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // check which keys were fixed assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['automation'].length, 0, 'expected to find no keys to be fixed' ); @@ -311,17 +313,18 @@ describe('type: automation', () => { it('Should fixKeys by key w/o re-retrieving, auto-schedule', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_fixKey_schedule', - 'testExisting_automation', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation_fixKey_schedule', 'testExisting_automation'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['automation'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['automation'][0], 'testExisting_automation_fixedKey_scheduled', 'returned keys do not correspond to expected fixed keys' ); @@ -356,17 +359,18 @@ describe('type: automation', () => { it('Should fixKeys by key w/o re-retrieving, auto-schedule and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_fixKey_schedule', - 'testExisting_automation', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation_fixKey_schedule', 'testExisting_automation'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['automation'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['automation'][0], 'testExisting_automation_fixedKey_scheduled', 'returned keys do not correspond to expected fixed keys' ); @@ -401,17 +405,18 @@ describe('type: automation', () => { it('Should fixKeys by key w/o re-retrieving, auto-schedule and then --schedule', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_fixKey_schedule', - 'testExisting_automation', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation_fixKey_schedule', 'testExisting_automation'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['automation'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['automation'][0], 'testExisting_automation_fixedKey_scheduled', 'returned keys do not correspond to expected fixed keys' ); @@ -446,16 +451,18 @@ describe('type: automation', () => { it('Should fixKeys by key w/o re-retrieving, deploy paused', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_fixKey_pause', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation_fixKey_pause'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['automation'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['automation'][0], 'testExisting_automation_fixedKey_paused', 'returned keys do not correspond to expected fixed keys' ); @@ -487,17 +494,18 @@ describe('type: automation', () => { it('Should fixKeys by key w/o re-retrieving, deploy paused and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_fixKey_pause', - 'testExisting_automation', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation_fixKey_pause', 'testExisting_automation'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['automation'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['automation'][0], 'testExisting_automation_fixedKey_paused', 'returned keys do not correspond to expected fixed keys' ); @@ -529,17 +537,18 @@ describe('type: automation', () => { it('Should fixKeys by key w/o re-retrieving, deploy paused and then --schedule', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, schedule: true }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'automation', [ - 'testExisting_automation_fixKey_pause', - 'testExisting_automation', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['automation'], + ['testExisting_automation_fixKey_pause', 'testExisting_automation'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['automation'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['automation'][0], 'testExisting_automation_fixedKey_paused', 'returned keys do not correspond to expected fixed keys' ); diff --git a/test/type.query.test.js b/test/type.query.test.js index c4f5fb744..69949bae0 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -448,14 +448,16 @@ describe('type: query', () => { it('Should run fixKeys but not find fixable keys and hence stop', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query', [ - 'testExisting_query', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['query'], + ['testExisting_query'] + ); // THEN assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); // check which keys were fixed assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['query'].length, 0, 'expected to find no keys to be fixed' ); @@ -479,17 +481,18 @@ describe('type: query', () => { it('Should fixKeys by key WITHOUT re-retrieving dependent types', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query', [ - 'testExisting_query_fixKeys', - 'testExisting_query', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['query'], + ['testExisting_query_fixKeys', 'testExisting_query'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['query'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['query'][0], 'testExisting_query_fixedKeys', 'returned keys do not correspond to expected fixed keys' ); @@ -519,10 +522,11 @@ describe('type: query', () => { keySuffix: '_DEV', skipInteraction: { fixKeysReretrieve: false }, }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query', [ - 'testExisting_query_fixKeysSuffix', - 'testExisting_query', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['query'], + ['testExisting_query_fixKeysSuffix', 'testExisting_query'] + ); // THEN assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); @@ -534,12 +538,12 @@ describe('type: query', () => { ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['query'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['query'][0], 'testExisting_query_fixedKeys_DEV', 'returned keys do not correspond to expected fixed keys' ); @@ -566,17 +570,18 @@ describe('type: query', () => { it('Should fixKeys by key WITHOUT re-retrieving dependent types and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: false }, execute: true }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query', [ - 'testExisting_query_fixKeys', - 'testExisting_query', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['query'], + ['testExisting_query_fixKeys', 'testExisting_query'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['query'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['query'][0], 'testExisting_query_fixedKeys', 'returned keys do not correspond to expected fixed keys' ); @@ -607,17 +612,18 @@ describe('type: query', () => { it('Should fixKeys by key AND re-retrieve dependent types', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: true } }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query', [ - 'testExisting_query_fixKeys', - 'testExisting_query', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['query'], + ['testExisting_query_fixKeys', 'testExisting_query'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['query'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['query'][0], 'testExisting_query_fixedKeys', 'returned keys do not correspond to expected fixed keys' ); @@ -644,17 +650,18 @@ describe('type: query', () => { it('Should fixKeys by key AND re-retrieve dependent types and then --execute', async () => { // WHEN handler.setOptions({ skipInteraction: { fixKeysReretrieve: true }, execute: true }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query', [ - 'testExisting_query_fixKeys', - 'testExisting_query', - ]); + const resultFixKeys = await handler.fixKeys( + 'testInstance/testBU', + ['query'], + ['testExisting_query_fixKeys', 'testExisting_query'] + ); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['query'].length, 1, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['query'][0], 'testExisting_query_fixedKeys', 'returned keys do not correspond to expected fixed keys' ); @@ -688,14 +695,14 @@ describe('type: query', () => { like: { key: 'testExisting_query_f%' }, skipInteraction: { fixKeysReretrieve: false }, }); - const resultFixKeys = await handler.fixKeys('testInstance/testBU', 'query'); + const resultFixKeys = await handler.fixKeys('testInstance/testBU', ['query']); assert.equal( - resultFixKeys['testInstance/testBU'].length, + resultFixKeys['testInstance/testBU']['query'].length, 2, 'returned number of keys does not correspond to number of expected fixed keys' ); assert.equal( - resultFixKeys['testInstance/testBU'][0], + resultFixKeys['testInstance/testBU']['query'][0], 'testExisting_query_fixedKeys', 'returned keys do not correspond to expected fixed keys' ); From ab981e694e0aee7f2e59d86ee1f37cd46529a30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 12:22:38 +0200 Subject: [PATCH 220/359] #1316: make sure types that are not supported on the BU dont cause errors --- lib/metadataTypes/MetadataType.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 91912406a..4fbf6a491 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -2214,6 +2214,10 @@ class MetadataType { */ static getKeysForFixing(metadataMap) { const keysForDeploy = []; + if (!metadataMap) { + // if a type was skipped e.g. because it shall only be looked at on the parent then we would expect metadataMap to be undefined + return keysForDeploy; + } if (Object.keys(metadataMap).length) { Util.logger.info( `Searching for ${this.definition.type} keys among downloaded items that need fixing:` From 7c5f55e282626fe8c2e4261d81e8e37446a50540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 12:24:10 +0200 Subject: [PATCH 221/359] #1316: refactoring --- lib/index.js | 2 +- lib/util/cli.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/index.js b/lib/index.js index 8d0d3252e..c24675caa 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1281,7 +1281,7 @@ class Mcdev { dependentTypes.join(', ') )}` ); - const reRetrieve = await Cli.postFixKeysReretrieve(type, dependentTypes); + const reRetrieve = await Cli.postFixKeysReretrieve(dependentTypes); if (reRetrieve) { Util.logger.info( `Retrieving latest versions of ${dependentTypes.join(', ')} from server` diff --git a/lib/util/cli.js b/lib/util/cli.js index fbbeff12c..a55baae29 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -78,11 +78,10 @@ const Cli = { /** * - * @param {string} type limit execution to given metadata type * @param {string[]} dependentTypes types that depent on type * @returns {Promise.} true if user wants to continue with retrieve */ - async postFixKeysReretrieve(type, dependentTypes) { + async postFixKeysReretrieve(dependentTypes) { if (Util.isTrue(Util.skipInteraction?.fixKeysReretrieve)) { return true; } else if (Util.isFalse(Util.skipInteraction?.fixKeysReretrieve)) { From 8dcb4904676b30058fc992171e4b52e895e56049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 12:26:44 +0200 Subject: [PATCH 222/359] #1316: ensure re-download question is suppressed if all types get fixed --- lib/index.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index c24675caa..26b1f1382 100644 --- a/lib/index.js +++ b/lib/index.js @@ -889,6 +889,8 @@ class Mcdev { * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys */ static async fixKeys(businessUnit, selectedTypesArr, keys) { + const properties = await config.getProperties(); + let reRetrieveAll = false; if (selectedTypesArr) { // check if types are valid for (const selectedType of Array.isArray(selectedTypesArr) @@ -900,7 +902,6 @@ class Mcdev { } } else { // do it for all standard retrieve types - const properties = await config.getProperties(); selectedTypesArr = []; selectedTypesArr.push( ...new Set( @@ -917,6 +918,10 @@ class Mcdev { ) ); Util.logger.info(`:: Fixing keys for ${selectedTypesArr.join(', ')}`); + reRetrieveAll = true; + this.setOptions({ + skipInteraction: { fixKeysReretrieve: false }, + }); } const response = {}; @@ -932,6 +937,15 @@ class Mcdev { response[businessUnit] ||= {}; response[businessUnit][selectedType] = temp[businessUnit]; } + + if (reRetrieveAll) { + Util.logger.info( + `Retrieving latest versions of ${selectedTypesArr.join(', ')} from server` + ); + const buObject = await Cli.getCredentialObject(properties, businessUnit, null, true); + const retriever = new Retriever(properties, buObject); + await retriever.retrieve(selectedTypesArr, null, null, false); + } return response; } /** From e4c73ae63294db3d272b3f47e8332ec91eae1522 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 14:53:16 +0200 Subject: [PATCH 223/359] #1318: ensure we update existing folders if IsActive, IsEditable or AllowChildren is set to false --- lib/metadataTypes/Folder.js | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index a5211c571..54f10dfdd 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -223,13 +223,12 @@ class Folder extends MetadataType { ); if ( existingId && - (metadata[metadataKey]._generated || // of generated, never "update" - !this.hasChangedGeneric( - cachedVersion, - metadata[metadataKey], - 'Path', - true - )) + !this.hasChangedGeneric( + cachedVersion, + metadata[metadataKey], + 'Path', + true + ) ) { Util.logger.verbose( ` - skipping ${this.definition.type} ${ @@ -246,13 +245,12 @@ class Folder extends MetadataType { existingId = cachedVersion?.ID; if ( existingId && - (metadata[metadataKey]._generated || // of generated, never "update" - !this.hasChangedGeneric( - cachedVersion, - metadata[metadataKey], - 'Path', - true - )) + !this.hasChangedGeneric( + cachedVersion, + metadata[metadataKey], + 'Path', + true + ) ) { Util.logger.verbose( ` - skipping ${this.definition.type} ${ From edcdffe5cb0911e8e8f88e69ddca7226ad80ec36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 14 May 2024 14:55:44 +0200 Subject: [PATCH 224/359] #1318: removed "Description" from auto-generated folders to avoid accidental overrides during update --- lib/Deployer.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index 839ab0c07..2507ca688 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -478,11 +478,11 @@ class Deployer { folderMetadata[`on-the-fly-${i}`] = { Path: folder, Name: folder.split('/').pop(), - Description: '', + // Description: '', // not setting this does not break the deployment and also could not override its existing value in case we need to run an update ContentType: contentType, - IsActive: true, - IsEditable: true, - AllowChildren: true, + IsActive: true, // would be auto-updated for existing folders if needed + IsEditable: true, // would be auto-updated for existing folders if needed + AllowChildren: true, // would be auto-updated for existing folders if needed _generated: true, }; } From f6d212d41213205996ad4e4f360ca1a85ca5547f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 10:31:56 +0200 Subject: [PATCH 225/359] #0: allow retrieving automations by objectid --- lib/metadataTypes/Automation.js | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index a2dee3578..48877ffd3 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -61,7 +61,10 @@ class Automation extends MetadataType { } else { /** @type {SoapRequestParams} */ let requestParams = null; - if (key) { + const objectIds = []; + if (key?.startsWith('id:')) { + objectIds.push(key.slice(3)); + } else if (key) { requestParams = { filter: { leftOperand: 'CustomerKey', @@ -69,18 +72,22 @@ class Automation extends MetadataType { rightOperand: key, }, }; + const results = await this.client.soap.retrieveBulk( + 'Program', + ['ObjectID'], + requestParams + ); + if (results?.Results?.length) { + objectIds.push(...results.Results.map((item) => item.ObjectID)); + } } - const results = await this.client.soap.retrieveBulk( - 'Program', - ['ObjectID'], - requestParams - ); + // the API seems to handle 50 concurrent requests nicely - const response = results?.Results?.length + const response = objectIds.length ? await this.retrieveRESTcollection( - results?.Results.map((item) => ({ - id: item.ObjectID, - uri: '/automation/v1/automations/' + item.ObjectID, + objectIds.map((objectID) => ({ + id: objectID, + uri: '/automation/v1/automations/' + objectID, })), 50, !key From 719e76357371af53476380dffd2a68b51f475d9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 10:53:24 +0200 Subject: [PATCH 226/359] #0: retrieve & delete asset by id/name/key --- lib/index.js | 2 +- lib/metadataTypes/Asset.js | 95 ++++++++++++++++++++++++-------------- 2 files changed, 61 insertions(+), 36 deletions(-) diff --git a/lib/index.js b/lib/index.js index 26b1f1382..119328912 100644 --- a/lib/index.js +++ b/lib/index.js @@ -571,7 +571,7 @@ class Mcdev { return; } Util.logger.info( - Util.getGrayMsg(` - Deleting ${type} with key ${customerKey} on BU ${businessUnit}`) + Util.getGrayMsg(` - Deleting ${type} ${customerKey} on BU ${businessUnit}`) ); try { MetadataTypeInfo[type].properties = properties; diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 66f91530f..e8f2c249f 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -60,7 +60,7 @@ class Asset extends MetadataType { for (const subType of subTypeArr) { // each subtype contains multiple different specific types (images contains jpg and png for example) // we use await here to limit the risk of too many concurrent api requests at time - items.push(...(await this.requestSubType(subType, retrieveDir, null, null, key))); + items.push(...(await this.requestSubType(subType, retrieveDir, key, null))); } const metadata = this.parseResponseBody({ items: items }); if (retrieveDir) { @@ -139,7 +139,12 @@ class Asset extends MetadataType { // each subtype contains multiple different specific types (images contains jpg and png for example) // we use await here to limit the risk of too many concurrent api requests at time items.push( - ...(await this.requestSubType(subType, templateDir, name, templateVariables)) + ...(await this.requestSubType( + subType, + templateDir, + 'name:' + name, + templateVariables + )) ); } const metadata = this.parseResponseBody({ items: items }); @@ -200,12 +205,11 @@ class Asset extends MetadataType { * * @param {string} subType group of similar assets to put in a folder (ie. images) * @param {string} [retrieveDir] target directory for saving assets - * @param {string} [templateName] name of the metadata file + * @param {string} [key] key/id/name to filter by * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata - * @param {string} [key] customer key to filter by * @returns {Promise.} Promise */ - static async requestSubType(subType, retrieveDir, templateName, templateVariables, key) { + static async requestSubType(subType, retrieveDir, key, templateVariables) { if (retrieveDir) { Util.logger.info(`- Retrieving Subtype: ${subType}`); } else { @@ -227,7 +231,7 @@ class Asset extends MetadataType { fields: ['category', 'createdDate', 'createdBy', 'modifiedDate', 'modifiedBy'], // get folder to allow duplicate name check against cache }; - if (templateName) { + if (key) { payload.query = { leftOperand: { property: 'assetType.id', @@ -235,26 +239,26 @@ class Asset extends MetadataType { value: subtypeIds, }, logicalOperator: 'AND', - rightOperand: { + }; + if (key.startsWith('id:')) { + payload.query.rightOperand = { + property: this.definition.idField, + simpleOperator: 'equal', + value: key.slice(3), + }; + } else if (key.startsWith('name:')) { + payload.query.rightOperand = { property: this.definition.nameField, simpleOperator: 'equal', - value: templateName, - }, - }; - } else if (key) { - payload.query = { - leftOperand: { - property: 'assetType.id', - simpleOperator: 'in', - value: subtypeIds, - }, - logicalOperator: 'AND', - rightOperand: { + value: key.slice(5), + }; + } else { + payload.query.rightOperand = { property: this.definition.keyField, simpleOperator: 'equal', value: key, - }, - }; + }; + } } else { payload.query = { property: 'assetType.id', @@ -1774,9 +1778,9 @@ class Asset extends MetadataType { * * @private * @param {string} key customer key - * @returns {Promise.} objectId or enpty string + * @returns {Promise.} id value or null */ - static async _getObjectIdForSingleRetrieve(key) { + static async _getIdForSingleRetrieve(key) { const name = key.startsWith('name:') ? key.slice(5) : null; const filter = name ? '?$filter=name%20eq%20' + encodeURIComponent(name) @@ -1789,40 +1793,61 @@ class Asset extends MetadataType { ); return found?.id || null; } + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} id id field + * @returns {Promise.} key value or null + */ + static async _getKeyForSingleRetrieve(id) { + const results = await this.client.rest.get('/asset/v1/content/assets/' + id); + return results?.customerKey || null; + } /** * Delete a metadata item from the specified business unit * - * @param {string} customerKey Identifier of data extension + * @param {string} key Identifier of item * @returns {Promise.} deletion success flag */ - static async deleteByKey(customerKey) { + static async deleteByKey(key) { // delete only works with the query's object id - const objectId = customerKey ? await this._getObjectIdForSingleRetrieve(customerKey) : null; - if (!objectId) { + let id; + if (key?.startsWith('id:')) { + id = key.slice(3); + // we need to get the actual key so that postDeletetTasks know what to do + key = await this._getKeyForSingleRetrieve(id); + } else { + id = key ? await this._getIdForSingleRetrieve(key) : null; + } + if (!id) { Util.logger.error(` - ${this.definition.type} not found`); return false; } - return super.deleteByKeyREST('/asset/v1/content/assets/' + objectId, customerKey); + return super.deleteByKeyREST('/asset/v1/content/assets/' + id, key); } /** * clean up after deleting a metadata item * cannot use the generic method due to the complexity of how assets are saved to disk * - * @param {string} customerKey Identifier of metadata item + * @param {string} key Identifier of metadata item * @returns {Promise.} - */ - static async postDeleteTasks(customerKey) { - const fileArr = await this.getFilesToCommit([customerKey]); + static async postDeleteTasks(key) { + if (key?.startsWith('id:')) { + // sad + } + const fileArr = await this.getFilesToCommit([key]); // check if asset sits in its own folder const ownFolderIndex = - fileArr[0].indexOf(customerKey + '\\') > 0 - ? fileArr[0].indexOf(customerKey + '\\') - : fileArr[0].indexOf(customerKey + '/'); + fileArr[0].indexOf(key + '\\') > 0 + ? fileArr[0].indexOf(key + '\\') + : fileArr[0].indexOf(key + '/'); if (ownFolderIndex > 0) { - fileArr.push(fileArr[0].slice(0, ownFolderIndex + customerKey.length)); + fileArr.push(fileArr[0].slice(0, ownFolderIndex + key.length)); } for (const filePath of fileArr) { From 65f927f5c0ce73db36bae5292f78bb122989694e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 10:58:35 +0200 Subject: [PATCH 227/359] #0: regression fix for f6d212d41213205996ad4e4f360ca1a85ca5547f --- lib/metadataTypes/Automation.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 48877ffd3..57613d510 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -72,14 +72,14 @@ class Automation extends MetadataType { rightOperand: key, }, }; - const results = await this.client.soap.retrieveBulk( - 'Program', - ['ObjectID'], - requestParams - ); - if (results?.Results?.length) { - objectIds.push(...results.Results.map((item) => item.ObjectID)); - } + } + const results = await this.client.soap.retrieveBulk( + 'Program', + ['ObjectID'], + requestParams + ); + if (results?.Results?.length) { + objectIds.push(...results.Results.map((item) => item.ObjectID)); } // the API seems to handle 50 concurrent requests nicely From 46d64e1bb40e0da62128201144762da7201a0a78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 13:31:27 +0200 Subject: [PATCH 228/359] #1320: ensure we can create folders but dont override the description during automatic updates --- lib/Deployer.js | 2 +- lib/metadataTypes/definitions/Folder.definition.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index 2507ca688..8bde04eda 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -478,7 +478,7 @@ class Deployer { folderMetadata[`on-the-fly-${i}`] = { Path: folder, Name: folder.split('/').pop(), - // Description: '', // not setting this does not break the deployment and also could not override its existing value in case we need to run an update + Description: '', // required for Create, omitted for update via definition file ContentType: contentType, IsActive: true, // would be auto-updated for existing folders if needed IsEditable: true, // would be auto-updated for existing folders if needed diff --git a/lib/metadataTypes/definitions/Folder.definition.js b/lib/metadataTypes/definitions/Folder.definition.js index 7ea579584..7ffd4924c 100644 --- a/lib/metadataTypes/definitions/Folder.definition.js +++ b/lib/metadataTypes/definitions/Folder.definition.js @@ -114,7 +114,7 @@ export default { }, Description: { isCreateable: true, - isUpdateable: true, + isUpdateable: false, // dont update this to prevent accidental overrides by auto-created folders retrieving: true, template: false, }, From 52a00fb0921d1810cf2bae54864a31ec038f6598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 13:32:52 +0200 Subject: [PATCH 229/359] #1320: allow creating folders for journey-triggeredSends --- lib/Deployer.js | 6 ++++++ lib/metadataTypes/definitions/Folder.definition.js | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Deployer.js b/lib/Deployer.js index 8bde04eda..19ec41a2a 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -475,6 +475,12 @@ class Deployer { ) { contentType = 'shared_dataextension'; } + if ( + metadataType === 'triggeredSend' && + folder.startsWith('Journey Builder Sends/') + ) { + contentType = 'triggered_send_journeybuilder'; + } folderMetadata[`on-the-fly-${i}`] = { Path: folder, Name: folder.split('/').pop(), diff --git a/lib/metadataTypes/definitions/Folder.definition.js b/lib/metadataTypes/definitions/Folder.definition.js index 7ffd4924c..db95da564 100644 --- a/lib/metadataTypes/definitions/Folder.definition.js +++ b/lib/metadataTypes/definitions/Folder.definition.js @@ -47,8 +47,8 @@ export default { 'ssjsactivity', 'suppression_list', 'synchronizeddataextension', - 'triggered_send', 'triggered_send_journeybuilder', + 'triggered_send', ], deployFolderBlacklist: [ // lower-case values! From 25765eaf44c2158037e8f7028713d1b52af33e46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 13:40:48 +0200 Subject: [PATCH 230/359] #1320: add support for creating automation folders --- lib/metadataTypes/Folder.js | 26 ++++++++++++++----- lib/metadataTypes/MetadataType.js | 17 +++++++----- .../definitions/Automation.definition.js | 2 +- .../definitions/Folder.definition.js | 1 + 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index 54f10dfdd..b521af8ba 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -351,15 +351,27 @@ class Folder extends MetadataType { } const path = metadataEntry.Path; try { - const response = await super.createSOAP(metadataEntry, true); - if (response) { - response.Results[0].Object = metadataEntry; - response.Results[0].Object.ID = response.Results[0].NewID; - response.Results[0].Object.CustomerKey = metadataEntry.CustomerKey; - delete response.Results[0].Object.$; + const restPayload = { + ParentCatId: metadataEntry.ParentFolder.ID, + Name: metadataEntry.Name, + CatType: metadataEntry.ContentType, + }; + const response = await super.createREST(restPayload, '/email/v1/category', true); + if (response?.objectId) { + // convert the response to the same format as the SOAP response + metadataEntry.ID = response.objectId; + const returnObject = { + Results: [ + { + Object: metadataEntry, + }, + ], + }; Util.logger.info(` - created folder: ${path}`); - return response; + return returnObject; + } else { + throw new Error(response); } } catch (ex) { if (ex?.results) { diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 4fbf6a491..bc9d5caf3 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -882,21 +882,24 @@ class MetadataType { * * @param {MetadataTypeItem} metadataEntry a single metadata Entry * @param {string} uri rest endpoint for POST + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method * @returns {Promise. | null} Promise of API response or null in case of an error */ - static async createREST(metadataEntry, uri) { + static async createREST(metadataEntry, uri, handleOutside) { const metadataClone = JSON.parse(JSON.stringify(metadataEntry)); this.removeNotCreateableFields(metadataEntry); try { // set to empty object in case API returned nothing to be able to update it in helper classes const response = (await this.client.rest.post(uri, metadataEntry)) || {}; await this.postCreateTasks(metadataEntry, response, metadataClone); - Util.logger.info( - ` - created ${this.definition.type}: ${ - metadataEntry[this.definition.keyField] || - metadataEntry[this.definition.nameField] - } / ${metadataEntry[this.definition.nameField]}` - ); + if (!handleOutside) { + Util.logger.info( + ` - created ${this.definition.type}: ${ + metadataEntry[this.definition.keyField] || + metadataEntry[this.definition.nameField] + } / ${metadataEntry[this.definition.nameField]}` + ); + } return response; } catch (ex) { const parsedErrors = this.getErrorsREST(ex); diff --git a/lib/metadataTypes/definitions/Automation.definition.js b/lib/metadataTypes/definitions/Automation.definition.js index cdd585bad..6f1e1efa7 100644 --- a/lib/metadataTypes/definitions/Automation.definition.js +++ b/lib/metadataTypes/definitions/Automation.definition.js @@ -33,7 +33,7 @@ export default { 'script', 'verification', ], - folderType: 'automation', + folderType: 'automations', hasExtended: false, filter: { description: ['Event Definition Automation'], diff --git a/lib/metadataTypes/definitions/Folder.definition.js b/lib/metadataTypes/definitions/Folder.definition.js index db95da564..445a85ad2 100644 --- a/lib/metadataTypes/definitions/Folder.definition.js +++ b/lib/metadataTypes/definitions/Folder.definition.js @@ -34,6 +34,7 @@ export default { deployFolderTypes: [ // lower-case values! 'asset', + 'automations', 'dataextension', 'filteractivity', 'filterdefinition', From 0cdabf672f0bb2b7bab154729613027b382ee3eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 13:42:17 +0200 Subject: [PATCH 231/359] #1320: add support for creating journey folders --- lib/metadataTypes/definitions/Folder.definition.js | 1 + lib/metadataTypes/definitions/Journey.definition.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/metadataTypes/definitions/Folder.definition.js b/lib/metadataTypes/definitions/Folder.definition.js index 445a85ad2..5d57756f6 100644 --- a/lib/metadataTypes/definitions/Folder.definition.js +++ b/lib/metadataTypes/definitions/Folder.definition.js @@ -38,6 +38,7 @@ export default { 'dataextension', 'filteractivity', 'filterdefinition', + 'journey', 'list', 'mysubs', 'publication', diff --git a/lib/metadataTypes/definitions/Journey.definition.js b/lib/metadataTypes/definitions/Journey.definition.js index 5a58ed9c5..47e479906 100644 --- a/lib/metadataTypes/definitions/Journey.definition.js +++ b/lib/metadataTypes/definitions/Journey.definition.js @@ -3,6 +3,7 @@ // insert: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/postCreateInteraction.html // update: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/putUpdateInteraction.html export default { + folderType: 'journey', bodyIteratorField: 'items', dependencies: [ 'folder-journey', From 4ec33779d41bf15553a3dcf5ed7af8961d8ec8e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 13:47:15 +0200 Subject: [PATCH 232/359] #1320: fine-tuning for REST payload --- lib/metadataTypes/Folder.js | 6 +++--- .../definitions/Folder.definition.js | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index b521af8ba..ae003ebdc 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -352,9 +352,9 @@ class Folder extends MetadataType { const path = metadataEntry.Path; try { const restPayload = { - ParentCatId: metadataEntry.ParentFolder.ID, - Name: metadataEntry.Name, - CatType: metadataEntry.ContentType, + parentCatId: metadataEntry.ParentFolder.ID, + name: metadataEntry.Name, + catType: metadataEntry.ContentType, }; const response = await super.createREST(restPayload, '/email/v1/category', true); if (response?.objectId) { diff --git a/lib/metadataTypes/definitions/Folder.definition.js b/lib/metadataTypes/definitions/Folder.definition.js index 5d57756f6..6b8e71af0 100644 --- a/lib/metadataTypes/definitions/Folder.definition.js +++ b/lib/metadataTypes/definitions/Folder.definition.js @@ -216,5 +216,26 @@ export default { retrieving: false, template: false, }, + catType: { + // REST only, equal to SOAP's ContentType + isCreateable: true, + isUpdateable: false, + retrieving: false, + template: false, + }, + name: { + // REST only, equal to SOAP's ParentFolder.ID + isCreateable: true, + isUpdateable: false, + retrieving: false, + template: false, + }, + parentCatId: { + // REST only, equal to SOAP's ParentFolder.ID + isCreateable: true, + isUpdateable: false, + retrieving: false, + template: false, + }, }, }; From a01ecb7ad69f382aab6f0c42931dc65f180b11b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 13:53:24 +0200 Subject: [PATCH 233/359] #1320: code comments --- lib/metadataTypes/Folder.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index ae003ebdc..0a81a6993 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -351,6 +351,7 @@ class Folder extends MetadataType { } const path = metadataEntry.Path; try { + // * We tried using the SOAP endpoint for creating folders but that did not support folders for automations nor journeys. This rest endpoint seems to cover everything though const restPayload = { parentCatId: metadataEntry.ParentFolder.ID, name: metadataEntry.Name, @@ -360,6 +361,7 @@ class Folder extends MetadataType { if (response?.objectId) { // convert the response to the same format as the SOAP response metadataEntry.ID = response.objectId; + // the following is a bit of a hack to make the response look like the SOAP response; not sure if we actually need that anywhere like this --> future developers feel free to double check const returnObject = { Results: [ { From bffeecb2eacb62edf642a5b14bdb4a7b2d0b9298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 14:01:47 +0200 Subject: [PATCH 234/359] #62: reworked event processing based on SalesforceObjectTriggerV2 might need future changes for the other 3 types --- lib/metadataTypes/Event.js | 13 + .../definitions/Event.definition.js | 254 +++++++++--------- 2 files changed, 143 insertions(+), 124 deletions(-) diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 34acc14da..b78dbe45a 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -201,7 +201,16 @@ class Event extends MetadataType { 'Name' ); metadata.arguments.dataExtensionId = metadata.dataExtensionId; + if (metadata.schema) { + delete metadata.schema; + } } + metadata.arguments.eventDefinitionKey = metadata.eventDefinitionKey; + + // standard values + metadata.isVisibleInPicker ||= false; + metadata.isPlatformObject = false; + metadata.mode = 'Production'; // potentially needs to be set to "1" instead return metadata; } @@ -222,6 +231,10 @@ class Event extends MetadataType { delete metadata.dataExtensionId; delete metadata.dataExtensionName; delete metadata.arguments.dataExtensionId; + if (metadata.schema) { + delete metadata.schema.id; + delete metadata.schema.name; + } } catch (ex) { Util.logger.verbose( ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ diff --git a/lib/metadataTypes/definitions/Event.definition.js b/lib/metadataTypes/definitions/Event.definition.js index 3a6a0fb86..41de287d5 100644 --- a/lib/metadataTypes/definitions/Event.definition.js +++ b/lib/metadataTypes/definitions/Event.definition.js @@ -16,6 +16,12 @@ export default { typeDescription: 'Used in Journeys (Interactions) to define Entry Events.', typeRetrieveByDefault: true, typeName: 'Journey: Entry Event Definition', + validTypes: [ + 'EmailAudience', // category: Audience; DEAudience-... + 'AutomationAudience', // category: Audience; DEAudience-... + 'APIEvent', // category: Event; APIEvent-... + 'SalesforceObjectTriggerV2', // category: Event; SalesforceObj... + ], fields: { 'arguments.audienceCount': { isCreateable: true, @@ -83,8 +89,8 @@ export default { 'arguments.dataExtensionId': { isCreateable: true, isUpdateable: true, - retrieving: true, - template: true, + retrieving: false, + template: false, }, 'arguments.dataTargetName': { isCreateable: true, @@ -132,8 +138,8 @@ export default { 'arguments.eventDefinitionKey': { isCreateable: true, isUpdateable: true, - retrieving: true, - template: true, + retrieving: false, + template: false, }, 'arguments.mid': { isCreateable: true, @@ -189,108 +195,108 @@ export default { retrieving: false, template: false, }, - 'configurationArguments.applicationExtensionKey': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.contactKey': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.contactPersonType': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.dataExtensionId': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.evaluationCriteriaSummary': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.eventDataConfig': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.eventDataSummary': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.objectAPIName': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.passThroughArgument': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.primaryObjectFilterCriteria': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.primaryObjectFilterSummary': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.relatedObjectFilterCriteria': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.relatedObjectFilterSummary': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.salesforceTriggerCriteria': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.unconfigured': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.version': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, - 'configurationArguments.whoToInject': { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, - }, + // 'configurationArguments.applicationExtensionKey': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.contactKey': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.contactPersonType': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.dataExtensionId': { + // isCreateable: false, + // isUpdateable: true, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.evaluationCriteriaSummary': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.eventDataConfig': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.eventDataSummary': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.objectAPIName': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.passThroughArgument': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.primaryObjectFilterCriteria': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.primaryObjectFilterSummary': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.relatedObjectFilterCriteria': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.relatedObjectFilterSummary': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.salesforceTriggerCriteria': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.unconfigured': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.version': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, + // 'configurationArguments.whoToInject': { + // isCreateable: false, + // isUpdateable: false, + // retrieving: false, + // template: false, + // }, createdBy: { isCreateable: false, isUpdateable: false, @@ -310,10 +316,10 @@ export default { template: false, }, dataExtensionName: { - isCreateable: true, - isUpdateable: true, - retrieving: true, - template: true, + isCreateable: false, + isUpdateable: false, + retrieving: false, + template: false, }, description: { isCreateable: true, @@ -336,7 +342,7 @@ export default { filterDefinitionId: { isCreateable: true, isUpdateable: true, - retrieving: false, + retrieving: true, template: false, }, filterDefinitionTemplate: { @@ -364,7 +370,7 @@ export default { template: false, }, isPlatformObject: { - isCreateable: true, + isCreateable: false, isUpdateable: true, retrieving: true, template: true, @@ -732,8 +738,8 @@ export default { mode: { isCreateable: true, isUpdateable: true, - retrieving: true, - template: true, + retrieving: false, + template: false, }, modifiedBy: { isCreateable: false, @@ -867,12 +873,6 @@ export default { retrieving: true, template: false, }, - 'schema.isPlatformObject': { - isCreateable: true, - isUpdateable: true, - retrieving: true, - template: true, - }, 'schema.fields': { isCreateable: true, isUpdateable: true, @@ -924,14 +924,14 @@ export default { 'schema.id': { isCreateable: false, isUpdateable: true, - retrieving: true, + retrieving: false, template: false, }, 'schema.name': { - isCreateable: true, + isCreateable: false, isUpdateable: true, - retrieving: true, - template: true, + retrieving: false, + template: false, }, 'schema.sendableCustomObjectField': { isCreateable: true, @@ -945,6 +945,12 @@ export default { retrieving: true, template: true, }, + 'schema.isPlatformObject': { + isCreateable: false, + isUpdateable: true, + retrieving: false, + template: false, + }, sourceApplicationExtensionId: { isCreateable: true, isUpdateable: true, From de374c76413ede428fed07eb2cb50b498e59917f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 14:38:42 +0200 Subject: [PATCH 235/359] #62: remove redundant triggeredSend info --- lib/metadataTypes/Journey.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 6330e6cb8..7217139f9 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -495,6 +495,10 @@ class Journey extends MetadataType { 'CustomerKey' ); delete activity.configurationArguments.triggeredSendId; + if (activity.configurationArguments.triggeredSend) { + // assumption is, that this stores potentially outdated triggeredSend info from the first version of the journey + delete activity.configurationArguments.triggeredSend; + } } } catch (ex) { Util.logger.warn( From 29c52b68244436a44a74fe192cfb38670c46a04d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 13:46:14 +0000 Subject: [PATCH 236/359] Bump chai from 5.1.0 to 5.1.1 Bumps [chai](https://github.com/chaijs/chai) from 5.1.0 to 5.1.1. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](https://github.com/chaijs/chai/compare/v5.1.0...v5.1.1) --- updated-dependencies: - dependency-name: chai dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 16 ++++++++-------- package.json | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index d24906ad6..97b0edcf3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -39,7 +39,7 @@ "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", - "chai": "5.1.0", + "chai": "5.1.1", "chai-files": "1.4.0", "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", @@ -1361,13 +1361,13 @@ ] }, "node_modules/chai": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.0.tgz", - "integrity": "sha512-kDZ7MZyM6Q1DhR9jy7dalKohXQ2yrlXkk59CR52aRKxJrobmlBNqnFQxX9xOX8w+4mz8SYlKJa/7D7ddltFXCw==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.1.1.tgz", + "integrity": "sha512-pT1ZgP8rPNqUgieVaEY+ryQr6Q4HXNg8Ei9UnLUrjN4IA7dvQC5JB+/kxVcPNDHyBcc/26CXPkbNzq3qwrOEKA==", "dev": true, "dependencies": { "assertion-error": "^2.0.1", - "check-error": "^2.0.0", + "check-error": "^2.1.1", "deep-eql": "^5.0.1", "loupe": "^3.1.0", "pathval": "^2.0.0" @@ -1415,9 +1415,9 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, "node_modules/check-error": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.0.0.tgz", - "integrity": "sha512-tjLAOBHKVxtPoHe/SA7kNOMvhCRdCJ3vETdeY0RuAc9popf+hyaSV6ZEg9hr4cpWF7jmo/JSWEnLDrnijS9Tog==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.1.tgz", + "integrity": "sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==", "dev": true, "engines": { "node": ">= 16" diff --git a/package.json b/package.json index 14505a517..4105b2065 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", - "chai": "5.1.0", + "chai": "5.1.1", "chai-files": "1.4.0", "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", From 59dbde3e7c0eb0d9da41680f8ea67758e6a29da2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 13:48:24 +0000 Subject: [PATCH 237/359] Bump eslint-plugin-jsdoc from 48.2.3 to 48.2.4 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.2.3 to 48.2.4. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.2.3...v48.2.4) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 54 ++++++++++++++++++++++++++++------------------- package.json | 2 +- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index 97b0edcf3..28665c8af 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.3", + "eslint-plugin-jsdoc": "48.2.4", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", @@ -279,11 +279,14 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.42.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.42.0.tgz", - "integrity": "sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==", + "version": "0.43.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", + "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", "dev": true, "dependencies": { + "@types/eslint": "^8.56.5", + "@types/estree": "^1.0.5", + "@typescript-eslint/types": "^7.2.0", "comment-parser": "1.4.1", "esquery": "^1.5.0", "jsdoc-type-pratt-parser": "~4.0.0" @@ -292,6 +295,19 @@ "node": ">=16" } }, + "node_modules/@es-joy/jsdoccomment/node_modules/@typescript-eslint/types": { + "version": "7.9.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz", + "integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -548,24 +564,20 @@ "dev": true }, "node_modules/@types/eslint": { - "version": "8.4.5", - "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.4.5.tgz", - "integrity": "sha512-dhsC09y1gpJWnK+Ff4SGvCuSnk9DaU0BJZSzOwa6GVSg65XtTugLBITDAAzRU5duGBoXBHpdR/9jHGxJjNflJQ==", + "version": "8.56.10", + "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.10.tgz", + "integrity": "sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==", "dev": true, - "optional": true, - "peer": true, "dependencies": { "@types/estree": "*", "@types/json-schema": "*" } }, "node_modules/@types/estree": { - "version": "0.0.52", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.52.tgz", - "integrity": "sha512-BZWrtCU0bMVAIliIV+HJO1f1PR41M7NKjfxrFJwwhKI1KwhwOxYw1SXg9ao+CIMt774nFuGiG6eU+udtbEI9oQ==", - "dev": true, - "optional": true, - "peer": true + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", + "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "dev": true }, "node_modules/@types/http-cache-semantics": { "version": "4.0.1", @@ -582,9 +594,7 @@ "version": "7.0.11", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", - "dev": true, - "optional": true, - "peer": true + "dev": true }, "node_modules/@types/mocha": { "version": "10.0.6", @@ -2297,12 +2307,12 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.3.tgz", - "integrity": "sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==", + "version": "48.2.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.4.tgz", + "integrity": "sha512-3ebvVgCJFy06gpmuS2ynz13uh9iFSzZ1C1dDkgcSAqVVg82zlORKMk2fvjq708pAO6bwfs5YLttknFEbaoDiGw==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.42.0", + "@es-joy/jsdoccomment": "~0.43.0", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.1", "debug": "^4.3.4", diff --git a/package.json b/package.json index 4105b2065..f03d8d117 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.3", + "eslint-plugin-jsdoc": "48.2.4", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", From 55419e94db25e6db017cf950d7ed532277b65526 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 May 2024 13:50:44 +0000 Subject: [PATCH 238/359] Bump @types/node from 20.12.7 to 20.12.12 Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 20.12.7 to 20.12.12. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node) --- updated-dependencies: - dependency-name: "@types/node" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 28665c8af..fa172923c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/mocha": "10.0.6", - "@types/node": "20.12.7", + "@types/node": "20.12.12", "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", @@ -603,9 +603,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.12.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.7.tgz", - "integrity": "sha512-wq0cICSkRLVaf3UGLMGItu/PtdY7oaXaI/RVU+xliKVOtRna3PRY57ZDfztpDL0n11vfymMUnXv8QwYCO7L1wg==", + "version": "20.12.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.12.tgz", + "integrity": "sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" diff --git a/package.json b/package.json index f03d8d117..ca729d31b 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ }, "devDependencies": { "@types/mocha": "10.0.6", - "@types/node": "20.12.7", + "@types/node": "20.12.12", "assert": "2.1.0", "axios-mock-adapter": "1.22.0", "c8": "9.1.0", From 1ff858a7406711d70cd65bbb7c7d7c2e3b48acff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 18:28:34 +0200 Subject: [PATCH 239/359] #62: small fixes --- lib/metadataTypes/Asset.js | 2 +- lib/metadataTypes/Event.js | 3 ++- lib/metadataTypes/definitions/Asset.definition.js | 6 +++--- lib/metadataTypes/definitions/Event.definition.js | 8 ++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index e8f2c249f..4f7d2fccb 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -710,7 +710,7 @@ class Asset extends MetadataType { }; metadata.views.html.template.data = { - email: { options: {} }, + email: { options: { generateFrom: null } }, }; metadata.views.html.template.availableViews = []; diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index b78dbe45a..4d1b965d1 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -202,7 +202,8 @@ class Event extends MetadataType { ); metadata.arguments.dataExtensionId = metadata.dataExtensionId; if (metadata.schema) { - delete metadata.schema; + metadata.schema.id = metadata.dataExtensionId; + metadata.schema.name = metadata.dataExtensionName; } } metadata.arguments.eventDefinitionKey = metadata.eventDefinitionKey; diff --git a/lib/metadataTypes/definitions/Asset.definition.js b/lib/metadataTypes/definitions/Asset.definition.js index f9dc15f4e..38c702eb6 100644 --- a/lib/metadataTypes/definitions/Asset.definition.js +++ b/lib/metadataTypes/definitions/Asset.definition.js @@ -56,10 +56,10 @@ export default { template: true, }, availableViews: { - isCreateable: false, - isUpdateable: false, + isCreateable: true, + isUpdateable: true, retrieving: true, - template: false, + template: true, }, modelVersion: { isCreateable: true, diff --git a/lib/metadataTypes/definitions/Event.definition.js b/lib/metadataTypes/definitions/Event.definition.js index 41de287d5..4bab3acf6 100644 --- a/lib/metadataTypes/definitions/Event.definition.js +++ b/lib/metadataTypes/definitions/Event.definition.js @@ -190,10 +190,10 @@ export default { template: true, }, configurationArguments: { - isCreateable: false, - isUpdateable: false, - retrieving: false, - template: false, + isCreateable: true, + isUpdateable: true, + retrieving: true, + template: true, }, // 'configurationArguments.applicationExtensionKey': { // isCreateable: false, From 5453e883f7faf66f85a934297443ede0690fd5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 18:49:50 +0200 Subject: [PATCH 240/359] #62: fix when redundant triggeredSend is removed --- lib/metadataTypes/Journey.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 7217139f9..1559f0023 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -495,10 +495,10 @@ class Journey extends MetadataType { 'CustomerKey' ); delete activity.configurationArguments.triggeredSendId; - if (activity.configurationArguments.triggeredSend) { - // assumption is, that this stores potentially outdated triggeredSend info from the first version of the journey - delete activity.configurationArguments.triggeredSend; - } + } + if (activity.configurationArguments.triggeredSend) { + // assumption is, that this stores potentially outdated triggeredSend info from the first version of the journey + delete activity.configurationArguments.triggeredSend; } } catch (ex) { Util.logger.warn( From 11bbb3511c8fb4b1be7af036ea1430ebe810a1b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 19:00:04 +0200 Subject: [PATCH 241/359] #62: regression fix for 5453e883f7faf66f85a934297443ede0690fd5fb --- lib/metadataTypes/Journey.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 1559f0023..d8dba0e33 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -496,7 +496,10 @@ class Journey extends MetadataType { ); delete activity.configurationArguments.triggeredSendId; } - if (activity.configurationArguments.triggeredSend) { + if ( + activity.configurationArguments?.triggeredSendKey && + activity.configurationArguments.triggeredSend + ) { // assumption is, that this stores potentially outdated triggeredSend info from the first version of the journey delete activity.configurationArguments.triggeredSend; } From 92926ac7c57d0e82b7925144c287c54bab9605ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 19:08:56 +0200 Subject: [PATCH 242/359] #1325: upgrade buildDefinition to accept --metadata --- lib/Builder.js | 28 ++++++++-------------------- lib/cli.js | 30 ++++++++++++++++++++++++++---- lib/index.js | 41 ++++++++++++++++++++++++++++++++++------- 3 files changed, 68 insertions(+), 31 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index 46740e707..35faa6644 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -62,23 +62,11 @@ saved * Builds a specific metadata file by name * * @param {string} metadataType metadata type to build - * @param {string} name name of metadata to build + * @param {string[]} nameArr name of metadata to build * @param {TemplateMap} templateVariables variables to be replaced in the metadata * @returns {Promise.} Promise */ - async _buildDefinition(metadataType, name, templateVariables) { - let nameArr; - /* eslint-disable unicorn/prefer-ternary */ - if (name.includes(',')) { - nameArr = name.split(',').map((item) => - // allow whitespace in comma-separated lists - item.trim() - ); - } else { - nameArr = [name.trim()]; - } - /* eslint-enable unicorn/prefer-ternary */ - + async _buildDefinition(metadataType, nameArr, templateVariables) { const type = metadataType; try { const result = await Promise.all( @@ -179,11 +167,11 @@ saved * * @param {string} businessUnit references credentials from properties.json * @param {string} selectedType supported metadata type - * @param {string} name name of the metadata + * @param {string[]} nameArr name of the metadata * @param {string} market market localizations * @returns {Promise.} - */ - static async buildDefinition(businessUnit, selectedType, name, market) { + static async buildDefinition(businessUnit, selectedType, nameArr, market) { const properties = await config.getProperties(); if (!(await config.checkProperties(properties))) { return null; @@ -201,7 +189,7 @@ saved if (buObject !== null) { const builder = new Builder(properties, buObject); if (Util.checkMarket(market, properties)) { - return builder._buildDefinition(selectedType, name, properties.markets[market]); + return builder._buildDefinition(selectedType, nameArr, properties.markets[market]); } } } @@ -210,10 +198,10 @@ saved * * @param {string} listName name of list of BU-market combos * @param {string} type supported metadata type - * @param {string} name name of the metadata + * @param {string[]} nameArr name of the metadata * @returns {Promise.} - */ - static async buildDefinitionBulk(listName, type, name) { + static async buildDefinitionBulk(listName, type, nameArr) { const properties = await config.getProperties(); if (!(await config.checkProperties(properties))) { return null; @@ -248,7 +236,7 @@ saved if (Util.checkMarket(market, properties)) { Util.logger.info(`Executing for '${businessUnit}': '${market}'`); // omitting "await" to speed up creation - bdPromises.push(this.buildDefinition(businessUnit, type, name, market)); + bdPromises.push(this.buildDefinition(businessUnit, type, nameArr, market)); } } } diff --git a/lib/cli.js b/lib/cli.js index ece283ce5..831939f22 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -370,7 +370,7 @@ yargs(hideBin(process.argv)) }) // @ts-expect-error .command({ - command: 'buildDefinition ', + command: 'buildDefinition [TYPE] [FILENAME] [MARKET]', aliases: ['bd'], desc: 'builds metadata definition based on template', builder: (yargs) => { @@ -389,12 +389,34 @@ yargs(hideBin(process.argv)) }) .positional('MARKET', { type: 'string', - describe: 'the business unit to deploy to', + describe: 'market used for building deployable definition', + }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Options for buildDefinition:', + describe: 'type:key combos to build template for', + }) + .option('market', { + type: 'string', + group: 'Options for buildDefinition:', + describe: 'market used for building deployable definition', }); }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.buildDefinition(argv.BU, argv.TYPE, argv.FILENAME, argv.MARKET); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + Mcdev.buildDefinition( + argv.BU, + argv.TYPE, + csvToArray(argv.FILENAME), + argv.MARKET || argv.market + ); + } else { + Mcdev.buildDefinition(argv.BU, typeKeyCombo, null, argv.MARKET || argv.market); + } + // Mcdev.buildDefinition(argv.BU, argv.TYPE, argv.FILENAME, argv.MARKET); }, }) // @ts-expect-error @@ -419,7 +441,7 @@ yargs(hideBin(process.argv)) }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, argv.FILENAME); + Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, csvToArray(argv.FILENAME)); }, }) // @ts-expect-error diff --git a/lib/index.js b/lib/index.js index 119328912..0b52df816 100644 --- a/lib/index.js +++ b/lib/index.js @@ -794,15 +794,42 @@ class Mcdev { * Build a specific metadata file based on a template. * * @param {string} businessUnit references credentials from properties.json - * @param {string} selectedType supported metadata type - * @param {string} name name of the metadata + * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type + * @param {string[]} nameArr name of the metadata * @param {string} market market localizations * @returns {Promise.} - */ - static async buildDefinition(businessUnit, selectedType, name, market) { + static async buildDefinition(businessUnit, selectedTypes, nameArr, market) { Util.startLogger(); Util.logger.info('mcdev:: Build Definition from Template'); - return Builder.buildDefinition(businessUnit, selectedType, name, market); + let selectedTypesArr; + if ('string' === typeof selectedTypes) { + selectedTypesArr = [selectedTypes]; + } else { + selectedTypesArr = Object.keys(selectedTypes); + // check if types are valid + for (const selectedType of selectedTypesArr) { + if (!Util._isValidType(selectedType)) { + return; + } + if (!Array.isArray(selectedTypes[selectedType])) { + // we need an array of keys here + return; + } + } + } + /** @type {MultiMetadataTypeList} */ + const returnObj = {}; + for (const selectedType of selectedTypesArr) { + const result = await Builder.buildDefinition( + businessUnit, + selectedType, + 'string' === typeof selectedTypes ? nameArr : selectedTypes[selectedType], + market + ); + returnObj[selectedType] = result[selectedType]; + } + return returnObj; } /** @@ -810,13 +837,13 @@ class Mcdev { * * @param {string} listName name of list of BU-market combos * @param {string} type supported metadata type - * @param {string} name name of the metadata + * @param {string[]} nameArr name of the metadata * @returns {Promise.} - */ - static async buildDefinitionBulk(listName, type, name) { + static async buildDefinitionBulk(listName, type, nameArr) { Util.startLogger(); Util.logger.info('mcdev:: Build Definition from Template Bulk'); - return Builder.buildDefinitionBulk(listName, type, name); + return Builder.buildDefinitionBulk(listName, type, nameArr); } /** * From 16d14d6d35aa40622428eb80471a97360d113d4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 19:10:41 +0200 Subject: [PATCH 243/359] #1325: upgrade buildTemplate to accept --metadata --- lib/cli.js | 25 +++++++++++++++++++++++-- lib/index.js | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 831939f22..e359eefa5 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -340,7 +340,7 @@ yargs(hideBin(process.argv)) }) // @ts-expect-error .command({ - command: 'buildTemplate ', + command: 'buildTemplate [TYPE] [KEY] [MARKET]', aliases: ['bt'], desc: 'builds a template out of a specific metadata file already in your retrieve folder', builder: (yargs) => { @@ -361,11 +361,32 @@ yargs(hideBin(process.argv)) .positional('MARKET', { type: 'string', describe: 'market used for reverse building template', + }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Options for buildTemplate:', + describe: 'type:key combos to build template for', + }) + .option('market', { + type: 'string', + group: 'Options for buildTemplate:', + describe: 'market used for reverse building template', }); }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.buildTemplate(argv.BU, argv.TYPE, csvToArray(argv.KEY), argv.MARKET); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + Mcdev.buildTemplate( + argv.BU, + argv.TYPE, + csvToArray(argv.KEY), + argv.MARKET || argv.market + ); + } else { + Mcdev.buildTemplate(argv.BU, typeKeyCombo, null, argv.MARKET || argv.market); + } }, }) // @ts-expect-error diff --git a/lib/index.js b/lib/index.js index 0b52df816..0456c481c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -780,15 +780,42 @@ class Mcdev { * Build a template based on a list of metadata files in the retrieve folder. * * @param {string} businessUnit references credentials from properties.json - * @param {string} selectedType supported metadata type + * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type * @param {string[]} keyArr customerkey of the metadata * @param {string} market market localizations * @returns {Promise.} - */ - static async buildTemplate(businessUnit, selectedType, keyArr, market) { + static async buildTemplate(businessUnit, selectedTypes, keyArr, market) { Util.startLogger(); Util.logger.info('mcdev:: Build Template from retrieved files'); - return Builder.buildTemplate(businessUnit, selectedType, keyArr, market); + let selectedTypesArr; + if ('string' === typeof selectedTypes) { + selectedTypesArr = [selectedTypes]; + } else { + selectedTypesArr = Object.keys(selectedTypes); + // check if types are valid + for (const selectedType of selectedTypesArr) { + if (!Util._isValidType(selectedType)) { + return; + } + if (!Array.isArray(selectedTypes[selectedType])) { + // we need an array of keys here + return; + } + } + } + /** @type {MultiMetadataTypeList} */ + const returnObj = {}; + for (const selectedType of selectedTypesArr) { + const result = await Builder.buildTemplate( + businessUnit, + selectedType, + 'string' === typeof selectedTypes ? keyArr : selectedTypes[selectedType], + market + ); + returnObj[selectedType] = result[selectedType]; + } + return returnObj; } /** * Build a specific metadata file based on a template. From e73f3f39fc9829cc7139a4a0997315406e64f084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 19:18:06 +0200 Subject: [PATCH 244/359] #0: add deprecation notice to retrieveAsTemplate --- lib/cli.js | 3 ++- lib/index.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index e359eefa5..b59ef2495 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -312,7 +312,7 @@ yargs(hideBin(process.argv)) .command({ command: 'retrieveAsTemplate ', aliases: ['rt'], - desc: 'Retrieves a specific metadata file by name from the server for templating', + desc: '[DEPRECATED] Retrieves a specific metadata file by name from the server for templating', builder: (yargs) => { yargs .positional('BU', { @@ -337,6 +337,7 @@ yargs(hideBin(process.argv)) Mcdev.setOptions(argv); Mcdev.retrieveAsTemplate(argv.BU, argv.TYPE, csvToArray(argv.NAME), argv.MARKET); }, + deprecated: true, }) // @ts-expect-error .command({ diff --git a/lib/index.js b/lib/index.js index 0456c481c..38646935a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -745,7 +745,9 @@ class Mcdev { */ static async retrieveAsTemplate(businessUnit, selectedType, name, market) { Util.startLogger(); - Util.logger.info('mcdev:: Retrieve as Template'); + Util.logger.warn( + 'mcdev:: [DEPRECATED] Retrieve as Template [DEPRECATED] - use "retrieve" + "buildTemplate" instead' + ); const properties = await config.getProperties(); if (!(await config.checkProperties(properties))) { return null; From af1b42a1c25ce00765923db73ed2aabee78303bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 19:19:56 +0200 Subject: [PATCH 245/359] #0: update copyright notice in yargs help to 2024 --- lib/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index b59ef2495..9286960b2 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -791,7 +791,7 @@ yargs(hideBin(process.argv)) .recommendCommands() .wrap(yargs(hideBin(process.argv)).terminalWidth()) .epilog( - 'Copyright 2023. Accenture. Get support at https://github.com/Accenture/sfmc-devtools/issues' + 'Copyright 2024. Accenture. Get support at https://github.com/Accenture/sfmc-devtools/issues' ) .help().argv; From 8391f4768b9c98728e6d49ced7198fc94865e407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 15 May 2024 19:33:53 +0200 Subject: [PATCH 246/359] #1325: adapt test cases to changed parameter type --- test/type.automation.test.js | 4 ++-- test/type.dataExtension.test.js | 4 ++-- test/type.dataExtract.test.js | 4 ++-- test/type.emailSend.test.js | 2 +- test/type.fileTransfer.test.js | 4 ++-- test/type.importFile.test.js | 4 ++-- test/type.journey.test.js | 2 +- test/type.mobileKeyword.test.js | 2 +- test/type.mobileMessage.test.js | 2 +- test/type.query.test.js | 4 ++-- test/type.script.test.js | 4 ++-- test/type.sendClassification.test.js | 2 +- test/type.senderProfile.test.js | 2 +- test/type.transactionalEmail.test.js | 2 +- test/type.transactionalPush.test.js | 2 +- test/type.transactionalSMS.test.js | 2 +- test/type.triggeredSend.test.js | 2 +- test/type.user.test.js | 2 +- test/type.verification.test.js | 2 +- 19 files changed, 26 insertions(+), 26 deletions(-) diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 5e143625b..96cc86460 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -604,7 +604,7 @@ describe('type: automation', () => { await handler.buildDefinition( 'testInstance/testBU', 'automation', - 'testExisting_automation', + ['testExisting_automation'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -647,7 +647,7 @@ describe('type: automation', () => { await handler.buildDefinition( 'testInstance/testBU', 'automation', - 'testExisting_automation', + ['testExisting_automation'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index d615f0d95..d53101ed8 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -272,7 +272,7 @@ describe('type: dataExtension', () => { await handler.buildDefinition( 'testInstance/testBU', 'dataExtension', - 'testExisting_dataExtension', + ['testExisting_dataExtension'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -318,7 +318,7 @@ describe('type: dataExtension', () => { await handler.buildDefinition( 'testInstance/testBU', 'dataExtension', - 'testExisting_dataExtension', + ['testExisting_dataExtension'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.dataExtract.test.js b/test/type.dataExtract.test.js index 1677e0079..d204fa0ac 100644 --- a/test/type.dataExtract.test.js +++ b/test/type.dataExtract.test.js @@ -109,7 +109,7 @@ describe('type: dataExtract', () => { await handler.buildDefinition( 'testInstance/testBU', 'dataExtract', - 'testExisting_dataExtract', + ['testExisting_dataExtract'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -151,7 +151,7 @@ describe('type: dataExtract', () => { await handler.buildDefinition( 'testInstance/testBU', 'dataExtract', - 'testExisting_dataExtract', + ['testExisting_dataExtract'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.emailSend.test.js b/test/type.emailSend.test.js index 54d12e0ad..ebd055a12 100644 --- a/test/type.emailSend.test.js +++ b/test/type.emailSend.test.js @@ -109,7 +109,7 @@ describe('type: emailSend', () => { await handler.buildDefinition( 'testInstance/testBU', 'emailSend', - 'testExisting_emailSend', + ['testExisting_emailSend'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.fileTransfer.test.js b/test/type.fileTransfer.test.js index 72eed54c1..c93dc40dd 100644 --- a/test/type.fileTransfer.test.js +++ b/test/type.fileTransfer.test.js @@ -106,7 +106,7 @@ describe('type: fileTransfer', () => { await handler.buildDefinition( 'testInstance/testBU', 'fileTransfer', - 'testExisting_fileTransfer', + ['testExisting_fileTransfer'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -148,7 +148,7 @@ describe('type: fileTransfer', () => { await handler.buildDefinition( 'testInstance/testBU', 'fileTransfer', - 'testExisting_fileTransfer', + ['testExisting_fileTransfer'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.importFile.test.js b/test/type.importFile.test.js index 1de52f156..81335cd85 100644 --- a/test/type.importFile.test.js +++ b/test/type.importFile.test.js @@ -141,7 +141,7 @@ describe('type: importFile', () => { await handler.buildDefinition( 'testInstance/testBU', 'importFile', - 'testExisting_importFile', + ['testExisting_importFile'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -183,7 +183,7 @@ describe('type: importFile', () => { await handler.buildDefinition( 'testInstance/testBU', 'importFile', - 'testExisting_importFile', + ['testExisting_importFile'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 421d06c19..7ffc6aa7e 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -217,7 +217,7 @@ describe('type: journey', () => { await handler.buildDefinition( 'testInstance/testBU', 'journey', - 'testExisting_journey_Quicksend', + ['testExisting_journey_Quicksend'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.mobileKeyword.test.js b/test/type.mobileKeyword.test.js index 613844ff3..0f10856df 100644 --- a/test/type.mobileKeyword.test.js +++ b/test/type.mobileKeyword.test.js @@ -211,7 +211,7 @@ describe('type: mobileKeyword', () => { await handler.buildDefinition( 'testInstance/testBU', 'mobileKeyword', - '4912312345678.TESTEXISTING_KEYWORD', + ['4912312345678.TESTEXISTING_KEYWORD'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.mobileMessage.test.js b/test/type.mobileMessage.test.js index 691acc40d..8823496d9 100644 --- a/test/type.mobileMessage.test.js +++ b/test/type.mobileMessage.test.js @@ -141,7 +141,7 @@ describe('type: mobileMessage', () => { await handler.buildDefinition( 'testInstance/testBU', 'mobileMessage', - 'NTIzOjc4OjA', + ['NTIzOjc4OjA'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.query.test.js b/test/type.query.test.js index 69949bae0..232d04cc2 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -755,7 +755,7 @@ describe('type: query', () => { await handler.buildDefinition( 'testInstance/testBU', 'query', - 'testExisting_query', + ['testExisting_query'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -807,7 +807,7 @@ describe('type: query', () => { await handler.buildDefinition( 'testInstance/testBU', 'query', - 'testExisting_query', + ['testExisting_query'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.script.test.js b/test/type.script.test.js index 328dacb00..c40cdcfb9 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -297,7 +297,7 @@ describe('type: script', () => { await handler.buildDefinition( 'testInstance/testBU', 'script', - 'testExisting_script', + ['testExisting_script'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); @@ -349,7 +349,7 @@ describe('type: script', () => { await handler.buildDefinition( 'testInstance/testBU', 'script', - 'testExisting_script', + ['testExisting_script'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.sendClassification.test.js b/test/type.sendClassification.test.js index 6e88f865a..d269cf4d0 100644 --- a/test/type.sendClassification.test.js +++ b/test/type.sendClassification.test.js @@ -118,7 +118,7 @@ describe('type: sendClassification', () => { await handler.buildDefinition( 'testInstance/testBU', 'sendClassification', - 'testExisting_sendClassification', + ['testExisting_sendClassification'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.senderProfile.test.js b/test/type.senderProfile.test.js index a148880aa..90356b34e 100644 --- a/test/type.senderProfile.test.js +++ b/test/type.senderProfile.test.js @@ -112,7 +112,7 @@ describe('type: senderProfile', () => { await handler.buildDefinition( 'testInstance/testBU', 'senderProfile', - 'testExisting_senderProfile', + ['testExisting_senderProfile'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.transactionalEmail.test.js b/test/type.transactionalEmail.test.js index 56d690c62..a3d0a8447 100644 --- a/test/type.transactionalEmail.test.js +++ b/test/type.transactionalEmail.test.js @@ -126,7 +126,7 @@ describe('type: transactionalEmail', () => { await handler.buildDefinition( 'testInstance/testBU', 'transactionalEmail', - 'testExisting_temail', + ['testExisting_temail'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.transactionalPush.test.js b/test/type.transactionalPush.test.js index d45bc0b50..5a0221b4b 100644 --- a/test/type.transactionalPush.test.js +++ b/test/type.transactionalPush.test.js @@ -126,7 +126,7 @@ describe('type: transactionalPush', () => { await handler.buildDefinition( 'testInstance/testBU', 'transactionalPush', - 'testExisting_tpush', + ['testExisting_tpush'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.transactionalSMS.test.js b/test/type.transactionalSMS.test.js index ee19fe601..8915390a5 100644 --- a/test/type.transactionalSMS.test.js +++ b/test/type.transactionalSMS.test.js @@ -151,7 +151,7 @@ describe('type: transactionalSMS', () => { await handler.buildDefinition( 'testInstance/testBU', 'transactionalSMS', - 'testExisting_tsms', + ['testExisting_tsms'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index 5fd16de52..5bfcc87b2 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -111,7 +111,7 @@ describe('type: triggeredSend', () => { await handler.buildDefinition( 'testInstance/testBU', 'triggeredSend', - 'testExisting_triggeredSend', + ['testExisting_triggeredSend'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.user.test.js b/test/type.user.test.js index d512482c6..16100fe2f 100644 --- a/test/type.user.test.js +++ b/test/type.user.test.js @@ -198,7 +198,7 @@ describe('type: user', () => { await handler.buildDefinition( 'testInstance/_ParentBU_', 'user', - 'testExisting_user', + ['testExisting_user'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); diff --git a/test/type.verification.test.js b/test/type.verification.test.js index c2aa57f8c..34a17cc16 100644 --- a/test/type.verification.test.js +++ b/test/type.verification.test.js @@ -133,7 +133,7 @@ describe('type: verification', () => { await handler.buildDefinition( 'testInstance/testBU', 'verification', - 'testExisting_39f6a488-20eb-4ba0-b0b9', + ['testExisting_39f6a488-20eb-4ba0-b0b9'], 'testTargetMarket' ); assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); From 9724aa8373e5fd085f18ba31dda551a0d362e03b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 00:17:44 +0200 Subject: [PATCH 247/359] #1296: handle unknown keys gracefully in buildTemplate --- lib/Builder.js | 4 ++-- lib/metadataTypes/MetadataType.js | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index 35faa6644..e722dd6ba 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -154,8 +154,8 @@ saved ); }) ); - if (result) { - this.metadata[result[0].type] = result.map((element) => element.metadata); + if (result && type === result[0].type) { + this.metadata[type] = result.filter(Boolean).map((element) => element.metadata); } } catch (ex) { Util.logger.errorStack(ex, 'mcdev.buildTemplate'); diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index bc9d5caf3..397fb3994 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -369,6 +369,13 @@ class MetadataType { } // return; } + if (!metadataStr) { + Util.logger.info( + Util.getGrayMsg(`- skipped ${this.definition.type} ${key}: not found`) + ); + return; + } + if (this.definition.stringifyFieldsBeforeTemplate) { // numeric fields are returned as numbers by the SDK/API. If we try to replace them in buildTemplate it would break the JSON format - but not if we stringify them first because then the {{{var}}} is in quotes metadataStr = JSON.parse(metadataStr); From c482414338685884ec5c2abc0d91866ea60d0c86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 00:28:35 +0200 Subject: [PATCH 248/359] #1296: handle unknown keys gracefully in buildDefinition --- lib/Builder.js | 7 ++----- lib/metadataTypes/MetadataType.js | 8 ++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index e722dd6ba..738984d33 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -86,11 +86,8 @@ saved ); }) ); - if (result) { - this.metadata[result[0].type] = []; - for (const element of result) { - this.metadata[result[0].type].push(element.metadata); - } + if (result && type === result[0].type) { + this.metadata[type] = result.filter(Boolean).map((element) => element.metadata); } } catch (ex) { Util.logger.errorStack(ex, 'mcdev.buildDefinition'); diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 397fb3994..153515858 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1968,6 +1968,14 @@ class MetadataType { } // return; } + if (!metadataStr) { + Util.logger.info( + Util.getGrayMsg( + `- skipped ${this.definition.type} ${templateName}: template not found` + ) + ); + return; + } let metadata; try { From b0390323840aac8032d071304718efcbfed6e637 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 00:31:55 +0200 Subject: [PATCH 249/359] #1325: add test case for multi-type buildTemplate/buildDefinition --- test/general.test.js | 109 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/test/general.test.js b/test/general.test.js index 735fb9c4d..be9751cd9 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -6,6 +6,7 @@ import chaiFiles from 'chai-files'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); +const file = chaiFiles.file; describe('GENERAL', () => { beforeEach(() => { @@ -284,6 +285,114 @@ describe('GENERAL', () => { ); }); }); + + describe('template --metadata ~~~', () => { + it('buildDefinition and buildTemplate multiple type with keys', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['automation', 'query']); + + const expectedApiCallsRetrieve = 25; + assert.equal( + testUtils.getAPIHistoryLength(), + expectedApiCallsRetrieve, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + + // preparation + const argvMetadata = [ + 'automation:testExisting_automation', + 'query:testExisting_query', + 'query:bad', + ]; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + + // *** buildTemplate *** + const templateResult = await handler.buildTemplate( + buName, + typeKeyCombo, + null, + 'testSourceMarket' + ); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); + // check automation + assert.equal( + templateResult.automation ? Object.keys(templateResult.automation).length : 0, + 1, + 'only one automation expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'template'), + 'returned template was not equal expected' + ); + // check query + assert.equal( + templateResult.query ? Object.keys(templateResult.query).length : 0, + 1, + 'only one query expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'template'), + 'returned template JSON of retrieveAsTemplate was not equal expected' + ); + expect( + file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + + // *** buildDefinition *** + const definitionResult = await handler.buildDefinition( + buName, + typeKeyCombo, + null, + 'testTargetMarket' + ); + assert.equal( + process.exitCode, + 0, + 'buildDefinition should not have thrown an error' + ); + + // check automation + assert.equal( + definitionResult.automation ? Object.keys(templateResult.automation).length : 0, + 1, + 'only one automation expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'build'), + 'returned deployment file was not equal expected' + ); + + // check query + assert.equal( + definitionResult.query ? Object.keys(templateResult.query).length : 0, + 1, + 'only one query expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'build'), + 'returned deployment JSON was not equal expected' + ); + expect( + file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + + assert.equal( + testUtils.getAPIHistoryLength() - expectedApiCallsRetrieve, + 0, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); + }); }); describe('without --metadata ================', () => { From 1a149f33fd412aa7f6c7003255a4ffa007df4927 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 10:23:12 +0200 Subject: [PATCH 250/359] #1324: fix buildTemplate for asset-message and asset-template, webpage --- lib/metadataTypes/Asset.js | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 4f7d2fccb..b62ed6439 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1026,13 +1026,14 @@ class Asset extends MetadataType { let readDirArr; // unfortunately, asset's key can contain spaces at beginning/end which can break the file system when folders are created with it const customerKey = metadata.customerKey.trim(); + const templateFileName = templateName || customerKey; switch (metadata.assetType.name) { case 'templatebasedemail': // message case 'htmlemail': { // message // this complex type always creates its own subdir per asset subDirArr = [this.definition.type, subType]; - readDirArr = [deployDir, ...subDirArr, templateName || customerKey]; + readDirArr = [deployDir, ...subDirArr, templateFileName]; // metadata.views.html.content (mandatory) // the main content can be empty (=not set up yet) hence check if we did extract sth or else readFile() will print error msgs @@ -1054,7 +1055,7 @@ class Asset extends MetadataType { if (templateName) { // to use this method in templating, store a copy of the info in fileList fileList.push({ - subFolder: [...subDirArr, customerKey], + subFolder: [...subDirArr, templateFileName], fileName: fileName, fileExt: 'html', content: metadata.views.html.content, @@ -1082,7 +1083,7 @@ class Asset extends MetadataType { // template-template // this complex type always creates its own subdir per asset subDirArr = [this.definition.type, subType]; - readDirArr = [deployDir, ...subDirArr, templateName || customerKey]; + readDirArr = [deployDir, ...subDirArr, templateFileName]; const fileName = 'content' + subtypeExtension; const fileExtArr = ['html']; // eslint-disable-line no-case-declarations @@ -1103,7 +1104,7 @@ class Asset extends MetadataType { if (templateName) { // to use this method in templating, store a copy of the info in fileList fileList.push({ - subFolder: subDirArr, + subFolder: [...subDirArr, templateFileName], fileName: fileName, fileExt: ext, content: metadata.content, @@ -1140,7 +1141,7 @@ class Asset extends MetadataType { await File.pathExists( File.normalizePath([ ...readDirArr, - `${templateName || customerKey}${subtypeExtension}.html`, + `${templateFileName}${subtypeExtension}.html`, ]) ) ) { @@ -1148,7 +1149,7 @@ class Asset extends MetadataType { if (!fileListOnly) { metadata.views.text.content = await File.readFilteredFilename( readDirArr, - (templateName || customerKey) + subtypeExtension, + templateFileName + subtypeExtension, 'html' ); } @@ -1156,7 +1157,7 @@ class Asset extends MetadataType { // to use this method in templating, store a copy of the info in fileList fileList.push({ subFolder: subDirArr, - fileName: customerKey + subtypeExtension, + fileName: templateFileName + subtypeExtension, fileExt: 'html', content: metadata.views.text.content, }); @@ -1168,7 +1169,7 @@ class Asset extends MetadataType { // asset // this complex type always creates its own subdir per asset subDirArr = [this.definition.type, subType]; - readDirArr = [deployDir, ...subDirArr, templateName || customerKey]; + readDirArr = [deployDir, ...subDirArr, templateFileName]; // metadata.views.html.slots.<>.blocks.<>.content (optional) (pre & post 20222) if (metadata?.views?.html?.slots) { @@ -1206,7 +1207,7 @@ class Asset extends MetadataType { if (templateName) { // to use this method in templating, store a copy of the info in fileList fileList.push({ - subFolder: [...subDirArr, customerKey], + subFolder: [...subDirArr, templateFileName], fileName: 'views.html.content' + subtypeExtension, fileExt: 'html', content: metadata.views.html.content, @@ -1232,7 +1233,7 @@ class Asset extends MetadataType { if (templateName) { // to use this method in templating, store a copy of the info in fileList fileList.push({ - subFolder: [...subDirArr, customerKey], + subFolder: [...subDirArr, templateFileName], fileName: 'content' + subtypeExtension, fileExt: 'html', content: metadata.views.html.content, @@ -1260,7 +1261,7 @@ class Asset extends MetadataType { await File.pathExists( File.normalizePath([ ...readDirArr, - `${templateName || customerKey}${subtypeExtension}.${ext}`, + `${templateFileName}${subtypeExtension}.${ext}`, ]) ) ) { @@ -1268,7 +1269,7 @@ class Asset extends MetadataType { if (!fileListOnly) { metadata.content = await File.readFilteredFilename( readDirArr, - (templateName || customerKey) + subtypeExtension, + templateFileName + subtypeExtension, ext ); if (ext === 'ssjs') { @@ -1279,7 +1280,7 @@ class Asset extends MetadataType { // to use this method in templating, store a copy of the info in fileList fileList.push({ subFolder: subDirArr, - fileName: (templateName || customerKey) + subtypeExtension, + fileName: templateFileName + subtypeExtension, fileExt: ext, content: metadata.content, }); @@ -1318,6 +1319,8 @@ class Asset extends MetadataType { templateName, fileListOnly = false ) { + const templateFileName = templateName || customerKey; + for (const slot in metadataSlots) { if (Object.prototype.hasOwnProperty.call(metadataSlots, slot)) { const slotObj = metadataSlots[slot]; @@ -1347,7 +1350,7 @@ class Asset extends MetadataType { if (templateName) { // to use this method in templating, store a copy of the info in fileList fileList.push({ - subFolder: [...subDirArr, customerKey, 'blocks'], + subFolder: [...subDirArr, templateFileName, 'blocks'], fileName: fileName, fileExt: 'html', content: slotObj.blocks[block].content, From 1114c4ce288658670fc64786bc67c7b41d4582cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 10:25:40 +0200 Subject: [PATCH 251/359] #798: ensure MID can be templated in memberId field of assets without breaking json --- lib/metadataTypes/Asset.js | 2 +- lib/metadataTypes/MetadataType.js | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index b62ed6439..aa3021117 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -734,7 +734,7 @@ class Asset extends MetadataType { if ( !Util.OPTIONS.noMidSuffix && this.buObject.mid && - metadata.memberId !== this.buObject.mid && + metadata.memberId != this.buObject.mid && // soft comparison to accomodate for string-version of mid !metadata[this.definition.keyField].endsWith(this.buObject.mid) ) { // #3 make sure customer key is unique by suffixing it with target MID (unless we are deploying to the same MID) diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 153515858..75cc09f75 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -396,6 +396,12 @@ class MetadataType { } metadataStr = JSON.stringify(metadataStr); } + if (this.definition.type === 'asset') { + // turn memberId integer to string to ensure it does not get replaced with a templateVariable + const temp = JSON.parse(metadataStr); + temp.memberId = temp.memberId.toString(); + metadataStr = JSON.stringify(temp); + } const metadata = JSON.parse(Util.replaceByObject(metadataStr, templateVariables)); this.keepTemplateFields(metadata); From 22f06c89bc5451926d6c6d27b3586245fd5140ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 10:43:08 +0200 Subject: [PATCH 252/359] #1324: handle template-source-not-found more gracefully for asset --- lib/Builder.js | 3 ++- lib/metadataTypes/Asset.js | 8 -------- lib/metadataTypes/MetadataType.js | 20 +++++++------------- 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index 738984d33..e0ceb1814 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -151,7 +151,8 @@ saved ); }) ); - if (result && type === result[0].type) { + if (result && type === result[0]?.type) { + // result elements can be undefined for each key that we did not find this.metadata[type] = result.filter(Boolean).map((element) => element.metadata); } } catch (ex) { diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index aa3021117..cc599a110 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1665,14 +1665,6 @@ class Asset extends MetadataType { break; } } - if (!subType) { - throw new Error( - `Could not find asset with name ${templateName} in ${File.normalizePath([ - templateDir, - ...typeDirArr, - ])}` - ); - } return subType; } /** diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 75cc09f75..1a4bf6516 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -359,21 +359,15 @@ class MetadataType { ex ); } catch { - throw new Error( - `${this.definition.type}:: Could not find ./${File.normalizePath([ - retrieveDir, - ...typeDirArr, - fileName + '.json', - ])}.` + // only happening for types that use readSecondaryFolder (e.g. asset) + // if we still have no metadataStr then we have to skip this metadata for all types and hence handle it outside of this catch + } + if (!metadataStr) { + Util.logger.warn( + Util.getGrayMsg(`- skipped ${this.definition.type} ${key}: not found`) ); + return; } - // return; - } - if (!metadataStr) { - Util.logger.info( - Util.getGrayMsg(`- skipped ${this.definition.type} ${key}: not found`) - ); - return; } if (this.definition.stringifyFieldsBeforeTemplate) { From ee206255fd3535f9f601eaa4062933bea0ea972f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 10:49:26 +0200 Subject: [PATCH 253/359] #1324: handle template more gracefully for asset --- lib/Builder.js | 3 ++- lib/metadataTypes/MetadataType.js | 24 +++++++++--------------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index e0ceb1814..db3883b62 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -86,7 +86,8 @@ saved ); }) ); - if (result && type === result[0].type) { + if (result && type === result[0]?.type) { + // result elements can be undefined for each key that we did not find this.metadata[type] = result.filter(Boolean).map((element) => element.metadata); } } catch (ex) { diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 1a4bf6516..ea0584364 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1958,23 +1958,17 @@ class MetadataType { ex ); } catch { - throw new Error( - `${this.definition.type}:: Could not find ./${File.normalizePath([ - templateDir, - ...typeDirArr, - fileName + '.json', - ])}.` + // only happening for types that use readSecondaryFolder (e.g. asset) + // if we still have no metadataStr then we have to skip this metadata for all types and hence handle it outside of this catch + } + if (!metadataStr) { + Util.logger.warn( + Util.getGrayMsg( + `- skipped ${this.definition.type} ${templateName}: template not found` + ) ); + return; } - // return; - } - if (!metadataStr) { - Util.logger.info( - Util.getGrayMsg( - `- skipped ${this.definition.type} ${templateName}: template not found` - ) - ); - return; } let metadata; From 40a77a46ff66d71982854a4570f3747b8f1886b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 11:26:00 +0200 Subject: [PATCH 254/359] #1324: fix buildDefinition for types with their own subfolder per item --- lib/metadataTypes/Asset.js | 3 +++ lib/metadataTypes/MetadataType.js | 7 ++++--- lib/metadataTypes/Query.js | 13 +------------ 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index cc599a110..8464b6a1d 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -922,6 +922,9 @@ class Asset extends MetadataType { }: ${extractedFile.fileName}.${extractedFile.fileExt}.` ); } + extractedFile.subFolder = extractedFile.subFolder + .map((el) => (el === templateName ? metadata[this.definition.keyField] : el)) + .map((el) => this.applyTemplateValues(el, templateVariables)); } // #2 binary extracts diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index ea0584364..c7e41916e 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1974,8 +1974,10 @@ class MetadataType { let metadata; try { // update all initial variables & create metadata object - metadata = JSON.parse(Mustache.render(metadataStr, variables, {}, ['{{{', '}}}'])); - typeDirArr = typeDirArr.map((el) => Mustache.render(el, variables, {}, ['{{{', '}}}'])); + metadata = JSON.parse(this.applyTemplateValues(metadataStr, variables)); + typeDirArr = typeDirArr + .map((el) => (el === templateName ? metadata[this.definition.keyField] : el)) + .map((el) => this.applyTemplateValues(el, variables)); } catch { throw new Error( `${this.definition.type}:: Error applying template variables on ${ @@ -1998,7 +2000,6 @@ class MetadataType { try { // write to file const targetDirArr = Array.isArray(targetDir) ? targetDir : [targetDir]; - for (const targetDir of targetDirArr) { await File.writeJSONToFile( [targetDir, ...typeDirArr], diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index 801c28e29..c88d2224c 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -4,7 +4,6 @@ import { Util } from '../util/util.js'; import MetadataType from './MetadataType.js'; import File from '../util/file.js'; import cache from '../util/cache.js'; -import Mustache from 'mustache'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -24,16 +23,6 @@ import Mustache from 'mustache'; * @typedef {import('../../types/mcdev.d.js').QueryMap} QueryMap */ -/** - * ensure that Mustache does not escape any characters - * - * @param {string} text - - * @returns {string} text - */ -Mustache.escape = function (text) { - return text; -}; - /** * Query MetadataType * @@ -292,7 +281,7 @@ class Query extends MetadataType { .join('}}}'); // replace template variables with their values - return Mustache.render(code, templateVariables, {}, ['{{{', '}}}']); + return super.applyTemplateValues(code, templateVariables); } /** * helper for {@link MetadataType.buildDefinition} From 976758a41199084ad0d37a8b75526ac77b5c1b04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 14:02:03 +0200 Subject: [PATCH 255/359] #1324: add templating test for assets: templatebased-emails --- .../build-templatebasedemail-expected.html | 20 ++ .../build-templatebasedemail-expected.json | 82 ++++++++ .../template-templatebasedemail-expected.html | 20 ++ .../template-templatebasedemail-expected.json | 82 ++++++++ test/type.asset.test.js | 176 ++++++++++++++++++ 5 files changed, 380 insertions(+) create mode 100644 test/resources/9999999/asset/build-templatebasedemail-expected.html create mode 100644 test/resources/9999999/asset/build-templatebasedemail-expected.json create mode 100644 test/resources/9999999/asset/template-templatebasedemail-expected.html create mode 100644 test/resources/9999999/asset/template-templatebasedemail-expected.json diff --git a/test/resources/9999999/asset/build-templatebasedemail-expected.html b/test/resources/9999999/asset/build-templatebasedemail-expected.html new file mode 100644 index 000000000..5ae3b84c4 --- /dev/null +++ b/test/resources/9999999/asset/build-templatebasedemail-expected.html @@ -0,0 +1,20 @@ +Update Profile + + + + +
+ This email was sent by: %%Member_Busname%%
%%Member_Addr%% + %%Member_City%%, %%Member_State%%, %%Member_PostalCode%%, %%Member_Country%%

+
+Manage Subscriptions diff --git a/test/resources/9999999/asset/build-templatebasedemail-expected.json b/test/resources/9999999/asset/build-templatebasedemail-expected.json new file mode 100644 index 000000000..6e32c69e0 --- /dev/null +++ b/test/resources/9999999/asset/build-templatebasedemail-expected.json @@ -0,0 +1,82 @@ +{ + "customerKey": "testTemplated_asset_templatebasedemail", + "contentType": "application/vnd.etmc.email.Message; kind=template", + "assetType": { "name": "templatebasedemail", "displayName": "Template-Based Email" }, + "name": " testTemplated_asset_templatebasedemail", + "createdBy": {}, + "modifiedBy": {}, + "memberId": "1111111", + "status": { "name": "Draft" }, + "views": { + "subjectline": { + "contentType": "application/vnd.etmc.email.View; kind=subjectline", + "thumbnail": {}, + "content": "my subject line", + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "preheader": { + "contentType": "application/vnd.etmc.email.View; kind=preheader", + "thumbnail": {}, + "content": "my custom preheader text", + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "text": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": "html" } } }, + "generateFrom": "html", + "modelVersion": 2 + }, + "viewAsAWebPage": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "subscriptioncenter": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "forwardHTML": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "forwardText": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "html": { + "thumbnail": {}, + "availableViews": [], + "template": { + "meta": { "contentHash": -166410261 }, + "r__assetTemplate_Key": "testTemplated_asset_template" + }, + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + } + }, + "availableViews": [ + "subjectline", + "preheader", + "text", + "viewAsAWebPage", + "subscriptioncenter", + "forwardHTML", + "forwardText", + "html" + ], + "data": { "email": { "options": { "characterEncoding": "utf-8" } } }, + "modelVersion": 2, + "r__folder_Path": "Content Builder" +} diff --git a/test/resources/9999999/asset/template-templatebasedemail-expected.html b/test/resources/9999999/asset/template-templatebasedemail-expected.html new file mode 100644 index 000000000..5ae3b84c4 --- /dev/null +++ b/test/resources/9999999/asset/template-templatebasedemail-expected.html @@ -0,0 +1,20 @@ +Update Profile + + + + +
+ This email was sent by: %%Member_Busname%%
%%Member_Addr%% + %%Member_City%%, %%Member_State%%, %%Member_PostalCode%%, %%Member_Country%%

+
+Manage Subscriptions diff --git a/test/resources/9999999/asset/template-templatebasedemail-expected.json b/test/resources/9999999/asset/template-templatebasedemail-expected.json new file mode 100644 index 000000000..8fc42da8a --- /dev/null +++ b/test/resources/9999999/asset/template-templatebasedemail-expected.json @@ -0,0 +1,82 @@ +{ + "customerKey": "{{{prefix}}}asset_templatebasedemail", + "contentType": "application/vnd.etmc.email.Message; kind=template", + "assetType": { "name": "templatebasedemail", "displayName": "Template-Based Email" }, + "name": " {{{prefix}}}asset_templatebasedemail", + "createdBy": {}, + "modifiedBy": {}, + "memberId": "{{{mid}}}", + "status": { "name": "Draft" }, + "views": { + "subjectline": { + "contentType": "application/vnd.etmc.email.View; kind=subjectline", + "thumbnail": {}, + "content": "my subject line", + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "preheader": { + "contentType": "application/vnd.etmc.email.View; kind=preheader", + "thumbnail": {}, + "content": "my custom preheader text", + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "text": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": "html" } } }, + "generateFrom": "html", + "modelVersion": 2 + }, + "viewAsAWebPage": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "subscriptioncenter": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "forwardHTML": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "forwardText": { + "thumbnail": {}, + "availableViews": [], + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + }, + "html": { + "thumbnail": {}, + "availableViews": [], + "template": { + "meta": { "contentHash": -166410261 }, + "r__assetTemplate_Key": "{{{prefix}}}asset_template" + }, + "data": { "email": { "options": { "generateFrom": null } } }, + "modelVersion": 2 + } + }, + "availableViews": [ + "subjectline", + "preheader", + "text", + "viewAsAWebPage", + "subscriptioncenter", + "forwardHTML", + "forwardText", + "html" + ], + "data": { "email": { "options": { "characterEncoding": "utf-8" } } }, + "modelVersion": 2, + "r__folder_Path": "Content Builder" +} diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 89ddce466..1ddad5030 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -44,6 +44,82 @@ async function getActualJson(customerKey, type, subtype, buName = 'testBU') { function getActualFile(customerKey, type, subtype, ext, buName = 'testBU') { return `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; } +/** + * gets file from Template folder + * + * @param {string} customerKey of metadata + * @param {string} type of metadata + * @param {string} subtype of metadata + * @returns {Promise.} file in string form + */ +async function getActualTemplateJson(customerKey, type, subtype) { + try { + return await File.readJSON( + `./template/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.json` + ); + } catch { + return await File.readJSON( + `./template/${type}/${subtype}/${customerKey}/${customerKey}.${type}-${subtype}-meta.json` + ); + } +} +/** + * gets file from Template folder + * + * @param {string} customerKey of metadata + * @param {string} type of metadata + * @param {string} subtype of metadata + * @param {string} ext file extension + * @param {string} [filename] optional fileprefix that differs from customerKey + * @returns {any} file + */ +function getActualTemplateFile(customerKey, type, subtype, ext, filename) { + return filename + ? file( + `./template/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}` + ) + : file(`./template/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`); +} +/** + * gets file from Deploy folder + * + * @param {string} customerKey of metadata + * @param {string} type of metadata + * @param {string} subtype of metadata + * @param {string} [buName] used when we need to test on ParentBU + * @returns {Promise.} file in string form + */ +async function getActualDeployJson(customerKey, type, subtype, buName = 'testBU') { + try { + return await File.readJSON( + `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.json` + ); + } catch { + return await File.readJSON( + `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}/${customerKey}.${type}-${subtype}-meta.json` + ); + } +} +/** + * gets file from Deploy folder + * + * @param {string} customerKey of metadata + * @param {string} type of metadata + * @param {string} subtype of metadata + * @param {string} ext file extension + * @param {string} [filename] optional fileprefix that differs from customerKey + * @param {string} [buName] used when we need to test on ParentBU + * @returns {any} file content + */ +function getActualDeployFile(customerKey, type, subtype, ext, filename, buName = 'testBU') { + return filename + ? file( + `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}` + ) + : file( + `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}` + ); +} describe('type: asset', () => { beforeEach(() => { @@ -214,6 +290,106 @@ describe('type: asset', () => { }); }); + describe('Templating ================', () => { + it('Should create a asset template via buildTemplate and build it', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['asset']); + + const expectedApiCallsRetrieve = 15; + assert.equal( + testUtils.getAPIHistoryLength(), + expectedApiCallsRetrieve, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + + // GIVEN there is a template + const result = await handler.buildTemplate( + 'testInstance/testBU', + 'asset', + ['testExisting_asset_templatebasedemail'], + 'testSourceMarket' + ); + // WHEN + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); + assert.equal( + result.asset ? Object.keys(result.asset).length : 0, + 1, + 'only one asset expected' + ); + assert.deepEqual( + await getActualTemplateJson( + 'testExisting_asset_templatebasedemail', + 'asset', + 'message' + ), + await testUtils.getExpectedJson('9999999', 'asset', 'template-templatebasedemail'), + 'returned template JSON of buildTemplate was not equal expected' + ); + + expect( + getActualTemplateFile( + 'testExisting_asset_templatebasedemail', + 'asset', + 'message', + 'html', + 'views.html.content' + ) + ).to.equal( + file( + testUtils.getExpectedFile( + '9999999', + 'asset', + 'template-templatebasedemail', + 'html' + ) + ) + ); + // THEN + await handler.buildDefinition( + 'testInstance/testBU', + 'asset', + ['testExisting_asset_templatebasedemail'], + 'testTargetMarket' + ); + assert.equal(process.exitCode, 0, 'buildDefinition should not have thrown an error'); + + assert.deepEqual( + await getActualDeployJson( + 'testTemplated_asset_templatebasedemail', + 'asset', + 'message' + ), + await testUtils.getExpectedJson('9999999', 'asset', 'build-templatebasedemail'), + 'returned deployment JSON was not equal expected' + ); + expect( + getActualDeployFile( + 'testTemplated_asset_templatebasedemail', + 'asset', + 'message', + 'html', + 'views.html.content' + ) + ).to.equal( + file( + testUtils.getExpectedFile( + '9999999', + 'asset', + 'build-templatebasedemail', + 'html' + ) + ) + ); + + assert.equal( + testUtils.getAPIHistoryLength() - expectedApiCallsRetrieve, + 0, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + describe('Delete ================', () => { it('Should delete the item', async () => { // WHEN From 94317a39329ce8b689dd31665df17411e2ffb104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 14:11:02 +0200 Subject: [PATCH 256/359] #1324: fix returned path for asset getFilesToCommit --- lib/metadataTypes/Asset.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 8464b6a1d..293d7814c 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -967,7 +967,6 @@ class Asset extends MetadataType { ); nestedFilePaths.push([ File.normalizePath([targetDir, ...extractedFile.subFolder]), - this.definition.type, extractedFile.fileName + '.' + this.definition.type + From b5fefcc344525edc36c8c1fbff39b6d854e74b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 14:25:19 +0200 Subject: [PATCH 257/359] #1329: add new command that chains buildTemplate and buildDefinition --- lib/cli.js | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- lib/index.js | 21 +++++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/lib/cli.js b/lib/cli.js index 9286960b2..ed65a9d80 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -340,6 +340,56 @@ yargs(hideBin(process.argv)) deprecated: true, }) // @ts-expect-error + .command({ + command: 'build', + desc: 'runs buildTemplate followed by buildDefinition', + builder: (yargs) => { + yargs + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Required parameters for build:', + describe: 'type:key combos to build template for', + demandOption: true, + }) + .option('buFrom', { + type: 'string', + alias: 'bf', + group: 'Required parameters for build:', + describe: 'market used for reverse building template', + demandOption: true, + }) + .option('buTo', { + type: 'string', + alias: 'bt', + group: 'Required parameters for build:', + describe: 'the business unit to deploy to', + demandOption: true, + }) + .option('marketFrom', { + type: 'string', + alias: 'mf', + group: 'Required parameters for build:', + describe: 'market used for reverse building template', + demandOption: true, + }) + .option('marketTo', { + type: 'string', + alias: 'mt', + group: 'Required parameters for build:', + describe: 'market used for building deployable definition', + demandOption: true, + }); + }, + handler: (argv) => { + Mcdev.setOptions(argv); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); + if ('undefined' !== typeof typeKeyCombo) { + Mcdev.build(argv.buFrom, argv.buTo, typeKeyCombo, argv.marketFrom, argv.marketTo); + } + }, + }) + // @ts-expect-error .command({ command: 'buildTemplate [TYPE] [KEY] [MARKET]', aliases: ['bt'], @@ -438,7 +488,6 @@ yargs(hideBin(process.argv)) } else { Mcdev.buildDefinition(argv.BU, typeKeyCombo, null, argv.MARKET || argv.market); } - // Mcdev.buildDefinition(argv.BU, argv.TYPE, argv.FILENAME, argv.MARKET); }, }) // @ts-expect-error diff --git a/lib/index.js b/lib/index.js index 38646935a..e1083b5a7 100644 --- a/lib/index.js +++ b/lib/index.js @@ -778,6 +778,27 @@ class Mcdev { } } + /** + * Build a template based on a list of metadata files in the retrieve folder. + * + * @param {string} businessUnitTemplate references credentials from properties.json + * @param {string} businessUnitDefinition references credentials from properties.json + * @param {TypeKeyCombo} typeKeyCombo limit retrieval to given metadata type + * @param {string} marketTemplate market localizations + * @param {string} marketDefinition market localizations + * @returns {Promise.} response from buildDefinition + */ + static async build( + businessUnitTemplate, + businessUnitDefinition, + typeKeyCombo, + marketTemplate, + marketDefinition + ) { + Util.logger.info('mcdev:: Build Template & Build Definition'); + await this.buildTemplate(businessUnitTemplate, typeKeyCombo, null, marketTemplate); + return this.buildDefinition(businessUnitDefinition, typeKeyCombo, null, marketDefinition); + } /** * Build a template based on a list of metadata files in the retrieve folder. * From a0b2bab75d1ae9b80fe81f2a209da55dcb67bcf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 14:31:59 +0200 Subject: [PATCH 258/359] #1329: add test case for new method --- test/general.test.js | 97 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 2 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index be9751cd9..f7cfa4606 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -361,7 +361,9 @@ describe('GENERAL', () => { // check automation assert.equal( - definitionResult.automation ? Object.keys(templateResult.automation).length : 0, + definitionResult.automation + ? Object.keys(definitionResult.automation).length + : 0, 1, 'only one automation expected' ); @@ -373,7 +375,98 @@ describe('GENERAL', () => { // check query assert.equal( - definitionResult.query ? Object.keys(templateResult.query).length : 0, + definitionResult.query ? Object.keys(definitionResult.query).length : 0, + 1, + 'only one query expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'build'), + 'returned deployment JSON was not equal expected' + ); + expect( + file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + + assert.equal( + testUtils.getAPIHistoryLength() - expectedApiCallsRetrieve, + 0, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); + + it('build multiple type with keys', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['automation', 'query']); + + const expectedApiCallsRetrieve = 25; + assert.equal( + testUtils.getAPIHistoryLength(), + expectedApiCallsRetrieve, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + + // preparation + const argvMetadata = [ + 'automation:testExisting_automation', + 'query:testExisting_query', + 'query:bad', + ]; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + + // *** build: buildTemplate and buildDefinition chained *** + const definitionResult = await handler.build( + buName, + buName, + typeKeyCombo, + 'testSourceMarket', + 'testTargetMarket' + ); + assert.equal(process.exitCode, 0, 'build should not have thrown an error'); + + // *** buildTemplate *** + + // check automation + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'template'), + 'returned template was not equal expected' + ); + // check query + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'template'), + 'returned template JSON of retrieveAsTemplate was not equal expected' + ); + expect( + file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + + // *** buildDefinition *** + + // check automation + assert.equal( + definitionResult.automation + ? Object.keys(definitionResult.automation).length + : 0, + 1, + 'only one automation expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'build'), + 'returned deployment file was not equal expected' + ); + + // check query + assert.equal( + definitionResult.query ? Object.keys(definitionResult.query).length : 0, 1, 'only one query expected' ); From 6218746ed6f9046bf5bfe47fe0c57aed0145bc41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 17:09:09 +0200 Subject: [PATCH 259/359] #1329: add --metadata support to buildDefinitionBulk --- lib/Builder.js | 15 ++++++++++----- lib/cli.js | 15 +++++++++++++-- lib/index.js | 39 ++++++++++++++++++++++++++++++++++----- 3 files changed, 57 insertions(+), 12 deletions(-) diff --git a/lib/Builder.js b/lib/Builder.js index db3883b62..a739faf1c 100644 --- a/lib/Builder.js +++ b/lib/Builder.js @@ -198,7 +198,7 @@ saved * @param {string} listName name of list of BU-market combos * @param {string} type supported metadata type * @param {string[]} nameArr name of the metadata - * @returns {Promise.} - + * @returns {Promise.} - */ static async buildDefinitionBulk(listName, type, nameArr) { const properties = await config.getProperties(); @@ -216,8 +216,8 @@ saved return; } let i = 0; - const bdPromises = []; + const responseObj = {}; for (const businessUnit in properties.marketList[listName]) { if (businessUnit === 'description') { // skip, it's just a metadata on this list and not a BU @@ -235,16 +235,21 @@ saved if (Util.checkMarket(market, properties)) { Util.logger.info(`Executing for '${businessUnit}': '${market}'`); // omitting "await" to speed up creation - bdPromises.push(this.buildDefinition(businessUnit, type, nameArr, market)); + responseObj[businessUnit] ||= {}; + responseObj[businessUnit][market] = await this.buildDefinition( + businessUnit, + type, + nameArr, + market + ); } } } - const response = await Promise.all(bdPromises); if (!i) { Util.logger.error('Please define properties.marketList in your config'); } - return response; + return responseObj; } } diff --git a/lib/cli.js b/lib/cli.js index ed65a9d80..d044db5e4 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -492,7 +492,7 @@ yargs(hideBin(process.argv)) }) // @ts-expect-error .command({ - command: 'buildDefinitionBulk ', + command: 'buildDefinitionBulk [TYPE] [FILENAME]', aliases: ['bdb'], desc: 'builds metadata definition based on template en bulk', builder: (yargs) => { @@ -508,11 +508,22 @@ yargs(hideBin(process.argv)) .positional('FILENAME', { type: 'string', describe: 'File name of the metadata template without the extension', + }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Options for buildDefinitionBulk:', + describe: 'type:templateName combos to build template for', }); }, handler: (argv) => { Mcdev.setOptions(argv); - Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, csvToArray(argv.FILENAME)); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, csvToArray(argv.FILENAME)); + } else { + Mcdev.buildDefinitionBulk(argv.LISTNAME, typeKeyCombo); + } }, }) // @ts-expect-error diff --git a/lib/index.js b/lib/index.js index e1083b5a7..080d2035e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -886,14 +886,43 @@ class Mcdev { * Build a specific metadata file based on a template using a list of bu-market combos * * @param {string} listName name of list of BU-market combos - * @param {string} type supported metadata type - * @param {string[]} nameArr name of the metadata - * @returns {Promise.} - + * @param {string | TypeKeyCombo} selectedTypes supported metadata type + * @param {string[]} [nameArr] name of the metadata + * @returns {Promise.} - */ - static async buildDefinitionBulk(listName, type, nameArr) { + static async buildDefinitionBulk(listName, selectedTypes, nameArr) { Util.startLogger(); Util.logger.info('mcdev:: Build Definition from Template Bulk'); - return Builder.buildDefinitionBulk(listName, type, nameArr); + let selectedTypesArr; + if ('string' === typeof selectedTypes) { + selectedTypesArr = [selectedTypes]; + } else { + selectedTypesArr = Object.keys(selectedTypes); + // check if types are valid + for (const selectedType of selectedTypesArr) { + if (!Util._isValidType(selectedType)) { + return; + } + if (!Array.isArray(selectedTypes[selectedType])) { + // we need an array of keys here + return; + } + } + } + /** @type {MultiMetadataTypeList} */ + const returnObj = {}; + for (const selectedType of selectedTypesArr) { + if (selectedTypesArr.length > 1) { + Util.logger.info(Util.getGrayMsg(`buildDefinitionBulk for ${selectedType}`)); + } + const result = await Builder.buildDefinitionBulk( + listName, + selectedType, + 'string' === typeof selectedTypes ? nameArr : selectedTypes[selectedType] + ); + returnObj[selectedType] = result; + } + return returnObj; } /** * From 730b4bced0fce929f6cbe0e79e93ae5686f8740e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 17:12:09 +0200 Subject: [PATCH 260/359] #1329: add --bulk mode to --- lib/cli.js | 12 +++++++++--- lib/index.js | 10 +++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index d044db5e4..3d88e90db 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -363,7 +363,7 @@ yargs(hideBin(process.argv)) type: 'string', alias: 'bt', group: 'Required parameters for build:', - describe: 'the business unit to deploy to', + describe: 'the business unit to deploy to; ignored if --bulk is set', demandOption: true, }) .option('marketFrom', { @@ -379,6 +379,13 @@ yargs(hideBin(process.argv)) group: 'Required parameters for build:', describe: 'market used for building deployable definition', demandOption: true, + }) + .option('bulk', { + type: 'boolean', + group: 'Optional parameters for build:', + describe: + 'if defined, the marketTo parameter has to be a marketList and buildDefinitionBulk is executed', + demandOption: true, }); }, handler: (argv) => { @@ -467,7 +474,7 @@ yargs(hideBin(process.argv)) type: 'string', alias: 'm', group: 'Options for buildDefinition:', - describe: 'type:key combos to build template for', + describe: 'type:templateName combos to build template for', }) .option('market', { type: 'string', @@ -792,7 +799,6 @@ yargs(hideBin(process.argv)) describe: 'optionally start existing schedule instead of running item once immediately (only works for automations)', }); - // TODO: add option --metadata }, handler: (argv) => { Mcdev.setOptions(argv); diff --git a/lib/index.js b/lib/index.js index 080d2035e..40a3492ec 100644 --- a/lib/index.js +++ b/lib/index.js @@ -786,18 +786,22 @@ class Mcdev { * @param {TypeKeyCombo} typeKeyCombo limit retrieval to given metadata type * @param {string} marketTemplate market localizations * @param {string} marketDefinition market localizations - * @returns {Promise.} response from buildDefinition + * @param {boolean} [bulk] runs buildDefinitionBulk instead of buildDefinition; requires marketList to be defined and given via marketDefinition + * @returns {Promise.} response from buildDefinition */ static async build( businessUnitTemplate, businessUnitDefinition, typeKeyCombo, marketTemplate, - marketDefinition + marketDefinition, + bulk ) { Util.logger.info('mcdev:: Build Template & Build Definition'); await this.buildTemplate(businessUnitTemplate, typeKeyCombo, null, marketTemplate); - return this.buildDefinition(businessUnitDefinition, typeKeyCombo, null, marketDefinition); + return bulk + ? this.buildDefinitionBulk(marketDefinition, typeKeyCombo, null) + : this.buildDefinition(businessUnitDefinition, typeKeyCombo, null, marketDefinition); } /** * Build a template based on a list of metadata files in the retrieve folder. From 90133ad5be712dd9d11d9f524e9b142b5a8b689b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 17:13:29 +0200 Subject: [PATCH 261/359] #1329: add test case for build --bulk --- test/general.test.js | 186 ++++++++++++++++++++++++++++++++++++ test/mockRoot/.mcdevrc.json | 12 ++- 2 files changed, 197 insertions(+), 1 deletion(-) diff --git a/test/general.test.js b/test/general.test.js index f7cfa4606..8ae950a8e 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -485,6 +485,192 @@ describe('GENERAL', () => { 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); }); + + it('build multiple type with keys and --bulk', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['automation', 'query']); + + const expectedApiCallsRetrieve = 25; + assert.equal( + testUtils.getAPIHistoryLength(), + expectedApiCallsRetrieve, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + + // preparation + const argvMetadata = [ + 'automation:testExisting_automation', + 'query:testExisting_query', + 'query:bad', + ]; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + + // *** build: buildTemplate and buildDefinition chained *** + const definitionResult = await handler.build( + buName, + 'ignored', + typeKeyCombo, + 'testSourceMarket', + 'deployment-target', + true + ); + assert.equal(process.exitCode, 0, 'build should not have thrown an error'); + + // *** buildTemplate *** + + // check automation + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'template'), + 'returned template was not equal expected' + ); + // check query + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'template'), + 'returned template JSON of retrieveAsTemplate was not equal expected' + ); + expect( + file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + + // *** buildDefinitionBulk *** + + // check automation + assert.equal( + definitionResult.automation?.['testInstance/testBU']?.testSourceMarket + ? Object.keys( + definitionResult.automation?.['testInstance/testBU']?.testSourceMarket + ).length + : 0, + 1, + 'only one automation expected' + ); + assert.equal( + definitionResult.automation?.['testInstance/testBU']?.testTargetMarket + ? Object.keys( + definitionResult.automation?.['testInstance/testBU']?.testTargetMarket + ).length + : 0, + 1, + 'only one automation expected' + ); + assert.equal( + definitionResult.automation?.['testInstance/_ParentBU_']?.testTargetMarket + ? Object.keys( + definitionResult.automation?.['testInstance/_ParentBU_'] + ?.testTargetMarket + ).length + : 0, + 1, + 'only one automation expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'build'), + 'returned deployment file was not equal expected' + ); + + // check if files were also created for other BU-market combos + // testBU: testSourceMarket + expect( + file( + testUtils.getActualDeployFile( + 'testExisting_automation', + 'automation', + 'json' + ) + ) + ).to.exist; + // _ParentBU_: testTargetMarket + expect( + file( + testUtils.getActualDeployFile( + 'testTemplated_automation', + 'automation', + 'json', + '_ParentBU_' + ) + ) + ).to.exist; + + // check query + assert.equal( + definitionResult.query?.['testInstance/testBU']?.testSourceMarket + ? Object.keys( + definitionResult.query?.['testInstance/testBU']?.testSourceMarket + ).length + : 0, + 1, + 'only one query expected' + ); + assert.equal( + definitionResult.query?.['testInstance/testBU']?.testTargetMarket + ? Object.keys( + definitionResult.query?.['testInstance/testBU']?.testTargetMarket + ).length + : 0, + 1, + 'only one query expected' + ); + assert.equal( + definitionResult.query?.['testInstance/_ParentBU_']?.testTargetMarket + ? Object.keys( + definitionResult.query?.['testInstance/_ParentBU_']?.testTargetMarket + ).length + : 0, + 1, + 'only one query expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'build'), + 'returned deployment JSON was not equal expected' + ); + expect( + file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + + // check if files were also created for other BU-market combos + // testBU: testSourceMarket + expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'json'))) + .to.exist; + expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'sql'))).to + .exist; + // _ParentBU_: testTargetMarket + expect( + file( + testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'json', + '_ParentBU_' + ) + ) + ).to.exist; + expect( + file( + testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'sql', + '_ParentBU_' + ) + ) + ).to.exist; + + assert.equal( + testUtils.getAPIHistoryLength() - expectedApiCallsRetrieve, + 0, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); }); }); diff --git a/test/mockRoot/.mcdevrc.json b/test/mockRoot/.mcdevrc.json index d7811fb20..49943786a 100644 --- a/test/mockRoot/.mcdevrc.json +++ b/test/mockRoot/.mcdevrc.json @@ -57,7 +57,17 @@ "countryCodeIn": "'testTarget'" } }, - "marketList": {}, + "marketList": { + "deployment-source": { + "description": "Define one 1:1 BU-Market combo here to as source for automated creation of deployment packages; you can create more than one source market list", + "testInstance/testBU": "testSourceMarket" + }, + "deployment-target": { + "description": "Define n BU-Market combo here to as target for automated creation of deployment packages; you can create more than one target market list and they can be as complex as you like", + "testInstance/testBU": ["testSourceMarket", "testTargetMarket"], + "testInstance/_ParentBU_": ["testTargetMarket"] + } + }, "metaDataTypes": { "documentOnRetrieve": ["user", "automation", "dataExtension", "role"], "retrieve": [ From 2928af986f6625ae3677c3dd72e0be7cd3d3cc2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 17:19:23 +0200 Subject: [PATCH 262/359] #1329: add test case for buildTemplate + buildDefinitionBulk --- test/general.test.js | 200 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 200 insertions(+) diff --git a/test/general.test.js b/test/general.test.js index 8ae950a8e..686e7c5a5 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -671,6 +671,206 @@ describe('GENERAL', () => { 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' ); }); + + it('buildTemplate + builDefinitionBulk multiple type with keys', async () => { + // download first before we test buildTemplate + await handler.retrieve('testInstance/testBU', ['automation', 'query']); + + const expectedApiCallsRetrieve = 25; + assert.equal( + testUtils.getAPIHistoryLength(), + expectedApiCallsRetrieve, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + + // preparation + const argvMetadata = [ + 'automation:testExisting_automation', + 'query:testExisting_query', + 'query:bad', + ]; + const typeKeyCombo = handler.metadataToTypeKey(argvMetadata); + assert.notEqual( + typeof typeKeyCombo, + 'undefined', + 'typeKeyCombo should not be undefined' + ); + const buName = 'testInstance/testBU'; + + // *** buildTemplate *** + const templateResult = await handler.buildTemplate( + buName, + typeKeyCombo, + null, + 'testSourceMarket' + ); + assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); + // check automation + assert.equal( + templateResult.automation ? Object.keys(templateResult.automation).length : 0, + 1, + 'only one automation expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'template'), + 'returned template was not equal expected' + ); + // check query + assert.equal( + templateResult.query ? Object.keys(templateResult.query).length : 0, + 1, + 'only one query expected' + ); + assert.deepEqual( + await testUtils.getActualTemplateJson('testExisting_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'template'), + 'returned template JSON of retrieveAsTemplate was not equal expected' + ); + expect( + file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + + // *** buildDefinitionBulk chained *** + const definitionResult = await handler.buildDefinitionBulk( + 'deployment-target', + typeKeyCombo + ); + assert.equal( + process.exitCode, + 0, + 'buildDefinitionBulk should not have thrown an error' + ); + + // check automation + assert.equal( + definitionResult.automation?.['testInstance/testBU']?.testSourceMarket + ? Object.keys( + definitionResult.automation?.['testInstance/testBU']?.testSourceMarket + ).length + : 0, + 1, + 'only one automation expected' + ); + assert.equal( + definitionResult.automation?.['testInstance/testBU']?.testTargetMarket + ? Object.keys( + definitionResult.automation?.['testInstance/testBU']?.testTargetMarket + ).length + : 0, + 1, + 'only one automation expected' + ); + assert.equal( + definitionResult.automation?.['testInstance/_ParentBU_']?.testTargetMarket + ? Object.keys( + definitionResult.automation?.['testInstance/_ParentBU_'] + ?.testTargetMarket + ).length + : 0, + 1, + 'only one automation expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_automation', 'automation'), + await testUtils.getExpectedJson('9999999', 'automation', 'build'), + 'returned deployment file was not equal expected' + ); + + // check if files were also created for other BU-market combos + // testBU: testSourceMarket + expect( + file( + testUtils.getActualDeployFile( + 'testExisting_automation', + 'automation', + 'json' + ) + ) + ).to.exist; + // _ParentBU_: testTargetMarket + expect( + file( + testUtils.getActualDeployFile( + 'testTemplated_automation', + 'automation', + 'json', + '_ParentBU_' + ) + ) + ).to.exist; + + // check query + assert.equal( + definitionResult.query?.['testInstance/testBU']?.testSourceMarket + ? Object.keys( + definitionResult.query?.['testInstance/testBU']?.testSourceMarket + ).length + : 0, + 1, + 'only one query expected' + ); + assert.equal( + definitionResult.query?.['testInstance/testBU']?.testTargetMarket + ? Object.keys( + definitionResult.query?.['testInstance/testBU']?.testTargetMarket + ).length + : 0, + 1, + 'only one query expected' + ); + assert.equal( + definitionResult.query?.['testInstance/_ParentBU_']?.testTargetMarket + ? Object.keys( + definitionResult.query?.['testInstance/_ParentBU_']?.testTargetMarket + ).length + : 0, + 1, + 'only one query expected' + ); + assert.deepEqual( + await testUtils.getActualDeployJson('testTemplated_query', 'query'), + await testUtils.getExpectedJson('9999999', 'query', 'build'), + 'returned deployment JSON was not equal expected' + ); + expect( + file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) + ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + + // check if files were also created for other BU-market combos + // testBU: testSourceMarket + expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'json'))) + .to.exist; + expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'sql'))).to + .exist; + // _ParentBU_: testTargetMarket + expect( + file( + testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'json', + '_ParentBU_' + ) + ) + ).to.exist; + expect( + file( + testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'sql', + '_ParentBU_' + ) + ) + ).to.exist; + + assert.equal( + testUtils.getAPIHistoryLength() - expectedApiCallsRetrieve, + 0, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + }); }); }); From 190cf68ac7dd5bbcc1f4d92352cefdf21ed27c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 16 May 2024 17:45:49 +0200 Subject: [PATCH 263/359] #1329: fix build --bulk parameter called via CLI --- lib/cli.js | 12 +++++++++--- lib/index.js | 7 +++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index 3d88e90db..a8458fc9b 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -363,8 +363,7 @@ yargs(hideBin(process.argv)) type: 'string', alias: 'bt', group: 'Required parameters for build:', - describe: 'the business unit to deploy to; ignored if --bulk is set', - demandOption: true, + describe: 'the business unit to deploy to; required unless --bulk is set', }) .option('marketFrom', { type: 'string', @@ -392,7 +391,14 @@ yargs(hideBin(process.argv)) Mcdev.setOptions(argv); const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); if ('undefined' !== typeof typeKeyCombo) { - Mcdev.build(argv.buFrom, argv.buTo, typeKeyCombo, argv.marketFrom, argv.marketTo); + Mcdev.build( + argv.buFrom, + argv.buTo, + typeKeyCombo, + argv.marketFrom, + argv.marketTo, + argv.bulk + ); } }, }) diff --git a/lib/index.js b/lib/index.js index 40a3492ec..e87500ab6 100644 --- a/lib/index.js +++ b/lib/index.js @@ -797,6 +797,13 @@ class Mcdev { marketDefinition, bulk ) { + if (!bulk && !businessUnitDefinition) { + Util.logger.error( + 'Please provide a business unit to deploy to via --buTo or activate --bulk' + ); + return; + } + Util.logger.info('mcdev:: Build Template & Build Definition'); await this.buildTemplate(businessUnitTemplate, typeKeyCombo, null, marketTemplate); return bulk From fd29b951ea8763d04ccf21984571c47bb976bb99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 16:07:34 +0200 Subject: [PATCH 264/359] #58: normalize cross-type references with r__ for query --- lib/metadataTypes/Query.js | 9 +++++---- lib/metadataTypes/definitions/Query.definition.js | 6 ++++++ .../_ParentBU_/query/testNew_query.query-meta.json | 2 +- .../testBU/query/testExisting_query.query-meta.json | 2 +- .../query/testExisting_query_fixKeys.query-meta.json | 2 +- .../testBU/query/testNew_query.query-meta.json | 2 +- .../1111111/query/patch_keySuffix-expected.json | 2 +- test/resources/9999999/query/build-expected.json | 2 +- test/resources/9999999/query/get-expected.json | 2 +- test/resources/9999999/query/get2-expected.json | 2 +- test/resources/9999999/query/patch-expected.json | 2 +- test/resources/9999999/query/patch_fixKeys-expected.json | 2 +- .../9999999/query/patch_fixKeysSuffix-expected.json | 2 +- test/resources/9999999/query/post-expected.json | 2 +- test/resources/9999999/query/template-expected.json | 2 +- test/type.query.test.js | 2 +- types/mcdev.d.js | 3 ++- 17 files changed, 27 insertions(+), 19 deletions(-) diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index c88d2224c..9e656e3e6 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -177,17 +177,18 @@ class Query extends MetadataType { metadata.targetKey }' --> '${targetKey}'. Acquired new value from looking up the DE's ObjectID in targetId.` ); - metadata.targetKey = targetKey; } + metadata.r__dataExtension_CustomerKey = targetKey; } else { // if no targetId is set, at least check if the targetKey points to an existing DE (no override needed) - cache.searchForField( + metadata.r__dataExtension_CustomerKey = cache.searchForField( 'dataExtension', metadata.targetKey, 'CustomerKey', 'CustomerKey' ); } + delete metadata.targetKey; } catch (ex) { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ @@ -243,14 +244,14 @@ class Query extends MetadataType { // dataExtension metadata.targetKey = cache.searchForField( 'dataExtension', - metadata.targetKey, + metadata.r__dataExtension_CustomerKey, 'CustomerKey', 'CustomerKey' ); // we've seen queries without this ID set - crucial in case the DE ever gets renamed to ensure the query keeps working metadata.targetId = cache.searchForField( 'dataExtension', - metadata.targetKey, + metadata.r__dataExtension_CustomerKey, 'CustomerKey', 'ObjectID' ); diff --git a/lib/metadataTypes/definitions/Query.definition.js b/lib/metadataTypes/definitions/Query.definition.js index 294c94741..5bb3357ce 100644 --- a/lib/metadataTypes/definitions/Query.definition.js +++ b/lib/metadataTypes/definitions/Query.definition.js @@ -123,6 +123,12 @@ export default { retrieving: false, template: false, }, + r__dataExtension_CustomerKey: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, r__folder_Path: { skipValidation: true }, }, }; diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json index 688e58db5..9ba11adb6 100644 --- a/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query", "description": "created on deploy", - "targetKey": "testExisting_dataExtensionShared", + "r__dataExtension_CustomerKey": "testExisting_dataExtensionShared", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json index 421e918e5..4c4fe104e 100644 --- a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json @@ -2,7 +2,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "updated on deploy", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json index 5455fe2ca..a5df8ba05 100644 --- a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json @@ -2,7 +2,7 @@ "name": "testExisting_query_fixedKeys", "key": "testExisting_query_fixKeys", "description": "updated on deploy", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json b/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json index 7e4bdc099..04aea7990 100644 --- a/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query", "description": "created on deploy", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/1111111/query/patch_keySuffix-expected.json b/test/resources/1111111/query/patch_keySuffix-expected.json index a69695ef8..d2d04cbc8 100644 --- a/test/resources/1111111/query/patch_keySuffix-expected.json +++ b/test/resources/1111111/query/patch_keySuffix-expected.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query_DEV", "description": "created on deploy", - "targetKey": "testExisting_dataExtensionShared", + "r__dataExtension_CustomerKey": "testExisting_dataExtensionShared", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/build-expected.json b/test/resources/9999999/query/build-expected.json index a7df67267..d493d739b 100644 --- a/test/resources/9999999/query/build-expected.json +++ b/test/resources/9999999/query/build-expected.json @@ -2,7 +2,7 @@ "name": "testTemplated_query", "key": "testTemplated_query", "description": "foobar", - "targetKey": "testTemplated_dataExtension", + "r__dataExtension_CustomerKey": "testTemplated_dataExtension", "targetUpdateTypeName": "Overwrite", "r__folder_Path": "Query" } diff --git a/test/resources/9999999/query/get-expected.json b/test/resources/9999999/query/get-expected.json index 4cd606716..2b795f1ee 100644 --- a/test/resources/9999999/query/get-expected.json +++ b/test/resources/9999999/query/get-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "bla bla", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:02:44.01", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/get2-expected.json b/test/resources/9999999/query/get2-expected.json index 5e3955fad..19c02d524 100644 --- a/test/resources/9999999/query/get2-expected.json +++ b/test/resources/9999999/query/get2-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query2", "key": "testExisting_query2", "description": "bla bla", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:02:44.01", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/patch-expected.json b/test/resources/9999999/query/patch-expected.json index 421e918e5..4c4fe104e 100644 --- a/test/resources/9999999/query/patch-expected.json +++ b/test/resources/9999999/query/patch-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "updated on deploy", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/patch_fixKeys-expected.json b/test/resources/9999999/query/patch_fixKeys-expected.json index 77a1e032e..d9ce442b7 100644 --- a/test/resources/9999999/query/patch_fixKeys-expected.json +++ b/test/resources/9999999/query/patch_fixKeys-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query_fixedKeys", "key": "testExisting_query_fixedKeys", "description": "updated on deploy", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/patch_fixKeysSuffix-expected.json b/test/resources/9999999/query/patch_fixKeysSuffix-expected.json index 7a7c4bee2..4413418e8 100644 --- a/test/resources/9999999/query/patch_fixKeysSuffix-expected.json +++ b/test/resources/9999999/query/patch_fixKeysSuffix-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query_fixedKeys", "key": "testExisting_query_fixedKeys_DEV", "description": "updated on deploy", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/post-expected.json b/test/resources/9999999/query/post-expected.json index 7e4bdc099..04aea7990 100644 --- a/test/resources/9999999/query/post-expected.json +++ b/test/resources/9999999/query/post-expected.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query", "description": "created on deploy", - "targetKey": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/template-expected.json b/test/resources/9999999/query/template-expected.json index 9f9bd2806..06d196847 100644 --- a/test/resources/9999999/query/template-expected.json +++ b/test/resources/9999999/query/template-expected.json @@ -2,7 +2,7 @@ "name": "{{{prefix}}}query", "key": "{{{prefix}}}query", "description": "{{{description}}}", - "targetKey": "{{{prefix}}}dataExtension", + "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension", "targetUpdateTypeName": "Overwrite", "r__folder_Path": "Query" } diff --git a/test/type.query.test.js b/test/type.query.test.js index 232d04cc2..90e02b776 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -40,7 +40,7 @@ describe('type: query', () => { expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.equal( file(testUtils.getExpectedFile('9999999', 'query', 'get', 'sql')) ); - // check if targetKey was overwritten + // check if r__dataExtension_CustomerKey was overwritten assert.deepEqual( await testUtils.getActualJson('testExisting_query2', 'query'), await testUtils.getExpectedJson('9999999', 'query', 'get2'), diff --git a/types/mcdev.d.js b/types/mcdev.d.js index b60364ce2..4d2323832 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -44,12 +44,13 @@ * @property {string} name name * @property {string} key key * @property {string} description - + * @property {string} [targetId] Object ID of DE (removed before save) * @property {string} targetKey key of target data extension + * @property {string} r__dataExtension_CustomerKey key of target data extension * @property {string} createdDate e.g. "2020-09-14T01:42:03.017" * @property {string} modifiedDate e.g. "2020-09-14T01:42:03.017" * @property {'Overwrite'|'Update'|'Append'} targetUpdateTypeName defines how the query writes into the target data extension * @property {number} [targetUpdateTypeId] 0|1|2, mapped to targetUpdateTypeName via this.definition.targetUpdateTypeMapping - * @property {string} [targetId] Object ID of DE (removed before save) * @property {string} [targetDescription] Description DE (removed before save) * @property {boolean} isFrozen looks like this is always set to false * @property {string} [queryText] contains SQL query with line breaks converted to '\n'. The content is extracted during retrieval and written into a separate *.sql file From 0604d227d5139e57219df05cb58e0483cf748bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 16:08:35 +0200 Subject: [PATCH 265/359] #58: normalize cross-type references with r__ for attributeGroup --- lib/metadataTypes/AttributeGroup.js | 43 ++++++++++--------- .../definitions/AttributeGroup.definition.js | 6 +++ .../attributeGroup/retrieve-expected.json | 2 +- 3 files changed, 30 insertions(+), 21 deletions(-) diff --git a/lib/metadataTypes/AttributeGroup.js b/lib/metadataTypes/AttributeGroup.js index cd853ab45..d35552cec 100644 --- a/lib/metadataTypes/AttributeGroup.js +++ b/lib/metadataTypes/AttributeGroup.js @@ -52,29 +52,32 @@ class AttributeGroup extends MetadataType { delete metadata.mID; // attributeSet - metadata.attributeSetIdentifiers = metadata.attributeSetIdentifiers.map((attributeSet) => { - try { - const key = cache.searchForField( - 'attributeSet', - attributeSet.definitionID, - 'definitionID', - 'definitionKey' - ); - if (key !== attributeSet.definitionKey) { - throw new Error( - `AttributeSet key mismatch. Found ${key} instead of ${attributeSet.definitionKey}` + metadata.r__attributeSet_definitionKey = metadata.attributeSetIdentifiers.map( + (attributeSet) => { + try { + const key = cache.searchForField( + 'attributeSet', + attributeSet.definitionID, + 'definitionID', + 'definitionKey' ); + if (key !== attributeSet.definitionKey) { + Util.logger.debug( + `AttributeSet key mismatch. Overwriting ${attributeSet.definitionKey} with ${key}` + ); + } + return key; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata[this.definition.keyField]} (for ${ + attributeSet.definitionKey + }): ${ex.message}` + ); + return attributeSet; } - return key; - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.keyField]} (for ${ - attributeSet.definitionKey - }): ${ex.message}` - ); - return attributeSet; } - }); + ); + delete metadata.attributeSetIdentifiers; // requiredRelationships // TODO: implement diff --git a/lib/metadataTypes/definitions/AttributeGroup.definition.js b/lib/metadataTypes/definitions/AttributeGroup.definition.js index 8883b43c2..4324d6bb7 100644 --- a/lib/metadataTypes/definitions/AttributeGroup.definition.js +++ b/lib/metadataTypes/definitions/AttributeGroup.definition.js @@ -245,5 +245,11 @@ export default { retrieving: true, template: true, }, + r__attributeSet_definitionKey: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, }, }; diff --git a/test/resources/9999999/attributeGroup/retrieve-expected.json b/test/resources/9999999/attributeGroup/retrieve-expected.json index f3bc7c5df..3c5bd952f 100644 --- a/test/resources/9999999/attributeGroup/retrieve-expected.json +++ b/test/resources/9999999/attributeGroup/retrieve-expected.json @@ -3,7 +3,7 @@ "attributeCount": 37, "attributeGroupIconKey": "Mobile", "attributeGroupType": "Standard", - "attributeSetIdentifiers": ["MobileDemographics", "MobileSubscriptions"], + "r__attributeSet_definitionKey": ["MobileDemographics", "MobileSubscriptions"], "canAddProperties": false, "canAddRelationships": true, "canChangeProperties": false, From 761add0f1fe6048a51ccc48950e383c7759fd28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 16:13:06 +0200 Subject: [PATCH 266/359] #58: normalize cross-type references with r__ for automation --- lib/metadataTypes/Automation.js | 25 ++++++++----------- ...stExisting_automation.automation-meta.json | 12 ++++----- .../testNew_automation.automation-meta.json | 14 +++++------ .../9999999/automation/build-expected.json | 14 +++++------ .../9999999/automation/create-expected.json | 14 +++++------ .../patch_fixKeys-pause-expected.json | 12 ++++----- .../patch_fixKeys-schedule-expected.json | 12 ++++----- .../9999999/automation/retrieve-expected.json | 14 +++++------ .../9999999/automation/template-expected.json | 14 +++++------ .../9999999/automation/update-expected.json | 12 ++++----- types/mcdev.d.js | 3 ++- 11 files changed, 71 insertions(+), 75 deletions(-) diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 57613d510..403787040 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -483,20 +483,13 @@ class Automation extends MetadataType { cache.getCache()[activity.r__type] ) { try { - // this will override the name returned by the API in case this activity's name was changed since the automation was last updated, keeping things nicely in sync for mcdev - const name = cache.searchForField( + activity.r__key = cache.searchForField( activity.r__type, activity.activityObjectId, Definitions[activity.r__type].idField, - Definitions[activity.r__type].nameField + Definitions[activity.r__type].keyField ); - if (name !== activity.name) { - Util.logger.debug( - ` - updated name of step ${stepNumber}.${activity.displayOrder}` + - ` in Automation '${metadata.name}' from ${activity.name} to ${name}` - ); - activity.name = name; - } + delete activity.name; } catch (ex) { // getFromCache throws error where the dependent metadata is not found Util.logger.warn( @@ -876,8 +869,8 @@ class Automation extends MetadataType { // automations can have empty placeholder for activities with only their type defined activity.activityObjectId = cache.searchForField( activity.r__type, - activity.name, - Definitions[activity.r__type].nameField, + activity.r__key, + Definitions[activity.r__type].keyField, Definitions[activity.r__type].idField ); } @@ -1478,8 +1471,10 @@ class Automation extends MetadataType { } output += row1.join('') + `|\n${tableSeparator}|\n`; for (let i = 1; i < tabled.length; i++) { - for (const field of tabled[i]) { - output += field ? `| _${field.i}: ${field.type}_
${field.name} ` : '| - '; + for (const activity of tabled[i]) { + output += activity + ? `| _${activity.i}: ${activity.type}_
${activity.key} ` + : '| - '; } output += '|\n'; } @@ -1520,7 +1515,7 @@ class Automation extends MetadataType { step.activities[activityIndex] ? { i: stepIndex + 1 + '.' + (activityIndex + 1), - name: step.activities[activityIndex].name, + key: step.activities[activityIndex].r__key, type: step.activities[activityIndex].r__type, } : null diff --git a/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json b/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json index 0110ca3e6..cdca01d9e 100644 --- a/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json @@ -14,27 +14,27 @@ { "activities": [ { - "name": "testExisting_dataExtract", + "r__key": "testExisting_dataExtract", "r__type": "dataExtract" }, { - "name": "testExisting_emailSend", + "r__key": "testExisting_emailSend", "r__type": "emailSend" }, { - "name": "testExisting_fileTransfer", + "r__key": "testExisting_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testExisting_importFile", + "r__key": "testExisting_importFile", "r__type": "importFile" }, { - "name": "testExisting_query", + "r__key": "testExisting_query", "r__type": "query" }, { - "name": "testExisting_script", + "r__key": "testExisting_script", "r__type": "script" } ], diff --git a/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json b/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json index e27ad3c97..4baf49b8d 100644 --- a/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json @@ -14,31 +14,31 @@ { "activities": [ { - "name": "testExisting_dataExtract", + "r__key": "testExisting_dataExtract", "r__type": "dataExtract" }, { - "name": "testExisting_emailSend", + "r__key": "testExisting_emailSend", "r__type": "emailSend" }, { - "name": "testExisting_fileTransfer", + "r__key": "testExisting_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testExisting_importFile", + "r__key": "testExisting_importFile", "r__type": "importFile" }, { - "name": "testExisting_query", + "r__key": "testExisting_query", "r__type": "query" }, { - "name": "testExisting_script", + "r__key": "testExisting_script", "r__type": "script" }, { - "name": "testNew_39f6a488-20eb-4ba0-b0b9", + "r__key": "testNew_39f6a488-20eb-4ba0-b0b9", "r__type": "verification" } ], diff --git a/test/resources/9999999/automation/build-expected.json b/test/resources/9999999/automation/build-expected.json index d0e111d1e..d3fe27de4 100644 --- a/test/resources/9999999/automation/build-expected.json +++ b/test/resources/9999999/automation/build-expected.json @@ -14,31 +14,31 @@ { "activities": [ { - "name": "testTemplated_dataExtract", + "r__key": "testTemplated_dataExtract", "r__type": "dataExtract" }, { - "name": "testTemplated_emailSend", + "r__key": "testTemplated_emailSend", "r__type": "emailSend" }, { - "name": "testTemplated_fileTransfer", + "r__key": "testTemplated_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testTemplated_importFile", + "r__key": "testTemplated_importFile", "r__type": "importFile" }, { - "name": "testTemplated_query", + "r__key": "testTemplated_query", "r__type": "query" }, { - "name": "testTemplated_script", + "r__key": "testTemplated_script", "r__type": "script" }, { - "name": "testTemplated_39f6a488-20eb-4ba0-b0b9", + "r__key": "testTemplated_39f6a488-20eb-4ba0-b0b9", "r__type": "verification" } ], diff --git a/test/resources/9999999/automation/create-expected.json b/test/resources/9999999/automation/create-expected.json index 794e0dff7..c0529497f 100644 --- a/test/resources/9999999/automation/create-expected.json +++ b/test/resources/9999999/automation/create-expected.json @@ -15,31 +15,31 @@ { "activities": [ { - "name": "testExisting_dataExtract", + "r__key": "testExisting_dataExtract", "r__type": "dataExtract" }, { - "name": "testExisting_emailSend", + "r__key": "testExisting_emailSend", "r__type": "emailSend" }, { - "name": "testExisting_fileTransfer", + "r__key": "testExisting_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testExisting_importFile", + "r__key": "testExisting_importFile", "r__type": "importFile" }, { - "name": "testExisting_query", + "r__key": "testExisting_query", "r__type": "query" }, { - "name": "testExisting_script", + "r__key": "testExisting_script", "r__type": "script" }, { - "name": "testNew_RANDOM_NEW_GUID", + "r__key": "testNew_RANDOM_NEW_GUID", "r__type": "verification" } ], diff --git a/test/resources/9999999/automation/patch_fixKeys-pause-expected.json b/test/resources/9999999/automation/patch_fixKeys-pause-expected.json index 67ad413f2..5c4da0379 100644 --- a/test/resources/9999999/automation/patch_fixKeys-pause-expected.json +++ b/test/resources/9999999/automation/patch_fixKeys-pause-expected.json @@ -14,27 +14,27 @@ { "activities": [ { - "name": "testExisting_dataExtract", + "r__key": "testExisting_dataExtract", "r__type": "dataExtract" }, { - "name": "testExisting_emailSend", + "r__key": "testExisting_emailSend", "r__type": "emailSend" }, { - "name": "testExisting_fileTransfer", + "r__key": "testExisting_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testExisting_importFile", + "r__key": "testExisting_importFile", "r__type": "importFile" }, { - "name": "testExisting_query", + "r__key": "testExisting_query", "r__type": "query" }, { - "name": "testExisting_script", + "r__key": "testExisting_script", "r__type": "script" } ] diff --git a/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json b/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json index 7ac22ba98..e0c47993c 100644 --- a/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json +++ b/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json @@ -14,27 +14,27 @@ { "activities": [ { - "name": "testExisting_dataExtract", + "r__key": "testExisting_dataExtract", "r__type": "dataExtract" }, { - "name": "testExisting_emailSend", + "r__key": "testExisting_emailSend", "r__type": "emailSend" }, { - "name": "testExisting_fileTransfer", + "r__key": "testExisting_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testExisting_importFile", + "r__key": "testExisting_importFile", "r__type": "importFile" }, { - "name": "testExisting_query", + "r__key": "testExisting_query", "r__type": "query" }, { - "name": "testExisting_script", + "r__key": "testExisting_script", "r__type": "script" } ] diff --git a/test/resources/9999999/automation/retrieve-expected.json b/test/resources/9999999/automation/retrieve-expected.json index a598c8aff..bb7cb0c62 100644 --- a/test/resources/9999999/automation/retrieve-expected.json +++ b/test/resources/9999999/automation/retrieve-expected.json @@ -14,31 +14,31 @@ { "activities": [ { - "name": "testExisting_dataExtract", + "r__key": "testExisting_dataExtract", "r__type": "dataExtract" }, { - "name": "testExisting_emailSend", + "r__key": "testExisting_emailSend", "r__type": "emailSend" }, { - "name": "testExisting_fileTransfer", + "r__key": "testExisting_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testExisting_importFile", + "r__key": "testExisting_importFile", "r__type": "importFile" }, { - "name": "testExisting_query", + "r__key": "testExisting_query", "r__type": "query" }, { - "name": "testExisting_script", + "r__key": "testExisting_script", "r__type": "script" }, { - "name": "testExisting_39f6a488-20eb-4ba0-b0b9", + "r__key": "testExisting_39f6a488-20eb-4ba0-b0b9", "r__type": "verification" } ], diff --git a/test/resources/9999999/automation/template-expected.json b/test/resources/9999999/automation/template-expected.json index 9e3db99fc..06e6370e1 100644 --- a/test/resources/9999999/automation/template-expected.json +++ b/test/resources/9999999/automation/template-expected.json @@ -14,31 +14,31 @@ { "activities": [ { - "name": "{{{prefix}}}dataExtract", + "r__key": "{{{prefix}}}dataExtract", "r__type": "dataExtract" }, { - "name": "{{{prefix}}}emailSend", + "r__key": "{{{prefix}}}emailSend", "r__type": "emailSend" }, { - "name": "{{{prefix}}}fileTransfer", + "r__key": "{{{prefix}}}fileTransfer", "r__type": "fileTransfer" }, { - "name": "{{{prefix}}}importFile", + "r__key": "{{{prefix}}}importFile", "r__type": "importFile" }, { - "name": "{{{prefix}}}query", + "r__key": "{{{prefix}}}query", "r__type": "query" }, { - "name": "{{{prefix}}}script", + "r__key": "{{{prefix}}}script", "r__type": "script" }, { - "name": "{{{prefix}}}39f6a488-20eb-4ba0-b0b9", + "r__key": "{{{prefix}}}39f6a488-20eb-4ba0-b0b9", "r__type": "verification" } ], diff --git a/test/resources/9999999/automation/update-expected.json b/test/resources/9999999/automation/update-expected.json index 0705285b5..41169ef1f 100644 --- a/test/resources/9999999/automation/update-expected.json +++ b/test/resources/9999999/automation/update-expected.json @@ -14,27 +14,27 @@ { "activities": [ { - "name": "testExisting_dataExtract", + "r__key": "testExisting_dataExtract", "r__type": "dataExtract" }, { - "name": "testExisting_emailSend", + "r__key": "testExisting_emailSend", "r__type": "emailSend" }, { - "name": "testExisting_fileTransfer", + "r__key": "testExisting_fileTransfer", "r__type": "fileTransfer" }, { - "name": "testExisting_importFile", + "r__key": "testExisting_importFile", "r__type": "importFile" }, { - "name": "testExisting_query", + "r__key": "testExisting_query", "r__type": "query" }, { - "name": "testExisting_script", + "r__key": "testExisting_script", "r__type": "script" } ], diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 4d2323832..1cce48f99 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -198,7 +198,8 @@ /** * @typedef {object} AutomationActivity - * @property {string} name name (not key) of activity + * @property {string} r__key key of associated activity + * @property {string} [name] name (not key) of associated activity * @property {number} [objectTypeId] Id of assoicated activity type; see this.definition.activityTypeMapping * @property {string} [activityObjectId] Object Id of assoicated metadata item * @property {number} [displayOrder] order within step; starts with 1 or higher number From 8237eb76cd7c005a9b6c52ee4301d077568a5a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 16:15:35 +0200 Subject: [PATCH 267/359] #58: normalize cross-type references with r__ for asset --- lib/metadataTypes/Asset.js | 10 +++++----- .../asset/build-templatebasedemail-expected.json | 2 +- .../asset/retrieve-templatebasedemail-expected.json | 2 +- .../asset/template-templatebasedemail-expected.json | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 293d7814c..30c6998fe 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -571,7 +571,7 @@ class Asset extends MetadataType { // get template try { if (metadata.views?.html?.template?.id) { - metadata.views.html.template.r__assetTemplate_Key = cache.searchForField( + metadata.views.html.template.r__asset_customerKey = cache.searchForField( 'asset', metadata.views?.html?.template?.id, 'id', @@ -688,18 +688,18 @@ class Asset extends MetadataType { // template-based emails if ( metadata.assetType.name === 'templatebasedemail' && - metadata.views?.html?.template?.r__assetTemplate_Key + metadata.views?.html?.template?.r__asset_customerKey ) { // template metadata.views.html.template.id = cache.searchForField( 'asset', - metadata.views.html.template.r__assetTemplate_Key, + metadata.views.html.template.r__asset_customerKey, 'customerKey', 'id' ); metadata.views.html.template.name = cache.searchForField( 'asset', - metadata.views.html.template.r__assetTemplate_Key, + metadata.views.html.template.r__asset_customerKey, 'customerKey', 'name' ); @@ -715,7 +715,7 @@ class Asset extends MetadataType { metadata.views.html.template.availableViews = []; metadata.views.html.template.modelVersion = 2; - delete metadata.views.html.template.r__assetTemplate_Key; + delete metadata.views.html.template.r__asset_customerKey; } // restore asset type id which is needed for deploy diff --git a/test/resources/9999999/asset/build-templatebasedemail-expected.json b/test/resources/9999999/asset/build-templatebasedemail-expected.json index 6e32c69e0..dfd718fdb 100644 --- a/test/resources/9999999/asset/build-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/build-templatebasedemail-expected.json @@ -60,7 +60,7 @@ "availableViews": [], "template": { "meta": { "contentHash": -166410261 }, - "r__assetTemplate_Key": "testTemplated_asset_template" + "r__asset_customerKey": "testTemplated_asset_template" }, "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json index 1bfc09130..ddd1c9593 100644 --- a/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json @@ -63,7 +63,7 @@ "availableViews": [], "template": { "meta": { "contentHash": -166410261 }, - "r__assetTemplate_Key": "testExisting_asset_template" + "r__asset_customerKey": "testExisting_asset_template" }, "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/asset/template-templatebasedemail-expected.json b/test/resources/9999999/asset/template-templatebasedemail-expected.json index 8fc42da8a..902e414ed 100644 --- a/test/resources/9999999/asset/template-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/template-templatebasedemail-expected.json @@ -60,7 +60,7 @@ "availableViews": [], "template": { "meta": { "contentHash": -166410261 }, - "r__assetTemplate_Key": "{{{prefix}}}asset_template" + "r__asset_customerKey": "{{{prefix}}}asset_template" }, "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 From 915fb73d67863ea85e1e3d71b175acd51602e23b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 17:59:59 +0200 Subject: [PATCH 268/359] #58: normalize cross-type references with r__ for journey --- lib/metadataTypes/Journey.js | 425 ++++++++++-------- ...isting_journey_Quicksend.journey-meta.json | 4 +- .../9999999/journey/build-expected.json | 4 +- .../journey/get-multistep-expected.json | 4 +- .../journey/get-quicksend-expected.json | 4 +- .../get-transactionalEmail-expected.json | 4 +- .../9999999/journey/template-expected.json | 4 +- 7 files changed, 242 insertions(+), 207 deletions(-) diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index d8dba0e33..514743f3d 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -332,16 +332,17 @@ class Journey extends MetadataType { ) { // trigger found; there can only be one entry in this array try { - const edId = cache.searchForField( + const edKey = cache.searchForField( 'event', - metadata.triggers[0].metaData.eventDefinitionKey, - 'eventDefinitionKey', - 'id' + metadata.triggers[0].metaData.eventDefinitionId, + 'id', + 'eventDefinitionKey' ); - if (metadata.triggers[0].metaData.eventDefinitionId !== edId) { - throw new Error( - `eventDefinitionId not matching Id found on event with key in eventDefinitionKey` + if (metadata.triggers[0].metaData.eventDefinitionKey !== edKey) { + Util.logger.debug( + `eventDefinitionKey not matching eventDefinitionId. Overwriting '${metadata.triggers[0].metaData.eventDefinitionKey}' with the correct key '${edKey}'.` ); + metadata.triggers[0].metaData.eventDefinitionKey = edKey; } delete metadata.triggers[0].metaData.eventDefinitionId; } catch (ex) { @@ -379,13 +380,15 @@ class Journey extends MetadataType { const activity = metadata.activities[0]; // trigger found; there can only be one entry in this array try { - const tEmailId = cache.searchForField( + const tEmailKey = cache.searchForField( 'transactionalEmail', - activity.configurationArguments?.triggeredSendKey, - 'definitionKey', - 'definitionId' + activity.configurationArguments?.triggeredSendId, + 'definitionId', + 'definitionKey' ); - if (tEmailId != activity.configurationArguments?.triggeredSendId) { + if ( + tEmailKey != activity.configurationArguments?.triggeredSendKey + ) { throw new Error( ` - ${this.definition.type} ${ metadata[this.definition.nameField] @@ -476,42 +479,57 @@ class Journey extends MetadataType { case 'EMAILV2': { // triggeredSend + email+asset // TODO email / asset - try { - if (activity.configurationArguments?.triggeredSendKey) { - // triggeredSendKey is not always set but triggeredSendId is - cache.searchForField( - 'triggeredSend', - activity.configurationArguments.triggeredSendKey, - 'CustomerKey', - 'CustomerKey' - ); - delete activity.configurationArguments.triggeredSendId; - } else if (activity.configurationArguments?.triggeredSendId) { - // triggeredSendKey is not always set but triggeredSendId is - activity.configurationArguments.triggeredSendKey = cache.searchForField( - 'triggeredSend', - activity.configurationArguments.triggeredSendId, - 'ObjectID', - 'CustomerKey' + const configurationArguments = activity.configurationArguments; + if (configurationArguments) { + try { + if (configurationArguments.triggeredSendId) { + // triggeredSendKey is not always set but triggeredSendId is + const tsKey = cache.searchForField( + 'triggeredSend', + configurationArguments.triggeredSendId, + 'ObjectID', + 'CustomerKey' + ); + if (configurationArguments.triggeredSendKey != tsKey) { + Util.logger.debug( + `triggeredSendKey not matching triggeredSendId. Overwriting '${configurationArguments.triggeredSendKey}' with the correct key '${tsKey}'.` + ); + configurationArguments.triggeredSendKey = tsKey; + } + configurationArguments.r__triggeredSend_CustomerKey = + configurationArguments.triggeredSendKey; + delete configurationArguments.triggeredSendKey; + delete configurationArguments.triggeredSendId; + } else if (configurationArguments.triggeredSendKey) { + // very rare case but it's been seen that no triggeredSendId was saved + Util.logger.debug( + `triggeredSendKey found on activity but no triggeredSendId present on journey. Checking key directly...` + ); + configurationArguments.r__triggeredSend_CustomerKey = + cache.searchForField( + 'triggeredSend', + configurationArguments.triggeredSendKey, + 'CustomerKey', + 'CustomerKey' + ); + delete configurationArguments.triggeredSendKey; + } + if ( + configurationArguments.triggeredSendKey && + configurationArguments.triggeredSend + ) { + // assumption is, that this stores potentially outdated triggeredSend info from the first version of the journey + delete configurationArguments.triggeredSend; + } + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }) activity-key=${activity.key}: ${ex.message}` ); - delete activity.configurationArguments.triggeredSendId; - } - if ( - activity.configurationArguments?.triggeredSendKey && - activity.configurationArguments.triggeredSend - ) { - // assumption is, that this stores potentially outdated triggeredSend info from the first version of the journey - delete activity.configurationArguments.triggeredSend; } - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ - metadata[this.definition.keyField] - }) activity-key=${activity.key}: ${ex.message}` - ); } - - const triggeredSend = activity.configurationArguments?.triggeredSend; + const triggeredSend = configurationArguments?.triggeredSend; if (triggeredSend) { // this section is likely only relevant for QuickSends and not for Multi-Step Journeys @@ -639,13 +657,13 @@ class Journey extends MetadataType { // email try { // content builder - triggeredSend.r__assetMessage_Name_readOnly = cache.searchForField( + triggeredSend.r__asset_name_readOnly = cache.searchForField( 'asset', triggeredSend.emailId, 'legacyData.legacyId', 'name' ); - triggeredSend.r__assetMessage_Key = cache.searchForField( + triggeredSend.r__asset_customerKey = cache.searchForField( 'asset', triggeredSend.emailId, 'legacyData.legacyId', @@ -674,112 +692,120 @@ class Journey extends MetadataType { break; } case 'SMSSYNC': { - // mobileMessage - try { - if (activity.configurationArguments?.messageId) { - activity.configurationArguments.c__mobileMessage_id = - cache.searchForField( + const configurationArguments = activity.configurationArguments; + if (configurationArguments) { + // mobileMessage + try { + if (configurationArguments.messageId) { + configurationArguments.r__mobileMessage_id = cache.searchForField( 'mobileMessage', - activity.configurationArguments.messageId, + configurationArguments.messageId, 'id', 'id' ); - delete activity.configurationArguments.messageId; + delete configurationArguments.messageId; + } + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }) activity-key=${activity.key}: ${ex.message}` + ); } - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ - metadata[this.definition.keyField] - }) activity-key=${activity.key}: ${ex.message}` - ); - } - try { // mobileKeyword - if (activity.configurationArguments?.keywordId) { - activity.configurationArguments.r__mobileKeyword_codeKeyword = - cache.searchForField( - 'mobileKeyword', - activity.configurationArguments.keywordId, - 'id', - 'c__codeKeyword' - ); - delete activity.configurationArguments.keywordId; + configurationArguments.r__mobileKeyword_c__codeKeyword = {}; + try { + if (configurationArguments.keywordId) { + configurationArguments.r__mobileKeyword_c__codeKeyword.current = + cache.searchForField( + 'mobileKeyword', + configurationArguments.keywordId, + 'id', + 'c__codeKeyword' + ); + delete configurationArguments.keywordId; + } + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }) activity-key=${activity.key}: ${ex.message}` + ); } - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ - metadata[this.definition.keyField] - }) activity-key=${activity.key}: ${ex.message}` - ); - } - try { - if (activity.configurationArguments?.nextKeywordId) { - activity.configurationArguments.c__next_mobileKeyword = - cache.searchForField( - 'mobileKeyword', - activity.configurationArguments.nextKeywordId, - 'id', - 'c__codeKeyword' - ); - delete activity.configurationArguments.nextKeywordId; + try { + if (configurationArguments.nextKeywordId) { + configurationArguments.r__mobileKeyword_c__codeKeyword.next = + cache.searchForField( + 'mobileKeyword', + configurationArguments.nextKeywordId, + 'id', + 'c__codeKeyword' + ); + delete configurationArguments.nextKeywordId; + } + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }) activity-key=${activity.key}: ${ex.message}` + ); + } + if ( + !Object.keys(configurationArguments.r__mobileKeyword_c__codeKeyword) + .length + ) { + // in case we found no linked dataExtensions, remove this empty shell + delete configurationArguments.r__mobileKeyword_c__codeKeyword; } - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ - metadata[this.definition.keyField] - }) activity-key=${activity.key}: ${ex.message}` - ); - } - try { // mobileCode - if (activity.configurationArguments?.codeId) { - activity.configurationArguments.c__mobileCode = cache.searchForField( - 'mobileCode', - activity.configurationArguments.codeId, - 'id', - 'code' + try { + if (configurationArguments.codeId) { + configurationArguments.r__mobileCode_code = cache.searchForField( + 'mobileCode', + configurationArguments.codeId, + 'id', + 'code' + ); + delete configurationArguments.codeId; + } + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }) activity-key=${activity.key}: ${ex.message}` ); - delete activity.configurationArguments.codeId; } - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ - metadata[this.definition.keyField] - }) activity-key=${activity.key}: ${ex.message}` - ); - } - try { - // asset-asset: jsonmessage - if (activity.configurationArguments?.assetId) { - activity.configurationArguments.r__assetMessage_Name_readOnly = - cache.searchForField( - 'asset', - activity.configurationArguments.assetId, - 'id', - 'name' - ); + try { + // asset-asset: jsonmessage + if (configurationArguments.assetId) { + configurationArguments.r__asset_name_readOnly = + cache.searchForField( + 'asset', + configurationArguments.assetId, + 'id', + 'name' + ); - activity.configurationArguments.r__assetMessage_Key = - cache.searchForField( + configurationArguments.r__asset_customerKey = cache.searchForField( 'asset', - activity.configurationArguments.assetId, + configurationArguments.assetId, 'id', 'customerKey' ); - delete activity.configurationArguments.assetId; + delete configurationArguments.assetId; + } + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ + metadata[this.definition.keyField] + }) activity-key=${activity.key}: ${ex.message}` + ); } - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${ - metadata[this.definition.keyField] - }) activity-key=${activity.key}: ${ex.message}` - ); - } - - // applicationExtensionId always equal "00000000-0000-0000-0000-000000000000" - delete activity.configurationArguments.applicationExtensionId; + // applicationExtensionId always equal "00000000-0000-0000-0000-000000000000" + delete configurationArguments.applicationExtensionId; + } break; } } @@ -924,17 +950,23 @@ class Journey extends MetadataType { case 'EMAILV2': { // triggeredSend + email+asset // TODO email / asset - if (activity.configurationArguments?.triggeredSendKey) { + const configurationArguments = activity.configurationArguments; + if ( + configurationArguments && + configurationArguments.r__triggeredSend_CustomerKey + ) { // triggeredSendKey is not always set but triggeredSendId is - activity.configurationArguments.triggeredSendId = cache.searchForField( + configurationArguments.triggeredSendId = cache.searchForField( 'triggeredSend', - activity.configurationArguments.triggeredSendKey, + configurationArguments.r__triggeredSend_CustomerKey, 'CustomerKey', 'ObjectID' ); + configurationArguments.triggeredSendKey = + configurationArguments.r__triggeredSend_CustomerKey; + delete configurationArguments.r__triggeredSend_CustomerKey; } - - const triggeredSend = activity.configurationArguments?.triggeredSend; + const triggeredSend = configurationArguments?.triggeredSend; if (triggeredSend) { // List (optional) if (triggeredSend.r__list_PathName) { @@ -1007,15 +1039,15 @@ class Journey extends MetadataType { } // email - if (triggeredSend.r__assetMessage_Key) { + if (triggeredSend.r__asset_customerKey) { triggeredSend.emailId = cache.searchForField( 'asset', - triggeredSend.r__assetMessage_Key, + triggeredSend.r__asset_customerKey, 'customerKey', 'legacyData.legacyId' ); - delete triggeredSend.r__assetMessage_Key; - delete triggeredSend.r__assetMessage_Name_readOnly; + delete triggeredSend.r__asset_customerKey; + delete triggeredSend.r__asset_name_readOnly; } else if (triggeredSend.r__email_Name) { // classic triggeredSend.emailId = cache.searchForField( @@ -1031,60 +1063,63 @@ class Journey extends MetadataType { break; } case 'SMSSYNC': { - // mobileMessage - if (activity.configurationArguments?.c__mobileMessage_id) { - activity.configurationArguments.messageId = cache.searchForField( - 'mobileMessage', - activity.configurationArguments.c__mobileMessage_id, - 'id', - 'id' - ); - delete activity.configurationArguments.c__mobileMessage_id; - } - // mobileKeyword - if (activity.configurationArguments?.r__mobileKeyword_codeKeyword) { - activity.configurationArguments.keywordId = cache.searchForField( - 'mobileKeyword', - activity.r__mobileKeyword_codeKeyword, - 'c__codeKeyword', - 'id' - ); - delete activity.configurationArguments.r__mobileKeyword_codeKeyword; - } - if (activity.configurationArguments?.c__next_mobileKeyword) { - activity.configurationArguments.nextKeywordId = cache.searchForField( - 'mobileKeyword', - activity.configurationArguments.c__next_mobileKeyword, - 'c__codeKeyword', - 'id' - ); - delete activity.configurationArguments.c__next_mobileKeyword; - } - // mobileCode - if (activity.configurationArguments?.c__mobileCode) { - activity.configurationArguments.codeId = cache.searchForField( - 'mobileCode', - activity.configurationArguments.c__mobileCode, - 'code', - 'id' - ); - delete activity.configurationArguments.c__mobileCode; - } - // asset-asset: jsonmessage - if (activity.configurationArguments?.r__assetMessage_Key) { - activity.configurationArguments.assetId = cache.searchForField( - 'asset', - activity.configurationArguments.r__assetMessage_Key, - 'customerKey', - 'id' - ); - delete activity.configurationArguments.r__assetMessage_Key; - delete activity.configurationArguments.r__assetMessage_Name_readOnly; + const configurationArguments = activity.configurationArguments; + if (configurationArguments) { + // mobileMessage + if (configurationArguments.r__mobileMessage_id) { + configurationArguments.messageId = cache.searchForField( + 'mobileMessage', + configurationArguments.r__mobileMessage_id, + 'id', + 'id' + ); + delete configurationArguments.r__mobileMessage_id; + } + // mobileKeyword + if (configurationArguments.r__mobileKeyword_c__codeKeyword?.current) { + configurationArguments.keywordId = cache.searchForField( + 'mobileKeyword', + configurationArguments.r__mobileKeyword_c__codeKeyword.current, + 'c__codeKeyword', + 'id' + ); + } + if (configurationArguments.r__mobileKeyword_c__codeKeyword?.next) { + configurationArguments.nextKeywordId = cache.searchForField( + 'mobileKeyword', + configurationArguments.r__mobileKeyword_c__codeKeyword.next, + 'c__codeKeyword', + 'id' + ); + } + delete configurationArguments.r__mobileKeyword_c__codeKeyword; + // mobileCode + if (configurationArguments.r__mobileCode_code) { + configurationArguments.codeId = cache.searchForField( + 'mobileCode', + configurationArguments.r__mobileCode_code, + 'code', + 'id' + ); + delete configurationArguments.r__mobileCode_code; + } + // asset-asset: jsonmessage + if (configurationArguments.r__asset_customerKey) { + configurationArguments.assetId = cache.searchForField( + 'asset', + configurationArguments.r__asset_customerKey, + 'customerKey', + 'id' + ); + delete configurationArguments.r__asset_customerKey; + delete configurationArguments.r__asset_name_readOnly; + } + + // applicationExtensionId always equal "00000000-0000-0000-0000-000000000000" + configurationArguments.applicationExtensionId = + '00000000-0000-0000-0000-000000000000'; } - // applicationExtensionId always equal "00000000-0000-0000-0000-000000000000" - activity.configurationArguments.applicationExtensionId = - '00000000-0000-0000-0000-000000000000'; break; } } diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json index 0b75e6127..de06ab128 100644 --- a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json @@ -57,8 +57,8 @@ "r__senderProfile_CustomerKey": "testExisting_senderProfile", "r__sendClassification_CustomerKey": "testExisting_sendClassification", "c__priority": "High", - "r__assetMessage_Name_readOnly": "testExisting_asset_message", - "r__assetMessage_Key": "testExisting_asset_message" + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message" }, "applicationExtensionKey": "jb-email-activity" }, diff --git a/test/resources/9999999/journey/build-expected.json b/test/resources/9999999/journey/build-expected.json index 0c0f6dc3b..ecfa44b7e 100644 --- a/test/resources/9999999/journey/build-expected.json +++ b/test/resources/9999999/journey/build-expected.json @@ -54,8 +54,8 @@ "r__senderProfile_CustomerKey": "testTemplated_senderProfile", "r__sendClassification_CustomerKey": "testTemplated_sendClassification", "c__priority": "High", - "r__assetMessage_Name_readOnly": "testTemplated_asset_message", - "r__assetMessage_Key": "testTemplated_asset_message" + "r__asset_name_readOnly": "testTemplated_asset_message", + "r__asset_customerKey": "testTemplated_asset_message" }, "applicationExtensionKey": "jb-email-activity" }, diff --git a/test/resources/9999999/journey/get-multistep-expected.json b/test/resources/9999999/journey/get-multistep-expected.json index 8434f0e86..86ad5f02a 100644 --- a/test/resources/9999999/journey/get-multistep-expected.json +++ b/test/resources/9999999/journey/get-multistep-expected.json @@ -103,8 +103,8 @@ "r__senderProfile_CustomerKey": "testExisting_senderProfile", "r__sendClassification_CustomerKey": "testExisting_sendClassification", "c__priority": "Medium", - "r__assetMessage_Name_readOnly": "testExisting_asset_message", - "r__assetMessage_Key": "testExisting_asset_message" + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message" } }, "metaData": { diff --git a/test/resources/9999999/journey/get-quicksend-expected.json b/test/resources/9999999/journey/get-quicksend-expected.json index bc8a9e17e..ccfdd8525 100644 --- a/test/resources/9999999/journey/get-quicksend-expected.json +++ b/test/resources/9999999/journey/get-quicksend-expected.json @@ -57,8 +57,8 @@ "r__senderProfile_CustomerKey": "testExisting_senderProfile", "r__sendClassification_CustomerKey": "testExisting_sendClassification", "c__priority": "High", - "r__assetMessage_Name_readOnly": "testExisting_asset_message", - "r__assetMessage_Key": "testExisting_asset_message" + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message" }, "applicationExtensionKey": "jb-email-activity" }, diff --git a/test/resources/9999999/journey/get-transactionalEmail-expected.json b/test/resources/9999999/journey/get-transactionalEmail-expected.json index 8fbcc318c..aad5ea53e 100644 --- a/test/resources/9999999/journey/get-transactionalEmail-expected.json +++ b/test/resources/9999999/journey/get-transactionalEmail-expected.json @@ -48,8 +48,8 @@ "r__senderProfile_CustomerKey": "testExisting_senderProfile", "r__sendClassification_CustomerKey": "testExisting_sendClassification", "c__priority": "Medium", - "r__assetMessage_Name_readOnly": "testExisting_asset_message", - "r__assetMessage_Key": "testExisting_asset_message" + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message" }, "r__transactionalEmail_definitionKey": "testExisting_temail" }, diff --git a/test/resources/9999999/journey/template-expected.json b/test/resources/9999999/journey/template-expected.json index 8cc6812bf..feeffddd1 100644 --- a/test/resources/9999999/journey/template-expected.json +++ b/test/resources/9999999/journey/template-expected.json @@ -54,8 +54,8 @@ "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile", "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", "c__priority": "High", - "r__assetMessage_Name_readOnly": "{{{prefix}}}asset_message", - "r__assetMessage_Key": "{{{prefix}}}asset_message" + "r__asset_name_readOnly": "{{{prefix}}}asset_message", + "r__asset_customerKey": "{{{prefix}}}asset_message" }, "applicationExtensionKey": "jb-email-activity" }, From e5ee9c356e78a863966cd8a092d2de088121472c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 18:02:19 +0200 Subject: [PATCH 269/359] #58: normalize cross-type references with r__ for emailSend --- lib/cli.js | 2 +- lib/metadataTypes/EmailSend.js | 35 ++++++++++--------- ...testExisting_emailSend.emailSend-meta.json | 6 ++-- .../testNew_emailSend.emailSend-meta.json | 6 ++-- .../9999999/emailSend/build-expected.json | 8 ++--- .../9999999/emailSend/get-expected.json | 8 ++--- .../9999999/emailSend/patch-expected.json | 8 ++--- .../9999999/emailSend/post-expected.json | 8 ++--- .../9999999/emailSend/template-expected.json | 8 ++--- 9 files changed, 45 insertions(+), 44 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index a8458fc9b..a6b999b2b 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -184,7 +184,7 @@ yargs(hideBin(process.argv)) // @ts-expect-error .command({ command: 'reloadBUs [credentialsName]', - aliases: ['rb'], + aliases: ['rb', 'refreshBUs'], desc: 'loads the list of available BUs from the server and saves it to your config', builder: (yargs) => { yargs.positional('credentialsName', { diff --git a/lib/metadataTypes/EmailSend.js b/lib/metadataTypes/EmailSend.js index 644fd0f32..f31ad1efe 100644 --- a/lib/metadataTypes/EmailSend.js +++ b/lib/metadataTypes/EmailSend.js @@ -114,20 +114,20 @@ class EmailSend extends MetadataType { // classic metadata.Email.ID = cache.searchForField('email', metadata.r__email_Name, 'Name', 'ID'); delete metadata.r__email_Name; - } else if (metadata.r__assetMessage_Key) { + } else if (metadata.r__asset_customerKey) { // content builder - // * this ignores r__assetMessage_Name on purpose\ as that is only unique per parent folder but useful during PR reviews + // * this ignores r__asset_name_readOnly on purpose\ as that is only unique per parent folder but useful during PR reviews // will try to find the key with the bu mid at the end, if unable, will try to find the key without it try { // check asset key as provided metadata.Email.ID = cache.searchForField( 'asset', - metadata.r__assetMessage_Key, + metadata.r__asset_customerKey, 'customerKey', 'legacyData.legacyId' ); - delete metadata.r__assetMessage_Key; - delete metadata.r__assetMessage_Name; + delete metadata.r__asset_customerKey; + delete metadata.r__asset_name_readOnly; } catch { // if we deploy to another BU, try applying the BU's MID to the end, which we do in preDeployTasks for assets @@ -136,18 +136,19 @@ class EmailSend extends MetadataType { metadata.Email.ID = cache.searchForField( 'asset', - metadata.r__assetMessage_Key.slice(0, Math.max(0, 36 - suffix.length)) + suffix, + metadata.r__asset_customerKey.slice(0, Math.max(0, 36 - suffix.length)) + + suffix, 'customerKey', 'legacyData.legacyId' ); - delete metadata.r__assetMessage_Key; - delete metadata.r__assetMessage_Name; + delete metadata.r__asset_customerKey; + delete metadata.r__asset_name_readOnly; } } else if (metadata.Email.ID) { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ metadata[this.definition.keyField] - }): Email.ID was provided manually in your deployment file. We recommend using r__assetMessage_Key instead.` + }): Email.ID was provided manually in your deployment file. We recommend using r__asset_customerKey instead.` ); try { // content builder - test only @@ -180,22 +181,22 @@ class EmailSend extends MetadataType { // - DataSourceTypeID=List --> List is source; DE is not defined for (const sdl of metadata.SendDefinitionList) { // get DataExtension (optional) - if (sdl.r__dataExtension_Key) { + if (sdl.r__dataExtension_CustomerKey) { if (sdl.DataSourceTypeID !== 'CustomObject') { throw new Error( - `Expecting DataSourceTypeID to equal 'CustomObject' when r__dataExtension_Key is defined; Found '${sdl.DataSourceTypeID}'` + `Expecting DataSourceTypeID to equal 'CustomObject' when r__dataExtension_CustomerKey is defined; Found '${sdl.DataSourceTypeID}'` ); } sdl.CustomObjectID = cache.searchForField( 'dataExtension', - sdl.r__dataExtension_Key, + sdl.r__dataExtension_CustomerKey, 'CustomerKey', 'ObjectID' ); - delete sdl.r__dataExtension_Key; + delete sdl.r__dataExtension_CustomerKey; } else if (sdl.DataSourceTypeID === 'CustomObject') { throw new Error( - `Expecting r__dataExtension_Key to be defined if DataSourceTypeID='CustomObject'` + `Expecting r__dataExtension_CustomerKey to be defined if DataSourceTypeID='CustomObject'` ); } if (!sdl.SalesForceObjectID || sdl.SalesForceObjectID === '') { @@ -276,14 +277,14 @@ class EmailSend extends MetadataType { 'legacyData.legacyId', 'name' ); - metadata.r__assetMessage_Name = contentBuilderEmailName; + metadata.r__asset_name_readOnly = contentBuilderEmailName; const contentBuilderEmailKey = cache.searchForField( 'asset', metadata.Email.ID, 'legacyData.legacyId', 'customerKey' ); - metadata.r__assetMessage_Key = contentBuilderEmailKey; + metadata.r__asset_customerKey = contentBuilderEmailKey; delete metadata.Email; } catch { try { @@ -319,7 +320,7 @@ class EmailSend extends MetadataType { // get DataExtension keys if (sdl.CustomObjectID) { try { - sdl.r__dataExtension_Key = cache.searchForField( + sdl.r__dataExtension_CustomerKey = cache.searchForField( 'dataExtension', sdl.CustomObjectID, 'ObjectID', diff --git a/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json index 6d929d3f0..ec0d05061 100644 --- a/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json @@ -21,14 +21,14 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_Key": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__assetMessage_Key": "testExisting_asset_message", - "r__assetMessage_Name": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", "r__sendClassification_CustomerKey": "testExisting_sendClassification", diff --git a/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json index f6f6302a4..8837a9ad1 100644 --- a/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json @@ -21,14 +21,14 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_Key": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__assetMessage_Key": "testExisting_asset_message", - "r__assetMessage_Name": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", "r__sendClassification_CustomerKey": "testExisting_sendClassification", diff --git a/test/resources/9999999/emailSend/build-expected.json b/test/resources/9999999/emailSend/build-expected.json index d1e1c0094..0942fba26 100644 --- a/test/resources/9999999/emailSend/build-expected.json +++ b/test/resources/9999999/emailSend/build-expected.json @@ -21,21 +21,21 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "ExclusionList", - "r__dataExtension_Key": "testTemplated_dataExtension_exclusion" + "r__dataExtension_CustomerKey": "testTemplated_dataExtension_exclusion" }, { "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_Key": "testTemplated_dataExtension", + "r__dataExtension_CustomerKey": "testTemplated_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__assetMessage_Key": "testTemplated_asset_message", - "r__assetMessage_Name": "testTemplated_asset_message", + "r__asset_customerKey": "testTemplated_asset_message", + "r__asset_name_readOnly": "testTemplated_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", "r__sendClassification_CustomerKey": "testTemplated_sendClassification", diff --git a/test/resources/9999999/emailSend/get-expected.json b/test/resources/9999999/emailSend/get-expected.json index fb715576c..c74a706fc 100644 --- a/test/resources/9999999/emailSend/get-expected.json +++ b/test/resources/9999999/emailSend/get-expected.json @@ -21,21 +21,21 @@ "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_Key": "testExisting_dataExtension_exclusion" + "r__dataExtension_CustomerKey": "testExisting_dataExtension_exclusion" }, { "SendDefinitionListType": "SourceList", "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_Key": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__assetMessage_Key": "testExisting_asset_message", - "r__assetMessage_Name": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", "r__sendClassification_CustomerKey": "testExisting_sendClassification", diff --git a/test/resources/9999999/emailSend/patch-expected.json b/test/resources/9999999/emailSend/patch-expected.json index 9aca8fbb7..ee58efb9b 100644 --- a/test/resources/9999999/emailSend/patch-expected.json +++ b/test/resources/9999999/emailSend/patch-expected.json @@ -19,21 +19,21 @@ "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_Key": "testExisting_dataExtension_exclusion" + "r__dataExtension_CustomerKey": "testExisting_dataExtension_exclusion" }, { "SendDefinitionListType": "SourceList", "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_Key": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__assetMessage_Key": "testExisting_asset_message", - "r__assetMessage_Name": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", "r__sendClassification_CustomerKey": "testExisting_sendClassification", diff --git a/test/resources/9999999/emailSend/post-expected.json b/test/resources/9999999/emailSend/post-expected.json index d8d2e93c8..7cc1393f5 100644 --- a/test/resources/9999999/emailSend/post-expected.json +++ b/test/resources/9999999/emailSend/post-expected.json @@ -19,21 +19,21 @@ "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_Key": "testExisting_dataExtension_exclusion" + "r__dataExtension_CustomerKey": "testExisting_dataExtension_exclusion" }, { "SendDefinitionListType": "SourceList", "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_Key": "testExisting_dataExtension", + "r__dataExtension_CustomerKey": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__assetMessage_Key": "testExisting_asset_message", - "r__assetMessage_Name": "testExisting_asset_message", + "r__asset_customerKey": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", "r__sendClassification_CustomerKey": "testExisting_sendClassification", diff --git a/test/resources/9999999/emailSend/template-expected.json b/test/resources/9999999/emailSend/template-expected.json index 122c43004..6be9d072a 100644 --- a/test/resources/9999999/emailSend/template-expected.json +++ b/test/resources/9999999/emailSend/template-expected.json @@ -21,21 +21,21 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "ExclusionList", - "r__dataExtension_Key": "{{{prefix}}}dataExtension_exclusion" + "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension_exclusion" }, { "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_Key": "{{{prefix}}}dataExtension", + "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__assetMessage_Key": "{{{prefix}}}asset_message", - "r__assetMessage_Name": "{{{prefix}}}asset_message", + "r__asset_customerKey": "{{{prefix}}}asset_message", + "r__asset_name_readOnly": "{{{prefix}}}asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", From 4661aa19557d5bf9b58c3205bf1feed1f1e7e3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 22:13:11 +0200 Subject: [PATCH 270/359] #58: normalize cross-type references with r__ for transactionalSMS --- lib/metadataTypes/TransactionalSMS.js | 79 ++++++++++++------- .../TransactionalSMS.definition.js | 6 ++ ...stExisting_tsms.transactionalSMS-meta.json | 3 +- .../testNew_tsms.transactionalSMS-meta.json | 3 +- .../transactionalSMS/build-expected.json | 3 +- .../transactionalSMS/get-expected.json | 3 +- .../transactionalSMS/patch-expected.json | 3 +- .../transactionalSMS/post-expected.json | 3 +- .../transactionalSMS/template-expected.json | 3 +- 9 files changed, 63 insertions(+), 43 deletions(-) diff --git a/lib/metadataTypes/TransactionalSMS.js b/lib/metadataTypes/TransactionalSMS.js index ccbd6e102..ab6f88b2b 100644 --- a/lib/metadataTypes/TransactionalSMS.js +++ b/lib/metadataTypes/TransactionalSMS.js @@ -59,21 +59,34 @@ class TransactionalSMS extends TransactionalMessage { ); } - // subscriptions: mobileCode - if (metadata.subscriptions?.shortCode) { + // subscriptions: mobileKeyword + if (metadata.subscriptions?.r__mobileKeyword_c__codeKeyword) { // we merely want to be able to show an error if it does not exist + cache.searchForField( + 'mobileKeyword', + metadata.subscriptions.r__mobileKeyword_c__codeKeyword, + 'c__codeKeyword', + 'c__codeKeyword' + ); + const codeKeywordArr = + metadata.subscriptions.r__mobileKeyword_c__codeKeyword.split('.'); + metadata.subscriptions.shortCode = codeKeywordArr[0]; + metadata.subscriptions.keyword = codeKeywordArr[1]; + // make sure the code actually exists cache.searchForField('mobileCode', metadata.subscriptions.shortCode, 'code', 'code'); - // subscriptions: mobileKeyword - if (metadata.subscriptions?.keyword) { - // we merely want to be able to show an error if it does not exist - cache.searchForField( - 'mobileKeyword', - metadata.subscriptions.shortCode + '.' + metadata.subscriptions.keyword, - 'c__codeKeyword', - 'id' - ); - } + } else if (metadata.subscriptions?.r__mobileCode_code) { + // subscriptions: mobileCode + // in case we dont have r__mobileKeyword_c__codeKeyword set + metadata.subscriptions.shortCode = cache.searchForField( + 'mobileCode', + metadata.subscriptions.r__mobileCode_code, + 'code', + 'code' + ); } + delete metadata.subscriptions.r__mobileKeyword_c__codeKeyword; + delete metadata.subscriptions.r__mobileCode_code; + return metadata; } /** @@ -139,6 +152,8 @@ class TransactionalSMS extends TransactionalMessage { 'code', 'code' ); + metadata.subscriptions.r__mobileCode_code = metadata.subscriptions.shortCode; + delete metadata.subscriptions.shortCode; } catch { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ @@ -146,23 +161,29 @@ class TransactionalSMS extends TransactionalMessage { }): Could not find mobileCode ${metadata.subscriptions.shortCode}.` ); } - } - // subscriptions: mobileKeyword - if (metadata.subscriptions?.keyword) { - try { - // we merely want to be able to show a warning if it does not exist - cache.searchForField( - 'mobileKeyword', - metadata.subscriptions.shortCode + '.' + metadata.subscriptions.keyword, - 'c__codeKeyword', - 'id' - ); - } catch { - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ - metadata[this.definition.keyField] - }): Could not find mobileKeyword ${metadata.subscriptions.keyword}.` - ); + // subscriptions: mobileKeyword + if (metadata.subscriptions?.keyword) { + try { + // we merely want to be able to show a warning if it does not exist + metadata.subscriptions.r__mobileKeyword_c__codeKeyword = cache.searchForField( + 'mobileKeyword', + (metadata.subscriptions.shortCode || + metadata.subscriptions.r__mobileCode_code) + + '.' + + metadata.subscriptions.keyword, + 'c__codeKeyword', + 'c__codeKeyword' + ); + delete metadata.subscriptions.r__mobileCode_code; + delete metadata.subscriptions.shortCode; + delete metadata.subscriptions.keyword; + } catch { + Util.logger.warn( + ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ + metadata[this.definition.keyField] + }): Could not find mobileKeyword ${metadata.subscriptions.keyword}.` + ); + } } } diff --git a/lib/metadataTypes/definitions/TransactionalSMS.definition.js b/lib/metadataTypes/definitions/TransactionalSMS.definition.js index 1d9cdbf83..4950a02f8 100644 --- a/lib/metadataTypes/definitions/TransactionalSMS.definition.js +++ b/lib/metadataTypes/definitions/TransactionalSMS.definition.js @@ -101,5 +101,11 @@ export default { retrieving: true, template: true, }, + 'subscriptions.r__mobileKeyword_c__codeKeyword': { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, }, }; diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json index 3ec2688e1..d187d880f 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json @@ -6,10 +6,9 @@ "createdDate": "2022-11-07T02:24:00", "modifiedDate": "2022-11-07T02:25:00", "subscriptions": { - "shortCode": "4912312345678", "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "keyword": "TESTEXISTING_KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json index 262b76007..a9877d0b9 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json @@ -6,10 +6,9 @@ "createdDate": "2022-11-07T02:24:00", "modifiedDate": "2022-11-07T02:25:00", "subscriptions": { - "shortCode": "4912312345678", "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "keyword": "TESTEXISTING_KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/build-expected.json b/test/resources/9999999/transactionalSMS/build-expected.json index 951d2e441..29dcbbab7 100644 --- a/test/resources/9999999/transactionalSMS/build-expected.json +++ b/test/resources/9999999/transactionalSMS/build-expected.json @@ -4,10 +4,9 @@ "description": "foobar", "status": "Active", "subscriptions": { - "shortCode": "4912312345678", "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "keyword": "TESTTEMPLATED_KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTTEMPLATED_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/get-expected.json b/test/resources/9999999/transactionalSMS/get-expected.json index 3ec2688e1..d187d880f 100644 --- a/test/resources/9999999/transactionalSMS/get-expected.json +++ b/test/resources/9999999/transactionalSMS/get-expected.json @@ -6,10 +6,9 @@ "createdDate": "2022-11-07T02:24:00", "modifiedDate": "2022-11-07T02:25:00", "subscriptions": { - "shortCode": "4912312345678", "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "keyword": "TESTEXISTING_KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/patch-expected.json b/test/resources/9999999/transactionalSMS/patch-expected.json index 3ec2688e1..d187d880f 100644 --- a/test/resources/9999999/transactionalSMS/patch-expected.json +++ b/test/resources/9999999/transactionalSMS/patch-expected.json @@ -6,10 +6,9 @@ "createdDate": "2022-11-07T02:24:00", "modifiedDate": "2022-11-07T02:25:00", "subscriptions": { - "shortCode": "4912312345678", "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "keyword": "TESTEXISTING_KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/post-expected.json b/test/resources/9999999/transactionalSMS/post-expected.json index 262b76007..a9877d0b9 100644 --- a/test/resources/9999999/transactionalSMS/post-expected.json +++ b/test/resources/9999999/transactionalSMS/post-expected.json @@ -6,10 +6,9 @@ "createdDate": "2022-11-07T02:24:00", "modifiedDate": "2022-11-07T02:25:00", "subscriptions": { - "shortCode": "4912312345678", "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "keyword": "TESTEXISTING_KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/template-expected.json b/test/resources/9999999/transactionalSMS/template-expected.json index 302c20679..e249c80b9 100644 --- a/test/resources/9999999/transactionalSMS/template-expected.json +++ b/test/resources/9999999/transactionalSMS/template-expected.json @@ -4,10 +4,9 @@ "description": "{{{description}}}", "status": "Active", "subscriptions": { - "shortCode": "4912312345678", "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "keyword": "{{{prefixUpper}}}KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.{{{prefixUpper}}}KEYWORD" } } From 75a60c1859ae6e1193cc1f74420221c59caf5fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 22:22:16 +0200 Subject: [PATCH 271/359] #58: normalize cross-type references with r__ for transactionalPush --- lib/metadataTypes/TransactionalPush.js | 11 +++++++---- .../definitions/TransactionalPush.definition.js | 6 ++++++ .../testExisting_tpush.transactionalPush-meta.json | 4 +--- .../testNew_tpush.transactionalPush-meta.json | 4 +--- .../9999999/transactionalPush/build-expected.json | 2 +- .../9999999/transactionalPush/get-expected.json | 2 +- .../9999999/transactionalPush/patch-expected.json | 4 +--- .../9999999/transactionalPush/post-expected.json | 4 +--- .../9999999/transactionalPush/template-expected.json | 2 +- 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/lib/metadataTypes/TransactionalPush.js b/lib/metadataTypes/TransactionalPush.js index 4fc95b2d7..89d98e907 100644 --- a/lib/metadataTypes/TransactionalPush.js +++ b/lib/metadataTypes/TransactionalPush.js @@ -33,14 +33,16 @@ class TransactionalPush extends TransactionalMessage { */ static async preDeployTasks(metadata) { // asset - if (metadata.content?.customerKey) { + if (metadata.r__asset_customerKey) { // we merely want to be able to show an error if it does not exist - cache.searchForField( + metadata.content ||= {}; + metadata.content.customerKey = cache.searchForField( 'asset', - metadata.content.customerKey, + metadata.r__asset_customerKey, 'customerKey', 'customerKey' ); + delete metadata.r__asset_customerKey; } if (metadata.options?.badge && typeof metadata.options?.badge !== 'string') { // ensure it's a string, or else the API will return an error. Our SDK turns numbers in strings into actual numbers @@ -60,12 +62,13 @@ class TransactionalPush extends TransactionalMessage { if (metadata.content?.customerKey) { try { // we merely want to be able to show an error if it does not exist - cache.searchForField( + metadata.r__asset_customerKey = cache.searchForField( 'asset', metadata.content.customerKey, 'customerKey', 'customerKey' ); + delete metadata.content; } catch (ex) { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ diff --git a/lib/metadataTypes/definitions/TransactionalPush.definition.js b/lib/metadataTypes/definitions/TransactionalPush.definition.js index f1ee79c13..1b502f2ae 100644 --- a/lib/metadataTypes/definitions/TransactionalPush.definition.js +++ b/lib/metadataTypes/definitions/TransactionalPush.definition.js @@ -71,6 +71,12 @@ export default { retrieving: true, template: true, }, + r__asset_customerKey: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, 'options.badge': { isCreateable: true, isUpdateable: true, diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json index 39407d688..38f5010bf 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json @@ -4,9 +4,7 @@ "status": "Active", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", "description": "updated via deploy; note that applicationId can only be manually set up in Setup - Mobile Push", - "content": { - "customerKey": "mobileMessage_test" - }, + "r__asset_customerKey": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1", diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json index e3c0301cf..44d75684a 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json @@ -4,9 +4,7 @@ "status": "Active", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", "description": "created on deploy; note that applicationId can only be manually set up in Setup - Mobile Push", - "content": { - "customerKey": "mobileMessage_test" - }, + "r__asset_customerKey": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1", diff --git a/test/resources/9999999/transactionalPush/build-expected.json b/test/resources/9999999/transactionalPush/build-expected.json index 0f464a59c..bfb884d23 100644 --- a/test/resources/9999999/transactionalPush/build-expected.json +++ b/test/resources/9999999/transactionalPush/build-expected.json @@ -3,6 +3,6 @@ "definitionKey": "testTemplated_tpush", "description": "foobar. note that applicationId can only be manually set up in Setup - Mobile Push", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", - "content": { "customerKey": "mobileMessage_testTarget" }, + "r__asset_customerKey": "mobileMessage_testTarget", "options": { "sound": "temp.wmv", "badge": "1" } } diff --git a/test/resources/9999999/transactionalPush/get-expected.json b/test/resources/9999999/transactionalPush/get-expected.json index 242a9a809..92bf55110 100644 --- a/test/resources/9999999/transactionalPush/get-expected.json +++ b/test/resources/9999999/transactionalPush/get-expected.json @@ -6,6 +6,6 @@ "status": "Active", "createdDate": "2022-12-07T02:56:00", "modifiedDate": "2022-12-07T02:56:00", - "content": { "customerKey": "mobileMessage_test" }, + "r__asset_customerKey": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1" } } diff --git a/test/resources/9999999/transactionalPush/patch-expected.json b/test/resources/9999999/transactionalPush/patch-expected.json index 2cf1ecd9b..403946381 100644 --- a/test/resources/9999999/transactionalPush/patch-expected.json +++ b/test/resources/9999999/transactionalPush/patch-expected.json @@ -6,9 +6,7 @@ "description": "updated via deploy; note that applicationId can only be manually set up in Setup - Mobile Push", "createdDate": "2022-12-07T02:56:00", "modifiedDate": "2022-12-07T03:26:00", - "content": { - "customerKey": "mobileMessage_test" - }, + "r__asset_customerKey": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1" diff --git a/test/resources/9999999/transactionalPush/post-expected.json b/test/resources/9999999/transactionalPush/post-expected.json index 7f87af359..cdf1c84ac 100644 --- a/test/resources/9999999/transactionalPush/post-expected.json +++ b/test/resources/9999999/transactionalPush/post-expected.json @@ -6,9 +6,7 @@ "description": "created on deploy; note that applicationId can only be manually set up in Setup - Mobile Push", "createdDate": "2022-12-07T02:56:00", "modifiedDate": "2022-12-07T03:26:00", - "content": { - "customerKey": "mobileMessage_test" - }, + "r__asset_customerKey": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1" diff --git a/test/resources/9999999/transactionalPush/template-expected.json b/test/resources/9999999/transactionalPush/template-expected.json index 78de6f6c6..6f13ae378 100644 --- a/test/resources/9999999/transactionalPush/template-expected.json +++ b/test/resources/9999999/transactionalPush/template-expected.json @@ -3,6 +3,6 @@ "definitionKey": "{{{prefix}}}tpush", "description": "{{{description}}}. note that applicationId can only be manually set up in Setup - Mobile Push", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", - "content": { "customerKey": "mobileMessage{{{suffix}}}" }, + "r__asset_customerKey": "mobileMessage{{{suffix}}}", "options": { "sound": "temp.wmv", "badge": "1" } } From 94e1cb12fe0a7acf143915f05eb425473ac65b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 17 May 2024 22:36:22 +0200 Subject: [PATCH 272/359] #58: normalize cross-type references with r__ for mobileMessage --- lib/metadataTypes/MobileMessage.js | 42 ++++++++++++------- .../definitions/MobileMessage.definition.js | 16 ++++--- .../NTIzOjc4OjA.mobileMessage-meta.json | 6 +-- .../mobileMessage/new.mobileMessage-meta.json | 6 +-- .../9999999/mobileMessage/build-expected.json | 7 +--- .../9999999/mobileMessage/get-expected.json | 7 +--- .../mobileMessage/post-create-expected.json | 4 +- .../mobileMessage/post-update-expected.json | 7 +--- .../mobileMessage/template-expected.json | 7 +--- 9 files changed, 52 insertions(+), 50 deletions(-) diff --git a/lib/metadataTypes/MobileMessage.js b/lib/metadataTypes/MobileMessage.js index 58390931d..7f2c56cda 100644 --- a/lib/metadataTypes/MobileMessage.js +++ b/lib/metadataTypes/MobileMessage.js @@ -165,7 +165,13 @@ class MobileMessage extends MetadataType { static postRetrieveTasks(metadata) { // mobileCode try { - cache.searchForField('mobileCode', metadata.code.code, 'code', 'code'); + metadata.r__mobileCode_code = cache.searchForField( + 'mobileCode', + metadata.code.code, + 'code', + 'code' + ); + delete metadata.code; } catch (ex) { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ @@ -175,11 +181,12 @@ class MobileMessage extends MetadataType { } // mobileKeyword + try { for (const attr of ['keyword', 'subscriptionKeyword', 'nextKeyword']) { if (metadata[attr]?.id) { metadata[attr] = { - c__codeKeyword: cache.searchForField( + r__mobileKeyword_c__codeKeyword: cache.searchForField( 'mobileKeyword', metadata[attr].id, 'id', @@ -198,7 +205,7 @@ class MobileMessage extends MetadataType { // campaign try { if (Array.isArray(metadata.campaigns)) { - metadata.c__campaignNames = []; + metadata.r__campaign_name = []; for (const campaign of metadata.campaigns) { try { @@ -208,7 +215,7 @@ class MobileMessage extends MetadataType { throw new Error(`campaign ${campaign.name} not found in cache`); } - metadata.c__campaignNames.push(campaign.name); + metadata.r__campaign_name.push(campaign.name); } catch (ex) { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]}: ${ @@ -267,19 +274,26 @@ class MobileMessage extends MetadataType { */ static async preDeployTasks(metadata, deployDir) { // mobileCode - const code = cache.getByKey('mobileCode', metadata.code.code); - if (!code) { - throw new Error(`mobileCode ${metadata.code.code} not found in cache`); + if (metadata.r__mobileCode_code) { + metadata.code ||= {}; + const code = cache.getByKey('mobileCode', metadata.r__mobileCode_code); + if (!code) { + throw new Error(`mobileCode ${metadata.r__mobileCode_code} not found in cache`); + } + metadata.code = code; + delete metadata.r__mobileCode_code; } - metadata.code = code; // mobileKeyword for (const attr of ['keyword', 'subscriptionKeyword', 'nextKeyword']) { - if (metadata[attr]?.c__codeKeyword) { - const keywordObj = cache.getByKey('mobileKeyword', metadata[attr].c__codeKeyword); + if (metadata[attr]?.r__mobileKeyword_c__codeKeyword) { + const keywordObj = cache.getByKey( + 'mobileKeyword', + metadata[attr].r__mobileKeyword_c__codeKeyword + ); if (!keywordObj) { throw new Error( - `mobileKeyword ${metadata[attr].c__codeKeyword} not found in cache` + `mobileKeyword ${metadata[attr].r__mobileKeyword_c__codeKeyword} not found in cache` ); } metadata[attr] = keywordObj; @@ -287,10 +301,10 @@ class MobileMessage extends MetadataType { } // campaign - if (Array.isArray(metadata.c__campaignNames)) { + if (Array.isArray(metadata.r__campaign_name)) { metadata.campaigns = []; - for (const campaignName of metadata.c__campaignNames) { + for (const campaignName of metadata.r__campaign_name) { const campaign = cache.getByKey('campaign', campaignName); if (!campaign) { throw new Error(`campaign ${campaignName} not found in cache`); @@ -304,7 +318,7 @@ class MobileMessage extends MetadataType { }, }); } - delete metadata.c__campaignNames; + delete metadata.r__campaign_name; } if (metadata.smsTriggeredSendDefinitionId !== '00000000-0000-0000-0000-000000000000') { diff --git a/lib/metadataTypes/definitions/MobileMessage.definition.js b/lib/metadataTypes/definitions/MobileMessage.definition.js index 70f02bbfa..7b0883ec8 100644 --- a/lib/metadataTypes/definitions/MobileMessage.definition.js +++ b/lib/metadataTypes/definitions/MobileMessage.definition.js @@ -37,6 +37,12 @@ export default { 'campaigns[]': { skipValidation: true, }, + r__mobileCode_code: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, 'code.code': { isCreateable: true, isUpdateable: true, @@ -319,7 +325,7 @@ export default { retrieving: false, template: false, }, - 'keyword.c__codeKeyword': { + 'keyword.r__mobileKeyword_c__codeKeyword': { isCreateable: false, isUpdateable: false, retrieving: true, @@ -635,7 +641,7 @@ export default { retrieving: false, template: false, }, - 'subscriptionKeyword.c__codeKeyword': { + 'subscriptionKeyword.r__mobileKeyword_c__codeKeyword': { isCreateable: false, isUpdateable: false, retrieving: true, @@ -665,7 +671,7 @@ export default { retrieving: false, template: false, }, - 'nextKeyword.c__codeKeyword': { + 'nextKeyword.r__mobileKeyword_c__codeKeyword': { isCreateable: false, isUpdateable: false, retrieving: true, @@ -774,12 +780,12 @@ export default { retrieving: true, template: true, }, - c__campaignNames: { + r__campaign_name: { isCreateable: false, isUpdateable: false, retrieving: true, template: true, }, - 'c__campaignNames[]': { skipValidation: true }, + 'r__campaign_name[]': { skipValidation: true }, }, }; diff --git a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json index 50cbe9cae..2300663ca 100644 --- a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json @@ -4,10 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testExisting_mobileMessage", "origin": "SMS Send", - "code": { - "code": "4912312345678" - }, - "c__campaignNames": ["testExisting_campaign"], + "r__mobileCode_code": "4912312345678", + "r__campaign_name": ["testExisting_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { diff --git a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json index 74c631b83..92dbe5bba 100644 --- a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json @@ -4,10 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testNew_mobileMessage", "origin": "SMS Send", - "code": { - "code": "4912312345678" - }, - "c__campaignNames": ["testExisting_campaign"], + "r__mobileCode_code": "4912312345678", + "r__campaign_name": ["testExisting_campaign"], "mtSendDate": "2017-07-03T14:03:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/build-expected.json b/test/resources/9999999/mobileMessage/build-expected.json index ae0b6bb81..3d990b9dd 100644 --- a/test/resources/9999999/mobileMessage/build-expected.json +++ b/test/resources/9999999/mobileMessage/build-expected.json @@ -3,11 +3,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testTemplated_mobileMessage", "origin": "SMS Send", - "code": { - "code": "4912312345678" - }, - "c__campaignNames": ["testTemplated_campaign"], - + "r__mobileCode_code": "4912312345678", + "r__campaign_name": ["testTemplated_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/get-expected.json b/test/resources/9999999/mobileMessage/get-expected.json index 4138eda34..8afb5b87d 100644 --- a/test/resources/9999999/mobileMessage/get-expected.json +++ b/test/resources/9999999/mobileMessage/get-expected.json @@ -4,11 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testExisting_mobileMessage", "origin": "SMS Send", - "code": { - "code": "4912312345678" - }, - "c__campaignNames": ["testExisting_campaign"], - + "r__mobileCode_code": "4912312345678", + "r__campaign_name": ["testExisting_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/post-create-expected.json b/test/resources/9999999/mobileMessage/post-create-expected.json index 936c2bd69..6b5a39f7d 100644 --- a/test/resources/9999999/mobileMessage/post-create-expected.json +++ b/test/resources/9999999/mobileMessage/post-create-expected.json @@ -4,9 +4,7 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "jb test 3", "origin": "SMS Send", - "code": { - "code": "4912312345678" - }, + "r__mobileCode_code": "4912312345678", "mtSendDate": "2017-07-03T14:03:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/post-update-expected.json b/test/resources/9999999/mobileMessage/post-update-expected.json index 50cbe9cae..fa72aa9ee 100644 --- a/test/resources/9999999/mobileMessage/post-update-expected.json +++ b/test/resources/9999999/mobileMessage/post-update-expected.json @@ -4,11 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testExisting_mobileMessage", "origin": "SMS Send", - "code": { - "code": "4912312345678" - }, - "c__campaignNames": ["testExisting_campaign"], - + "r__mobileCode_code": "4912312345678", + "r__campaign_name": ["testExisting_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/template-expected.json b/test/resources/9999999/mobileMessage/template-expected.json index dc388db49..26b7e3933 100644 --- a/test/resources/9999999/mobileMessage/template-expected.json +++ b/test/resources/9999999/mobileMessage/template-expected.json @@ -3,11 +3,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "{{{prefix}}}mobileMessage", "origin": "SMS Send", - "code": { - "code": "4912312345678" - }, - "c__campaignNames": ["{{{prefix}}}campaign"], - + "r__mobileCode_code": "4912312345678", + "r__campaign_name": ["{{{prefix}}}campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", From a76e0552f5987bf91a74974273b47773546eaed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 21 May 2024 14:40:13 +0200 Subject: [PATCH 273/359] #58: normalize cross-type references with r__ for importFile --- lib/metadataTypes/ImportFile.js | 31 +++++++++++++++---- .../definitions/ImportFile.definition.js | 2 +- .../9999999/importFile/get-sms-expected.json | 2 +- 3 files changed, 27 insertions(+), 8 deletions(-) diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index e4f3cd0ed..b370cb573 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -268,15 +268,15 @@ class ImportFile extends MetadataType { break; } case 'SMS': { - if (metadata.destination.c__codeKeyword) { + if (metadata.destination.r__mobileKeyword_c__codeKeyword) { // code const codeObj = cache.getByKey( 'mobileCode', - metadata.destination.c__codeKeyword.split('.')[0] + metadata.destination.r__mobileKeyword_c__codeKeyword.split('.')[0] ); if (!codeObj) { throw new Error( - `mobileCode ${metadata.destination.c__codeKeyword} not found in cache` + `mobileCode ${metadata.destination.r__mobileKeyword_c__codeKeyword} not found in cache` ); } metadata.code = codeObj; @@ -284,11 +284,11 @@ class ImportFile extends MetadataType { // keyword const keywordObj = cache.getByKey( 'mobileKeyword', - metadata.destination.c__codeKeyword + metadata.destination.r__mobileKeyword_c__codeKeyword ); if (!keywordObj) { throw new Error( - `mobileKeyword ${metadata.destination.c__codeKeyword} not found in cache` + `mobileKeyword ${metadata.destination.r__mobileKeyword_c__codeKeyword} not found in cache` ); } metadata.keyword = keywordObj; @@ -398,8 +398,27 @@ class ImportFile extends MetadataType { case 'SMS': { if (this.smsImports[metadata.name]) { const smsImport = this.smsImports[metadata.name]; + + // code + try { + cache.searchForField('mobileCode', smsImport.code?.code, 'code', 'code'); + } catch (ex) { + Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`); + } + // keyword + try { + cache.searchForField( + 'mobileKeyword', + smsImport.keyword?.keyword, + 'c__codeKeyword', + 'c__codeKeyword' + ); + } catch (ex) { + Util.logger.warn(` - ImportFile ${metadata.customerKey}: ${ex.message}`); + } + // code + keyword - metadata.destination.c__codeKeyword = + metadata.destination.r__mobileKeyword_c__codeKeyword = smsImport.code?.code + '.' + smsImport.keyword?.keyword; // source dataExtension if (smsImport.sourceObjectKey) { diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js index 236f954b7..2db250324 100644 --- a/lib/metadataTypes/definitions/ImportFile.definition.js +++ b/lib/metadataTypes/definitions/ImportFile.definition.js @@ -255,7 +255,7 @@ export default { retrieving: true, template: true, }, - 'destination.c__codeKeyword': { + 'destination.r__mobileKeyword_c__codeKeyword': { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/test/resources/9999999/importFile/get-sms-expected.json b/test/resources/9999999/importFile/get-sms-expected.json index b25b501aa..7a758133e 100644 --- a/test/resources/9999999/importFile/get-sms-expected.json +++ b/test/resources/9999999/importFile/get-sms-expected.json @@ -70,7 +70,7 @@ "standardQuotedStrings": false, "destination": { "c__destinationType": "SMS", - "c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" }, "source": { "r__dataExtension_CustomerKey": "testExisting_dataExtension", From c1cfaa1ff109557bb3403b0650caf9e14df3bcd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 21 May 2024 16:02:35 +0200 Subject: [PATCH 274/359] #58: simplify relation attributes to r__TYPE_key and r__TYPE_name and r__TYPE_id previously, we attempted to use the exact field names from the other type --- lib/metadataTypes/Asset.js | 10 +- lib/metadataTypes/AttributeGroup.js | 42 +++-- lib/metadataTypes/AttributeSet.js | 11 +- lib/metadataTypes/DataExtension.js | 20 +-- lib/metadataTypes/EmailSend.js | 56 +++---- lib/metadataTypes/Event.js | 8 +- lib/metadataTypes/ImportFile.js | 30 ++-- lib/metadataTypes/Journey.js | 154 +++++++++--------- lib/metadataTypes/MobileMessage.js | 28 ++-- lib/metadataTypes/Query.js | 8 +- lib/metadataTypes/SendClassification.js | 6 +- lib/metadataTypes/TransactionalEmail.js | 15 +- lib/metadataTypes/TransactionalPush.js | 8 +- lib/metadataTypes/TransactionalSMS.js | 25 ++- lib/metadataTypes/TriggeredSend.js | 45 +++-- lib/metadataTypes/Verification.js | 6 +- .../definitions/AttributeGroup.definition.js | 2 +- .../definitions/AttributeSet.definition.js | 2 +- .../definitions/DataExtension.definition.js | 2 +- .../definitions/EmailSend.definition.js | 10 +- .../definitions/ImportFile.definition.js | 6 +- .../definitions/MobileMessage.definition.js | 12 +- .../definitions/Query.definition.js | 2 +- .../SendClassification.definition.js | 2 +- .../TransactionalEmail.definition.js | 4 +- .../TransactionalPush.definition.js | 2 +- .../TransactionalSMS.definition.js | 2 +- .../definitions/TriggeredSend.definition.js | 10 +- .../definitions/Verification.definition.js | 2 +- .../query/testNew_query.query-meta.json | 2 +- ...testExisting_emailSend.emailSend-meta.json | 8 +- .../testNew_emailSend.emailSend-meta.json | 8 +- ...stExisting_importFile.importFile-meta.json | 2 +- .../testNew_importFile.importFile-meta.json | 2 +- ...isting_journey_Quicksend.journey-meta.json | 8 +- .../NTIzOjc4OjA.mobileMessage-meta.json | 4 +- .../mobileMessage/new.mobileMessage-meta.json | 4 +- .../query/testExisting_query.query-meta.json | 2 +- ...testExisting_query_fixKeys.query-meta.json | 2 +- .../query/testNew_query.query-meta.json | 2 +- ...lassification.sendClassification-meta.json | 2 +- ...lassification.sendClassification-meta.json | 2 +- ...isting_temail.transactionalEmail-meta.json | 2 +- ...estNew_temail.transactionalEmail-meta.json | 2 +- ...Existing_tpush.transactionalPush-meta.json | 2 +- .../testNew_tpush.transactionalPush-meta.json | 2 +- ...stExisting_tsms.transactionalSMS-meta.json | 2 +- .../testNew_tsms.transactionalSMS-meta.json | 2 +- ...ting_triggeredSend.triggeredSend-meta.json | 6 +- ...tNew_triggeredSend.triggeredSend-meta.json | 6 +- ...a488-20eb-4ba0-b0b9.verification-meta.json | 2 +- ...a488-20eb-4ba0-b0b9.verification-meta.json | 2 +- .../query/patch_keySuffix-expected.json | 2 +- .../build-templatebasedemail-expected.json | 2 +- .../retrieve-templatebasedemail-expected.json | 2 +- .../template-templatebasedemail-expected.json | 2 +- .../attributeGroup/retrieve-expected.json | 2 +- .../attributeSet/retrieve-expected.json | 6 +- .../9999999/emailSend/build-expected.json | 10 +- .../9999999/emailSend/get-expected.json | 10 +- .../9999999/emailSend/patch-expected.json | 10 +- .../9999999/emailSend/post-expected.json | 10 +- .../9999999/emailSend/template-expected.json | 10 +- .../9999999/importFile/build-expected.json | 2 +- .../9999999/importFile/get-expected.json | 2 +- .../9999999/importFile/get-sms-expected.json | 4 +- .../9999999/importFile/patch-expected.json | 2 +- .../9999999/importFile/post-expected.json | 2 +- .../9999999/importFile/template-expected.json | 2 +- .../9999999/journey/build-expected.json | 8 +- .../journey/get-multistep-expected.json | 6 +- .../journey/get-quicksend-expected.json | 8 +- .../get-transactionalEmail-expected.json | 10 +- .../9999999/journey/template-expected.json | 8 +- .../9999999/mobileMessage/build-expected.json | 4 +- .../9999999/mobileMessage/get-expected.json | 4 +- .../mobileMessage/post-create-expected.json | 2 +- .../mobileMessage/post-update-expected.json | 4 +- .../mobileMessage/template-expected.json | 4 +- .../9999999/query/build-expected.json | 2 +- .../resources/9999999/query/get-expected.json | 2 +- .../9999999/query/get2-expected.json | 2 +- .../9999999/query/patch-expected.json | 2 +- .../9999999/query/patch_fixKeys-expected.json | 2 +- .../query/patch_fixKeysSuffix-expected.json | 2 +- .../9999999/query/post-expected.json | 2 +- .../9999999/query/template-expected.json | 2 +- .../sendClassification/build-expected.json | 2 +- .../sendClassification/get-expected.json | 2 +- .../sendClassification/patch-expected.json | 2 +- .../sendClassification/post-expected.json | 2 +- .../sendClassification/template-expected.json | 2 +- .../transactionalEmail/build-expected.json | 4 +- .../transactionalEmail/get-expected.json | 4 +- .../transactionalEmail/patch-expected.json | 4 +- .../transactionalEmail/post-expected.json | 4 +- .../transactionalEmail/template-expected.json | 4 +- .../transactionalPush/build-expected.json | 2 +- .../transactionalPush/get-expected.json | 2 +- .../transactionalPush/patch-expected.json | 2 +- .../transactionalPush/post-expected.json | 2 +- .../transactionalPush/template-expected.json | 2 +- .../transactionalSMS/build-expected.json | 2 +- .../transactionalSMS/get-expected.json | 2 +- .../transactionalSMS/patch-expected.json | 2 +- .../transactionalSMS/post-expected.json | 2 +- .../transactionalSMS/template-expected.json | 2 +- .../9999999/triggeredSend/build-expected.json | 6 +- .../9999999/triggeredSend/get-expected.json | 6 +- .../9999999/triggeredSend/patch-expected.json | 6 +- .../9999999/triggeredSend/post-expected.json | 6 +- .../triggeredSend/template-expected.json | 6 +- .../9999999/verification/build-expected.json | 2 +- .../9999999/verification/get-expected.json | 2 +- .../9999999/verification/patch-expected.json | 2 +- .../9999999/verification/post-expected.json | 2 +- .../verification/template-expected.json | 2 +- test/type.query.test.js | 2 +- types/mcdev.d.js | 6 +- 119 files changed, 421 insertions(+), 437 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 30c6998fe..cce4e3a35 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -571,7 +571,7 @@ class Asset extends MetadataType { // get template try { if (metadata.views?.html?.template?.id) { - metadata.views.html.template.r__asset_customerKey = cache.searchForField( + metadata.views.html.template.r__asset_key = cache.searchForField( 'asset', metadata.views?.html?.template?.id, 'id', @@ -688,18 +688,18 @@ class Asset extends MetadataType { // template-based emails if ( metadata.assetType.name === 'templatebasedemail' && - metadata.views?.html?.template?.r__asset_customerKey + metadata.views?.html?.template?.r__asset_key ) { // template metadata.views.html.template.id = cache.searchForField( 'asset', - metadata.views.html.template.r__asset_customerKey, + metadata.views.html.template.r__asset_key, 'customerKey', 'id' ); metadata.views.html.template.name = cache.searchForField( 'asset', - metadata.views.html.template.r__asset_customerKey, + metadata.views.html.template.r__asset_key, 'customerKey', 'name' ); @@ -715,7 +715,7 @@ class Asset extends MetadataType { metadata.views.html.template.availableViews = []; metadata.views.html.template.modelVersion = 2; - delete metadata.views.html.template.r__asset_customerKey; + delete metadata.views.html.template.r__asset_key; } // restore asset type id which is needed for deploy diff --git a/lib/metadataTypes/AttributeGroup.js b/lib/metadataTypes/AttributeGroup.js index d35552cec..50134ee77 100644 --- a/lib/metadataTypes/AttributeGroup.js +++ b/lib/metadataTypes/AttributeGroup.js @@ -52,31 +52,29 @@ class AttributeGroup extends MetadataType { delete metadata.mID; // attributeSet - metadata.r__attributeSet_definitionKey = metadata.attributeSetIdentifiers.map( - (attributeSet) => { - try { - const key = cache.searchForField( - 'attributeSet', - attributeSet.definitionID, - 'definitionID', - 'definitionKey' + metadata.r__attributeSet_key = metadata.attributeSetIdentifiers.map((attributeSet) => { + try { + const key = cache.searchForField( + 'attributeSet', + attributeSet.definitionID, + 'definitionID', + 'definitionKey' + ); + if (key !== attributeSet.definitionKey) { + Util.logger.debug( + `AttributeSet key mismatch. Overwriting ${attributeSet.definitionKey} with ${key}` ); - if (key !== attributeSet.definitionKey) { - Util.logger.debug( - `AttributeSet key mismatch. Overwriting ${attributeSet.definitionKey} with ${key}` - ); - } - return key; - } catch (ex) { - Util.logger.warn( - ` - ${this.definition.type} ${metadata[this.definition.keyField]} (for ${ - attributeSet.definitionKey - }): ${ex.message}` - ); - return attributeSet; } + return key; + } catch (ex) { + Util.logger.warn( + ` - ${this.definition.type} ${metadata[this.definition.keyField]} (for ${ + attributeSet.definitionKey + }): ${ex.message}` + ); + return attributeSet; } - ); + }); delete metadata.attributeSetIdentifiers; // requiredRelationships diff --git a/lib/metadataTypes/AttributeSet.js b/lib/metadataTypes/AttributeSet.js index edc75a928..29843d4f7 100644 --- a/lib/metadataTypes/AttributeSet.js +++ b/lib/metadataTypes/AttributeSet.js @@ -189,7 +189,7 @@ class AttributeSet extends MetadataType { case 'DataExtension': { // shared / local DEs try { - metadata.r__dataExtension_CustomerKey = cache.searchForField( + metadata.r__dataExtension_key = cache.searchForField( 'dataExtension', metadata.storageReferenceID.value, 'ObjectID', @@ -244,7 +244,7 @@ class AttributeSet extends MetadataType { switch (relationship[type + 'Item'].relationshipType) { case 'AttributeGroup': { try { - relationship[type + 'Item'].r__attributeGroup_definitionKey = + relationship[type + 'Item'].r__attributeGroup_key = cache.searchForField( 'attributeGroup', relationship[type + 'Item']?.identifier, @@ -267,7 +267,7 @@ class AttributeSet extends MetadataType { } case 'AttributeSet': { try { - relationship[type + 'Item'].r__attributeSet_definitionKey = + relationship[type + 'Item'].r__attributeSet_key = cache.searchForField( 'attributeSet', relationship[type + 'Item']?.identifier, @@ -279,13 +279,12 @@ class AttributeSet extends MetadataType { // get relationship fieldnames // check if its a self-reference to metadata.valueDefinitions or if it's a reference to another attributeSet relationshipObj = - relationship[type + 'Item'].r__attributeSet_definitionKey === + relationship[type + 'Item'].r__attributeSet_key === metadata.definitionKey ? metadata : cache.getByKey( 'attributeSet', - relationship[type + 'Item'] - .r__attributeSet_definitionKey + relationship[type + 'Item'].r__attributeSet_key ); } catch (ex) { Util.logger.warn( diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index 68a2261f4..98d81e1cc 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -926,7 +926,7 @@ class DataExtension extends MetadataType { // DataExtensionTemplate if (metadata.Template?.CustomerKey) { try { - metadata.r__dataExtensionTemplate_Name = cache.searchForField( + metadata.r__dataExtensionTemplate_name = cache.searchForField( 'dataExtensionTemplate', metadata.Template.CustomerKey, 'CustomerKey', @@ -1090,10 +1090,10 @@ class DataExtension extends MetadataType { super.setFolderId(metadata); // DataExtensionTemplate - if (metadata.r__dataExtensionTemplate_Name) { + if (metadata.r__dataExtensionTemplate_name) { // remove templated fields for (const templateField of this.definition.templateFields[ - metadata.r__dataExtensionTemplate_Name + metadata.r__dataExtensionTemplate_name ]) { for (let index = 0; index < metadata.Fields.length; index++) { const element = metadata.Fields[index]; @@ -1110,15 +1110,15 @@ class DataExtension extends MetadataType { metadata.Template = { CustomerKey: cache.searchForField( 'dataExtensionTemplate', - metadata.r__dataExtensionTemplate_Name, + metadata.r__dataExtensionTemplate_name, 'Name', 'CustomerKey' ), }; - delete metadata.r__dataExtensionTemplate_Name; + delete metadata.r__dataExtensionTemplate_name; } catch (ex) { Util.logger.debug(ex.message); - // It is assumed that non-supported types would not have been converted to r__dataExtensionTemplate_Name upon retrieve. + // It is assumed that non-supported types would not have been converted to r__dataExtensionTemplate_name upon retrieve. // Deploying to same BU therefore still works! // A workaround for cross-BU deploy exists but it's likely not beneficial to explain to users: // Create a DE based on the not-supported template on the target BU, retrieve it, copy the Template.CustomerKey into the to-be-deployed DE (or use mcdev-templating), done @@ -1227,8 +1227,8 @@ class DataExtension extends MetadataType { ')

\n\n' : `No

\n\n`; output += `

Testable: ${json.IsTestable === true ? 'Yes' : 'No'}

\n\n`; - if (json.r__dataExtensionTemplate_Name) { - output += `

Template: ${json.r__dataExtensionTemplate_Name}

`; + if (json.r__dataExtensionTemplate_name) { + output += `

Template: ${json.r__dataExtensionTemplate_name}

`; } output += ''; @@ -1280,8 +1280,8 @@ class DataExtension extends MetadataType { '`)\n\n' : `No\n\n`; output += `**Testable:** ${json.IsTestable === true ? 'Yes' : 'No'}\n\n`; - if (json.r__dataExtensionTemplate_Name) { - output += `**Template:** ${json.r__dataExtensionTemplate_Name}\n\n`; + if (json.r__dataExtensionTemplate_name) { + output += `**Template:** ${json.r__dataExtensionTemplate_name}\n\n`; } let tableSeparator = ''; diff --git a/lib/metadataTypes/EmailSend.js b/lib/metadataTypes/EmailSend.js index f31ad1efe..48537566e 100644 --- a/lib/metadataTypes/EmailSend.js +++ b/lib/metadataTypes/EmailSend.js @@ -110,11 +110,11 @@ class EmailSend extends MetadataType { super.setFolderId(metadata); // email; in case we still have Email.ID, keep it but warn metadata.Email ||= {}; - if (metadata.r__email_Name) { + if (metadata.r__email_name) { // classic - metadata.Email.ID = cache.searchForField('email', metadata.r__email_Name, 'Name', 'ID'); - delete metadata.r__email_Name; - } else if (metadata.r__asset_customerKey) { + metadata.Email.ID = cache.searchForField('email', metadata.r__email_name, 'Name', 'ID'); + delete metadata.r__email_name; + } else if (metadata.r__asset_key) { // content builder // * this ignores r__asset_name_readOnly on purpose\ as that is only unique per parent folder but useful during PR reviews // will try to find the key with the bu mid at the end, if unable, will try to find the key without it @@ -122,11 +122,11 @@ class EmailSend extends MetadataType { // check asset key as provided metadata.Email.ID = cache.searchForField( 'asset', - metadata.r__asset_customerKey, + metadata.r__asset_key, 'customerKey', 'legacyData.legacyId' ); - delete metadata.r__asset_customerKey; + delete metadata.r__asset_key; delete metadata.r__asset_name_readOnly; } catch { // if we deploy to another BU, try applying the BU's MID to the end, which we do in preDeployTasks for assets @@ -136,19 +136,18 @@ class EmailSend extends MetadataType { metadata.Email.ID = cache.searchForField( 'asset', - metadata.r__asset_customerKey.slice(0, Math.max(0, 36 - suffix.length)) + - suffix, + metadata.r__asset_key.slice(0, Math.max(0, 36 - suffix.length)) + suffix, 'customerKey', 'legacyData.legacyId' ); - delete metadata.r__asset_customerKey; + delete metadata.r__asset_key; delete metadata.r__asset_name_readOnly; } } else if (metadata.Email.ID) { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]} (${ metadata[this.definition.keyField] - }): Email.ID was provided manually in your deployment file. We recommend using r__asset_customerKey instead.` + }): Email.ID was provided manually in your deployment file. We recommend using r__asset_key instead.` ); try { // content builder - test only @@ -181,22 +180,22 @@ class EmailSend extends MetadataType { // - DataSourceTypeID=List --> List is source; DE is not defined for (const sdl of metadata.SendDefinitionList) { // get DataExtension (optional) - if (sdl.r__dataExtension_CustomerKey) { + if (sdl.r__dataExtension_key) { if (sdl.DataSourceTypeID !== 'CustomObject') { throw new Error( - `Expecting DataSourceTypeID to equal 'CustomObject' when r__dataExtension_CustomerKey is defined; Found '${sdl.DataSourceTypeID}'` + `Expecting DataSourceTypeID to equal 'CustomObject' when r__dataExtension_key is defined; Found '${sdl.DataSourceTypeID}'` ); } sdl.CustomObjectID = cache.searchForField( 'dataExtension', - sdl.r__dataExtension_CustomerKey, + sdl.r__dataExtension_key, 'CustomerKey', 'ObjectID' ); - delete sdl.r__dataExtension_CustomerKey; + delete sdl.r__dataExtension_key; } else if (sdl.DataSourceTypeID === 'CustomObject') { throw new Error( - `Expecting r__dataExtension_CustomerKey to be defined if DataSourceTypeID='CustomObject'` + `Expecting r__dataExtension_key to be defined if DataSourceTypeID='CustomObject'` ); } if (!sdl.SalesForceObjectID || sdl.SalesForceObjectID === '') { @@ -218,30 +217,30 @@ class EmailSend extends MetadataType { } // sender profile - if (metadata.r__senderProfile_CustomerKey) { + if (metadata.r__senderProfile_key) { cache.searchForField( 'senderProfile', - metadata.r__senderProfile_CustomerKey, + metadata.r__senderProfile_key, 'CustomerKey', 'CustomerKey' ); metadata.SenderProfile = { - CustomerKey: metadata.r__senderProfile_CustomerKey, + CustomerKey: metadata.r__senderProfile_key, }; - delete metadata.r__senderProfile_CustomerKey; + delete metadata.r__senderProfile_key; } // send classification - if (metadata.r__sendClassification_CustomerKey) { + if (metadata.r__sendClassification_key) { cache.searchForField( 'sendClassification', - metadata.r__sendClassification_CustomerKey, + metadata.r__sendClassification_key, 'CustomerKey', 'CustomerKey' ); metadata.SendClassification = { - CustomerKey: metadata.r__sendClassification_CustomerKey, + CustomerKey: metadata.r__sendClassification_key, }; - delete metadata.r__sendClassification_CustomerKey; + delete metadata.r__sendClassification_key; } // delivery profile if (metadata.r__deliveryProfile_key) { @@ -284,7 +283,7 @@ class EmailSend extends MetadataType { 'legacyData.legacyId', 'customerKey' ); - metadata.r__asset_customerKey = contentBuilderEmailKey; + metadata.r__asset_key = contentBuilderEmailKey; delete metadata.Email; } catch { try { @@ -295,7 +294,7 @@ class EmailSend extends MetadataType { 'ID', 'Name' ); - metadata.r__email_Name = classicEmail; + metadata.r__email_name = classicEmail; delete metadata.Email; } catch { Util.logger.warn( @@ -320,7 +319,7 @@ class EmailSend extends MetadataType { // get DataExtension keys if (sdl.CustomObjectID) { try { - sdl.r__dataExtension_CustomerKey = cache.searchForField( + sdl.r__dataExtension_key = cache.searchForField( 'dataExtension', sdl.CustomObjectID, 'ObjectID', @@ -365,7 +364,7 @@ class EmailSend extends MetadataType { 'CustomerKey', 'CustomerKey' ); - metadata.r__senderProfile_CustomerKey = metadata.SenderProfile.CustomerKey; + metadata.r__senderProfile_key = metadata.SenderProfile.CustomerKey; delete metadata.SenderProfile; } catch (ex) { Util.logger.warn( @@ -382,8 +381,7 @@ class EmailSend extends MetadataType { 'CustomerKey', 'CustomerKey' ); - metadata.r__sendClassification_CustomerKey = - metadata.SendClassification.CustomerKey; + metadata.r__sendClassification_key = metadata.SendClassification.CustomerKey; delete metadata.SendClassification; } catch (ex) { Util.logger.warn( diff --git a/lib/metadataTypes/Event.js b/lib/metadataTypes/Event.js index 4d1b965d1..8d167c3bd 100644 --- a/lib/metadataTypes/Event.js +++ b/lib/metadataTypes/Event.js @@ -187,16 +187,16 @@ class Event extends MetadataType { * @returns {MetadataTypeItem} parsed version */ static preDeployTasks(metadata) { - if (metadata.r__dataExtension_CustomerKey) { + if (metadata.r__dataExtension_key) { metadata.dataExtensionId = cache.searchForField( 'dataExtension', - metadata.r__dataExtension_CustomerKey, + metadata.r__dataExtension_key, 'CustomerKey', 'ObjectID' ); metadata.dataExtensionName = cache.searchForField( 'dataExtension', - metadata.r__dataExtension_CustomerKey, + metadata.r__dataExtension_key, 'CustomerKey', 'Name' ); @@ -223,7 +223,7 @@ class Event extends MetadataType { */ static postRetrieveTasks(metadata) { try { - metadata.r__dataExtension_CustomerKey = cache.searchForField( + metadata.r__dataExtension_key = cache.searchForField( 'dataExtension', metadata.dataExtensionId, 'ObjectID', diff --git a/lib/metadataTypes/ImportFile.js b/lib/metadataTypes/ImportFile.js index b370cb573..e2b40265c 100644 --- a/lib/metadataTypes/ImportFile.js +++ b/lib/metadataTypes/ImportFile.js @@ -237,14 +237,14 @@ class ImportFile extends MetadataType { switch (metadata.destination.c__destinationType) { case 'DataExtension': { - if (metadata.destination.r__dataExtension_CustomerKey) { + if (metadata.destination.r__dataExtension_key) { metadata.destinationObjectId = cache.searchForField( 'dataExtension', - metadata.destination.r__dataExtension_CustomerKey, + metadata.destination.r__dataExtension_key, 'CustomerKey', 'ObjectID' ); - delete metadata.destination.r__dataExtension_CustomerKey; + delete metadata.destination.r__dataExtension_key; } else { throw new Error('Import Destination DataExtension not defined'); } @@ -268,15 +268,15 @@ class ImportFile extends MetadataType { break; } case 'SMS': { - if (metadata.destination.r__mobileKeyword_c__codeKeyword) { + if (metadata.destination.r__mobileKeyword_key) { // code const codeObj = cache.getByKey( 'mobileCode', - metadata.destination.r__mobileKeyword_c__codeKeyword.split('.')[0] + metadata.destination.r__mobileKeyword_key.split('.')[0] ); if (!codeObj) { throw new Error( - `mobileCode ${metadata.destination.r__mobileKeyword_c__codeKeyword} not found in cache` + `mobileCode ${metadata.destination.r__mobileKeyword_key} not found in cache` ); } metadata.code = codeObj; @@ -284,11 +284,11 @@ class ImportFile extends MetadataType { // keyword const keywordObj = cache.getByKey( 'mobileKeyword', - metadata.destination.r__mobileKeyword_c__codeKeyword + metadata.destination.r__mobileKeyword_key ); if (!keywordObj) { throw new Error( - `mobileKeyword ${metadata.destination.r__mobileKeyword_c__codeKeyword} not found in cache` + `mobileKeyword ${metadata.destination.r__mobileKeyword_key} not found in cache` ); } metadata.keyword = keywordObj; @@ -302,14 +302,14 @@ class ImportFile extends MetadataType { metadata.destinationObjectId = '00000000-0000-0000-0000-000000000000'; metadata.destinationObjectType = 'MobileSubscription'; // source - if (this.dataExtensionsLegacy[metadata.source.r__dataExtension_CustomerKey]) { + if (this.dataExtensionsLegacy[metadata.source.r__dataExtension_key]) { metadata.sourceObjectId = - this.dataExtensionsLegacy[metadata.source.r__dataExtension_CustomerKey].id; + this.dataExtensionsLegacy[metadata.source.r__dataExtension_key].id; metadata.sourceObjectName = this.dataExtensionsLegacy[ - metadata.source.r__dataExtension_CustomerKey + metadata.source.r__dataExtension_key ].dataExtensionName; - delete metadata.source.r__dataExtension_CustomerKey; + delete metadata.source.r__dataExtension_key; } Util.logger.debug( @@ -369,7 +369,7 @@ class ImportFile extends MetadataType { switch (metadata.destination.c__destinationType) { case 'DataExtension': { try { - metadata.destination.r__dataExtension_CustomerKey = cache.searchForField( + metadata.destination.r__dataExtension_key = cache.searchForField( 'dataExtension', metadata.destinationObjectId, 'ObjectID', @@ -418,11 +418,11 @@ class ImportFile extends MetadataType { } // code + keyword - metadata.destination.r__mobileKeyword_c__codeKeyword = + metadata.destination.r__mobileKeyword_key = smsImport.code?.code + '.' + smsImport.keyword?.keyword; // source dataExtension if (smsImport.sourceObjectKey) { - metadata.source.r__dataExtension_CustomerKey = smsImport.sourceObjectKey; + metadata.source.r__dataExtension_key = smsImport.sourceObjectKey; } } else { Util.logger.warn( diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index 514743f3d..a4caf3236 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -410,14 +410,14 @@ class Journey extends MetadataType { }): metaData.highThroughput.definitionKey not matching key in configurationArguments.transactionalEmailKey` ); } - activity.configurationArguments.r__transactionalEmail_definitionKey = + activity.configurationArguments.r__transactionalEmail_key = activity.configurationArguments.triggeredSendKey; delete activity.configurationArguments.triggeredSendKey; delete activity.configurationArguments.triggeredSendId; delete activity.metaData.highThroughput.definitionKey; if (activity.metaData?.highThroughput?.dataExtensionId) { - activity.metaData.highThroughput.r__dataExtension_CustomerKey = + activity.metaData.highThroughput.r__dataExtension_key = cache.searchForField( 'dataExtension', activity.metaData.highThroughput.dataExtensionId, @@ -496,7 +496,7 @@ class Journey extends MetadataType { ); configurationArguments.triggeredSendKey = tsKey; } - configurationArguments.r__triggeredSend_CustomerKey = + configurationArguments.r__triggeredSend_key = configurationArguments.triggeredSendKey; delete configurationArguments.triggeredSendKey; delete configurationArguments.triggeredSendId; @@ -505,13 +505,12 @@ class Journey extends MetadataType { Util.logger.debug( `triggeredSendKey found on activity but no triggeredSendId present on journey. Checking key directly...` ); - configurationArguments.r__triggeredSend_CustomerKey = - cache.searchForField( - 'triggeredSend', - configurationArguments.triggeredSendKey, - 'CustomerKey', - 'CustomerKey' - ); + configurationArguments.r__triggeredSend_key = cache.searchForField( + 'triggeredSend', + configurationArguments.triggeredSendKey, + 'CustomerKey', + 'CustomerKey' + ); delete configurationArguments.triggeredSendKey; } if ( @@ -571,14 +570,14 @@ class Journey extends MetadataType { } // DataExtension (optional) - triggeredSend.r__dataExtension_CustomerKey = {}; + triggeredSend.r__dataExtension_key = {}; if ( triggeredSend.domainExclusions && Array.isArray(triggeredSend.domainExclusions) && triggeredSend.domainExclusions.length ) { let errors = 0; - triggeredSend.r__dataExtension_CustomerKey.domainExclusions = + triggeredSend.r__dataExtension_key.domainExclusions = triggeredSend.domainExclusions.map((de) => { try { return cache.searchForField( @@ -599,15 +598,15 @@ class Journey extends MetadataType { delete triggeredSend.domainExclusions; // array with id & name of DE } } - if (!Object.keys(triggeredSend.r__dataExtension_CustomerKey).length) { + if (!Object.keys(triggeredSend.r__dataExtension_key).length) { // in case we found no linked dataExtensions, remove this empty shell - delete triggeredSend.r__dataExtension_CustomerKey; + delete triggeredSend.r__dataExtension_key; } // sender profile if (triggeredSend.senderProfileId) { try { - triggeredSend.r__senderProfile_CustomerKey = cache.searchForField( + triggeredSend.r__senderProfile_key = cache.searchForField( 'senderProfile', triggeredSend.senderProfileId, 'ObjectID', @@ -625,13 +624,12 @@ class Journey extends MetadataType { // send classification if (triggeredSend.sendClassificationId) { try { - triggeredSend.r__sendClassification_CustomerKey = - cache.searchForField( - 'sendClassification', - triggeredSend.sendClassificationId, - 'ObjectID', - 'CustomerKey' - ); + triggeredSend.r__sendClassification_key = cache.searchForField( + 'sendClassification', + triggeredSend.sendClassificationId, + 'ObjectID', + 'CustomerKey' + ); delete triggeredSend.sendClassificationId; } catch (ex) { Util.logger.warn( @@ -663,7 +661,7 @@ class Journey extends MetadataType { 'legacyData.legacyId', 'name' ); - triggeredSend.r__asset_customerKey = cache.searchForField( + triggeredSend.r__asset_key = cache.searchForField( 'asset', triggeredSend.emailId, 'legacyData.legacyId', @@ -673,7 +671,7 @@ class Journey extends MetadataType { } catch { try { // classic - triggeredSend.r__email_Name = cache.searchForField( + triggeredSend.r__email_name = cache.searchForField( 'email', triggeredSend.emailId, 'ID', @@ -697,7 +695,7 @@ class Journey extends MetadataType { // mobileMessage try { if (configurationArguments.messageId) { - configurationArguments.r__mobileMessage_id = cache.searchForField( + configurationArguments.r__mobileMessage_key = cache.searchForField( 'mobileMessage', configurationArguments.messageId, 'id', @@ -713,10 +711,10 @@ class Journey extends MetadataType { ); } // mobileKeyword - configurationArguments.r__mobileKeyword_c__codeKeyword = {}; + configurationArguments.r__mobileKeyword_key = {}; try { if (configurationArguments.keywordId) { - configurationArguments.r__mobileKeyword_c__codeKeyword.current = + configurationArguments.r__mobileKeyword_key.current = cache.searchForField( 'mobileKeyword', configurationArguments.keywordId, @@ -734,7 +732,7 @@ class Journey extends MetadataType { } try { if (configurationArguments.nextKeywordId) { - configurationArguments.r__mobileKeyword_c__codeKeyword.next = + configurationArguments.r__mobileKeyword_key.next = cache.searchForField( 'mobileKeyword', configurationArguments.nextKeywordId, @@ -750,17 +748,14 @@ class Journey extends MetadataType { }) activity-key=${activity.key}: ${ex.message}` ); } - if ( - !Object.keys(configurationArguments.r__mobileKeyword_c__codeKeyword) - .length - ) { + if (!Object.keys(configurationArguments.r__mobileKeyword_key).length) { // in case we found no linked dataExtensions, remove this empty shell - delete configurationArguments.r__mobileKeyword_c__codeKeyword; + delete configurationArguments.r__mobileKeyword_key; } // mobileCode try { if (configurationArguments.codeId) { - configurationArguments.r__mobileCode_code = cache.searchForField( + configurationArguments.r__mobileCode_key = cache.searchForField( 'mobileCode', configurationArguments.codeId, 'id', @@ -787,7 +782,7 @@ class Journey extends MetadataType { 'name' ); - configurationArguments.r__asset_customerKey = cache.searchForField( + configurationArguments.r__asset_key = cache.searchForField( 'asset', configurationArguments.assetId, 'id', @@ -881,32 +876,31 @@ class Journey extends MetadataType { switch (metadata.channel) { case 'email': { const activity = metadata.activities[0]; - if (activity.configurationArguments?.r__transactionalEmail_definitionKey) { + if (activity.configurationArguments?.r__transactionalEmail_key) { // trigger found; there can only be one entry in this array activity.configurationArguments.triggeredSendId = cache.searchForField( 'transactionalEmail', - activity.configurationArguments.r__transactionalEmail_definitionKey, + activity.configurationArguments.r__transactionalEmail_key, 'definitionKey', 'definitionId' ); activity.configurationArguments.triggeredSendKey = - activity.configurationArguments.r__transactionalEmail_definitionKey; + activity.configurationArguments.r__transactionalEmail_key; if (activity.metaData?.highThroughput) { activity.metaData.highThroughput.definitionKey = - activity.configurationArguments.r__transactionalEmail_definitionKey; + activity.configurationArguments.r__transactionalEmail_key; } - delete activity.configurationArguments - .r__transactionalEmail_definitionKey; + delete activity.configurationArguments.r__transactionalEmail_key; } - if (activity.metaData?.highThroughput?.r__dataExtension_CustomerKey) { + if (activity.metaData?.highThroughput?.r__dataExtension_key) { activity.metaData.highThroughput.dataExtensionId = cache.searchForField( 'dataExtension', - activity.metaData.highThroughput.r__dataExtension_CustomerKey, + activity.metaData.highThroughput.r__dataExtension_key, 'CustomerKey', 'ObjectID' ); - delete activity.metaData.highThroughput.r__dataExtension_CustomerKey; + delete activity.metaData.highThroughput.r__dataExtension_key; } break; @@ -951,20 +945,17 @@ class Journey extends MetadataType { // triggeredSend + email+asset // TODO email / asset const configurationArguments = activity.configurationArguments; - if ( - configurationArguments && - configurationArguments.r__triggeredSend_CustomerKey - ) { + if (configurationArguments && configurationArguments.r__triggeredSend_key) { // triggeredSendKey is not always set but triggeredSendId is configurationArguments.triggeredSendId = cache.searchForField( 'triggeredSend', - configurationArguments.r__triggeredSend_CustomerKey, + configurationArguments.r__triggeredSend_key, 'CustomerKey', 'ObjectID' ); configurationArguments.triggeredSendKey = - configurationArguments.r__triggeredSend_CustomerKey; - delete configurationArguments.r__triggeredSend_CustomerKey; + configurationArguments.r__triggeredSend_key; + delete configurationArguments.r__triggeredSend_key; } const triggeredSend = configurationArguments?.triggeredSend; if (triggeredSend) { @@ -992,9 +983,9 @@ class Journey extends MetadataType { delete triggeredSend.r__list_PathName; } // DataExtension (optional) - if (triggeredSend.r__dataExtension_CustomerKey?.length) { - triggeredSend.domainExclusions = - triggeredSend.r__dataExtension_CustomerKey.map((key) => { + if (triggeredSend.r__dataExtension_key?.length) { + triggeredSend.domainExclusions = triggeredSend.r__dataExtension_key.map( + (key) => { const id = cache.searchForField( 'dataExtension', key, @@ -1008,28 +999,29 @@ class Journey extends MetadataType { 'Name' ); return { id, name }; - }); + } + ); } // sender profile - if (triggeredSend.r__senderProfile_CustomerKey) { + if (triggeredSend.r__senderProfile_key) { triggeredSend.senderProfileId = cache.searchForField( 'senderProfile', - triggeredSend.r__senderProfile_CustomerKey, + triggeredSend.r__senderProfile_key, 'CustomerKey', 'ObjectID' ); - delete triggeredSend.r__senderProfile_CustomerKey; + delete triggeredSend.r__senderProfile_key; } // send classification - if (triggeredSend.r__sendClassification_CustomerKey) { + if (triggeredSend.r__sendClassification_key) { triggeredSend.sendClassificationId = cache.searchForField( 'sendClassification', - triggeredSend.r__sendClassification_CustomerKey, + triggeredSend.r__sendClassification_key, 'CustomerKey', 'ObjectID' ); - delete triggeredSend.r__sendClassification_CustomerKey; + delete triggeredSend.r__sendClassification_key; } // message priority if (triggeredSend.c__priority) { @@ -1039,24 +1031,24 @@ class Journey extends MetadataType { } // email - if (triggeredSend.r__asset_customerKey) { + if (triggeredSend.r__asset_key) { triggeredSend.emailId = cache.searchForField( 'asset', - triggeredSend.r__asset_customerKey, + triggeredSend.r__asset_key, 'customerKey', 'legacyData.legacyId' ); - delete triggeredSend.r__asset_customerKey; + delete triggeredSend.r__asset_key; delete triggeredSend.r__asset_name_readOnly; - } else if (triggeredSend.r__email_Name) { + } else if (triggeredSend.r__email_name) { // classic triggeredSend.emailId = cache.searchForField( 'email', - triggeredSend.r__email_Name, + triggeredSend.r__email_name, 'Name', 'ID' ); - delete triggeredSend.r__email_Name; + delete triggeredSend.r__email_name; } } @@ -1066,52 +1058,52 @@ class Journey extends MetadataType { const configurationArguments = activity.configurationArguments; if (configurationArguments) { // mobileMessage - if (configurationArguments.r__mobileMessage_id) { + if (configurationArguments.r__mobileMessage_key) { configurationArguments.messageId = cache.searchForField( 'mobileMessage', - configurationArguments.r__mobileMessage_id, + configurationArguments.r__mobileMessage_key, 'id', 'id' ); - delete configurationArguments.r__mobileMessage_id; + delete configurationArguments.r__mobileMessage_key; } // mobileKeyword - if (configurationArguments.r__mobileKeyword_c__codeKeyword?.current) { + if (configurationArguments.r__mobileKeyword_key?.current) { configurationArguments.keywordId = cache.searchForField( 'mobileKeyword', - configurationArguments.r__mobileKeyword_c__codeKeyword.current, + configurationArguments.r__mobileKeyword_key.current, 'c__codeKeyword', 'id' ); } - if (configurationArguments.r__mobileKeyword_c__codeKeyword?.next) { + if (configurationArguments.r__mobileKeyword_key?.next) { configurationArguments.nextKeywordId = cache.searchForField( 'mobileKeyword', - configurationArguments.r__mobileKeyword_c__codeKeyword.next, + configurationArguments.r__mobileKeyword_key.next, 'c__codeKeyword', 'id' ); } - delete configurationArguments.r__mobileKeyword_c__codeKeyword; + delete configurationArguments.r__mobileKeyword_key; // mobileCode - if (configurationArguments.r__mobileCode_code) { + if (configurationArguments.r__mobileCode_key) { configurationArguments.codeId = cache.searchForField( 'mobileCode', - configurationArguments.r__mobileCode_code, + configurationArguments.r__mobileCode_key, 'code', 'id' ); - delete configurationArguments.r__mobileCode_code; + delete configurationArguments.r__mobileCode_key; } // asset-asset: jsonmessage - if (configurationArguments.r__asset_customerKey) { + if (configurationArguments.r__asset_key) { configurationArguments.assetId = cache.searchForField( 'asset', - configurationArguments.r__asset_customerKey, + configurationArguments.r__asset_key, 'customerKey', 'id' ); - delete configurationArguments.r__asset_customerKey; + delete configurationArguments.r__asset_key; delete configurationArguments.r__asset_name_readOnly; } diff --git a/lib/metadataTypes/MobileMessage.js b/lib/metadataTypes/MobileMessage.js index 7f2c56cda..f3e616ade 100644 --- a/lib/metadataTypes/MobileMessage.js +++ b/lib/metadataTypes/MobileMessage.js @@ -165,7 +165,7 @@ class MobileMessage extends MetadataType { static postRetrieveTasks(metadata) { // mobileCode try { - metadata.r__mobileCode_code = cache.searchForField( + metadata.r__mobileCode_key = cache.searchForField( 'mobileCode', metadata.code.code, 'code', @@ -186,7 +186,7 @@ class MobileMessage extends MetadataType { for (const attr of ['keyword', 'subscriptionKeyword', 'nextKeyword']) { if (metadata[attr]?.id) { metadata[attr] = { - r__mobileKeyword_c__codeKeyword: cache.searchForField( + r__mobileKeyword_key: cache.searchForField( 'mobileKeyword', metadata[attr].id, 'id', @@ -205,7 +205,7 @@ class MobileMessage extends MetadataType { // campaign try { if (Array.isArray(metadata.campaigns)) { - metadata.r__campaign_name = []; + metadata.r__campaign_key = []; for (const campaign of metadata.campaigns) { try { @@ -215,7 +215,7 @@ class MobileMessage extends MetadataType { throw new Error(`campaign ${campaign.name} not found in cache`); } - metadata.r__campaign_name.push(campaign.name); + metadata.r__campaign_key.push(campaign.name); } catch (ex) { Util.logger.warn( ` - ${this.definition.type} ${metadata[this.definition.nameField]}: ${ @@ -274,26 +274,26 @@ class MobileMessage extends MetadataType { */ static async preDeployTasks(metadata, deployDir) { // mobileCode - if (metadata.r__mobileCode_code) { + if (metadata.r__mobileCode_key) { metadata.code ||= {}; - const code = cache.getByKey('mobileCode', metadata.r__mobileCode_code); + const code = cache.getByKey('mobileCode', metadata.r__mobileCode_key); if (!code) { - throw new Error(`mobileCode ${metadata.r__mobileCode_code} not found in cache`); + throw new Error(`mobileCode ${metadata.r__mobileCode_key} not found in cache`); } metadata.code = code; - delete metadata.r__mobileCode_code; + delete metadata.r__mobileCode_key; } // mobileKeyword for (const attr of ['keyword', 'subscriptionKeyword', 'nextKeyword']) { - if (metadata[attr]?.r__mobileKeyword_c__codeKeyword) { + if (metadata[attr]?.r__mobileKeyword_key) { const keywordObj = cache.getByKey( 'mobileKeyword', - metadata[attr].r__mobileKeyword_c__codeKeyword + metadata[attr].r__mobileKeyword_key ); if (!keywordObj) { throw new Error( - `mobileKeyword ${metadata[attr].r__mobileKeyword_c__codeKeyword} not found in cache` + `mobileKeyword ${metadata[attr].r__mobileKeyword_key} not found in cache` ); } metadata[attr] = keywordObj; @@ -301,10 +301,10 @@ class MobileMessage extends MetadataType { } // campaign - if (Array.isArray(metadata.r__campaign_name)) { + if (Array.isArray(metadata.r__campaign_key)) { metadata.campaigns = []; - for (const campaignName of metadata.r__campaign_name) { + for (const campaignName of metadata.r__campaign_key) { const campaign = cache.getByKey('campaign', campaignName); if (!campaign) { throw new Error(`campaign ${campaignName} not found in cache`); @@ -318,7 +318,7 @@ class MobileMessage extends MetadataType { }, }); } - delete metadata.r__campaign_name; + delete metadata.r__campaign_key; } if (metadata.smsTriggeredSendDefinitionId !== '00000000-0000-0000-0000-000000000000') { diff --git a/lib/metadataTypes/Query.js b/lib/metadataTypes/Query.js index 9e656e3e6..ba1268797 100644 --- a/lib/metadataTypes/Query.js +++ b/lib/metadataTypes/Query.js @@ -178,10 +178,10 @@ class Query extends MetadataType { }' --> '${targetKey}'. Acquired new value from looking up the DE's ObjectID in targetId.` ); } - metadata.r__dataExtension_CustomerKey = targetKey; + metadata.r__dataExtension_key = targetKey; } else { // if no targetId is set, at least check if the targetKey points to an existing DE (no override needed) - metadata.r__dataExtension_CustomerKey = cache.searchForField( + metadata.r__dataExtension_key = cache.searchForField( 'dataExtension', metadata.targetKey, 'CustomerKey', @@ -244,14 +244,14 @@ class Query extends MetadataType { // dataExtension metadata.targetKey = cache.searchForField( 'dataExtension', - metadata.r__dataExtension_CustomerKey, + metadata.r__dataExtension_key, 'CustomerKey', 'CustomerKey' ); // we've seen queries without this ID set - crucial in case the DE ever gets renamed to ensure the query keeps working metadata.targetId = cache.searchForField( 'dataExtension', - metadata.r__dataExtension_CustomerKey, + metadata.r__dataExtension_key, 'CustomerKey', 'ObjectID' ); diff --git a/lib/metadataTypes/SendClassification.js b/lib/metadataTypes/SendClassification.js index 79b8413eb..4a1ed42ba 100644 --- a/lib/metadataTypes/SendClassification.js +++ b/lib/metadataTypes/SendClassification.js @@ -89,12 +89,12 @@ class SendClassification extends MetadataType { metadata.SenderProfile = { CustomerKey: cache.searchForField( 'senderProfile', - metadata.r__senderProfile_CustomerKey, + metadata.r__senderProfile_key, 'CustomerKey', 'CustomerKey' ), }; - delete metadata.r__senderProfile_CustomerKey; + delete metadata.r__senderProfile_key; metadata.DeliveryProfile = { CustomerKey: cache.searchForField( @@ -123,7 +123,7 @@ class SendClassification extends MetadataType { delete metadata.SendClassificationType; try { - metadata.r__senderProfile_CustomerKey = cache.searchForField( + metadata.r__senderProfile_key = cache.searchForField( 'senderProfile', metadata.SenderProfile.CustomerKey, 'CustomerKey', diff --git a/lib/metadataTypes/TransactionalEmail.js b/lib/metadataTypes/TransactionalEmail.js index dd6e3d05e..43920b28b 100644 --- a/lib/metadataTypes/TransactionalEmail.js +++ b/lib/metadataTypes/TransactionalEmail.js @@ -55,24 +55,24 @@ class TransactionalEmail extends TransactionalMessage { */ static async preDeployTasks(metadata) { // asset - if (metadata.r__asset_customerKey) { + if (metadata.r__asset_key) { // we merely want to be able to show an error if it does not exist metadata.content = { customerKey: cache.searchForField( 'asset', - metadata.r__asset_customerKey, + metadata.r__asset_key, 'customerKey', 'customerKey' ), }; - delete metadata.r__asset_customerKey; + delete metadata.r__asset_key; } // subscriptions: dataExtension - if (metadata.subscriptions?.r__dataExtension_CustomerKey) { + if (metadata.subscriptions?.r__dataExtension_key) { // we merely want to be able to show an error if it does not exist metadata.subscriptions.dataExtension = cache.searchForField( 'dataExtension', - metadata.subscriptions.r__dataExtension_CustomerKey, + metadata.subscriptions.r__dataExtension_key, 'CustomerKey', 'CustomerKey' ); @@ -139,7 +139,7 @@ class TransactionalEmail extends TransactionalMessage { static postRetrieveTasks(metadata) { // asset if (metadata.content?.customerKey) { - metadata.r__asset_customerKey = metadata.content.customerKey; + metadata.r__asset_key = metadata.content.customerKey; try { // we merely want to be able to show an error if it does not exist cache.searchForField( @@ -160,8 +160,7 @@ class TransactionalEmail extends TransactionalMessage { // subscriptions: dataExtension if (metadata.subscriptions?.dataExtension) { - metadata.subscriptions.r__dataExtension_CustomerKey = - metadata.subscriptions.dataExtension; + metadata.subscriptions.r__dataExtension_key = metadata.subscriptions.dataExtension; try { // we merely want to be able to show a warning if it does not exist cache.searchForField( diff --git a/lib/metadataTypes/TransactionalPush.js b/lib/metadataTypes/TransactionalPush.js index 89d98e907..82904fe6f 100644 --- a/lib/metadataTypes/TransactionalPush.js +++ b/lib/metadataTypes/TransactionalPush.js @@ -33,16 +33,16 @@ class TransactionalPush extends TransactionalMessage { */ static async preDeployTasks(metadata) { // asset - if (metadata.r__asset_customerKey) { + if (metadata.r__asset_key) { // we merely want to be able to show an error if it does not exist metadata.content ||= {}; metadata.content.customerKey = cache.searchForField( 'asset', - metadata.r__asset_customerKey, + metadata.r__asset_key, 'customerKey', 'customerKey' ); - delete metadata.r__asset_customerKey; + delete metadata.r__asset_key; } if (metadata.options?.badge && typeof metadata.options?.badge !== 'string') { // ensure it's a string, or else the API will return an error. Our SDK turns numbers in strings into actual numbers @@ -62,7 +62,7 @@ class TransactionalPush extends TransactionalMessage { if (metadata.content?.customerKey) { try { // we merely want to be able to show an error if it does not exist - metadata.r__asset_customerKey = cache.searchForField( + metadata.r__asset_key = cache.searchForField( 'asset', metadata.content.customerKey, 'customerKey', diff --git a/lib/metadataTypes/TransactionalSMS.js b/lib/metadataTypes/TransactionalSMS.js index ab6f88b2b..f6b08f607 100644 --- a/lib/metadataTypes/TransactionalSMS.js +++ b/lib/metadataTypes/TransactionalSMS.js @@ -60,32 +60,31 @@ class TransactionalSMS extends TransactionalMessage { } // subscriptions: mobileKeyword - if (metadata.subscriptions?.r__mobileKeyword_c__codeKeyword) { + if (metadata.subscriptions?.r__mobileKeyword_key) { // we merely want to be able to show an error if it does not exist cache.searchForField( 'mobileKeyword', - metadata.subscriptions.r__mobileKeyword_c__codeKeyword, + metadata.subscriptions.r__mobileKeyword_key, 'c__codeKeyword', 'c__codeKeyword' ); - const codeKeywordArr = - metadata.subscriptions.r__mobileKeyword_c__codeKeyword.split('.'); + const codeKeywordArr = metadata.subscriptions.r__mobileKeyword_key.split('.'); metadata.subscriptions.shortCode = codeKeywordArr[0]; metadata.subscriptions.keyword = codeKeywordArr[1]; // make sure the code actually exists cache.searchForField('mobileCode', metadata.subscriptions.shortCode, 'code', 'code'); - } else if (metadata.subscriptions?.r__mobileCode_code) { + } else if (metadata.subscriptions?.r__mobileCode_key) { // subscriptions: mobileCode - // in case we dont have r__mobileKeyword_c__codeKeyword set + // in case we dont have r__mobileKeyword_key set metadata.subscriptions.shortCode = cache.searchForField( 'mobileCode', - metadata.subscriptions.r__mobileCode_code, + metadata.subscriptions.r__mobileCode_key, 'code', 'code' ); } - delete metadata.subscriptions.r__mobileKeyword_c__codeKeyword; - delete metadata.subscriptions.r__mobileCode_code; + delete metadata.subscriptions.r__mobileKeyword_key; + delete metadata.subscriptions.r__mobileCode_key; return metadata; } @@ -152,7 +151,7 @@ class TransactionalSMS extends TransactionalMessage { 'code', 'code' ); - metadata.subscriptions.r__mobileCode_code = metadata.subscriptions.shortCode; + metadata.subscriptions.r__mobileCode_key = metadata.subscriptions.shortCode; delete metadata.subscriptions.shortCode; } catch { Util.logger.warn( @@ -165,16 +164,16 @@ class TransactionalSMS extends TransactionalMessage { if (metadata.subscriptions?.keyword) { try { // we merely want to be able to show a warning if it does not exist - metadata.subscriptions.r__mobileKeyword_c__codeKeyword = cache.searchForField( + metadata.subscriptions.r__mobileKeyword_key = cache.searchForField( 'mobileKeyword', (metadata.subscriptions.shortCode || - metadata.subscriptions.r__mobileCode_code) + + metadata.subscriptions.r__mobileCode_key) + '.' + metadata.subscriptions.keyword, 'c__codeKeyword', 'c__codeKeyword' ); - delete metadata.subscriptions.r__mobileCode_code; + delete metadata.subscriptions.r__mobileCode_key; delete metadata.subscriptions.shortCode; delete metadata.subscriptions.keyword; } catch { diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 5800d44e7..5720edc1a 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -122,20 +122,20 @@ class TriggeredSend extends MetadataType { 'legacyData.legacyId', 'name' ); - metadata.r__assetMessage_Name_readOnly = contentBuilderEmailName; + metadata.r__asset_name_readOnly = contentBuilderEmailName; const contentBuilderEmailKey = cache.searchForField( 'asset', metadata.Email.ID, 'legacyData.legacyId', 'customerKey' ); - metadata.r__assetMessage_Key = contentBuilderEmailKey; + metadata.r__asset_key = contentBuilderEmailKey; delete metadata.Email; } catch { try { // classic const classicEmail = cache.searchForField('email', metadata.Email.ID, 'ID', 'Name'); - metadata.r__email_Name = classicEmail; + metadata.r__email_name = classicEmail; delete metadata.Email; } catch { Util.logger.verbose( @@ -175,7 +175,7 @@ class TriggeredSend extends MetadataType { 'CustomerKey', 'CustomerKey' ); - metadata.r__senderProfile_CustomerKey = metadata.SenderProfile.CustomerKey; + metadata.r__senderProfile_key = metadata.SenderProfile.CustomerKey; delete metadata.SenderProfile; } catch (ex) { Util.logger.warn( @@ -192,8 +192,7 @@ class TriggeredSend extends MetadataType { 'CustomerKey', 'CustomerKey' ); - metadata.r__sendClassification_CustomerKey = - metadata.SendClassification.CustomerKey; + metadata.r__sendClassification_key = metadata.SendClassification.CustomerKey; delete metadata.SendClassification; } catch (ex) { Util.logger.warn( @@ -225,28 +224,28 @@ class TriggeredSend extends MetadataType { // folder super.setFolderId(metadata); // email - if (metadata.r__email_Name) { + if (metadata.r__email_name) { // classic metadata.Email = { - ID: cache.searchForField('email', metadata.r__email_Name, 'Name', 'ID'), + ID: cache.searchForField('email', metadata.r__email_name, 'Name', 'ID'), }; - delete metadata.r__email_Name; - } else if (metadata.r__assetMessage_Key) { + delete metadata.r__email_name; + } else if (metadata.r__asset_key) { // content builder - // * this ignores r__assetMessage_Name_readOnly on purpose as that is only unique per parent folder but useful during PR reviews + // * this ignores r__asset_name_readOnly on purpose as that is only unique per parent folder but useful during PR reviews metadata.Email = { ID: cache.searchForField( 'asset', - metadata.r__assetMessage_Key, + metadata.r__asset_key, 'customerKey', 'legacyData.legacyId' ), }; - delete metadata.r__assetMessage_Key; - delete metadata.r__assetMessage_Name_readOnly; + delete metadata.r__asset_key; + delete metadata.r__asset_name_readOnly; } else if (metadata?.Email?.ID) { throw new Error( - `r__assetMessage_Key / r__email_Name not defined but instead found Email.ID. Please try re-retrieving this TSD from your BU.` + `r__asset_key / r__email_name not defined but instead found Email.ID. Please try re-retrieving this TSD from your BU.` ); } // message priority @@ -266,30 +265,30 @@ class TriggeredSend extends MetadataType { ); } // sender profile - if (metadata.r__senderProfile_CustomerKey) { + if (metadata.r__senderProfile_key) { cache.searchForField( 'senderProfile', - metadata.r__senderProfile_CustomerKey, + metadata.r__senderProfile_key, 'CustomerKey', 'CustomerKey' ); metadata.SenderProfile = { - CustomerKey: metadata.r__senderProfile_CustomerKey, + CustomerKey: metadata.r__senderProfile_key, }; - delete metadata.r__senderProfile_CustomerKey; + delete metadata.r__senderProfile_key; } // send classification - if (metadata.r__sendClassification_CustomerKey) { + if (metadata.r__sendClassification_key) { cache.searchForField( 'sendClassification', - metadata.r__sendClassification_CustomerKey, + metadata.r__sendClassification_key, 'CustomerKey', 'CustomerKey' ); metadata.SendClassification = { - CustomerKey: metadata.r__sendClassification_CustomerKey, + CustomerKey: metadata.r__sendClassification_key, }; - delete metadata.r__sendClassification_CustomerKey; + delete metadata.r__sendClassification_key; } return metadata; diff --git a/lib/metadataTypes/Verification.js b/lib/metadataTypes/Verification.js index 0cc74e02f..b418d629e 100644 --- a/lib/metadataTypes/Verification.js +++ b/lib/metadataTypes/Verification.js @@ -201,11 +201,11 @@ class Verification extends MetadataType { static async preDeployTasks(metadata) { metadata.targetObjectId = cache.searchForField( 'dataExtension', - metadata.r__dataExtension_CustomerKey, + metadata.r__dataExtension_key, 'CustomerKey', 'ObjectID' ); - delete metadata.r__dataExtension_CustomerKey; + delete metadata.r__dataExtension_key; return metadata; } /** @@ -216,7 +216,7 @@ class Verification extends MetadataType { */ static postRetrieveTasks(metadata) { try { - metadata.r__dataExtension_CustomerKey = cache.searchForField( + metadata.r__dataExtension_key = cache.searchForField( 'dataExtension', metadata.targetObjectId, 'ObjectID', diff --git a/lib/metadataTypes/definitions/AttributeGroup.definition.js b/lib/metadataTypes/definitions/AttributeGroup.definition.js index 4324d6bb7..6f3ab5ad0 100644 --- a/lib/metadataTypes/definitions/AttributeGroup.definition.js +++ b/lib/metadataTypes/definitions/AttributeGroup.definition.js @@ -245,7 +245,7 @@ export default { retrieving: true, template: true, }, - r__attributeSet_definitionKey: { + r__attributeSet_key: { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/lib/metadataTypes/definitions/AttributeSet.definition.js b/lib/metadataTypes/definitions/AttributeSet.definition.js index 011e0a6d8..14657877c 100644 --- a/lib/metadataTypes/definitions/AttributeSet.definition.js +++ b/lib/metadataTypes/definitions/AttributeSet.definition.js @@ -906,7 +906,7 @@ export default { retrieving: true, template: null, }, - r__dataExtension_CustomerKey: { + r__dataExtension_key: { isCreateable: null, isUpdateable: null, retrieving: true, diff --git a/lib/metadataTypes/definitions/DataExtension.definition.js b/lib/metadataTypes/definitions/DataExtension.definition.js index f6e2bb6c5..a64849d62 100644 --- a/lib/metadataTypes/definitions/DataExtension.definition.js +++ b/lib/metadataTypes/definitions/DataExtension.definition.js @@ -287,7 +287,7 @@ export default { r__folder_Path: { skipValidation: true, }, - r__dataExtensionTemplate_Name: { + r__dataExtensionTemplate_name: { skipValidation: true, }, c__retentionPolicy: { diff --git a/lib/metadataTypes/definitions/EmailSend.definition.js b/lib/metadataTypes/definitions/EmailSend.definition.js index 584caed9e..daa2b329c 100644 --- a/lib/metadataTypes/definitions/EmailSend.definition.js +++ b/lib/metadataTypes/definitions/EmailSend.definition.js @@ -564,12 +564,12 @@ export default { retrieving: false, templating: false, }, - r__assetMessage_Name: { skipValidation: true }, - r__assetMessage_Key: { skipValidation: true }, - r__email_Name: { skipValidation: true }, + r__asset_name_readOnly: { skipValidation: true }, + r__asset_key: { skipValidation: true }, + r__email_name: { skipValidation: true }, r__folder_Path: { skipValidation: true }, - r__senderProfile_CustomerKey: { skipValidation: true }, - r__sendClassification_CustomerKey: { skipValidation: true }, + r__senderProfile_key: { skipValidation: true }, + r__sendClassification_key: { skipValidation: true }, r__deliveryProfile_key: { skipValidation: true }, }, }; diff --git a/lib/metadataTypes/definitions/ImportFile.definition.js b/lib/metadataTypes/definitions/ImportFile.definition.js index 2db250324..cb0c91867 100644 --- a/lib/metadataTypes/definitions/ImportFile.definition.js +++ b/lib/metadataTypes/definitions/ImportFile.definition.js @@ -255,19 +255,19 @@ export default { retrieving: true, template: true, }, - 'destination.r__mobileKeyword_c__codeKeyword': { + 'destination.r__mobileKeyword_key': { isCreateable: false, isUpdateable: false, retrieving: true, template: true, }, - 'source.r__dataExtension_CustomerKey': { + 'source.r__dataExtension_key': { isCreateable: false, isUpdateable: false, retrieving: true, template: true, }, - 'destination.r__dataExtension_CustomerKey': { + 'destination.r__dataExtension_key': { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/lib/metadataTypes/definitions/MobileMessage.definition.js b/lib/metadataTypes/definitions/MobileMessage.definition.js index 7b0883ec8..c80f428c3 100644 --- a/lib/metadataTypes/definitions/MobileMessage.definition.js +++ b/lib/metadataTypes/definitions/MobileMessage.definition.js @@ -37,7 +37,7 @@ export default { 'campaigns[]': { skipValidation: true, }, - r__mobileCode_code: { + r__mobileCode_key: { isCreateable: false, isUpdateable: false, retrieving: true, @@ -325,7 +325,7 @@ export default { retrieving: false, template: false, }, - 'keyword.r__mobileKeyword_c__codeKeyword': { + 'keyword.r__mobileKeyword_key': { isCreateable: false, isUpdateable: false, retrieving: true, @@ -641,7 +641,7 @@ export default { retrieving: false, template: false, }, - 'subscriptionKeyword.r__mobileKeyword_c__codeKeyword': { + 'subscriptionKeyword.r__mobileKeyword_key': { isCreateable: false, isUpdateable: false, retrieving: true, @@ -671,7 +671,7 @@ export default { retrieving: false, template: false, }, - 'nextKeyword.r__mobileKeyword_c__codeKeyword': { + 'nextKeyword.r__mobileKeyword_key': { isCreateable: false, isUpdateable: false, retrieving: true, @@ -780,12 +780,12 @@ export default { retrieving: true, template: true, }, - r__campaign_name: { + r__campaign_key: { isCreateable: false, isUpdateable: false, retrieving: true, template: true, }, - 'r__campaign_name[]': { skipValidation: true }, + 'r__campaign_key[]': { skipValidation: true }, }, }; diff --git a/lib/metadataTypes/definitions/Query.definition.js b/lib/metadataTypes/definitions/Query.definition.js index 5bb3357ce..eb41f411d 100644 --- a/lib/metadataTypes/definitions/Query.definition.js +++ b/lib/metadataTypes/definitions/Query.definition.js @@ -123,7 +123,7 @@ export default { retrieving: false, template: false, }, - r__dataExtension_CustomerKey: { + r__dataExtension_key: { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/lib/metadataTypes/definitions/SendClassification.definition.js b/lib/metadataTypes/definitions/SendClassification.definition.js index 2e67e4168..843e78d60 100644 --- a/lib/metadataTypes/definitions/SendClassification.definition.js +++ b/lib/metadataTypes/definitions/SendClassification.definition.js @@ -147,7 +147,7 @@ export default { r__deliveryProfile_key: { skipValidation: true, }, - r__senderProfile_CustomerKey: { + r__senderProfile_key: { skipValidation: true, }, }, diff --git a/lib/metadataTypes/definitions/TransactionalEmail.definition.js b/lib/metadataTypes/definitions/TransactionalEmail.definition.js index 34b3877dd..ee2dc66f6 100644 --- a/lib/metadataTypes/definitions/TransactionalEmail.definition.js +++ b/lib/metadataTypes/definitions/TransactionalEmail.definition.js @@ -83,7 +83,7 @@ export default { retrieving: true, template: true, }, - 'subscriptions.r__dataExtension_CustomerKey': { + 'subscriptions.r__dataExtension_key': { isCreateable: false, isUpdateable: false, retrieving: true, @@ -149,7 +149,7 @@ export default { retrieving: true, template: true, }, - r__asset_customerKey: { + r__asset_key: { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/lib/metadataTypes/definitions/TransactionalPush.definition.js b/lib/metadataTypes/definitions/TransactionalPush.definition.js index 1b502f2ae..1c2c1783e 100644 --- a/lib/metadataTypes/definitions/TransactionalPush.definition.js +++ b/lib/metadataTypes/definitions/TransactionalPush.definition.js @@ -71,7 +71,7 @@ export default { retrieving: true, template: true, }, - r__asset_customerKey: { + r__asset_key: { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/lib/metadataTypes/definitions/TransactionalSMS.definition.js b/lib/metadataTypes/definitions/TransactionalSMS.definition.js index 4950a02f8..25b50c30a 100644 --- a/lib/metadataTypes/definitions/TransactionalSMS.definition.js +++ b/lib/metadataTypes/definitions/TransactionalSMS.definition.js @@ -101,7 +101,7 @@ export default { retrieving: true, template: true, }, - 'subscriptions.r__mobileKeyword_c__codeKeyword': { + 'subscriptions.r__mobileKeyword_key': { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index 6c4c1b88c..59c75a681 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -539,13 +539,13 @@ export default { retrieving: false, templating: false, }, - r__assetMessage_Name_readOnly: { skipValidation: true }, - r__assetMessage_Key: { skipValidation: true }, - r__email_Name: { skipValidation: true }, + r__asset_name_readOnly: { skipValidation: true }, + r__asset_key: { skipValidation: true }, + r__email_name: { skipValidation: true }, r__folder_Path: { skipValidation: true }, r__list_PathName: { skipValidation: true }, c__priority: { skipValidation: true }, - r__sendClassification_CustomerKey: { skipValidation: true }, - r__senderProfile_CustomerKey: { skipValidation: true }, + r__sendClassification_key: { skipValidation: true }, + r__senderProfile_key: { skipValidation: true }, }, }; diff --git a/lib/metadataTypes/definitions/Verification.definition.js b/lib/metadataTypes/definitions/Verification.definition.js index 5ae5545d0..c5766e903 100644 --- a/lib/metadataTypes/definitions/Verification.definition.js +++ b/lib/metadataTypes/definitions/Verification.definition.js @@ -78,7 +78,7 @@ export default { retrieving: true, template: true, }, - r__dataExtension_CustomerKey: { + r__dataExtension_key: { isCreateable: false, isUpdateable: false, retrieving: true, diff --git a/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json index 9ba11adb6..e0f734fef 100644 --- a/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json +++ b/test/mockRoot/deploy/testInstance/_ParentBU_/query/testNew_query.query-meta.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query", "description": "created on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtensionShared", + "r__dataExtension_key": "testExisting_dataExtensionShared", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json index ec0d05061..00d988c6b 100644 --- a/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/emailSend/testExisting_emailSend.emailSend-meta.json @@ -21,16 +21,16 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json index 8837a9ad1..7bfb7438a 100644 --- a/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/emailSend/testNew_emailSend.emailSend-meta.json @@ -21,16 +21,16 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json index 84a4db504..6e891879f 100644 --- a/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json @@ -27,7 +27,7 @@ "c__subscriberImportType": "DataExtension", "destination": { "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension" + "r__dataExtension_key": "testExisting_dataExtension" }, "source": { "r__fileLocation_name": "ExactTarget Enhanced FTP" diff --git a/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json b/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json index 81a4d3dc6..4f2c40033 100644 --- a/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json @@ -25,7 +25,7 @@ "c__dataAction": "AddUpdate", "destination": { "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension" + "r__dataExtension_key": "testExisting_dataExtension" }, "source": { "r__fileLocation_name": "ExactTarget Enhanced FTP" diff --git a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json index de06ab128..237c73925 100644 --- a/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/journey/testExisting_journey_Quicksend.journey-meta.json @@ -51,14 +51,14 @@ "publicationList": "my subscribers/All Subscribers", "suppressionLists": ["Suppression Lists/testExisting_suppressionList"] }, - "r__dataExtension_CustomerKey": { + "r__dataExtension_key": { "domainExclusions": ["testExisting_DomainExclusion"] }, - "r__senderProfile_CustomerKey": "testExisting_senderProfile", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", "c__priority": "High", "r__asset_name_readOnly": "testExisting_asset_message", - "r__asset_customerKey": "testExisting_asset_message" + "r__asset_key": "testExisting_asset_message" }, "applicationExtensionKey": "jb-email-activity" }, diff --git a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json index 2300663ca..56fe1f4e7 100644 --- a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/NTIzOjc4OjA.mobileMessage-meta.json @@ -4,8 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testExisting_mobileMessage", "origin": "SMS Send", - "r__mobileCode_code": "4912312345678", - "r__campaign_name": ["testExisting_campaign"], + "r__mobileCode_key": "4912312345678", + "r__campaign_key": ["testExisting_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { diff --git a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json index 92dbe5bba..a8b835902 100644 --- a/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/mobileMessage/new.mobileMessage-meta.json @@ -4,8 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testNew_mobileMessage", "origin": "SMS Send", - "r__mobileCode_code": "4912312345678", - "r__campaign_name": ["testExisting_campaign"], + "r__mobileCode_key": "4912312345678", + "r__campaign_key": ["testExisting_campaign"], "mtSendDate": "2017-07-03T14:03:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json index 4c4fe104e..bb96f9b40 100644 --- a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query.query-meta.json @@ -2,7 +2,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "updated on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json index a5df8ba05..42808b345 100644 --- a/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json @@ -2,7 +2,7 @@ "name": "testExisting_query_fixedKeys", "key": "testExisting_query_fixKeys", "description": "updated on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json b/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json index 04aea7990..bc06864f0 100644 --- a/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/query/testNew_query.query-meta.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query", "description": "created on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json index 5a7701d88..3cc32064a 100644 --- a/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testExisting_sendClassification.sendClassification-meta.json @@ -3,6 +3,6 @@ "Name": "testExisting_sendClassification", "Description": "updated on deploy", "c__classification": "Commercial", - "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__senderProfile_key": "testExisting_senderProfile", "r__deliveryProfile_key": "Default" } diff --git a/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json index dd786c022..51456ddc9 100644 --- a/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/sendClassification/testNew_sendClassification.sendClassification-meta.json @@ -3,6 +3,6 @@ "Name": "testNew_sendClassification", "Description": "created on deploy", "c__classification": "Commercial", - "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__senderProfile_key": "testExisting_senderProfile", "r__deliveryProfile_key": "Default" } diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testExisting_temail.transactionalEmail-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testExisting_temail.transactionalEmail-meta.json index 777a3cc15..de4fcfac6 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testExisting_temail.transactionalEmail-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testExisting_temail.transactionalEmail-meta.json @@ -16,5 +16,5 @@ "trackLinks": true }, "r__journey_key": "testExisting_interaction", - "r__asset_customerKey": "testExisting_asset_message" + "r__asset_key": "testExisting_asset_message" } diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testNew_temail.transactionalEmail-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testNew_temail.transactionalEmail-meta.json index 197e9f902..aec6b1002 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testNew_temail.transactionalEmail-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testNew_temail.transactionalEmail-meta.json @@ -15,5 +15,5 @@ "options": { "trackLinks": true }, - "r__asset_customerKey": "testExisting_asset_message" + "r__asset_key": "testExisting_asset_message" } diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json index 38f5010bf..2cbfb8186 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testExisting_tpush.transactionalPush-meta.json @@ -4,7 +4,7 @@ "status": "Active", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", "description": "updated via deploy; note that applicationId can only be manually set up in Setup - Mobile Push", - "r__asset_customerKey": "mobileMessage_test", + "r__asset_key": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1", diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json index 44d75684a..fcee47d50 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalPush/testNew_tpush.transactionalPush-meta.json @@ -4,7 +4,7 @@ "status": "Active", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", "description": "created on deploy; note that applicationId can only be manually set up in Setup - Mobile Push", - "r__asset_customerKey": "mobileMessage_test", + "r__asset_key": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1", diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json index d187d880f..5d2a9a074 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testExisting_tsms.transactionalSMS-meta.json @@ -9,6 +9,6 @@ "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + "r__mobileKeyword_key": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json index a9877d0b9..196a92a35 100644 --- a/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/transactionalSMS/testNew_tsms.transactionalSMS-meta.json @@ -9,6 +9,6 @@ "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + "r__mobileKeyword_key": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json index 43d0fc8fa..1a80fcf65 100644 --- a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json @@ -21,8 +21,8 @@ "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", - "r__email_Name": "Sporting Goods for September", + "r__email_name": "Sporting Goods for September", "r__folder_Path": "Triggered Sends", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json index 535df8ee7..7ac9ae35e 100644 --- a/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json @@ -21,8 +21,8 @@ "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", - "r__email_Name": "Sporting Goods for September", + "r__email_name": "Sporting Goods for September", "r__folder_Path": "Triggered Sends", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/mockRoot/deploy/testInstance/testBU/verification/testExisting_39f6a488-20eb-4ba0-b0b9.verification-meta.json b/test/mockRoot/deploy/testInstance/testBU/verification/testExisting_39f6a488-20eb-4ba0-b0b9.verification-meta.json index dc8d975d2..03c68f68c 100644 --- a/test/mockRoot/deploy/testInstance/testBU/verification/testExisting_39f6a488-20eb-4ba0-b0b9.verification-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/verification/testExisting_39f6a488-20eb-4ba0-b0b9.verification-meta.json @@ -2,7 +2,7 @@ "dataVerificationDefinitionId": "testExisting_39f6a488-20eb-4ba0-b0b9", "notificationEmailAddress": "test@accenture.com", "notificationEmailMessage": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "shouldEmailOnFailure": true, "shouldStopOnFailure": true, "value1": 1, diff --git a/test/mockRoot/deploy/testInstance/testBU/verification/testNew_39f6a488-20eb-4ba0-b0b9.verification-meta.json b/test/mockRoot/deploy/testInstance/testBU/verification/testNew_39f6a488-20eb-4ba0-b0b9.verification-meta.json index ee5c6ed27..d5a13a4d8 100644 --- a/test/mockRoot/deploy/testInstance/testBU/verification/testNew_39f6a488-20eb-4ba0-b0b9.verification-meta.json +++ b/test/mockRoot/deploy/testInstance/testBU/verification/testNew_39f6a488-20eb-4ba0-b0b9.verification-meta.json @@ -2,7 +2,7 @@ "dataVerificationDefinitionId": "testNew_39f6a488-20eb-4ba0-b0b9", "notificationEmailAddress": "", "notificationEmailMessage": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "shouldEmailOnFailure": false, "shouldStopOnFailure": false, "value1": 2, diff --git a/test/resources/1111111/query/patch_keySuffix-expected.json b/test/resources/1111111/query/patch_keySuffix-expected.json index d2d04cbc8..ab0d0a375 100644 --- a/test/resources/1111111/query/patch_keySuffix-expected.json +++ b/test/resources/1111111/query/patch_keySuffix-expected.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query_DEV", "description": "created on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtensionShared", + "r__dataExtension_key": "testExisting_dataExtensionShared", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/asset/build-templatebasedemail-expected.json b/test/resources/9999999/asset/build-templatebasedemail-expected.json index dfd718fdb..9bcbdc340 100644 --- a/test/resources/9999999/asset/build-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/build-templatebasedemail-expected.json @@ -60,7 +60,7 @@ "availableViews": [], "template": { "meta": { "contentHash": -166410261 }, - "r__asset_customerKey": "testTemplated_asset_template" + "r__asset_key": "testTemplated_asset_template" }, "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json index ddd1c9593..e5b47fbc7 100644 --- a/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json @@ -63,7 +63,7 @@ "availableViews": [], "template": { "meta": { "contentHash": -166410261 }, - "r__asset_customerKey": "testExisting_asset_template" + "r__asset_key": "testExisting_asset_template" }, "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/asset/template-templatebasedemail-expected.json b/test/resources/9999999/asset/template-templatebasedemail-expected.json index 902e414ed..196b64a83 100644 --- a/test/resources/9999999/asset/template-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/template-templatebasedemail-expected.json @@ -60,7 +60,7 @@ "availableViews": [], "template": { "meta": { "contentHash": -166410261 }, - "r__asset_customerKey": "{{{prefix}}}asset_template" + "r__asset_key": "{{{prefix}}}asset_template" }, "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/attributeGroup/retrieve-expected.json b/test/resources/9999999/attributeGroup/retrieve-expected.json index 3c5bd952f..54b34dfc1 100644 --- a/test/resources/9999999/attributeGroup/retrieve-expected.json +++ b/test/resources/9999999/attributeGroup/retrieve-expected.json @@ -3,7 +3,7 @@ "attributeCount": 37, "attributeGroupIconKey": "Mobile", "attributeGroupType": "Standard", - "r__attributeSet_definitionKey": ["MobileDemographics", "MobileSubscriptions"], + "r__attributeSet_key": ["MobileDemographics", "MobileSubscriptions"], "canAddProperties": false, "canAddRelationships": true, "canChangeProperties": false, diff --git a/test/resources/9999999/attributeSet/retrieve-expected.json b/test/resources/9999999/attributeSet/retrieve-expected.json index f24f33133..74ed7681d 100644 --- a/test/resources/9999999/attributeSet/retrieve-expected.json +++ b/test/resources/9999999/attributeSet/retrieve-expected.json @@ -28,7 +28,7 @@ }, "name": "testExisting_dataExtensionShared", "parentID": "00000000-0000-0000-0000-000000000000", - "r__dataExtension_CustomerKey": "testExisting_dataExtensionShared", + "r__dataExtension_key": "testExisting_dataExtensionShared", "r__folder_Path": "Shared Items/Shared Data Extensions", "relationshipCount": 1, "relationships": [ @@ -40,7 +40,7 @@ "isSystemDefined": false, "leftItem": { "cardinality": "One", - "r__attributeGroup_definitionKey": "testExisting_attributeGroup", + "r__attributeGroup_key": "testExisting_attributeGroup", "relationshipType": "AttributeGroup" }, "leftRelationshipIDs": [ @@ -59,7 +59,7 @@ "relationshipID": "598b787a-5238-ee11-b85a-48df37d1de8a", "rightItem": { "cardinality": "One", - "r__attributeSet_definitionKey": "testExisting_dataExtensionShared", + "r__attributeSet_key": "testExisting_dataExtensionShared", "relationshipType": "AttributeSet" } } diff --git a/test/resources/9999999/emailSend/build-expected.json b/test/resources/9999999/emailSend/build-expected.json index 0942fba26..2b50e8fb3 100644 --- a/test/resources/9999999/emailSend/build-expected.json +++ b/test/resources/9999999/emailSend/build-expected.json @@ -21,23 +21,23 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "ExclusionList", - "r__dataExtension_CustomerKey": "testTemplated_dataExtension_exclusion" + "r__dataExtension_key": "testTemplated_dataExtension_exclusion" }, { "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_CustomerKey": "testTemplated_dataExtension", + "r__dataExtension_key": "testTemplated_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__asset_customerKey": "testTemplated_asset_message", + "r__asset_key": "testTemplated_asset_message", "r__asset_name_readOnly": "testTemplated_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", - "r__sendClassification_CustomerKey": "testTemplated_sendClassification", - "r__senderProfile_CustomerKey": "testTemplated_senderProfile" + "r__sendClassification_key": "testTemplated_sendClassification", + "r__senderProfile_key": "testTemplated_senderProfile" } diff --git a/test/resources/9999999/emailSend/get-expected.json b/test/resources/9999999/emailSend/get-expected.json index c74a706fc..1f1747a76 100644 --- a/test/resources/9999999/emailSend/get-expected.json +++ b/test/resources/9999999/emailSend/get-expected.json @@ -21,23 +21,23 @@ "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension_exclusion" + "r__dataExtension_key": "testExisting_dataExtension_exclusion" }, { "SendDefinitionListType": "SourceList", "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/resources/9999999/emailSend/patch-expected.json b/test/resources/9999999/emailSend/patch-expected.json index ee58efb9b..e5dc97113 100644 --- a/test/resources/9999999/emailSend/patch-expected.json +++ b/test/resources/9999999/emailSend/patch-expected.json @@ -19,23 +19,23 @@ "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension_exclusion" + "r__dataExtension_key": "testExisting_dataExtension_exclusion" }, { "SendDefinitionListType": "SourceList", "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/resources/9999999/emailSend/post-expected.json b/test/resources/9999999/emailSend/post-expected.json index 7cc1393f5..50f81b547 100644 --- a/test/resources/9999999/emailSend/post-expected.json +++ b/test/resources/9999999/emailSend/post-expected.json @@ -19,23 +19,23 @@ "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension_exclusion" + "r__dataExtension_key": "testExisting_dataExtension_exclusion" }, { "SendDefinitionListType": "SourceList", "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__asset_name_readOnly": "testExisting_asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/resources/9999999/emailSend/template-expected.json b/test/resources/9999999/emailSend/template-expected.json index 6be9d072a..f6aaa794d 100644 --- a/test/resources/9999999/emailSend/template-expected.json +++ b/test/resources/9999999/emailSend/template-expected.json @@ -21,23 +21,23 @@ "IsTestObject": false, "Name": "", "SendDefinitionListType": "ExclusionList", - "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension_exclusion" + "r__dataExtension_key": "{{{prefix}}}dataExtension_exclusion" }, { "DataSourceTypeID": "CustomObject", "IsTestObject": false, "Name": "", "SendDefinitionListType": "SourceList", - "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension", + "r__dataExtension_key": "{{{prefix}}}dataExtension", "r__list_PathName": "Publication Lists/Demo Publication List" } ], "SuppressTracking": false, "TestEmailAddr": "", - "r__asset_customerKey": "{{{prefix}}}asset_message", + "r__asset_key": "{{{prefix}}}asset_message", "r__asset_name_readOnly": "{{{prefix}}}asset_message", "r__deliveryProfile_key": "Default", "r__folder_Path": "User-Initiated", - "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", - "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile" + "r__sendClassification_key": "{{{prefix}}}sendClassification", + "r__senderProfile_key": "{{{prefix}}}senderProfile" } diff --git a/test/resources/9999999/importFile/build-expected.json b/test/resources/9999999/importFile/build-expected.json index 51b090b67..a3efa21ec 100644 --- a/test/resources/9999999/importFile/build-expected.json +++ b/test/resources/9999999/importFile/build-expected.json @@ -24,7 +24,7 @@ "standardQuotedStrings": true, "destination": { "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testTemplated_dataExtension" + "r__dataExtension_key": "testTemplated_dataExtension" }, "source": { "r__fileLocation_name": "ExactTarget Enhanced FTP" diff --git a/test/resources/9999999/importFile/get-expected.json b/test/resources/9999999/importFile/get-expected.json index 5e05166a9..2598549d3 100644 --- a/test/resources/9999999/importFile/get-expected.json +++ b/test/resources/9999999/importFile/get-expected.json @@ -27,7 +27,7 @@ "standardQuotedStrings": true, "destination": { "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension" + "r__dataExtension_key": "testExisting_dataExtension" }, "source": { "r__fileLocation_name": "ExactTarget Enhanced FTP" diff --git a/test/resources/9999999/importFile/get-sms-expected.json b/test/resources/9999999/importFile/get-sms-expected.json index 7a758133e..821a83a43 100644 --- a/test/resources/9999999/importFile/get-sms-expected.json +++ b/test/resources/9999999/importFile/get-sms-expected.json @@ -70,10 +70,10 @@ "standardQuotedStrings": false, "destination": { "c__destinationType": "SMS", - "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + "r__mobileKeyword_key": "4912312345678.TESTEXISTING_KEYWORD" }, "source": { - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "r__fileLocation_name": "ExactTarget Enhanced FTP" } } diff --git a/test/resources/9999999/importFile/patch-expected.json b/test/resources/9999999/importFile/patch-expected.json index 4dc13b3a6..de056d7c2 100644 --- a/test/resources/9999999/importFile/patch-expected.json +++ b/test/resources/9999999/importFile/patch-expected.json @@ -26,7 +26,7 @@ "standardQuotedStrings": true, "destination": { "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension" + "r__dataExtension_key": "testExisting_dataExtension" }, "source": { "r__fileLocation_name": "ExactTarget Enhanced FTP" diff --git a/test/resources/9999999/importFile/post-expected.json b/test/resources/9999999/importFile/post-expected.json index d3c37c058..58a53c3b1 100644 --- a/test/resources/9999999/importFile/post-expected.json +++ b/test/resources/9999999/importFile/post-expected.json @@ -24,7 +24,7 @@ "standardQuotedStrings": true, "destination": { "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "testExisting_dataExtension" + "r__dataExtension_key": "testExisting_dataExtension" }, "source": { "r__fileLocation_name": "ExactTarget Enhanced FTP" diff --git a/test/resources/9999999/importFile/template-expected.json b/test/resources/9999999/importFile/template-expected.json index c29bd7989..3139964b4 100644 --- a/test/resources/9999999/importFile/template-expected.json +++ b/test/resources/9999999/importFile/template-expected.json @@ -24,7 +24,7 @@ "standardQuotedStrings": true, "destination": { "c__destinationType": "DataExtension", - "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension" + "r__dataExtension_key": "{{{prefix}}}dataExtension" }, "source": { "r__fileLocation_name": "ExactTarget Enhanced FTP" diff --git a/test/resources/9999999/journey/build-expected.json b/test/resources/9999999/journey/build-expected.json index ecfa44b7e..829b51b46 100644 --- a/test/resources/9999999/journey/build-expected.json +++ b/test/resources/9999999/journey/build-expected.json @@ -48,14 +48,14 @@ "publicationList": "my subscribers/All Subscribers", "suppressionLists": ["Suppression Lists/testTemplated_suppressionList"] }, - "r__dataExtension_CustomerKey": { + "r__dataExtension_key": { "domainExclusions": ["testTemplated_DomainExclusion"] }, - "r__senderProfile_CustomerKey": "testTemplated_senderProfile", - "r__sendClassification_CustomerKey": "testTemplated_sendClassification", + "r__senderProfile_key": "testTemplated_senderProfile", + "r__sendClassification_key": "testTemplated_sendClassification", "c__priority": "High", "r__asset_name_readOnly": "testTemplated_asset_message", - "r__asset_customerKey": "testTemplated_asset_message" + "r__asset_key": "testTemplated_asset_message" }, "applicationExtensionKey": "jb-email-activity" }, diff --git a/test/resources/9999999/journey/get-multistep-expected.json b/test/resources/9999999/journey/get-multistep-expected.json index 86ad5f02a..cb8496dd2 100644 --- a/test/resources/9999999/journey/get-multistep-expected.json +++ b/test/resources/9999999/journey/get-multistep-expected.json @@ -100,11 +100,11 @@ "throttleCloses": "1/1/0001 12:00:00 AM", "isTrackingClicks": true, "r__list_PathName": { "publicationList": "my subscribers/All Subscribers" }, - "r__senderProfile_CustomerKey": "testExisting_senderProfile", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", "c__priority": "Medium", "r__asset_name_readOnly": "testExisting_asset_message", - "r__asset_customerKey": "testExisting_asset_message" + "r__asset_key": "testExisting_asset_message" } }, "metaData": { diff --git a/test/resources/9999999/journey/get-quicksend-expected.json b/test/resources/9999999/journey/get-quicksend-expected.json index ccfdd8525..a34d705bc 100644 --- a/test/resources/9999999/journey/get-quicksend-expected.json +++ b/test/resources/9999999/journey/get-quicksend-expected.json @@ -51,14 +51,14 @@ "publicationList": "my subscribers/All Subscribers", "suppressionLists": ["Suppression Lists/testExisting_suppressionList"] }, - "r__dataExtension_CustomerKey": { + "r__dataExtension_key": { "domainExclusions": ["testExisting_DomainExclusion"] }, - "r__senderProfile_CustomerKey": "testExisting_senderProfile", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", "c__priority": "High", "r__asset_name_readOnly": "testExisting_asset_message", - "r__asset_customerKey": "testExisting_asset_message" + "r__asset_key": "testExisting_asset_message" }, "applicationExtensionKey": "jb-email-activity" }, diff --git a/test/resources/9999999/journey/get-transactionalEmail-expected.json b/test/resources/9999999/journey/get-transactionalEmail-expected.json index aad5ea53e..0e3ae79c5 100644 --- a/test/resources/9999999/journey/get-transactionalEmail-expected.json +++ b/test/resources/9999999/journey/get-transactionalEmail-expected.json @@ -45,16 +45,16 @@ "throttleCloses": "1/1/0001 12:00:00 AM", "isTrackingClicks": true, "r__list_PathName": { "publicationList": "my subscribers/All Subscribers" }, - "r__senderProfile_CustomerKey": "testExisting_senderProfile", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", "c__priority": "Medium", "r__asset_name_readOnly": "testExisting_asset_message", - "r__asset_customerKey": "testExisting_asset_message" + "r__asset_key": "testExisting_asset_message" }, - "r__transactionalEmail_definitionKey": "testExisting_temail" + "r__transactionalEmail_key": "testExisting_temail" }, "metaData": { - "highThroughput": { "r__dataExtension_CustomerKey": "testExisting_dataExtension" }, + "highThroughput": { "r__dataExtension_key": "testExisting_dataExtension" }, "sections": {}, "isConfigured": true }, diff --git a/test/resources/9999999/journey/template-expected.json b/test/resources/9999999/journey/template-expected.json index feeffddd1..428055f77 100644 --- a/test/resources/9999999/journey/template-expected.json +++ b/test/resources/9999999/journey/template-expected.json @@ -48,14 +48,14 @@ "publicationList": "my subscribers/All Subscribers", "suppressionLists": ["Suppression Lists/{{{prefix}}}suppressionList"] }, - "r__dataExtension_CustomerKey": { + "r__dataExtension_key": { "domainExclusions": ["{{{prefix}}}DomainExclusion"] }, - "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile", - "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", + "r__senderProfile_key": "{{{prefix}}}senderProfile", + "r__sendClassification_key": "{{{prefix}}}sendClassification", "c__priority": "High", "r__asset_name_readOnly": "{{{prefix}}}asset_message", - "r__asset_customerKey": "{{{prefix}}}asset_message" + "r__asset_key": "{{{prefix}}}asset_message" }, "applicationExtensionKey": "jb-email-activity" }, diff --git a/test/resources/9999999/mobileMessage/build-expected.json b/test/resources/9999999/mobileMessage/build-expected.json index 3d990b9dd..a2d036815 100644 --- a/test/resources/9999999/mobileMessage/build-expected.json +++ b/test/resources/9999999/mobileMessage/build-expected.json @@ -3,8 +3,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testTemplated_mobileMessage", "origin": "SMS Send", - "r__mobileCode_code": "4912312345678", - "r__campaign_name": ["testTemplated_campaign"], + "r__mobileCode_key": "4912312345678", + "r__campaign_key": ["testTemplated_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/get-expected.json b/test/resources/9999999/mobileMessage/get-expected.json index 8afb5b87d..54e5b7398 100644 --- a/test/resources/9999999/mobileMessage/get-expected.json +++ b/test/resources/9999999/mobileMessage/get-expected.json @@ -4,8 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testExisting_mobileMessage", "origin": "SMS Send", - "r__mobileCode_code": "4912312345678", - "r__campaign_name": ["testExisting_campaign"], + "r__mobileCode_key": "4912312345678", + "r__campaign_key": ["testExisting_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/post-create-expected.json b/test/resources/9999999/mobileMessage/post-create-expected.json index 6b5a39f7d..b87f2b8fa 100644 --- a/test/resources/9999999/mobileMessage/post-create-expected.json +++ b/test/resources/9999999/mobileMessage/post-create-expected.json @@ -4,7 +4,7 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "jb test 3", "origin": "SMS Send", - "r__mobileCode_code": "4912312345678", + "r__mobileCode_key": "4912312345678", "mtSendDate": "2017-07-03T14:03:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/post-update-expected.json b/test/resources/9999999/mobileMessage/post-update-expected.json index fa72aa9ee..ab279adad 100644 --- a/test/resources/9999999/mobileMessage/post-update-expected.json +++ b/test/resources/9999999/mobileMessage/post-update-expected.json @@ -4,8 +4,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "testExisting_mobileMessage", "origin": "SMS Send", - "r__mobileCode_code": "4912312345678", - "r__campaign_name": ["testExisting_campaign"], + "r__mobileCode_key": "4912312345678", + "r__campaign_key": ["testExisting_campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/mobileMessage/template-expected.json b/test/resources/9999999/mobileMessage/template-expected.json index 26b7e3933..395ac4db5 100644 --- a/test/resources/9999999/mobileMessage/template-expected.json +++ b/test/resources/9999999/mobileMessage/template-expected.json @@ -3,8 +3,8 @@ "type": "ExactTarget.Mobile.Sms.Core.Entities.SmsMessageEntity", "name": "{{{prefix}}}mobileMessage", "origin": "SMS Send", - "r__mobileCode_code": "4912312345678", - "r__campaign_name": ["{{{prefix}}}campaign"], + "r__mobileCode_key": "4912312345678", + "r__campaign_key": ["{{{prefix}}}campaign"], "mtSendDate": "2020-07-16T22:46:00Z", "template": { "id": "Mzo4MDow", diff --git a/test/resources/9999999/query/build-expected.json b/test/resources/9999999/query/build-expected.json index d493d739b..52f2eb855 100644 --- a/test/resources/9999999/query/build-expected.json +++ b/test/resources/9999999/query/build-expected.json @@ -2,7 +2,7 @@ "name": "testTemplated_query", "key": "testTemplated_query", "description": "foobar", - "r__dataExtension_CustomerKey": "testTemplated_dataExtension", + "r__dataExtension_key": "testTemplated_dataExtension", "targetUpdateTypeName": "Overwrite", "r__folder_Path": "Query" } diff --git a/test/resources/9999999/query/get-expected.json b/test/resources/9999999/query/get-expected.json index 2b795f1ee..095a95795 100644 --- a/test/resources/9999999/query/get-expected.json +++ b/test/resources/9999999/query/get-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "bla bla", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:02:44.01", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/get2-expected.json b/test/resources/9999999/query/get2-expected.json index 19c02d524..7202dfafd 100644 --- a/test/resources/9999999/query/get2-expected.json +++ b/test/resources/9999999/query/get2-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query2", "key": "testExisting_query2", "description": "bla bla", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:02:44.01", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/patch-expected.json b/test/resources/9999999/query/patch-expected.json index 4c4fe104e..bb96f9b40 100644 --- a/test/resources/9999999/query/patch-expected.json +++ b/test/resources/9999999/query/patch-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query", "key": "testExisting_query", "description": "updated on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/patch_fixKeys-expected.json b/test/resources/9999999/query/patch_fixKeys-expected.json index d9ce442b7..f832f198f 100644 --- a/test/resources/9999999/query/patch_fixKeys-expected.json +++ b/test/resources/9999999/query/patch_fixKeys-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query_fixedKeys", "key": "testExisting_query_fixedKeys", "description": "updated on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/patch_fixKeysSuffix-expected.json b/test/resources/9999999/query/patch_fixKeysSuffix-expected.json index 4413418e8..e64f16d95 100644 --- a/test/resources/9999999/query/patch_fixKeysSuffix-expected.json +++ b/test/resources/9999999/query/patch_fixKeysSuffix-expected.json @@ -2,7 +2,7 @@ "name": "testExisting_query_fixedKeys", "key": "testExisting_query_fixedKeys_DEV", "description": "updated on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/post-expected.json b/test/resources/9999999/query/post-expected.json index 04aea7990..bc06864f0 100644 --- a/test/resources/9999999/query/post-expected.json +++ b/test/resources/9999999/query/post-expected.json @@ -2,7 +2,7 @@ "name": "testNew_query", "key": "testNew_query", "description": "created on deploy", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "createdDate": "2022-04-26T15:21:16.453", "modifiedDate": "2022-04-26T16:04:15.88", "targetUpdateTypeName": "Overwrite", diff --git a/test/resources/9999999/query/template-expected.json b/test/resources/9999999/query/template-expected.json index 06d196847..f8b37fc59 100644 --- a/test/resources/9999999/query/template-expected.json +++ b/test/resources/9999999/query/template-expected.json @@ -2,7 +2,7 @@ "name": "{{{prefix}}}query", "key": "{{{prefix}}}query", "description": "{{{description}}}", - "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension", + "r__dataExtension_key": "{{{prefix}}}dataExtension", "targetUpdateTypeName": "Overwrite", "r__folder_Path": "Query" } diff --git a/test/resources/9999999/sendClassification/build-expected.json b/test/resources/9999999/sendClassification/build-expected.json index e7cc512c7..9f1f723f0 100644 --- a/test/resources/9999999/sendClassification/build-expected.json +++ b/test/resources/9999999/sendClassification/build-expected.json @@ -4,5 +4,5 @@ "Name": "testTemplated_sendClassification", "c__classification": "Commercial", "r__deliveryProfile_key": "Default", - "r__senderProfile_CustomerKey": "testTemplated_senderProfile" + "r__senderProfile_key": "testTemplated_senderProfile" } diff --git a/test/resources/9999999/sendClassification/get-expected.json b/test/resources/9999999/sendClassification/get-expected.json index f1239e7f6..e53df9bc3 100644 --- a/test/resources/9999999/sendClassification/get-expected.json +++ b/test/resources/9999999/sendClassification/get-expected.json @@ -5,6 +5,6 @@ "Name": "testExisting_sendClassification", "Description": "", "c__classification": "Commercial", - "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__senderProfile_key": "testExisting_senderProfile", "r__deliveryProfile_key": "Default" } diff --git a/test/resources/9999999/sendClassification/patch-expected.json b/test/resources/9999999/sendClassification/patch-expected.json index 5a7701d88..3cc32064a 100644 --- a/test/resources/9999999/sendClassification/patch-expected.json +++ b/test/resources/9999999/sendClassification/patch-expected.json @@ -3,6 +3,6 @@ "Name": "testExisting_sendClassification", "Description": "updated on deploy", "c__classification": "Commercial", - "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__senderProfile_key": "testExisting_senderProfile", "r__deliveryProfile_key": "Default" } diff --git a/test/resources/9999999/sendClassification/post-expected.json b/test/resources/9999999/sendClassification/post-expected.json index 23346b5eb..c7a7bb807 100644 --- a/test/resources/9999999/sendClassification/post-expected.json +++ b/test/resources/9999999/sendClassification/post-expected.json @@ -3,6 +3,6 @@ "Name": "testNew_sendClassification", "Description": "created on deploy", "c__classification": "Transactional", - "r__senderProfile_CustomerKey": "testExisting_senderProfile", + "r__senderProfile_key": "testExisting_senderProfile", "r__deliveryProfile_key": "Default" } diff --git a/test/resources/9999999/sendClassification/template-expected.json b/test/resources/9999999/sendClassification/template-expected.json index ebf5f00f1..c7d069e6b 100644 --- a/test/resources/9999999/sendClassification/template-expected.json +++ b/test/resources/9999999/sendClassification/template-expected.json @@ -4,5 +4,5 @@ "Name": "{{{prefix}}}sendClassification", "c__classification": "Commercial", "r__deliveryProfile_key": "Default", - "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile" + "r__senderProfile_key": "{{{prefix}}}senderProfile" } diff --git a/test/resources/9999999/transactionalEmail/build-expected.json b/test/resources/9999999/transactionalEmail/build-expected.json index 72f881cc6..e6cd0702a 100644 --- a/test/resources/9999999/transactionalEmail/build-expected.json +++ b/test/resources/9999999/transactionalEmail/build-expected.json @@ -5,7 +5,7 @@ "classification": "Default Transactional", "status": "Active", "subscriptions": { - "r__dataExtension_CustomerKey": "testTemplated_dataExtension", + "r__dataExtension_key": "testTemplated_dataExtension", "autoAddSubscriber": true, "updateSubscriber": true, "r__list_PathName": "my subscribers/All Subscribers" @@ -13,6 +13,6 @@ "options": { "trackLinks": true }, - "r__asset_customerKey": "testTemplated_asset_message", + "r__asset_key": "testTemplated_asset_message", "r__journey_key": "testTemplated_temail" } diff --git a/test/resources/9999999/transactionalEmail/get-expected.json b/test/resources/9999999/transactionalEmail/get-expected.json index 6a4e1f88f..10a0771e6 100644 --- a/test/resources/9999999/transactionalEmail/get-expected.json +++ b/test/resources/9999999/transactionalEmail/get-expected.json @@ -7,7 +7,7 @@ "createdDate": "2020-09-10T03:29:00", "modifiedDate": "2020-09-10T03:29:00", "subscriptions": { - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "autoAddSubscriber": true, "updateSubscriber": true, "r__list_PathName": "my subscribers/All Subscribers" @@ -15,6 +15,6 @@ "options": { "trackLinks": true }, - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__journey_key": "testExisting_temail" } diff --git a/test/resources/9999999/transactionalEmail/patch-expected.json b/test/resources/9999999/transactionalEmail/patch-expected.json index 625911658..5ba8fb626 100644 --- a/test/resources/9999999/transactionalEmail/patch-expected.json +++ b/test/resources/9999999/transactionalEmail/patch-expected.json @@ -7,7 +7,7 @@ "createdDate": "2020-09-10T03:29:00", "modifiedDate": "2020-09-10T03:29:00", "subscriptions": { - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "autoAddSubscriber": true, "updateSubscriber": true, "r__list_PathName": "my subscribers/All Subscribers" @@ -15,6 +15,6 @@ "options": { "trackLinks": true }, - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__journey_key": "testExisting_temail" } diff --git a/test/resources/9999999/transactionalEmail/post-expected.json b/test/resources/9999999/transactionalEmail/post-expected.json index e6070aa31..6b94ce5cc 100644 --- a/test/resources/9999999/transactionalEmail/post-expected.json +++ b/test/resources/9999999/transactionalEmail/post-expected.json @@ -7,7 +7,7 @@ "createdDate": "2022-12-06T06:08:00", "modifiedDate": "2022-12-06T06:08:00", "subscriptions": { - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "autoAddSubscriber": true, "updateSubscriber": true, "r__list_PathName": "my subscribers/All Subscribers" @@ -15,6 +15,6 @@ "options": { "trackLinks": true }, - "r__asset_customerKey": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message", "r__journey_key": "testNew_RANDOM_interaction" } diff --git a/test/resources/9999999/transactionalEmail/template-expected.json b/test/resources/9999999/transactionalEmail/template-expected.json index 482d7ae37..216aac4b9 100644 --- a/test/resources/9999999/transactionalEmail/template-expected.json +++ b/test/resources/9999999/transactionalEmail/template-expected.json @@ -5,7 +5,7 @@ "classification": "Default Transactional", "status": "Active", "subscriptions": { - "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension", + "r__dataExtension_key": "{{{prefix}}}dataExtension", "autoAddSubscriber": true, "updateSubscriber": true, "r__list_PathName": "my subscribers/All Subscribers" @@ -13,6 +13,6 @@ "options": { "trackLinks": true }, - "r__asset_customerKey": "{{{prefix}}}asset_message", + "r__asset_key": "{{{prefix}}}asset_message", "r__journey_key": "{{{prefix}}}temail" } diff --git a/test/resources/9999999/transactionalPush/build-expected.json b/test/resources/9999999/transactionalPush/build-expected.json index bfb884d23..3397223c9 100644 --- a/test/resources/9999999/transactionalPush/build-expected.json +++ b/test/resources/9999999/transactionalPush/build-expected.json @@ -3,6 +3,6 @@ "definitionKey": "testTemplated_tpush", "description": "foobar. note that applicationId can only be manually set up in Setup - Mobile Push", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", - "r__asset_customerKey": "mobileMessage_testTarget", + "r__asset_key": "mobileMessage_testTarget", "options": { "sound": "temp.wmv", "badge": "1" } } diff --git a/test/resources/9999999/transactionalPush/get-expected.json b/test/resources/9999999/transactionalPush/get-expected.json index 92bf55110..443dd8e0f 100644 --- a/test/resources/9999999/transactionalPush/get-expected.json +++ b/test/resources/9999999/transactionalPush/get-expected.json @@ -6,6 +6,6 @@ "status": "Active", "createdDate": "2022-12-07T02:56:00", "modifiedDate": "2022-12-07T02:56:00", - "r__asset_customerKey": "mobileMessage_test", + "r__asset_key": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1" } } diff --git a/test/resources/9999999/transactionalPush/patch-expected.json b/test/resources/9999999/transactionalPush/patch-expected.json index 403946381..c36cff58b 100644 --- a/test/resources/9999999/transactionalPush/patch-expected.json +++ b/test/resources/9999999/transactionalPush/patch-expected.json @@ -6,7 +6,7 @@ "description": "updated via deploy; note that applicationId can only be manually set up in Setup - Mobile Push", "createdDate": "2022-12-07T02:56:00", "modifiedDate": "2022-12-07T03:26:00", - "r__asset_customerKey": "mobileMessage_test", + "r__asset_key": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1" diff --git a/test/resources/9999999/transactionalPush/post-expected.json b/test/resources/9999999/transactionalPush/post-expected.json index cdf1c84ac..5f662aff8 100644 --- a/test/resources/9999999/transactionalPush/post-expected.json +++ b/test/resources/9999999/transactionalPush/post-expected.json @@ -6,7 +6,7 @@ "description": "created on deploy; note that applicationId can only be manually set up in Setup - Mobile Push", "createdDate": "2022-12-07T02:56:00", "modifiedDate": "2022-12-07T03:26:00", - "r__asset_customerKey": "mobileMessage_test", + "r__asset_key": "mobileMessage_test", "options": { "sound": "temp.wmv", "badge": "1" diff --git a/test/resources/9999999/transactionalPush/template-expected.json b/test/resources/9999999/transactionalPush/template-expected.json index 6f13ae378..526267021 100644 --- a/test/resources/9999999/transactionalPush/template-expected.json +++ b/test/resources/9999999/transactionalPush/template-expected.json @@ -3,6 +3,6 @@ "definitionKey": "{{{prefix}}}tpush", "description": "{{{description}}}. note that applicationId can only be manually set up in Setup - Mobile Push", "applicationId": "ffbab4c9-fbf6-4b87-9c9a-10c6ce86e81d", - "r__asset_customerKey": "mobileMessage{{{suffix}}}", + "r__asset_key": "mobileMessage{{{suffix}}}", "options": { "sound": "temp.wmv", "badge": "1" } } diff --git a/test/resources/9999999/transactionalSMS/build-expected.json b/test/resources/9999999/transactionalSMS/build-expected.json index 29dcbbab7..813e86ab5 100644 --- a/test/resources/9999999/transactionalSMS/build-expected.json +++ b/test/resources/9999999/transactionalSMS/build-expected.json @@ -7,6 +7,6 @@ "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTTEMPLATED_KEYWORD" + "r__mobileKeyword_key": "4912312345678.TESTTEMPLATED_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/get-expected.json b/test/resources/9999999/transactionalSMS/get-expected.json index d187d880f..5d2a9a074 100644 --- a/test/resources/9999999/transactionalSMS/get-expected.json +++ b/test/resources/9999999/transactionalSMS/get-expected.json @@ -9,6 +9,6 @@ "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + "r__mobileKeyword_key": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/patch-expected.json b/test/resources/9999999/transactionalSMS/patch-expected.json index d187d880f..5d2a9a074 100644 --- a/test/resources/9999999/transactionalSMS/patch-expected.json +++ b/test/resources/9999999/transactionalSMS/patch-expected.json @@ -9,6 +9,6 @@ "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + "r__mobileKeyword_key": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/post-expected.json b/test/resources/9999999/transactionalSMS/post-expected.json index a9877d0b9..196a92a35 100644 --- a/test/resources/9999999/transactionalSMS/post-expected.json +++ b/test/resources/9999999/transactionalSMS/post-expected.json @@ -9,6 +9,6 @@ "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "r__mobileKeyword_c__codeKeyword": "4912312345678.TESTEXISTING_KEYWORD" + "r__mobileKeyword_key": "4912312345678.TESTEXISTING_KEYWORD" } } diff --git a/test/resources/9999999/transactionalSMS/template-expected.json b/test/resources/9999999/transactionalSMS/template-expected.json index e249c80b9..8c2f3b9e0 100644 --- a/test/resources/9999999/transactionalSMS/template-expected.json +++ b/test/resources/9999999/transactionalSMS/template-expected.json @@ -7,6 +7,6 @@ "countryCode": "", "autoAddSubscriber": true, "updateSubscriber": true, - "r__mobileKeyword_c__codeKeyword": "4912312345678.{{{prefixUpper}}}KEYWORD" + "r__mobileKeyword_key": "4912312345678.{{{prefixUpper}}}KEYWORD" } } diff --git a/test/resources/9999999/triggeredSend/build-expected.json b/test/resources/9999999/triggeredSend/build-expected.json index 84ca3b304..d935d1e65 100644 --- a/test/resources/9999999/triggeredSend/build-expected.json +++ b/test/resources/9999999/triggeredSend/build-expected.json @@ -21,8 +21,8 @@ "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", - "r__email_Name": "Sporting Goods for September", + "r__email_name": "Sporting Goods for September", "r__folder_Path": "Triggered Sends", - "r__sendClassification_CustomerKey": "testTemplated_sendClassification", - "r__senderProfile_CustomerKey": "testTemplated_senderProfile" + "r__sendClassification_key": "testTemplated_sendClassification", + "r__senderProfile_key": "testTemplated_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/get-expected.json b/test/resources/9999999/triggeredSend/get-expected.json index 422ebc048..c46e34718 100644 --- a/test/resources/9999999/triggeredSend/get-expected.json +++ b/test/resources/9999999/triggeredSend/get-expected.json @@ -21,8 +21,8 @@ "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", - "r__email_Name": "Sporting Goods for September", + "r__email_name": "Sporting Goods for September", "r__folder_Path": "Triggered Sends", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/patch-expected.json b/test/resources/9999999/triggeredSend/patch-expected.json index 925ffc957..b919f998a 100644 --- a/test/resources/9999999/triggeredSend/patch-expected.json +++ b/test/resources/9999999/triggeredSend/patch-expected.json @@ -21,8 +21,8 @@ "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", - "r__email_Name": "Sporting Goods for September", + "r__email_name": "Sporting Goods for September", "r__folder_Path": "Triggered Sends", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/post-expected.json b/test/resources/9999999/triggeredSend/post-expected.json index 764a61695..dbe8f1a0c 100644 --- a/test/resources/9999999/triggeredSend/post-expected.json +++ b/test/resources/9999999/triggeredSend/post-expected.json @@ -21,8 +21,8 @@ "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", - "r__email_Name": "Sporting Goods for September", + "r__email_name": "Sporting Goods for September", "r__folder_Path": "Triggered Sends", - "r__sendClassification_CustomerKey": "testExisting_sendClassification", - "r__senderProfile_CustomerKey": "testExisting_senderProfile" + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile" } diff --git a/test/resources/9999999/triggeredSend/template-expected.json b/test/resources/9999999/triggeredSend/template-expected.json index c1d85b166..9bf279f19 100644 --- a/test/resources/9999999/triggeredSend/template-expected.json +++ b/test/resources/9999999/triggeredSend/template-expected.json @@ -21,8 +21,8 @@ "SuppressTracking": false, "TriggeredSendStatus": "New", "TriggeredSendType": "Continuous", - "r__email_Name": "Sporting Goods for September", + "r__email_name": "Sporting Goods for September", "r__folder_Path": "Triggered Sends", - "r__sendClassification_CustomerKey": "{{{prefix}}}sendClassification", - "r__senderProfile_CustomerKey": "{{{prefix}}}senderProfile" + "r__sendClassification_key": "{{{prefix}}}sendClassification", + "r__senderProfile_key": "{{{prefix}}}senderProfile" } diff --git a/test/resources/9999999/verification/build-expected.json b/test/resources/9999999/verification/build-expected.json index f717cc626..88071b50a 100644 --- a/test/resources/9999999/verification/build-expected.json +++ b/test/resources/9999999/verification/build-expected.json @@ -2,7 +2,7 @@ "dataVerificationDefinitionId": "testTemplated_39f6a488-20eb-4ba0-b0b9", "notificationEmailAddress": "", "notificationEmailMessage": "", - "r__dataExtension_CustomerKey": "testTemplated_dataExtension", + "r__dataExtension_key": "testTemplated_dataExtension", "shouldEmailOnFailure": false, "shouldStopOnFailure": true, "value1": 1, diff --git a/test/resources/9999999/verification/get-expected.json b/test/resources/9999999/verification/get-expected.json index 1f9c1825b..1c88e98d8 100644 --- a/test/resources/9999999/verification/get-expected.json +++ b/test/resources/9999999/verification/get-expected.json @@ -2,7 +2,7 @@ "dataVerificationDefinitionId": "testExisting_39f6a488-20eb-4ba0-b0b9", "notificationEmailAddress": "", "notificationEmailMessage": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "shouldEmailOnFailure": false, "shouldStopOnFailure": true, "value1": 1, diff --git a/test/resources/9999999/verification/patch-expected.json b/test/resources/9999999/verification/patch-expected.json index dc8d975d2..03c68f68c 100644 --- a/test/resources/9999999/verification/patch-expected.json +++ b/test/resources/9999999/verification/patch-expected.json @@ -2,7 +2,7 @@ "dataVerificationDefinitionId": "testExisting_39f6a488-20eb-4ba0-b0b9", "notificationEmailAddress": "test@accenture.com", "notificationEmailMessage": "", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "shouldEmailOnFailure": true, "shouldStopOnFailure": true, "value1": 1, diff --git a/test/resources/9999999/verification/post-expected.json b/test/resources/9999999/verification/post-expected.json index b06a77b76..99d85f52d 100644 --- a/test/resources/9999999/verification/post-expected.json +++ b/test/resources/9999999/verification/post-expected.json @@ -1,6 +1,6 @@ { "dataVerificationDefinitionId": "testNew_RANDOM_NEW_GUID", - "r__dataExtension_CustomerKey": "testExisting_dataExtension", + "r__dataExtension_key": "testExisting_dataExtension", "verificationType": "IsEqualTo", "value1": 2, "value2": 0, diff --git a/test/resources/9999999/verification/template-expected.json b/test/resources/9999999/verification/template-expected.json index 04296b7ea..6898ddb09 100644 --- a/test/resources/9999999/verification/template-expected.json +++ b/test/resources/9999999/verification/template-expected.json @@ -2,7 +2,7 @@ "dataVerificationDefinitionId": "{{{prefix}}}39f6a488-20eb-4ba0-b0b9", "notificationEmailAddress": "", "notificationEmailMessage": "", - "r__dataExtension_CustomerKey": "{{{prefix}}}dataExtension", + "r__dataExtension_key": "{{{prefix}}}dataExtension", "shouldEmailOnFailure": false, "shouldStopOnFailure": true, "value1": 1, diff --git a/test/type.query.test.js b/test/type.query.test.js index 90e02b776..5ef5e0900 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -40,7 +40,7 @@ describe('type: query', () => { expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.equal( file(testUtils.getExpectedFile('9999999', 'query', 'get', 'sql')) ); - // check if r__dataExtension_CustomerKey was overwritten + // check if r__dataExtension_key was overwritten assert.deepEqual( await testUtils.getActualJson('testExisting_query2', 'query'), await testUtils.getExpectedJson('9999999', 'query', 'get2'), diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 1cce48f99..7103c4bee 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -46,7 +46,7 @@ * @property {string} description - * @property {string} [targetId] Object ID of DE (removed before save) * @property {string} targetKey key of target data extension - * @property {string} r__dataExtension_CustomerKey key of target data extension + * @property {string} r__dataExtension_key key of target data extension * @property {string} createdDate e.g. "2020-09-14T01:42:03.017" * @property {string} modifiedDate e.g. "2020-09-14T01:42:03.017" * @property {'Overwrite'|'Update'|'Append'} targetUpdateTypeName defines how the query writes into the target data extension @@ -113,7 +113,7 @@ * @property {'dataextension'|'salesforcedataextension'|'synchronizeddataextension'|'shared_dataextension'|'shared_salesforcedataextension'} r__folder_ContentType retrieved from associated folder * @property {string} r__folder_Path folder path in which this DE is saved * @property {string} [CategoryID] holds folder ID, replaced with r__folder_Path during retrieve - * @property {string} [r__dataExtensionTemplate_Name] name of optionally associated DE template + * @property {string} [r__dataExtensionTemplate_name] name of optionally associated DE template * @property {object} [Template] - * @property {string} [Template.CustomerKey] key of optionally associated DE teplate * @property {string} RetainUntil empty string or US date + 12:00:00 AM @@ -302,7 +302,7 @@ * @property {string} notificationEmailMessage email message to send; empty string if shouldEmailOnFailure=false * @property {number} createdBy user id of creator * @property {string} [targetObjectId] ObjectID of target data extension - * @property {string} r__dataExtension_CustomerKey key of target data extension + * @property {string} r__dataExtension_key key of target data extension */ /** From 0b51d562ee68663a9378a188950f888f6072debb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 21 May 2024 16:19:10 +0200 Subject: [PATCH 275/359] #58: add missing field definitions --- lib/metadataTypes/definitions/Automation.definition.js | 3 +++ lib/metadataTypes/definitions/Event.definition.js | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/lib/metadataTypes/definitions/Automation.definition.js b/lib/metadataTypes/definitions/Automation.definition.js index 6f1e1efa7..55176a5f0 100644 --- a/lib/metadataTypes/definitions/Automation.definition.js +++ b/lib/metadataTypes/definitions/Automation.definition.js @@ -572,6 +572,9 @@ export default { 'steps[].activities[].r__type': { skipValidation: true, }, + 'steps[].activities[].r__key': { + skipValidation: true, + }, 'steps[].description': { isCreateable: true, isUpdateable: true, diff --git a/lib/metadataTypes/definitions/Event.definition.js b/lib/metadataTypes/definitions/Event.definition.js index 4bab3acf6..65f93e775 100644 --- a/lib/metadataTypes/definitions/Event.definition.js +++ b/lib/metadataTypes/definitions/Event.definition.js @@ -963,5 +963,11 @@ export default { retrieving: true, template: true, }, + r__dataExtension_CustomerKey: { + isCreateable: false, + isUpdateable: false, + retrieving: true, + template: true, + }, }, }; From 3e6bf1ca1e4ce61ddc60459a6a52392e1a96096a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 14:38:53 +0000 Subject: [PATCH 276/359] --- updated-dependencies: - dependency-name: fast-xml-parser dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index fa172923c..0f238f030 100644 --- a/package-lock.json +++ b/package-lock.json @@ -48,7 +48,7 @@ "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", - "fast-xml-parser": "4.3.6", + "fast-xml-parser": "4.4.0", "husky": "9.0.11", "lint-staged": "15.2.2", "mocha": "10.4.0", @@ -2712,9 +2712,9 @@ "dev": true }, "node_modules/fast-xml-parser": { - "version": "4.3.6", - "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.3.6.tgz", - "integrity": "sha512-M2SovcRxD4+vC493Uc2GZVcZaj66CCJhWurC4viynVSTvrpErCShNcDz1lAho6n9REQKvL/ll4A4/fw6Y9z8nw==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/fast-xml-parser/-/fast-xml-parser-4.4.0.tgz", + "integrity": "sha512-kLY3jFlwIYwBNDojclKsNAC12sfD6NwW74QB2CoNGPvtVxjliYehVunB3HYyNi+n4Tt1dAcgwYvmKF/Z18flqg==", "dev": true, "funding": [ { diff --git a/package.json b/package.json index ca729d31b..9a1a57ef3 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", - "fast-xml-parser": "4.3.6", + "fast-xml-parser": "4.4.0", "husky": "9.0.11", "lint-staged": "15.2.2", "mocha": "10.4.0", From 9d25e9077467d95399dbb9c6e87c317ca679165b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 15:10:10 +0000 Subject: [PATCH 277/359] --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 22 +++++++++++++++++----- package.json | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0f238f030..8c5d9b2dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.4", + "eslint-plugin-jsdoc": "48.2.5", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", @@ -2307,9 +2307,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.2.4", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.4.tgz", - "integrity": "sha512-3ebvVgCJFy06gpmuS2ynz13uh9iFSzZ1C1dDkgcSAqVVg82zlORKMk2fvjq708pAO6bwfs5YLttknFEbaoDiGw==", + "version": "48.2.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.5.tgz", + "integrity": "sha512-ZeTfKV474W1N9niWfawpwsXGu+ZoMXu4417eBROX31d7ZuOk8zyG66SO77DpJ2+A9Wa2scw/jRqBPnnQo7VbcQ==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.43.0", @@ -2319,7 +2319,7 @@ "escape-string-regexp": "^4.0.0", "esquery": "^1.5.0", "is-builtin-module": "^3.2.1", - "semver": "^7.6.0", + "semver": "^7.6.1", "spdx-expression-parse": "^4.0.0" }, "engines": { @@ -2329,6 +2329,18 @@ "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" } }, + "node_modules/eslint-plugin-jsdoc/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-plugin-jsdoc/node_modules/spdx-expression-parse": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", diff --git a/package.json b/package.json index 9a1a57ef3..1295d609b 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.4", + "eslint-plugin-jsdoc": "48.2.5", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", From 125dc4a3830de299914f5df185ed73cf53ec47dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 10:12:15 +0200 Subject: [PATCH 278/359] #0: upgrade minimum node requirement to 18.18.2 to fix an incompatiblity with @typescript-eslint/types@7.9.0 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8c5d9b2dc..d58a5fb2d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -57,7 +57,7 @@ "prettier-eslint": "16.3.0" }, "engines": { - "node": ">=18.16.0" + "node": ">=18.18.2" }, "funding": { "type": "corporate", diff --git a/package.json b/package.json index 1295d609b..ee57b60a2 100644 --- a/package.json +++ b/package.json @@ -41,7 +41,7 @@ "mcdev": "./lib/cli.js" }, "engines": { - "node": ">=18.16.0" + "node": ">=18.18.2" }, "scripts": { "start": "node lib/cli.js", From 99b85d7112737797b5f0b52dc64084d73067cb9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 10:40:46 +0200 Subject: [PATCH 279/359] #1248: bump beauty-amp-core2 from 0.4.6 to 0.4.9 --- package-lock.json | 26 ++++---------------------- package.json | 2 +- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/package-lock.json b/package-lock.json index d58a5fb2d..9c0a011dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "6.0.2", "license": "MIT", "dependencies": { - "beauty-amp-core2": "0.4.6", + "beauty-amp-core2": "0.4.9", "cli-progress": "3.12.0", "command-exists": "1.2.9", "conf": "12.0.0", @@ -1023,27 +1023,9 @@ ] }, "node_modules/beauty-amp-core2": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/beauty-amp-core2/-/beauty-amp-core2-0.4.6.tgz", - "integrity": "sha512-kEyX5uhmRU28Zy0uAcceHOoU7PZXXMuKUuuP0y7iMMSwluZrsRxhMcy23EEXJ+iASP9jQ/ffXavlfHc36yPvMg==", - "dependencies": { - "lodash": "^4.17.21", - "prettier": "^2.8.8" - } - }, - "node_modules/beauty-amp-core2/node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", - "bin": { - "prettier": "bin-prettier.js" - }, - "engines": { - "node": ">=10.13.0" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } + "version": "0.4.9", + "resolved": "https://registry.npmjs.org/beauty-amp-core2/-/beauty-amp-core2-0.4.9.tgz", + "integrity": "sha512-OFZ3XHPgv1NCHwic0H7G4kfS5gkkyY5iLzM4WZF6M8KxV1JGYhKFbFke2bVp3DKa4vy6yOwlVyhOmFhuTt7X6Q==" }, "node_modules/big-integer": { "version": "1.6.52", diff --git a/package.json b/package.json index ee57b60a2..aa97ec009 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "version:patch": "npm version --no-commit-hooks patch" }, "dependencies": { - "beauty-amp-core2": "0.4.6", + "beauty-amp-core2": "0.4.9", "cli-progress": "3.12.0", "command-exists": "1.2.9", "conf": "12.0.0", From e30c4ef470331267cde82ba43d0fd4d5e0e6a9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 10:42:04 +0200 Subject: [PATCH 280/359] #0: improve Downloaded info log for assets --- lib/metadataTypes/Asset.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index cce4e3a35..7964023f0 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -321,24 +321,21 @@ class Asset extends MetadataType { } while (moreResults); // only when we save results do we need the complete metadata or files. caching can skip these - if (retrieveDir && items.length > 0) { - for (const item of items) { - if (item.customerKey.trim() !== item.customerKey) { - Util.logger.warn( - ` - ${this.definition.type} ${item[this.definition.nameField]} (${ - item[this.definition.keyField] - }) has leading or trailing spaces in customerKey. Please remove them in SFMC.` - ); + if (retrieveDir) { + if (items.length > 0) { + for (const item of items) { + if (item.customerKey.trim() !== item.customerKey) { + Util.logger.warn( + ` - ${this.definition.type} ${item[this.definition.nameField]} (${ + item[this.definition.keyField] + }) has leading or trailing spaces in customerKey. Please remove them in SFMC.` + ); + } } + // we have to wait on execution or it potentially causes memory reference issues when changing between BUs + await this.requestAndSaveExtended(items, subType, retrieveDir, templateVariables); } - // we have to wait on execution or it potentially causes memory reference issues when changing between BUs - await this.requestAndSaveExtended(items, subType, retrieveDir, templateVariables); - if (Util.isRunViaVSCodeExtension) { - Util.logger.info(` Downloaded asset-${subType}: ${items.length}`); - } else { - Util.logger.debug(`Downloaded asset-${subType}: ${items.length}`); - } - } else if (retrieveDir && !items.length) { + // always show the summary even if we already had the progress bar in the console Util.logger.info(` Downloaded asset-${subType}: ${items.length}`); } @@ -366,7 +363,7 @@ class Asset extends MetadataType { const extendedBar = new cliProgress.SingleBar( { format: - ' Downloaded [{bar}] {percentage}% | {value}/{total} | asset-' + + ' Downloading [{bar}] {percentage}% | {value}/{total} | asset-' + subType, }, cliProgress.Presets.shades_classic From b85c2af0d149b4dd108d0c309eded22b984d2299 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 10:48:50 +0200 Subject: [PATCH 281/359] #1248: switch html formatting from prettier to beautyAmp extension it runs prettier on html but also formats ampscript --- boilerplate/files/.vscode/settings.json | 2 +- boilerplate/forcedUpdates.json | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json index 6a4e75c53..e21149bb5 100644 --- a/boilerplate/files/.vscode/settings.json +++ b/boilerplate/files/.vscode/settings.json @@ -48,7 +48,7 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "FiB.beautyAmp" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" diff --git a/boilerplate/forcedUpdates.json b/boilerplate/forcedUpdates.json index c325c1b39..602d879cd 100644 --- a/boilerplate/forcedUpdates.json +++ b/boilerplate/forcedUpdates.json @@ -1,11 +1,12 @@ [ { - "version": "6.1.0", - "files": [".vscode/settings.json", ".beautyamp.json", ".vscode/extensions.json"] - }, - { - "version": "6.0.3", - "files": [".prettierrc"] + "version": "7.0.0", + "files": [ + ".vscode/extensions.json", + ".vscode/settings.json", + ".beautyamp.json", + ".prettierrc" + ] }, { "version": "5.0.0", From e589ac50b046c638d04c57f3d6ed44f7f7682037 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 11:14:25 +0200 Subject: [PATCH 282/359] #1248: adding FiB.beautyAmp to recommended contributor extensions to make writing asset-test cases easier --- .beautyamp.json | 13 +++++++++++++ .vscode/extensions.json | 1 + .vscode/settings.json | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .beautyamp.json diff --git a/.beautyamp.json b/.beautyamp.json new file mode 100644 index 000000000..612573c50 --- /dev/null +++ b/.beautyamp.json @@ -0,0 +1,13 @@ +{ + "ampscript": { + "capitalizeAndOrNot": true, + "capitalizeIfFor": true, + "capitalizeSet": true, + "capitalizeVar": true, + "maxParametersPerLine": 4 + }, + "editor": { + "insertSpaces": true, + "tabSize": 4 + } +} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index a71f41ad1..16aa0fcfb 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -14,6 +14,7 @@ // Formatting & colors "editorconfig.editorconfig", "esbenp.prettier-vscode", + "FiB.beautyAmp", // mcdev tests "hbenl.vscode-mocha-test-adapter", diff --git a/.vscode/settings.json b/.vscode/settings.json index 95c678797..b20f5a880 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,7 +19,7 @@ "sql-formatter.indent": " ", "sql-formatter.uppercase": true, "[html]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "FiB.beautyAmp" }, "[javascript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" From ce37d9bad9959001664d7648a3fa9225824fa3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 11:19:08 +0200 Subject: [PATCH 283/359] #1248: fix test cases for beauty-amp-core2 0.4.9 --- .../9999999/asset/block-1157-retrieve-expected.html | 6 +++--- test/resources/9999999/script/get_mixed-expected.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/test/resources/9999999/asset/block-1157-retrieve-expected.html b/test/resources/9999999/asset/block-1157-retrieve-expected.html index a4023930f..9c2c588b0 100644 --- a/test/resources/9999999/asset/block-1157-retrieve-expected.html +++ b/test/resources/9999999/asset/block-1157-retrieve-expected.html @@ -3,7 +3,7 @@ cellspacing="0" width="100%" role="presentation" - style="min-width: 100%" + style="min-width: 100%; " class="stylingblock-content-wrapper" > @@ -13,8 +13,8 @@ /* my ampscript */ ]%% + // my ssjs +
my 2nd html
diff --git a/test/resources/9999999/script/get_mixed-expected.html b/test/resources/9999999/script/get_mixed-expected.html index 87ae1266f..99c35e107 100644 --- a/test/resources/9999999/script/get_mixed-expected.html +++ b/test/resources/9999999/script/get_mixed-expected.html @@ -5,5 +5,5 @@ %%[ SET @test = 'bla bla' ]%% -line2 %%= v(@test) =%% still line2; collapsed to line2 because -it's assumed HTML +line2 %%= v(@test) =%% still line2; collapsed to line2 because it's assumed +HTML From 4fe52babff0ffbecc349ebf27abd6941b4913df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 11:54:01 +0200 Subject: [PATCH 284/359] #1248: associating html with ampscript to make writing asset-test cases easier; add amscript-language to recommended extensions for contributors --- .vscode/extensions.json | 1 + .vscode/settings.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 16aa0fcfb..31c85a36d 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -14,6 +14,7 @@ // Formatting & colors "editorconfig.editorconfig", "esbenp.prettier-vscode", + "xnerd.ampscript-language", "FiB.beautyAmp", // mcdev tests diff --git a/.vscode/settings.json b/.vscode/settings.json index b20f5a880..f40128b62 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -5,7 +5,8 @@ }, "editor.formatOnSave": true, "files.associations": { - "*.ssjs": "javascript" + "*.ssjs": "javascript", + "*.html": "ampscript" }, "files.eol": "\n", "js/ts.implicitProjectConfig.checkJs": true, From 85a484b311fd0c2ecd3464050e6a6362c95278c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 11:55:14 +0200 Subject: [PATCH 285/359] #1248: enhance asset test case to cover ampscript print tags not getting formatted --- test/resources/9999999/asset/block-1157-retrieve-expected.html | 1 + .../9999999/asset/v1/content/assets/1295064/get-response.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/resources/9999999/asset/block-1157-retrieve-expected.html b/test/resources/9999999/asset/block-1157-retrieve-expected.html index 9c2c588b0..19d29887d 100644 --- a/test/resources/9999999/asset/block-1157-retrieve-expected.html +++ b/test/resources/9999999/asset/block-1157-retrieve-expected.html @@ -17,6 +17,7 @@
my 2nd html
+
%%=TreatAsContent(ContentBlockByName("Content Builder\my very long path\Content Blocks Library\COMMON\some other folder\my code snippet"))=%%
diff --git a/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json b/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json index ffa82c774..d33670c1c 100644 --- a/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json +++ b/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json @@ -45,7 +45,7 @@ "name": "Content Builder", "parentId": 0 }, - "content": "
\n my 1st html\n
\n\n%%[ /* my ampscript */ ]%%\n\n\n\n
\n my 2nd html\n
", + "content": "
\n my 1st html\n
\n\n%%[ /* my ampscript */ ]%%\n\n\n\n
\n my 2nd html\n
\n
%%=TreatAsContent(ContentBlockByName(\"Content Builder\\my very long path\\Content Blocks Library\\COMMON\\some other folder\\my code snippet\"))=%%
", "design": "", "meta": { "wrapperStyles": { From 08a35f7656b509db60f3a8bac5131ae3b9fb5593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 11:59:22 +0200 Subject: [PATCH 286/359] #1248: configure ampscript file icon for contributors --- .vscode/settings.json | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.vscode/settings.json b/.vscode/settings.json index f40128b62..28bc58f4a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -57,5 +57,16 @@ "label": "Created By Me", "query": "author:${user} state:open repo:${owner}/${repository} sort:created-desc" } + ], + "vsicons.associations.files": [ + { + "icon": "apex", + "languages": [ + { "ids": "ampscript", "defaultExtension": "amp" }, + { "ids": "AMPscript", "defaultExtension": "amp" } + ], + "light": true, + "format": "FileFormat.svg" + } ] } From e2876a2b73ed888cbdab73d96df79a38966b56f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 12:00:08 +0200 Subject: [PATCH 287/359] #1248: correct casing of file association for ampscript in boilerplate vscode config --- boilerplate/files/.vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boilerplate/files/.vscode/settings.json b/boilerplate/files/.vscode/settings.json index e21149bb5..d2dc42b28 100644 --- a/boilerplate/files/.vscode/settings.json +++ b/boilerplate/files/.vscode/settings.json @@ -37,7 +37,7 @@ "editor.formatOnSave": true, "files.associations": { "*.ssjs": "javascript", - "*.html": "AMPscript" + "*.html": "ampscript" }, "files.eol": "\n", "files.exclude": { From ab224825d7eb752ac1a8e2cfb1b10a47a9d86fc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 22 May 2024 20:56:22 +0200 Subject: [PATCH 288/359] #1332: do not refreshBU on mcdev join --- lib/util/cli.js | 18 ++++++++++++------ lib/util/init.js | 11 ++++++++--- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/lib/util/cli.js b/lib/util/cli.js index a55baae29..07733eadc 100644 --- a/lib/util/cli.js +++ b/lib/util/cli.js @@ -134,15 +134,16 @@ const Cli = { * * @param {Mcdevrc} properties config file's json * @param {string} credName name of credential that needs updating + * @param {boolean} [refreshBUs] if this was triggered by mcdev join, do not refresh BUs * @returns {Promise.} success of update */ - async updateCredential(properties, credName) { + async updateCredential(properties, credName, refreshBUs = true) { const skipInteraction = Util.skipInteraction; if (credName) { if (!skipInteraction) { Util.logger.info(`Please enter the details for '${credName}'`); } - return await this._setCredential(properties, credName); + return await this._setCredential(properties, credName, refreshBUs); } }, /** @@ -309,9 +310,10 @@ const Cli = { * * @param {Mcdevrc} properties from config file * @param {string} [credName] name of credential that needs updating + * @param {boolean} [refreshBUs] if this was triggered by mcdev join, do not refresh BUs * @returns {Promise.} success of refresh or credential name */ - async _setCredential(properties, credName) { + async _setCredential(properties, credName, refreshBUs = true) { const skipInteraction = Util.skipInteraction; // Get user input let credentialsGood = null; @@ -364,9 +366,13 @@ const Cli = { } } } while (!credentialsGood); - // Get all business units and add them to the properties - const status = await BuHelper.refreshBUProperties(properties, inputData.credentialName); - return status ? inputData.credentialName : status; + if (refreshBUs) { + // Get all business units and add them to the properties + const status = await BuHelper.refreshBUProperties(properties, inputData.credentialName); + return status ? inputData.credentialName : status; + } else { + return credentialsGood; + } }, /** diff --git a/lib/util/init.js b/lib/util/init.js index 38b703c80..6deabf4bf 100644 --- a/lib/util/init.js +++ b/lib/util/init.js @@ -40,9 +40,10 @@ const Init = { * * @param {Mcdevrc} properties config file's json * @param {string} [credentialName] identifying name of the installed package / project; if set, will update this credential + * @param {boolean} [refreshBUs] if this was triggered by mcdev join, do not refresh BUs * @returns {Promise.} - */ - async initProject(properties, credentialName) { + async initProject(properties, credentialName, refreshBUs = true) { if (!(await Init._checkPathForCloud())) { return; } @@ -105,7 +106,11 @@ const Init = { do { error = false; try { - const success = await Cli.updateCredential(properties, badCredName); + const success = await Cli.updateCredential( + properties, + badCredName, + refreshBUs + ); if (success) { Util.logger.info(`✔️ Credential '${badCredName}' updated.`); } else { @@ -283,7 +288,7 @@ const Init = { await InitGit._updateGitConfigUser(); // ask the user to enter the server credentials - await this.initProject(properties); + await this.initProject(properties, null, false); } else { return; } From 52a502c9c2719a9ab2e5bfb7c2c49193654c95b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 10:00:03 +0200 Subject: [PATCH 289/359] #1110: add typescript as dev dependency to create d.ts file for vsce --- package-lock.json | 9 +++++---- package.json | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9c0a011dd..b947b63a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -54,7 +54,8 @@ "mocha": "10.4.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", - "prettier-eslint": "16.3.0" + "prettier-eslint": "16.3.0", + "typescript": "5.4.5" }, "engines": { "node": ">=18.18.2" @@ -6926,9 +6927,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", "dev": true, "bin": { "tsc": "bin/tsc", diff --git a/package.json b/package.json index aa97ec009..86107e92a 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,8 @@ "mocha": "10.4.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", - "prettier-eslint": "16.3.0" + "prettier-eslint": "16.3.0", + "typescript": "5.4.5" }, "optionalDependencies": { "fsevents": "*" From 947794925febcee1b8ddf6dc2d07d6ba9ff2fe26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 10:22:38 +0200 Subject: [PATCH 290/359] #1110: configure that executing tsc should only emit types --- tsconfig.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 tsconfig.json diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..567bd5d65 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,21 @@ +{ + // Change this to match your project + "include": ["lib/**/*"], + "compilerOptions": { + // Tells TypeScript to read JS files, as + // normally they are ignored as source files + "allowJs": true, + // Generate d.ts files + "declaration": true, + // This compiler run should + // only output d.ts files + "emitDeclarationOnly": true, + // Types should go into this directory. + // Removing this would place the .d.ts files + // next to the .js files + "outDir": "types", + // go to js file when using IDE functions like + // "Go to Definition" in VSCode + "declarationMap": true + } +} From 0f66d709d4fca63e5cbd92ead5927ba923cd80f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 10:26:56 +0200 Subject: [PATCH 291/359] #1110: auto-create typescript types on commit --- .husky/pre-commit | 5 + package.json | 4 +- tsconfig.json | 2 +- types/ts/lib/Builder.d.ts | 97 ++ types/ts/lib/Builder.d.ts.map | 1 + types/ts/lib/Deployer.d.ts | 99 ++ types/ts/lib/Deployer.d.ts.map | 1 + types/ts/lib/MetadataTypeDefinitions.d.ts | 80 ++ types/ts/lib/MetadataTypeDefinitions.d.ts.map | 1 + types/ts/lib/MetadataTypeInfo.d.ts | 78 + types/ts/lib/MetadataTypeInfo.d.ts.map | 1 + types/ts/lib/Retriever.d.ts | 66 + types/ts/lib/Retriever.d.ts.map | 1 + types/ts/lib/cli.d.ts | 3 + types/ts/lib/cli.d.ts.map | 1 + types/ts/lib/index.d.ts | 359 +++++ types/ts/lib/index.d.ts.map | 1 + types/ts/lib/metadataTypes/Asset.d.ts | 1109 ++++++++++++++ types/ts/lib/metadataTypes/Asset.d.ts.map | 1 + .../ts/lib/metadataTypes/AttributeGroup.d.ts | 290 ++++ .../lib/metadataTypes/AttributeGroup.d.ts.map | 1 + types/ts/lib/metadataTypes/AttributeSet.d.ts | 968 +++++++++++++ .../lib/metadataTypes/AttributeSet.d.ts.map | 1 + types/ts/lib/metadataTypes/Automation.d.ts | 915 ++++++++++++ .../ts/lib/metadataTypes/Automation.d.ts.map | 1 + types/ts/lib/metadataTypes/Campaign.d.ts | 190 +++ types/ts/lib/metadataTypes/Campaign.d.ts.map | 1 + types/ts/lib/metadataTypes/ContentArea.d.ts | 250 ++++ .../ts/lib/metadataTypes/ContentArea.d.ts.map | 1 + types/ts/lib/metadataTypes/DataExtension.d.ts | 571 ++++++++ .../lib/metadataTypes/DataExtension.d.ts.map | 1 + .../lib/metadataTypes/DataExtensionField.d.ts | 236 +++ .../metadataTypes/DataExtensionField.d.ts.map | 1 + .../metadataTypes/DataExtensionTemplate.d.ts | 175 +++ .../DataExtensionTemplate.d.ts.map | 1 + types/ts/lib/metadataTypes/DataExtract.d.ts | 217 +++ .../ts/lib/metadataTypes/DataExtract.d.ts.map | 1 + .../ts/lib/metadataTypes/DataExtractType.d.ts | 80 ++ .../metadataTypes/DataExtractType.d.ts.map | 1 + .../ts/lib/metadataTypes/DeliveryProfile.d.ts | 102 ++ .../metadataTypes/DeliveryProfile.d.ts.map | 1 + types/ts/lib/metadataTypes/Discovery.d.ts | 189 +++ types/ts/lib/metadataTypes/Discovery.d.ts.map | 1 + types/ts/lib/metadataTypes/Email.d.ts | 384 +++++ types/ts/lib/metadataTypes/Email.d.ts.map | 1 + types/ts/lib/metadataTypes/EmailSend.d.ts | 652 +++++++++ types/ts/lib/metadataTypes/EmailSend.d.ts.map | 1 + types/ts/lib/metadataTypes/Event.d.ts | 958 +++++++++++++ types/ts/lib/metadataTypes/Event.d.ts.map | 1 + types/ts/lib/metadataTypes/FileLocation.d.ts | 101 ++ .../lib/metadataTypes/FileLocation.d.ts.map | 1 + types/ts/lib/metadataTypes/FileTransfer.d.ts | 228 +++ .../lib/metadataTypes/FileTransfer.d.ts.map | 1 + types/ts/lib/metadataTypes/Filter.d.ts | 145 ++ types/ts/lib/metadataTypes/Filter.d.ts.map | 1 + types/ts/lib/metadataTypes/Folder.d.ts | 287 ++++ types/ts/lib/metadataTypes/Folder.d.ts.map | 1 + types/ts/lib/metadataTypes/ImportFile.d.ts | 409 ++++++ .../ts/lib/metadataTypes/ImportFile.d.ts.map | 1 + types/ts/lib/metadataTypes/Journey.d.ts | 527 +++++++ types/ts/lib/metadataTypes/Journey.d.ts.map | 1 + types/ts/lib/metadataTypes/List.d.ts | 191 +++ types/ts/lib/metadataTypes/List.d.ts.map | 1 + types/ts/lib/metadataTypes/MetadataType.d.ts | 654 +++++++++ .../lib/metadataTypes/MetadataType.d.ts.map | 1 + types/ts/lib/metadataTypes/MobileCode.d.ts | 225 +++ .../ts/lib/metadataTypes/MobileCode.d.ts.map | 1 + types/ts/lib/metadataTypes/MobileKeyword.d.ts | 432 ++++++ .../lib/metadataTypes/MobileKeyword.d.ts.map | 1 + types/ts/lib/metadataTypes/MobileMessage.d.ts | 931 ++++++++++++ .../lib/metadataTypes/MobileMessage.d.ts.map | 1 + types/ts/lib/metadataTypes/Query.d.ts | 299 ++++ types/ts/lib/metadataTypes/Query.d.ts.map | 1 + types/ts/lib/metadataTypes/Role.d.ts | 164 +++ types/ts/lib/metadataTypes/Role.d.ts.map | 1 + types/ts/lib/metadataTypes/Script.d.ts | 283 ++++ types/ts/lib/metadataTypes/Script.d.ts.map | 1 + .../lib/metadataTypes/SendClassification.d.ts | 221 +++ .../metadataTypes/SendClassification.d.ts.map | 1 + types/ts/lib/metadataTypes/SenderProfile.d.ts | 254 ++++ .../lib/metadataTypes/SenderProfile.d.ts.map | 1 + .../lib/metadataTypes/TransactionalEmail.d.ts | 230 +++ .../metadataTypes/TransactionalEmail.d.ts.map | 1 + .../metadataTypes/TransactionalMessage.d.ts | 163 +++ .../TransactionalMessage.d.ts.map | 1 + .../lib/metadataTypes/TransactionalPush.d.ts | 175 +++ .../metadataTypes/TransactionalPush.d.ts.map | 1 + .../lib/metadataTypes/TransactionalSMS.d.ts | 205 +++ .../metadataTypes/TransactionalSMS.d.ts.map | 1 + types/ts/lib/metadataTypes/TriggeredSend.d.ts | 671 +++++++++ .../lib/metadataTypes/TriggeredSend.d.ts.map | 1 + types/ts/lib/metadataTypes/User.d.ts | 677 +++++++++ types/ts/lib/metadataTypes/User.d.ts.map | 1 + types/ts/lib/metadataTypes/Verification.d.ts | 188 +++ .../lib/metadataTypes/Verification.d.ts.map | 1 + .../definitions/Asset.definition.d.ts | 692 +++++++++ .../definitions/Asset.definition.d.ts.map | 1 + .../AttributeGroup.definition.d.ts | 246 ++++ .../AttributeGroup.definition.d.ts.map | 1 + .../definitions/AttributeSet.definition.d.ts | 893 ++++++++++++ .../AttributeSet.definition.d.ts.map | 1 + .../definitions/Automation.definition.d.ts | 616 ++++++++ .../Automation.definition.d.ts.map | 1 + .../definitions/Campaign.definition.d.ts | 126 ++ .../definitions/Campaign.definition.d.ts.map | 1 + .../definitions/ContentArea.definition.d.ts | 182 +++ .../ContentArea.definition.d.ts.map | 1 + .../definitions/DataExtension.definition.d.ts | 237 +++ .../DataExtension.definition.d.ts.map | 1 + .../DataExtensionField.definition.d.ts | 121 ++ .../DataExtensionField.definition.d.ts.map | 1 + .../DataExtensionTemplate.definition.d.ts | 133 ++ .../DataExtensionTemplate.definition.d.ts.map | 1 + .../definitions/DataExtract.definition.d.ts | 156 ++ .../DataExtract.definition.d.ts.map | 1 + .../DataExtractType.definition.d.ts | 34 + .../DataExtractType.definition.d.ts.map | 1 + .../DeliveryProfile.definition.d.ts | 80 ++ .../DeliveryProfile.definition.d.ts.map | 1 + .../definitions/Discovery.definition.d.ts | 146 ++ .../definitions/Discovery.definition.d.ts.map | 1 + .../definitions/Email.definition.d.ts | 314 ++++ .../definitions/Email.definition.d.ts.map | 1 + .../definitions/EmailSend.definition.d.ts | 582 ++++++++ .../definitions/EmailSend.definition.d.ts.map | 1 + .../definitions/Event.definition.d.ts | 867 +++++++++++ .../definitions/Event.definition.d.ts.map | 1 + .../definitions/FileLocation.definition.d.ts | 68 + .../FileLocation.definition.d.ts.map | 1 + .../definitions/FileTransfer.definition.d.ts | 191 +++ .../FileTransfer.definition.d.ts.map | 1 + .../definitions/Filter.definition.d.ts | 147 ++ .../definitions/Filter.definition.d.ts.map | 1 + .../definitions/Folder.definition.d.ts | 174 +++ .../definitions/Folder.definition.d.ts.map | 1 + .../definitions/ImportFile.definition.d.ts | 306 ++++ .../ImportFile.definition.d.ts.map | 1 + .../definitions/Journey.definition.d.ts | 426 ++++++ .../definitions/Journey.definition.d.ts.map | 1 + .../definitions/List.definition.d.ts | 118 ++ .../definitions/List.definition.d.ts.map | 1 + .../definitions/MobileCode.definition.d.ts | 167 +++ .../MobileCode.definition.d.ts.map | 1 + .../definitions/MobileKeyword.definition.d.ts | 276 ++++ .../MobileKeyword.definition.d.ts.map | 1 + .../definitions/MobileMessage.definition.d.ts | 783 ++++++++++ .../MobileMessage.definition.d.ts.map | 1 + .../definitions/Query.definition.d.ts | 203 +++ .../definitions/Query.definition.d.ts.map | 1 + .../definitions/Role.definition.d.ts | 108 ++ .../definitions/Role.definition.d.ts.map | 1 + .../definitions/Script.definition.d.ts | 153 ++ .../definitions/Script.definition.d.ts.map | 1 + .../SendClassification.definition.d.ts | 151 ++ .../SendClassification.definition.d.ts.map | 1 + .../definitions/SenderProfile.definition.d.ts | 180 +++ .../SenderProfile.definition.d.ts.map | 1 + .../TransactionalEmail.definition.d.ts | 167 +++ .../TransactionalEmail.definition.d.ts.map | 1 + .../TransactionalMessage.definition.d.ts | 99 ++ .../TransactionalMessage.definition.d.ts.map | 1 + .../TransactionalPush.definition.d.ts | 119 ++ .../TransactionalPush.definition.d.ts.map | 1 + .../TransactionalSMS.definition.d.ts | 113 ++ .../TransactionalSMS.definition.d.ts.map | 1 + .../definitions/TriggeredSend.definition.d.ts | 560 ++++++++ .../TriggeredSend.definition.d.ts.map | 1 + .../definitions/User.definition.d.ts | 423 ++++++ .../definitions/User.definition.d.ts.map | 1 + .../definitions/Verification.definition.d.ts | 129 ++ .../Verification.definition.d.ts.map | 1 + types/ts/lib/retrieveChangelog.d.ts | 3 + types/ts/lib/retrieveChangelog.d.ts.map | 1 + types/ts/lib/util/auth.d.ts | 41 + types/ts/lib/util/auth.d.ts.map | 1 + types/ts/lib/util/businessUnit.d.ts | 21 + types/ts/lib/util/businessUnit.d.ts.map | 1 + types/ts/lib/util/cache.d.ts | 64 + types/ts/lib/util/cache.d.ts.map | 1 + types/ts/lib/util/cli.d.ts | 125 ++ types/ts/lib/util/cli.d.ts.map | 1 + types/ts/lib/util/config.d.ts | 45 + types/ts/lib/util/config.d.ts.map | 1 + types/ts/lib/util/devops.d.ts | 62 + types/ts/lib/util/devops.d.ts.map | 1 + types/ts/lib/util/file.d.ts | 20 + types/ts/lib/util/file.d.ts.map | 1 + types/ts/lib/util/init.config.d.ts | 66 + types/ts/lib/util/init.config.d.ts.map | 1 + types/ts/lib/util/init.d.ts | 72 + types/ts/lib/util/init.d.ts.map | 1 + types/ts/lib/util/init.git.d.ts | 40 + types/ts/lib/util/init.git.d.ts.map | 1 + types/ts/lib/util/init.npm.d.ts | 24 + types/ts/lib/util/init.npm.d.ts.map | 1 + types/ts/lib/util/util.d.ts | 302 ++++ types/ts/lib/util/util.d.ts.map | 1 + types/ts/types/mcdev.d.d.ts | 1268 +++++++++++++++++ types/ts/types/mcdev.d.d.ts.map | 1 + 199 files changed, 28472 insertions(+), 4 deletions(-) create mode 100644 types/ts/lib/Builder.d.ts create mode 100644 types/ts/lib/Builder.d.ts.map create mode 100644 types/ts/lib/Deployer.d.ts create mode 100644 types/ts/lib/Deployer.d.ts.map create mode 100644 types/ts/lib/MetadataTypeDefinitions.d.ts create mode 100644 types/ts/lib/MetadataTypeDefinitions.d.ts.map create mode 100644 types/ts/lib/MetadataTypeInfo.d.ts create mode 100644 types/ts/lib/MetadataTypeInfo.d.ts.map create mode 100644 types/ts/lib/Retriever.d.ts create mode 100644 types/ts/lib/Retriever.d.ts.map create mode 100644 types/ts/lib/cli.d.ts create mode 100644 types/ts/lib/cli.d.ts.map create mode 100644 types/ts/lib/index.d.ts create mode 100644 types/ts/lib/index.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Asset.d.ts create mode 100644 types/ts/lib/metadataTypes/Asset.d.ts.map create mode 100644 types/ts/lib/metadataTypes/AttributeGroup.d.ts create mode 100644 types/ts/lib/metadataTypes/AttributeGroup.d.ts.map create mode 100644 types/ts/lib/metadataTypes/AttributeSet.d.ts create mode 100644 types/ts/lib/metadataTypes/AttributeSet.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Automation.d.ts create mode 100644 types/ts/lib/metadataTypes/Automation.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Campaign.d.ts create mode 100644 types/ts/lib/metadataTypes/Campaign.d.ts.map create mode 100644 types/ts/lib/metadataTypes/ContentArea.d.ts create mode 100644 types/ts/lib/metadataTypes/ContentArea.d.ts.map create mode 100644 types/ts/lib/metadataTypes/DataExtension.d.ts create mode 100644 types/ts/lib/metadataTypes/DataExtension.d.ts.map create mode 100644 types/ts/lib/metadataTypes/DataExtensionField.d.ts create mode 100644 types/ts/lib/metadataTypes/DataExtensionField.d.ts.map create mode 100644 types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts create mode 100644 types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map create mode 100644 types/ts/lib/metadataTypes/DataExtract.d.ts create mode 100644 types/ts/lib/metadataTypes/DataExtract.d.ts.map create mode 100644 types/ts/lib/metadataTypes/DataExtractType.d.ts create mode 100644 types/ts/lib/metadataTypes/DataExtractType.d.ts.map create mode 100644 types/ts/lib/metadataTypes/DeliveryProfile.d.ts create mode 100644 types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Discovery.d.ts create mode 100644 types/ts/lib/metadataTypes/Discovery.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Email.d.ts create mode 100644 types/ts/lib/metadataTypes/Email.d.ts.map create mode 100644 types/ts/lib/metadataTypes/EmailSend.d.ts create mode 100644 types/ts/lib/metadataTypes/EmailSend.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Event.d.ts create mode 100644 types/ts/lib/metadataTypes/Event.d.ts.map create mode 100644 types/ts/lib/metadataTypes/FileLocation.d.ts create mode 100644 types/ts/lib/metadataTypes/FileLocation.d.ts.map create mode 100644 types/ts/lib/metadataTypes/FileTransfer.d.ts create mode 100644 types/ts/lib/metadataTypes/FileTransfer.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Filter.d.ts create mode 100644 types/ts/lib/metadataTypes/Filter.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Folder.d.ts create mode 100644 types/ts/lib/metadataTypes/Folder.d.ts.map create mode 100644 types/ts/lib/metadataTypes/ImportFile.d.ts create mode 100644 types/ts/lib/metadataTypes/ImportFile.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Journey.d.ts create mode 100644 types/ts/lib/metadataTypes/Journey.d.ts.map create mode 100644 types/ts/lib/metadataTypes/List.d.ts create mode 100644 types/ts/lib/metadataTypes/List.d.ts.map create mode 100644 types/ts/lib/metadataTypes/MetadataType.d.ts create mode 100644 types/ts/lib/metadataTypes/MetadataType.d.ts.map create mode 100644 types/ts/lib/metadataTypes/MobileCode.d.ts create mode 100644 types/ts/lib/metadataTypes/MobileCode.d.ts.map create mode 100644 types/ts/lib/metadataTypes/MobileKeyword.d.ts create mode 100644 types/ts/lib/metadataTypes/MobileKeyword.d.ts.map create mode 100644 types/ts/lib/metadataTypes/MobileMessage.d.ts create mode 100644 types/ts/lib/metadataTypes/MobileMessage.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Query.d.ts create mode 100644 types/ts/lib/metadataTypes/Query.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Role.d.ts create mode 100644 types/ts/lib/metadataTypes/Role.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Script.d.ts create mode 100644 types/ts/lib/metadataTypes/Script.d.ts.map create mode 100644 types/ts/lib/metadataTypes/SendClassification.d.ts create mode 100644 types/ts/lib/metadataTypes/SendClassification.d.ts.map create mode 100644 types/ts/lib/metadataTypes/SenderProfile.d.ts create mode 100644 types/ts/lib/metadataTypes/SenderProfile.d.ts.map create mode 100644 types/ts/lib/metadataTypes/TransactionalEmail.d.ts create mode 100644 types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map create mode 100644 types/ts/lib/metadataTypes/TransactionalMessage.d.ts create mode 100644 types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map create mode 100644 types/ts/lib/metadataTypes/TransactionalPush.d.ts create mode 100644 types/ts/lib/metadataTypes/TransactionalPush.d.ts.map create mode 100644 types/ts/lib/metadataTypes/TransactionalSMS.d.ts create mode 100644 types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map create mode 100644 types/ts/lib/metadataTypes/TriggeredSend.d.ts create mode 100644 types/ts/lib/metadataTypes/TriggeredSend.d.ts.map create mode 100644 types/ts/lib/metadataTypes/User.d.ts create mode 100644 types/ts/lib/metadataTypes/User.d.ts.map create mode 100644 types/ts/lib/metadataTypes/Verification.d.ts create mode 100644 types/ts/lib/metadataTypes/Verification.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Email.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Event.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/List.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Query.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Role.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Script.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/User.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map create mode 100644 types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts create mode 100644 types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map create mode 100644 types/ts/lib/retrieveChangelog.d.ts create mode 100644 types/ts/lib/retrieveChangelog.d.ts.map create mode 100644 types/ts/lib/util/auth.d.ts create mode 100644 types/ts/lib/util/auth.d.ts.map create mode 100644 types/ts/lib/util/businessUnit.d.ts create mode 100644 types/ts/lib/util/businessUnit.d.ts.map create mode 100644 types/ts/lib/util/cache.d.ts create mode 100644 types/ts/lib/util/cache.d.ts.map create mode 100644 types/ts/lib/util/cli.d.ts create mode 100644 types/ts/lib/util/cli.d.ts.map create mode 100644 types/ts/lib/util/config.d.ts create mode 100644 types/ts/lib/util/config.d.ts.map create mode 100644 types/ts/lib/util/devops.d.ts create mode 100644 types/ts/lib/util/devops.d.ts.map create mode 100644 types/ts/lib/util/file.d.ts create mode 100644 types/ts/lib/util/file.d.ts.map create mode 100644 types/ts/lib/util/init.config.d.ts create mode 100644 types/ts/lib/util/init.config.d.ts.map create mode 100644 types/ts/lib/util/init.d.ts create mode 100644 types/ts/lib/util/init.d.ts.map create mode 100644 types/ts/lib/util/init.git.d.ts create mode 100644 types/ts/lib/util/init.git.d.ts.map create mode 100644 types/ts/lib/util/init.npm.d.ts create mode 100644 types/ts/lib/util/init.npm.d.ts.map create mode 100644 types/ts/lib/util/util.d.ts create mode 100644 types/ts/lib/util/util.d.ts.map create mode 100644 types/ts/types/mcdev.d.d.ts create mode 100644 types/ts/types/mcdev.d.d.ts.map diff --git a/.husky/pre-commit b/.husky/pre-commit index 718da8a9c..629808a23 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1,6 @@ +# run lint-staged hooks npx --no lint-staged + +# update typescript type declarations +npx tsc +git add types/ts diff --git a/package.json b/package.json index 86107e92a..d0cd62ebb 100644 --- a/package.json +++ b/package.json @@ -112,9 +112,7 @@ "fsevents": "*" }, "lint-staged": { - "*.{js,jsx,ts,tsx}": [ - "eslint --fix" - ] + "*.js": ["eslint --fix"] }, "type": "module" } diff --git a/tsconfig.json b/tsconfig.json index 567bd5d65..9019b17f7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ // Types should go into this directory. // Removing this would place the .d.ts files // next to the .js files - "outDir": "types", + "outDir": "types/ts", // go to js file when using IDE functions like // "Go to Definition" in VSCode "declarationMap": true diff --git a/types/ts/lib/Builder.d.ts b/types/ts/lib/Builder.d.ts new file mode 100644 index 000000000..7a8594777 --- /dev/null +++ b/types/ts/lib/Builder.d.ts @@ -0,0 +1,97 @@ +export default Builder; +export type BuObject = import('../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../types/mcdev.d.js').CodeExtractItem; +export type Mcdevrc = import('../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../types/mcdev.d.js').MultiMetadataTypeList; +export type SoapRequestParams = import('../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * Builds metadata from a template using market specific customisation + */ +declare class Builder { + /** + * Build a template based on a list of metadata files in the retrieve folder. + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} selectedType supported metadata type + * @param {string[]} keyArr customerkey of the metadata + * @param {string} market market localizations + * @returns {Promise.} - + */ + static buildTemplate(businessUnit: string, selectedType: string, keyArr: string[], market: string): Promise; + /** + * Build a specific metadata file based on a template. + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} selectedType supported metadata type + * @param {string[]} nameArr name of the metadata + * @param {string} market market localizations + * @returns {Promise.} - + */ + static buildDefinition(businessUnit: string, selectedType: string, nameArr: string[], market: string): Promise; + /** + * Build a specific metadata file based on a template using a list of bu-market combos + * + * @param {string} listName name of list of BU-market combos + * @param {string} type supported metadata type + * @param {string[]} nameArr name of the metadata + * @returns {Promise.} - + */ + static buildDefinitionBulk(listName: string, type: string, nameArr: string[]): Promise; + /** + * Creates a Builder, uses v2 auth if v2AuthOptions are passed. + * + * @param {Mcdevrc} properties properties for auth +saved + * @param {BuObject} buObject properties for auth + */ + constructor(properties: Mcdevrc, buObject: BuObject); + properties: import("../types/mcdev.d.js").Mcdevrc; + templateDir: string; + retrieveDir: any; + buObject: import("../types/mcdev.d.js").BuObject; + targetDir: string[]; + /** + * @type {MultiMetadataTypeList} + */ + metadata: MultiMetadataTypeList; + /** + * Builds a specific metadata file by name + * + * @param {string} metadataType metadata type to build + * @param {string[]} nameArr name of metadata to build + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise + */ + _buildDefinition(metadataType: string, nameArr: string[], templateVariables: TemplateMap): Promise; + /** + * Build a template based on a list of metadata files in the retrieve folder. + * + * @param {string} metadataType metadata type to create a template of + * @param {string[]} keyArr customerkey of metadata to create a template of + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise + */ + _buildTemplate(metadataType: string, keyArr: string[], templateVariables: TemplateMap): Promise; +} +//# sourceMappingURL=Builder.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/Builder.d.ts.map b/types/ts/lib/Builder.d.ts.map new file mode 100644 index 000000000..815755e4a --- /dev/null +++ b/types/ts/lib/Builder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../../lib/Builder.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;AAZtD;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH;IAsEI;;;;;;;;OAQG;IACH,mCANW,MAAM,gBACN,MAAM,UACN,MAAM,EAAE,UACR,MAAM,GACJ,QAAS,qBAAqB,CAAC,CAuB3C;IAoCD;;;;;;;;OAQG;IACH,qCANW,MAAM,gBACN,MAAM,WACN,MAAM,EAAE,UACR,MAAM,GACJ,QAAS,qBAAqB,CAAC,CAuB3C;IACD;;;;;;;OAOG;IACH,qCALW,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CAoD5B;IAhOD;;;;;;OAMG;IACH,wBAJW,OAAO,YAEP,QAAQ,EAyBlB;IAtBG,kDAA4B;IAC5B,oBAAkD;IAClD,iBAIE;IACF,iDAAwB;IAMxB,oBAGC;IAED;;OAEG;IACH,UAFU,qBAAqB,CAEb;IAGtB;;;;;;;OAOG;IACH,+BALW,MAAM,WACN,MAAM,EAAE,qBACR,WAAW,GACT,QAAS,qBAAqB,CAAC,CA8B3C;IAgCD;;;;;;;OAOG;IACH,6BALW,MAAM,UACN,MAAM,EAAE,qBACR,WAAW,GACT,QAAS,qBAAqB,CAAC,CA4B3C;CA2FJ"} \ No newline at end of file diff --git a/types/ts/lib/Deployer.d.ts b/types/ts/lib/Deployer.d.ts new file mode 100644 index 000000000..a390d3a30 --- /dev/null +++ b/types/ts/lib/Deployer.d.ts @@ -0,0 +1,99 @@ +export default Deployer; +export type BuObject = import('../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../types/mcdev.d.js').CodeExtractItem; +export type Mcdevrc = import('../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../types/mcdev.d.js').MultiMetadataTypeList; +export type SoapRequestParams = import('../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../types/mcdev.d.js').TemplateMap; +export type MultiMetadataTypeMap = import('../types/mcdev.d.js').MultiMetadataTypeMap; +export type TypeKeyCombo = import('../types/mcdev.d.js').TypeKeyCombo; +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ +/** + * Reads metadata from local directory and deploys it to specified target business unit. + * Source and target business units are also compared before the deployment to apply metadata specific patches. + */ +declare class Deployer { + /** + * Deploys all metadata located in the 'deploy' directory to the specified business unit + * + * @param {string} businessUnit references credentials from properties.json + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit deployment to given metadata type + * @param {string[]} [keyArr] limit deployment to given metadata keys + * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) + */ + static deploy(businessUnit: string, selectedTypesArr?: string[] | TypeKeyCombo, keyArr?: string[]): Promise<{ + [x: string]: MultiMetadataTypeMap; + }>; + /** + * helper for {@link Deployer.deploy} + * + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {Mcdevrc} properties General configuration to be used in retrieve + * @param {string[] | TypeKeyCombo} [typeArr] limit deployment to given metadata type + * @param {string[]} [keyArr] limit deployment to given metadata keys + * @returns {Promise.} ensure that BUs are worked on sequentially + */ + static _deployBU(cred: string, bu: string, properties: Mcdevrc, typeArr?: string[] | TypeKeyCombo, keyArr?: string[]): Promise; + /** + * Returns metadata of a business unit that is saved locally + * + * @param {string} deployDir root directory of metadata. + * @param {string[]} [typeArr] limit deployment to given metadata type + * @param {boolean} [listBadKeys] do not print errors, used for badKeys() + * @returns {MultiMetadataTypeMap} Metadata of BU in local directory + */ + static readBUMetadata(deployDir: string, typeArr?: string[], listBadKeys?: boolean): MultiMetadataTypeMap; + /** + * parses asset metadata to auto-create folders in target folder + * + * @param {string} deployDir root directory of metadata. + * @param {MultiMetadataTypeMap} metadata list of metadata + * @param {string[]} metadataTypeArr list of metadata types + * @returns {Promise.} folder metadata + */ + static createFolderDefinitions(deployDir: string, metadata: MultiMetadataTypeMap, metadataTypeArr: string[]): Promise; + /** + * Creates a Deployer, uses v2 auth if v2AuthOptions are passed. + * + * @param {Mcdevrc} properties General configuration to be used in retrieve + * @param {BuObject} buObject properties for auth + */ + constructor(properties: Mcdevrc, buObject: BuObject); + buObject: import("../types/mcdev.d.js").BuObject; + properties: import("../types/mcdev.d.js").Mcdevrc; + deployDir: any; + retrieveDir: any; + /** + * Deploy all metadata that is located in the deployDir + * + * @param {string[] | TypeKeyCombo} [types] limit deployment to given metadata type (can include subtype) + * @param {string[]} [keyArr] limit deployment to given metadata keys + * @returns {Promise.} Promise of all deployed metadata + */ + _deploy(types?: string[] | TypeKeyCombo, keyArr?: string[]): Promise; + /** @type {MultiMetadataTypeMap} */ + metadata: MultiMetadataTypeMap; +} +//# sourceMappingURL=Deployer.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/Deployer.d.ts.map b/types/ts/lib/Deployer.d.ts.map new file mode 100644 index 000000000..6d3e3cdab --- /dev/null +++ b/types/ts/lib/Deployer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Deployer.d.ts","sourceRoot":"","sources":["../../../lib/Deployer.js"],"names":[],"mappings":";uBAYa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;mCACzC,OAAO,qBAAqB,EAAE,oBAAoB;2BAClD,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH;IAwBI;;;;;;;OAOG;IACH,4BALW,MAAM,qBACN,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,oBAAoB;MAAE,CA2J3D;IACD;;;;;;;;;OASG;IACH,uBAPW,MAAM,MACN,MAAM,cACN,OAAO,YACP,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAmB1C;IAiHD;;;;;;;OAOG;IACH,iCALW,MAAM,YACN,MAAM,EAAE,gBACR,OAAO,GACL,oBAAoB,CA4BhC;IAED;;;;;;;OAOG;IACH,0CALW,MAAM,YACN,oBAAoB,mBACpB,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA6G5B;IA5dD;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAkBlB;IAfG,iDAAwB;IACxB,kDAA4B;IAC5B,eAIE;IACF,iBAIE;IAoMN;;;;;;OAMG;IACH,gBAJW,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAwG1C;IAhGO,mCAAmC;IACnC,UADW,oBAAoB,CACiC;CAyP3E"} \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeDefinitions.d.ts b/types/ts/lib/MetadataTypeDefinitions.d.ts new file mode 100644 index 000000000..45d9e44e2 --- /dev/null +++ b/types/ts/lib/MetadataTypeDefinitions.d.ts @@ -0,0 +1,80 @@ +declare namespace _default { + export { asset }; + export { attributeGroup }; + export { attributeSet }; + export { automation }; + export { campaign }; + export { contentArea }; + export { dataExtension }; + export { dataExtensionField }; + export { dataExtensionTemplate }; + export { dataExtract }; + export { dataExtractType }; + export { deliveryProfile }; + export { discovery }; + export { email }; + export { emailSend }; + export { event }; + export { fileLocation }; + export { fileTransfer }; + export { filter }; + export { folder }; + export { importFile }; + export { journey }; + export { list }; + export { mobileCode }; + export { mobileKeyword }; + export { mobileMessage }; + export { query }; + export { role }; + export { script }; + export { sendClassification }; + export { senderProfile }; + export { transactionalMessage }; + export { transactionalEmail }; + export { transactionalPush }; + export { transactionalSMS }; + export { triggeredSend }; + export { user }; + export { verification }; +} +export default _default; +import asset from './metadataTypes/definitions/Asset.definition.js'; +import attributeGroup from './metadataTypes/definitions/AttributeGroup.definition.js'; +import attributeSet from './metadataTypes/definitions/AttributeSet.definition.js'; +import automation from './metadataTypes/definitions/Automation.definition.js'; +import campaign from './metadataTypes/definitions/Campaign.definition.js'; +import contentArea from './metadataTypes/definitions/ContentArea.definition.js'; +import dataExtension from './metadataTypes/definitions/DataExtension.definition.js'; +import dataExtensionField from './metadataTypes/definitions/DataExtensionField.definition.js'; +import dataExtensionTemplate from './metadataTypes/definitions/DataExtensionTemplate.definition.js'; +import dataExtract from './metadataTypes/definitions/DataExtract.definition.js'; +import dataExtractType from './metadataTypes/definitions/DataExtractType.definition.js'; +import deliveryProfile from './metadataTypes/definitions/DeliveryProfile.definition.js'; +import discovery from './metadataTypes/definitions/Discovery.definition.js'; +import email from './metadataTypes/definitions/Email.definition.js'; +import emailSend from './metadataTypes/definitions/EmailSend.definition.js'; +import event from './metadataTypes/definitions/Event.definition.js'; +import fileLocation from './metadataTypes/definitions/FileLocation.definition.js'; +import fileTransfer from './metadataTypes/definitions/FileTransfer.definition.js'; +import filter from './metadataTypes/definitions/Filter.definition.js'; +import folder from './metadataTypes/definitions/Folder.definition.js'; +import importFile from './metadataTypes/definitions/ImportFile.definition.js'; +import journey from './metadataTypes/definitions/Journey.definition.js'; +import list from './metadataTypes/definitions/List.definition.js'; +import mobileCode from './metadataTypes/definitions/MobileCode.definition.js'; +import mobileKeyword from './metadataTypes/definitions/MobileKeyword.definition.js'; +import mobileMessage from './metadataTypes/definitions/MobileMessage.definition.js'; +import query from './metadataTypes/definitions/Query.definition.js'; +import role from './metadataTypes/definitions/Role.definition.js'; +import script from './metadataTypes/definitions/Script.definition.js'; +import sendClassification from './metadataTypes/definitions/SendClassification.definition.js'; +import senderProfile from './metadataTypes/definitions/SenderProfile.definition.js'; +import transactionalMessage from './metadataTypes/definitions/TransactionalMessage.definition.js'; +import transactionalEmail from './metadataTypes/definitions/TransactionalEmail.definition.js'; +import transactionalPush from './metadataTypes/definitions/TransactionalPush.definition.js'; +import transactionalSMS from './metadataTypes/definitions/TransactionalSMS.definition.js'; +import triggeredSend from './metadataTypes/definitions/TriggeredSend.definition.js'; +import user from './metadataTypes/definitions/User.definition.js'; +import verification from './metadataTypes/definitions/Verification.definition.js'; +//# sourceMappingURL=MetadataTypeDefinitions.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeDefinitions.d.ts.map b/types/ts/lib/MetadataTypeDefinitions.d.ts.map new file mode 100644 index 000000000..97ca45310 --- /dev/null +++ b/types/ts/lib/MetadataTypeDefinitions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MetadataTypeDefinitions.d.ts","sourceRoot":"","sources":["../../../lib/MetadataTypeDefinitions.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEkB,iDAAiD;2BACxC,0DAA0D;yBAC5D,wDAAwD;uBAC1D,sDAAsD;qBACxD,oDAAoD;wBACjD,uDAAuD;0BACrD,yDAAyD;+BACpD,8DAA8D;kCAC3D,iEAAiE;wBAC3E,uDAAuD;4BACnD,2DAA2D;4BAC3D,2DAA2D;sBACjE,qDAAqD;kBACzD,iDAAiD;sBAC7C,qDAAqD;kBACzD,iDAAiD;yBAC1C,wDAAwD;yBACxD,wDAAwD;mBAC9D,kDAAkD;mBAClD,kDAAkD;uBAC9C,sDAAsD;oBACzD,mDAAmD;iBACtD,gDAAgD;uBAC1C,sDAAsD;0BACnD,yDAAyD;0BACzD,yDAAyD;kBACjE,iDAAiD;iBAClD,gDAAgD;mBAC9C,kDAAkD;+BACtC,8DAA8D;0BACnE,yDAAyD;iCAClD,gEAAgE;+BAClE,8DAA8D;8BAC/D,6DAA6D;6BAC9D,4DAA4D;0BAC/D,yDAAyD;iBAClE,gDAAgD;yBACxC,wDAAwD"} \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeInfo.d.ts b/types/ts/lib/MetadataTypeInfo.d.ts new file mode 100644 index 000000000..02158a715 --- /dev/null +++ b/types/ts/lib/MetadataTypeInfo.d.ts @@ -0,0 +1,78 @@ +declare namespace _default { + export { asset }; + export { attributeGroup }; + export { attributeSet }; + export { automation }; + export { campaign }; + export { contentArea }; + export { dataExtension }; + export { dataExtensionField }; + export { dataExtensionTemplate }; + export { dataExtract }; + export { dataExtractType }; + export { deliveryProfile }; + export { discovery }; + export { email }; + export { emailSend }; + export { event }; + export { fileLocation }; + export { fileTransfer }; + export { filter }; + export { folder }; + export { importFile }; + export { journey }; + export { list }; + export { mobileCode }; + export { mobileKeyword }; + export { mobileMessage }; + export { query }; + export { role }; + export { script }; + export { sendClassification }; + export { senderProfile }; + export { transactionalEmail }; + export { transactionalPush }; + export { transactionalSMS }; + export { triggeredSend }; + export { user }; + export { verification }; +} +export default _default; +import asset from './metadataTypes/Asset.js'; +import attributeGroup from './metadataTypes/AttributeGroup.js'; +import attributeSet from './metadataTypes/AttributeSet.js'; +import automation from './metadataTypes/Automation.js'; +import campaign from './metadataTypes/Campaign.js'; +import contentArea from './metadataTypes/ContentArea.js'; +import dataExtension from './metadataTypes/DataExtension.js'; +import dataExtensionField from './metadataTypes/DataExtensionField.js'; +import dataExtensionTemplate from './metadataTypes/DataExtensionTemplate.js'; +import dataExtract from './metadataTypes/DataExtract.js'; +import dataExtractType from './metadataTypes/DataExtractType.js'; +import deliveryProfile from './metadataTypes/DeliveryProfile.js'; +import discovery from './metadataTypes/Discovery.js'; +import email from './metadataTypes/Email.js'; +import emailSend from './metadataTypes/EmailSend.js'; +import event from './metadataTypes/Event.js'; +import fileLocation from './metadataTypes/FileLocation.js'; +import fileTransfer from './metadataTypes/FileTransfer.js'; +import filter from './metadataTypes/Filter.js'; +import folder from './metadataTypes/Folder.js'; +import importFile from './metadataTypes/ImportFile.js'; +import journey from './metadataTypes/Journey.js'; +import list from './metadataTypes/List.js'; +import mobileCode from './metadataTypes/MobileCode.js'; +import mobileKeyword from './metadataTypes/MobileKeyword.js'; +import mobileMessage from './metadataTypes/MobileMessage.js'; +import query from './metadataTypes/Query.js'; +import role from './metadataTypes/Role.js'; +import script from './metadataTypes/Script.js'; +import sendClassification from './metadataTypes/SendClassification.js'; +import senderProfile from './metadataTypes/SenderProfile.js'; +import transactionalEmail from './metadataTypes/TransactionalEmail.js'; +import transactionalPush from './metadataTypes/TransactionalPush.js'; +import transactionalSMS from './metadataTypes/TransactionalSMS.js'; +import triggeredSend from './metadataTypes/TriggeredSend.js'; +import user from './metadataTypes/User.js'; +import verification from './metadataTypes/Verification.js'; +//# sourceMappingURL=MetadataTypeInfo.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeInfo.d.ts.map b/types/ts/lib/MetadataTypeInfo.d.ts.map new file mode 100644 index 000000000..1cc2633be --- /dev/null +++ b/types/ts/lib/MetadataTypeInfo.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MetadataTypeInfo.d.ts","sourceRoot":"","sources":["../../../lib/MetadataTypeInfo.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEkB,0BAA0B;2BACjB,mCAAmC;yBACrC,iCAAiC;uBACnC,+BAA+B;qBACjC,6BAA6B;wBAC1B,gCAAgC;0BAC9B,kCAAkC;+BAC7B,uCAAuC;kCACpC,0CAA0C;wBACpD,gCAAgC;4BAC5B,oCAAoC;4BACpC,oCAAoC;sBAC1C,8BAA8B;kBAClC,0BAA0B;sBACtB,8BAA8B;kBAClC,0BAA0B;yBACnB,iCAAiC;yBACjC,iCAAiC;mBACvC,2BAA2B;mBAC3B,2BAA2B;uBACvB,+BAA+B;oBAClC,4BAA4B;iBAC/B,yBAAyB;uBACnB,+BAA+B;0BAC5B,kCAAkC;0BAClC,kCAAkC;kBAC1C,0BAA0B;iBAC3B,yBAAyB;mBACvB,2BAA2B;+BACf,uCAAuC;0BAC5C,kCAAkC;+BAC7B,uCAAuC;8BACxC,sCAAsC;6BACvC,qCAAqC;0BACxC,kCAAkC;iBAC3C,yBAAyB;yBACjB,iCAAiC"} \ No newline at end of file diff --git a/types/ts/lib/Retriever.d.ts b/types/ts/lib/Retriever.d.ts new file mode 100644 index 000000000..a7e016fc6 --- /dev/null +++ b/types/ts/lib/Retriever.d.ts @@ -0,0 +1,66 @@ +export default Retriever; +export type BuObject = import('../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../types/mcdev.d.js').CodeExtractItem; +export type Mcdevrc = import('../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../types/mcdev.d.js').TypeKeyCombo; +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + */ +/** + * Retrieves metadata from a business unit and saves it to the local filesystem. + */ +declare class Retriever { + /** + * Creates a Retriever, uses v2 auth if v2AuthOptions are passed. + * + * @param {Mcdevrc} properties General configuration to be used in retrieve + * @param {BuObject} buObject properties for auth + */ + constructor(properties: Mcdevrc, buObject: BuObject); + buObject: import("../types/mcdev.d.js").BuObject; + properties: import("../types/mcdev.d.js").Mcdevrc; + retrieveDir: string; + templateDir: string; + savePath: any; + /** + * Retrieve metadata of specified types into local file system and Retriever.metadata + * + * @param {string[]} metadataTypes list of metadata types to retrieve; can include subtypes! + * @param {string[] | TypeKeyCombo} [namesOrKeys] name of Metadata to retrieveAsTemplate or list of keys for normal retrieval + * @param {TemplateMap} [templateVariables] Object of values which can be replaced (in case of templating) + * @param {boolean} [changelogOnly] skip saving, only create json in memory + * @returns {Promise.} Promise of a list of retrieved items grouped by type {automation:[...], query:[...]} + */ + retrieve(metadataTypes: string[], namesOrKeys?: string[] | TypeKeyCombo, templateVariables?: TemplateMap, changelogOnly?: boolean): Promise; + /** + * helper for Retriever.retrieve to get all dependencies of the given types + * + * @param {string[]} metadataTypes list of metadata types to retrieve; can include subtypes! + * @returns {string[]} unique list dependent metadata types + */ + _getTypeDependencies(metadataTypes: string[]): string[]; +} +//# sourceMappingURL=Retriever.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/Retriever.d.ts.map b/types/ts/lib/Retriever.d.ts.map new file mode 100644 index 000000000..ed7621f9d --- /dev/null +++ b/types/ts/lib/Retriever.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Retriever.d.ts","sourceRoot":"","sources":["../../../lib/Retriever.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;gCAClD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH;IACI;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAYlB;IATG,iDAAwB;IACxB,kDAA4B;IAC5B,oBAAkD;IAClD,oBAAkD;IAClD,cAIE;IAGN;;;;;;;;OAQG;IACH,wBANW,MAAM,EAAE,gBACR,MAAM,EAAE,GAAG,YAAY,sBACvB,WAAW,kBACX,OAAO,GACL,QAAS,qBAAqB,CAAC,CA4I3C;IAED;;;;;OAKG;IACH,oCAHW,MAAM,EAAE,GACN,MAAM,EAAE,CAepB;CACJ"} \ No newline at end of file diff --git a/types/ts/lib/cli.d.ts b/types/ts/lib/cli.d.ts new file mode 100644 index 000000000..1efa6f4b0 --- /dev/null +++ b/types/ts/lib/cli.d.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +export type TypeKeyCombo = import('../types/mcdev.d.js').TypeKeyCombo; +//# sourceMappingURL=cli.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/cli.d.ts.map b/types/ts/lib/cli.d.ts.map new file mode 100644 index 000000000..876ccb2b4 --- /dev/null +++ b/types/ts/lib/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../lib/cli.js"],"names":[],"mappings":";2BAaa,OAAO,qBAAqB,EAAE,YAAY"} \ No newline at end of file diff --git a/types/ts/lib/index.d.ts b/types/ts/lib/index.d.ts new file mode 100644 index 000000000..22585125c --- /dev/null +++ b/types/ts/lib/index.d.ts @@ -0,0 +1,359 @@ +export default Mcdev; +export type BuObject = import('../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../types/mcdev.d.js').MultiMetadataTypeMap; +export type SkipInteraction = import('../types/mcdev.d.js').SkipInteraction; +export type SoapRequestParams = import('../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../types/mcdev.d.js').TypeKeyCombo; +export type ExplainType = import('../types/mcdev.d.js').ExplainType; +/** + * @typedef {import('../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../types/mcdev.d.js').SkipInteraction} SkipInteraction + * @typedef {import('../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../types/mcdev.d.js').ExplainType} ExplainType + */ +/** + * main class + */ +declare class Mcdev { + /** + * @returns {string} current version of mcdev + */ + static version(): string; + /** + * helper method to use unattended mode when including mcdev as a package + * + * @param {SkipInteraction} [skipInteraction] signals what to insert automatically for things usually asked via wizard + * @returns {void} + */ + static setSkipInteraction(skipInteraction?: SkipInteraction): void; + /** + * configures what is displayed in the console + * + * @param {object} argv list of command line parameters given by user + * @param {boolean} [argv.silent] only errors printed to CLI + * @param {boolean} [argv.verbose] chatty user CLI output + * @param {boolean} [argv.debug] enables developer output & features + * @returns {void} + */ + static setLoggingLevel(argv: { + silent?: boolean; + verbose?: boolean; + debug?: boolean; + }): void; + /** + * allows setting system wide / command related options + * + * @param {object} argv list of command line parameters given by user + * @returns {void} + */ + static setOptions(argv: object): void; + /** + * handler for 'mcdev createDeltaPkg + * + * @param {object} argv yargs parameters + * @param {string} [argv.range] git commit range + into deploy directory + * @param {string} [argv.filter] filter file paths that start with any + * @param {number} [argv.commitHistory] filter file paths that start with any + * @param {DeltaPkgItem[]} [argv.diffArr] list of files to include in delta package (skips git diff when provided) + * @returns {Promise.} list of changed items + */ + static createDeltaPkg(argv: { + range?: string; + filter?: string; + commitHistory?: number; + diffArr?: DeltaPkgItem[]; + }): Promise; + /** + * @returns {Promise} . + */ + static selectTypes(): Promise; + /** + * @returns {ExplainType[]} list of supported types with their apiNames + */ + static explainTypes(): ExplainType[]; + /** + * @returns {Promise.} success flag + */ + static upgrade(): Promise; + /** + * helper to show an off-the-logs message to users + */ + static "__#6@#welcomeMessage"(): void; + /** + * Retrieve all metadata from the specified business unit into the local file system. + * + * @param {string} businessUnit references credentials from properties.json + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type + * @param {string[]} [keys] limit retrieval to given metadata key + * @param {boolean} [changelogOnly] skip saving, only create json in memory + * @returns {Promise.} - + */ + static retrieve(businessUnit: string, selectedTypesArr?: string[] | TypeKeyCombo, keys?: string[], changelogOnly?: boolean): Promise; + /** + * helper for {@link Mcdev.retrieve} + * + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit retrieval to given metadata type/subtype + * @param {string[]} [keys] limit retrieval to given metadata key + * @param {boolean} [changelogOnly] skip saving, only create json in memory + * @returns {Promise.} ensure that BUs are worked on sequentially + */ + static "__#6@#retrieveBU"(cred: string, bu: string, selectedTypesArr?: string[] | TypeKeyCombo, keys?: string[], changelogOnly?: boolean): Promise; + /** + * Deploys all metadata located in the 'deploy' directory to the specified business unit + * + * @param {string} businessUnit references credentials from properties.json + * @param {string[] | TypeKeyCombo} [selectedTypesArr] limit deployment to given metadata type + * @param {string[]} [keyArr] limit deployment to given metadata keys + * @returns {Promise.>} deployed metadata per BU (first key: bu name, second key: metadata type) + */ + static deploy(businessUnit: string, selectedTypesArr?: string[] | TypeKeyCombo, keyArr?: string[]): Promise<{ + [x: string]: MultiMetadataTypeMap; + }>; + /** + * Creates template file for properties.json + * + * @param {string} [credentialsName] identifying name of the installed package / project + * @returns {Promise.} - + */ + static initProject(credentialsName?: string): Promise; + /** + * Clones an existing project from git repository and installs it + * + * @returns {Promise.} - + */ + static joinProject(): Promise; + /** + * Refreshes BU names and ID's from MC instance + * + * @param {string} credentialsName identifying name of the installed package / project + * @returns {Promise.} - + */ + static findBUs(credentialsName: string): Promise; + /** + * Creates docs for supported metadata types in Markdown and/or HTML format + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} type metadata type + * @returns {Promise.} - + */ + static document(businessUnit: string, type: string): Promise; + /** + * deletes metadata from MC instance by key + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} type supported metadata type + * @param {string} customerKey Identifier of metadata + * @returns {Promise.} true if successful, false otherwise + */ + static deleteByKey(businessUnit: string, type: string, customerKey: string): Promise; + /** + * get name & key for provided id + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} type supported metadata type + * @param {string} id Identifier of metadata + * @returns {Promise.<{key:string, name:string, path:string}>} key, name and path of metadata; null if not found + */ + static resolveId(businessUnit: string, type: string, id: string): Promise<{ + key: string; + name: string; + path: string; + }>; + /** + * ensures triggered sends are restarted to ensure they pick up on changes of the underlying emails + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} type references credentials from properties.json + * @param {string[]} [keyArr] metadata keys + * @returns {Promise.} - + */ + static refresh(businessUnit: string, type: string, keyArr?: string[]): Promise; + /** + * Converts metadata to legacy format. Output is saved in 'converted' directory + * + * @param {string} businessUnit references credentials from properties.json + * @returns {Promise.} - + */ + static badKeys(businessUnit: string): Promise; + /** + * Retrieve a specific metadata file and templatise. + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} selectedType supported metadata type + * @param {string[]} name name of the metadata + * @param {string} market market which should be used to revert template + * @returns {Promise.} - + */ + static retrieveAsTemplate(businessUnit: string, selectedType: string, name: string[], market: string): Promise; + /** + * Build a template based on a list of metadata files in the retrieve folder. + * + * @param {string} businessUnitTemplate references credentials from properties.json + * @param {string} businessUnitDefinition references credentials from properties.json + * @param {TypeKeyCombo} typeKeyCombo limit retrieval to given metadata type + * @param {string} marketTemplate market localizations + * @param {string} marketDefinition market localizations + * @param {boolean} [bulk] runs buildDefinitionBulk instead of buildDefinition; requires marketList to be defined and given via marketDefinition + * @returns {Promise.} response from buildDefinition + */ + static build(businessUnitTemplate: string, businessUnitDefinition: string, typeKeyCombo: TypeKeyCombo, marketTemplate: string, marketDefinition: string, bulk?: boolean): Promise; + /** + * Build a template based on a list of metadata files in the retrieve folder. + * + * @param {string} businessUnit references credentials from properties.json + * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type + * @param {string[]} keyArr customerkey of the metadata + * @param {string} market market localizations + * @returns {Promise.} - + */ + static buildTemplate(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr: string[], market: string): Promise; + /** + * Build a specific metadata file based on a template. + * + * @param {string} businessUnit references credentials from properties.json + * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type + * @param {string[]} nameArr name of the metadata + * @param {string} market market localizations + * @returns {Promise.} - + */ + static buildDefinition(businessUnit: string, selectedTypes: string | TypeKeyCombo, nameArr: string[], market: string): Promise; + /** + * Build a specific metadata file based on a template using a list of bu-market combos + * + * @param {string} listName name of list of BU-market combos + * @param {string | TypeKeyCombo} selectedTypes supported metadata type + * @param {string[]} [nameArr] name of the metadata + * @returns {Promise.} - + */ + static buildDefinitionBulk(listName: string, selectedTypes: string | TypeKeyCombo, nameArr?: string[]): Promise; + /** + * + * @param {string} businessUnit references credentials from properties.json + * @param {string} selectedType supported metadata type + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + */ + static getFilesToCommit(businessUnit: string, selectedType: string, keyArr: string[]): Promise; + /** + * Schedule an item (shortcut for execute --schedule) + * + * @param {string} businessUnit name of BU + * @param {string} [selectedType] limit to given metadata types + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>} key: business unit name, value: list of scheduled item keys + */ + static schedule(businessUnit: string, selectedType?: string, keys?: string[]): Promise<{ + [x: string]: string[]; + }>; + /** + * Start/execute an item + * + * @param {string} businessUnit name of BU + * @param {string} [selectedType] limit to given metadata types + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>} key: business unit name, value: list of executed item keys + */ + static execute(businessUnit: string, selectedType?: string, keys?: string[]): Promise<{ + [x: string]: string[]; + }>; + /** + * pause an item + * + * @param {string} businessUnit name of BU + * @param {string} [selectedType] limit to given metadata types + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>} key: business unit name, value: list of paused item keys + */ + static pause(businessUnit: string, selectedType?: string, keys?: string[]): Promise<{ + [x: string]: string[]; + }>; + /** + * Updates the key to match the name field + * + * @param {string} businessUnit name of BU + * @param {string[] | TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys + */ + static fixKeys(businessUnit: string, selectedTypesArr: string[] | TypeKeyCombo, keys?: string[]): Promise<{ + [x: string]: object; + }>; + /** + * run a method across BUs + * + * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {string} businessUnit name of BU + * @param {string} [selectedType] limit to given metadata types + * @param {string[]} [keys] customerkey of the metadata + * @returns {Promise.>} key: business unit name, value: list of affected item keys + */ + static "__#6@#runMethod"(methodName: 'execute' | 'pause' | 'fixKeys', businessUnit: string, selectedType?: string, keys?: string[]): Promise<{ + [x: string]: string[]; + }>; + /** + * helper for Mcdev.#runMethod + * + * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {string} [type] limit execution to given metadata type + * @param {string[]} [keyArr] customerkey of the metadata + * @returns {Promise.} list of keys that were affected + */ + static "__#6@#runOnBU"(methodName: 'execute' | 'pause' | 'fixKeys', cred: string, bu: string, type?: string, keyArr?: string[]): Promise; + /** + * helper for Mcdev.#runOnBU + * + * @param {string} selectedType limit execution to given metadata type + * @param {BuObject} buObject properties for auth + * @returns {Promise.} keyArr + */ + static "__#6@#retrieveKeysWithLike"(selectedType: string, buObject: BuObject): Promise; + /** + * Updates the key to match the name field + * + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {string} type limit execution to given metadata type + * @param {string[]} [keyArr] customerkey of the metadata + * @returns {Promise.} list of keys that were affected + */ + static "__#6@#fixKeys"(cred: string, bu: string, type: string, keyArr?: string[]): Promise; + /** + * helper to convert CSVs into an array. if only one value was given, it's also returned as an array + * + * @param {string|string[]} metadataOption potentially comma-separated value or null + * @param {string[]} [allowedIdentifiers] 'key', 'id', 'name' + * @param {boolean} [firstOnly] removes all but the first entry if enabled + * @returns {TypeKeyCombo} values split into an array. + */ + static metadataToTypeKey(metadataOption: string | string[], allowedIdentifiers?: string[], firstOnly?: boolean): TypeKeyCombo; +} +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/index.d.ts.map b/types/ts/lib/index.d.ts.map new file mode 100644 index 000000000..bd66acf77 --- /dev/null +++ b/types/ts/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/index.js"],"names":[],"mappings":";uBAmBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;AAjBtD;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB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AAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;OAOG;IACH,2BALW,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CA6D7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,gBAC3B,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CA4J/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,QAC3B,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAgD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Asset.d.ts b/types/ts/lib/metadataTypes/Asset.d.ts new file mode 100644 index 000000000..9d05b7bc7 --- /dev/null +++ b/types/ts/lib/metadataTypes/Asset.d.ts @@ -0,0 +1,1109 @@ +export default Asset; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type AssetSubType = import('../../types/mcdev.d.js').AssetSubType; +export type AssetMap = import('../../types/mcdev.d.js').AssetMap; +export type AssetItem = import('../../types/mcdev.d.js').AssetItem; +export type AssetRequestParams = import('../../types/mcdev.d.js').AssetRequestParams; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').AssetSubType} AssetSubType + * @typedef {import('../../types/mcdev.d.js').AssetMap} AssetMap + * @typedef {import('../../types/mcdev.d.js').AssetItem} AssetItem + * @typedef {import('../../types/mcdev.d.js').AssetRequestParams} AssetRequestParams + */ +/** + * FileTransfer MetadataType + * + * @augments MetadataType + */ +declare class Asset extends MetadataType { + /** + * Retrieves Metadata of Asset + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} _ unused parameter + * @param {string[]} [subTypeArr] optionally limit to a single AssetSubType + * @param {string} [key] customer key + * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise + */ + static retrieve(retrieveDir: string, _: void | string[], subTypeArr?: string[], key?: string): Promise<{ + metadata: AssetMap; + type: string; + }>; + /** + * helper for Journey's {@link Asset.saveResults}. Gets executed after retreive of metadata type and + * + * @param {MetadataTypeMap} metadataMap key=customer key, value=metadata + */ + static _postRetrieveTasksBulk(metadataMap: MetadataTypeMap): Promise; + /** + * Retrieves asset metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise + */ + static retrieveForCache(_?: void | string[], subTypeArr?: string[]): Promise<{ + metadata: AssetMap; + type: string; + }>; + /** + * Retrieves asset metadata for templating + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {AssetSubType} [selectedSubType] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetItem, type: string}>} Promise + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap, selectedSubType?: AssetSubType): Promise<{ + metadata: AssetItem; + type: string; + }>; + /** + * helper for {@link Asset.retrieve} + {@link Asset.retrieveAsTemplate} + * + * @private + * @returns {string[]} AssetSubType array + */ + private static _getSubTypes; + /** + * Creates a single asset + * + * @param {AssetItem} metadata a single asset + * @returns {Promise} Promise + */ + static create(metadata: AssetItem): Promise; + /** + * Updates a single asset + * + * @param {AssetItem} metadata a single asset + * @returns {Promise} Promise + */ + static update(metadata: AssetItem): Promise; + /** + * Retrieves Metadata of a specific asset type + * + * @param {string} subType group of similar assets to put in a folder (ie. images) + * @param {string} [retrieveDir] target directory for saving assets + * @param {string} [key] key/id/name to filter by + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise + */ + static requestSubType(subType: string, retrieveDir?: string, key?: string, templateVariables?: TemplateMap): Promise; + /** + * Retrieves extended metadata (files or extended content) of asset + * + * @param {Array} items array of items to retrieve + * @param {string} subType group of similar assets to put in a folder (ie. images) + * @param {string} retrieveDir target directory for saving assets + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise} Promise + */ + static requestAndSaveExtended(items: any[], subType: string, retrieveDir: string, templateVariables?: TemplateMap): Promise; + /** + * helper that reset the log level and prints errors + * + * @private + * @param {'info'|'verbose'|'debug'|'error'} loggerLevelBak original logger level + * @param {object[]} failed array of failed items + */ + private static _resetLogLevel; + /** + * Some metadata types store their actual content as a separate file, e.g. images + * This method retrieves these and saves them alongside the metadata json + * + * @param {AssetItem} metadata a single asset + * @param {string} subType group of similar assets to put in a folder (ie. images) + * @param {string} retrieveDir target directory for saving assets + * @returns {Promise.} - + */ + static _retrieveExtendedFile(metadata: AssetItem, subType: string, retrieveDir: string): Promise; + /** + * helper for {@link Asset.preDeployTasks} + * Some metadata types store their actual content as a separate file, e.g. images + * This method reads these from the local FS stores them in the metadata object allowing to deploy it + * + * @param {AssetItem} metadata a single asset + * @param {string} subType group of similar assets to put in a folder (ie. images) + * @param {string} deployDir directory of deploy files + * @param {boolean} [pathOnly] used by getFilesToCommit which does not need the binary file to be actually read + * @returns {Promise.} if found will return the path of the binary file + */ + static _readExtendedFileFromFS(metadata: AssetItem, subType: string, deployDir: string, pathOnly?: boolean): Promise; + /** + * manages post retrieve steps + * + * @param {AssetItem} metadata a single asset + * @returns {CodeExtractItem} metadata + */ + static postRetrieveTasks(metadata: AssetItem): CodeExtractItem; + /** + * Gets executed after deployment of metadata type + * + * @param {MetadataTypeMap} metadata metadata mapped by their keyField + * @param {MetadataTypeMap} _ originalMetadata to be updated (contains additioanl fields) + * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates + * @returns {Promise.} - + */ + static postDeployTasks(metadata: MetadataTypeMap, _: MetadataTypeMap, createdUpdated: { + created: number; + updated: number; + }): Promise; + /** + * helper for {@link Asset.postDeployTasks}. triggers a refresh of active triggerredSendDefinitions associated with the updated asset-message items. Gets executed if refresh option has been set. + * + * @private + * @param {MetadataTypeMap} metadata metadata mapped by their keyField + * @returns {Promise.} - + */ + private static _refreshTriggeredSend; + /** + * prepares an asset definition for deployment + * + * @param {AssetItem} metadata a single asset + * @param {string} deployDir directory of deploy files + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: AssetItem, deployDir: string): Promise; + /** + * find the subType matching the extendedSubType + * + * @param {string} extendedSubType webpage, htmlblock, etc + * @returns {string} subType: block, message, other, etc + */ + static "__#1@#getMainSubtype"(extendedSubType: string): string; + /** + * helper to find a new unique name during asset creation + * + * @private + * @param {string} key key of the asset + * @param {string} name name of the asset + * @param {string} type assetType-name + * @param {{ type: string; key: string; name: any; }[]} namesInFolder names of the assets in the same folder + * @returns {string} new name + */ + private static _findUniqueName; + /** + * determines the subtype of the current asset + * + * @private + * @param {AssetItem} metadata a single asset + * @returns {string} subtype + */ + private static _getSubtype; + /** + * helper for {@link MetadataType.buildDefinition} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string} targetDir Directory where built definitions will be saved + * @param {AssetItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildDefinitionForNested(templateDir: string, targetDir: string, metadata: AssetItem, templateVariables: TemplateMap, templateName: string): Promise; + /** + * helper for {@link MetadataType.buildTemplate} + * handles extracted code if any are found for complex types + * + * @example assets of type codesnippetblock will result in 1 json and 1 amp/html file. both files need to be run through templating + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {AssetItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildTemplateForNested(templateDir: string, targetDir: string | string[], metadata: AssetItem, templateVariables: TemplateMap, templateName: string): Promise; + /** + * helper for {@link MetadataType.buildDefinition} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {AssetItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @param {'definition'|'template'} mode defines what we use this helper for + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static _buildForNested(templateDir: string, targetDir: string | string[], metadata: AssetItem, templateVariables: TemplateMap, templateName: string, mode: 'definition' | 'template'): Promise; + /** + * helper for {@link Asset.preDeployTasks} that loads extracted code content back into JSON + * + * @param {AssetItem} metadata a single asset definition + * @param {string} deployDir directory of deploy files + * @param {string} subType asset-subtype name; full list in AssetSubType + * @param {string} [templateName] name of the template used to built defintion (prior applying templating) + * @param {boolean} [fileListOnly] does not read file contents nor update metadata if true + * @returns {Promise.} fileList for templating (disregarded during deployment) + */ + static _mergeCode(metadata: AssetItem, deployDir: string, subType: string, templateName?: string, fileListOnly?: boolean): Promise; + /** + * helper for {@link Asset.preDeployTasks} that loads extracted code content back into JSON + * + * @param {string} prefix usually the customerkey + * @param {object} metadataSlots metadata.views.html.slots or deeper slots.<>.blocks.<>.slots + * @param {string[]} readDirArr directory of deploy files + * @param {string} subtypeExtension asset-subtype name ending on -meta + * @param {string[]} subDirArr directory of files w/o leading deploy dir + * @param {object[]} fileList directory of files w/o leading deploy dir + * @param {string} customerKey external key of template (could have been changed if used during templating) + * @param {string} [templateName] name of the template used to built defintion (prior applying templating) + * @param {boolean} [fileListOnly] does not read file contents nor update metadata if true + * @returns {Promise.} - + */ + static _mergeCode_slots(prefix: string, metadataSlots: object, readDirArr: string[], subtypeExtension: string, subDirArr: string[], fileList: object[], customerKey: string, templateName?: string, fileListOnly?: boolean): Promise; + /** + * helper for {@link Asset.postRetrieveTasks} that finds code content in JSON and extracts it + * to allow saving that separately and formatted + * + * @param {AssetItem} metadata a single asset definition + * @returns {CodeExtractItem} { json: metadata, codeArr: object[], subFolder: string[] } + */ + static _extractCode(metadata: AssetItem): CodeExtractItem; + /** + * @param {string} prefix usually the customerkey + * @param {object} metadataSlots metadata.views.html.slots or deeper slots.<>.blocks.<>.slots + * @param {object[]} codeArr to be extended array for extracted code + * @returns {void} + */ + static _extractCode_slots(prefix: string, metadataSlots: object, codeArr: object[]): void; + /** + * Returns file contents mapped to their fileName without '.json' ending + * + * @param {string} dir directory that contains '.json' files to be read + * @param {boolean} _ unused parameter + * @param {string[]} selectedSubType asset, message, ... + * @returns {MetadataTypeMap} fileName => fileContent map + */ + static getJsonFromFS(dir: string, _: boolean, selectedSubType: string[]): MetadataTypeMap; + /** + * optional method used for some types to try a different folder structure + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string[]} typeDirArr current subdir for this type + * @param {string} templateName name of the metadata template + * @param {string} fileName name of the metadata template file w/o extension + * @returns {Promise.} metadata in string form + */ + static readSecondaryFolder(templateDir: string, typeDirArr: string[], templateName: string, fileName: string): Promise; + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} id value or null + */ + private static _getIdForSingleRetrieve; + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} id id field + * @returns {Promise.} key value or null + */ + private static _getKeyForSingleRetrieve; + /** + * clean up after deleting a metadata item + * cannot use the generic method due to the complexity of how assets are saved to disk + * + * @param {string} key Identifier of metadata item + * @returns {Promise.} - + */ + static postDeleteTasks(key: string): Promise; + /** + * get name & key for provided id + * + * @param {string} id Identifier of metadata + * @returns {Promise.<{key:string, name:string, path:string, folder:string, mid:number, error:string, isShared:boolean}>} key, name and path of metadata; null if not found + */ + static resolveId(id: string): Promise<{ + key: string; + name: string; + path: string; + folder: string; + mid: number; + error: string; + isShared: boolean; + }>; + /** + * helper for {@link Asset.resolveId} that finds the path to the asset's code + * + * @param {string} subType asset subtype + * @param {object} item api response for metadata + * @param {string} buName owner business unit name + * @returns {string} path to the asset's code + */ + static "__#1@#getPath"(subType: string, item: object, buName: string): string; + /** + * helper for {@link Asset.resolveId} that loads the JSON file for the asset + * + * @param {string} subType asset subtype + * @param {object} item api response for metadata + * @returns {object} JS object of the asset we loaded from disk + */ + static "__#1@#getJson"(subType: string, item: object): object; +} +declare namespace Asset { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: string; + lastmodDateField: string; + lastmodNameField: string; + restPagination: boolean; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: string[]; + typeName: string; + fields: { + activeDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + /** + * FileTransfer MetadataType + * + * @augments MetadataType + */ + template: boolean; + }; + allowedBlocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + assetType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'assetType.displayName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'assetType.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'assetType.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + availableViews: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modelVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + blocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + businessUnitAvailability: { + skipValidation: boolean; + }; + category: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'category.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'category.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'category.parentId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + channels: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + content: { + isCreateable: boolean; /** + * Helper for writing Metadata to disk, used for Retrieve and deploy + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve + * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + contentType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.userId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customFields: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'data.campaigns': { + skipValidation: boolean; + }; + 'data.approvals': { + skipValidation: boolean; + }; + 'data.email.attributes': { + skipValidation: boolean; + }; + 'data.email.legacy': { + isCreateable: boolean; + isUpdateable: boolean; /** + * Retrieves asset metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise + */ + retrieving: boolean; + template: boolean; + }; + 'data.email.options': { + skipValidation: boolean; + }; + 'data.portfolio': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + /** + * Retrieves asset metadata for templating + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {AssetSubType} [selectedSubType] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetItem, type: string}>} Promise + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + design: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + enterpriseId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + file: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.fileName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.extension': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.externalUrl': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.fileSize': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.fileCreatedDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.width': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.height': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.publishedURL': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + legacyData: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + locked: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxBlocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * Creates a single asset + * + * @param {AssetItem} metadata a single asset + * @returns {Promise} Promise + */ + }; + memberId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + meta: { + skipValidation: boolean; + }; + minBlocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.id': { + isCreateable: boolean; /** + * Retrieves Metadata of a specific asset type + * + * @param {string} subType group of similar assets to put in a folder (ie. images) + * @param {string} [retrieveDir] target directory for saving assets + * @param {string} [key] key/id/name to filter by + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.userId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + objectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.userId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sharingProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sharingProperties.localAssets': { + skipValidation: boolean; + }; + 'sharingProperties.sharedWith': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sharingProperties.sharingType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + slots: { + skipValidation: boolean; + }; + 'status.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'status.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + superContent: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + tags: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + template: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + thumbnail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + version: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + views: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; + subTypes: string[]; + binarySubtypes: string[]; + extendedSubTypes: { + asset: string[]; + image: string[]; + rawimage: string[]; + video: string[]; + document: string[]; + audio: string[]; + archive: string[]; + code: string[]; + textfile: string[]; + block: string[]; + template: string[]; + message: string[]; + other: string[]; + }; + typeMapping: { + asset: number; + file: number; + block: number; + template: number; + message: number; + custom: number; + default: number; + image: number; + rawimage: number; + video: number; + document: number; + audio: number; + archive: number; + code: number; + textfile: number; + ai: number; + psd: number; + pdd: number; + eps: number; + gif: number; + jpe: number; + jpeg: number; + jpg: number; + jp2: number; + jpx: number; + pict: number; + pct: number; + png: number; + tif: number; + tiff: number; + tga: number; + bmp: number; + wmf: number; + vsd: number; + pnm: number; + pgm: number; + pbm: number; + ppm: number; + svg: number; + '3fr': number; + ari: number; + arw: number; + bay: number; + cap: number; + crw: number; + cr2: number; + dcr: number; + dcs: number; + dng: number; + drf: number; + eip: number; + erf: number; + fff: number; + iiq: number; + k25: number; + kdc: number; + mef: number; + mos: number; + mrw: number; + nef: number; + nrw: number; + orf: number; + pef: number; + ptx: number; + pxn: number; + raf: number; + raw: number; + rw2: number; + rwl: number; + rwz: number; + srf: number; + sr2: number; + srw: number; + x3f: number; + '3gp': number; + '3gpp': number; + '3g2': number; + '3gp2': number; + asf: number; + avi: number; + m2ts: number; + mts: number; + dif: number; + dv: number; + mkv: number; + mpg: number; + f4v: number; + flv: number; + mjpg: number; + mjpeg: number; + mxf: number; + mpeg: number; + mp4: number; + m4v: number; + mp4v: number; + mov: number; + swf: number; + wmv: number; + rm: number; + ogv: number; + indd: number; + indt: number; + incx: number; + wwcx: number; + doc: number; + docx: number; + dot: number; + dotx: number; + mdb: number; + mpp: number; + ics: number; + xls: number; + xlsx: number; + xlk: number; + xlsm: number; + xlt: number; + xltm: number; + csv: number; + tsv: number; + tab: number; + pps: number; + ppsx: number; + ppt: number; + pptx: number; + pot: number; + thmx: number; + pdf: number; + ps: number; + qxd: number; + rtf: number; + sxc: number; + sxi: number; + sxw: number; + odt: number; + ods: number; + ots: number; + odp: number; + otp: number; + epub: number; + dvi: number; + key: number; + keynote: number; + pez: number; + aac: number; + m4a: number; + au: number; + aif: number; + aiff: number; + aifc: number; + mp3: number; + wav: number; + wma: number; + midi: number; + oga: number; + ogg: number; + ra: number; + vox: number; + voc: number; + '7z': number; + arj: number; + bz2: number; + cab: number; + gz: number; + gzip: number; + iso: number; + lha: number; + sit: number; + tgz: number; + jar: number; + rar: number; + tar: number; + /** + * Some metadata types store their actual content as a separate file, e.g. images + * This method retrieves these and saves them alongside the metadata json + * + * @param {AssetItem} metadata a single asset + * @param {string} subType group of similar assets to put in a folder (ie. images) + * @param {string} retrieveDir target directory for saving assets + * @returns {Promise.} - + */ + zip: number; + gpg: number; + htm: number; + html: number; + xhtml: number; + xht: number; + css: number; + less: number; + sass: number; + js: number; + json: number; + atom: number; + rss: number; + xml: number; + xsl: number; + xslt: number; + md: number; + markdown: number; + as: number; + fla: number; + eml: number; + text: number; + txt: number; + freeformblock: number; + textblock: number; + htmlblock: number; + textplusimageblock: number; + imageblock: number; + abtestblock: number; + dynamicblock: number; + stylingblock: number; + einsteincontentblock: number; + webpage: number; + webtemplate: number; + templatebasedemail: number; + htmlemail: number; + textonlyemail: number; + socialshareblock: number; + socialfollowblock: number; + buttonblock: number; + layoutblock: number; + defaulttemplate: number; + smartcaptureblock: number; + smartcaptureformfieldblock: number; + smartcapturesubmitoptionsblock: number; + slotpropertiesblock: number; + externalcontentblock: number; + codesnippetblock: number; + rssfeedblock: number; + formstylingblock: number; + referenceblock: number; + imagecarouselblock: number; + customblock: number; + liveimageblock: number; + livesettingblock: number; + contentmap: number; + jsonmessage: number; + icemailformblock: number; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Asset.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Asset.d.ts.map b/types/ts/lib/metadataTypes/Asset.d.ts.map new file mode 100644 index 000000000..acb2d12ca --- /dev/null +++ b/types/ts/lib/metadataTypes/Asset.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAYa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;iCAC1C,OAAO,wBAAwB,EAAE,kBAAkB;AAdhE;;;;;;;;;GASG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,QACR,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CA+BxD;IAiBD;;;;OAIG;IACH,2CAFW,eAAe,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4RH;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApfkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeGroup.d.ts b/types/ts/lib/metadataTypes/AttributeGroup.d.ts new file mode 100644 index 000000000..248239a72 --- /dev/null +++ b/types/ts/lib/metadataTypes/AttributeGroup.d.ts @@ -0,0 +1,290 @@ +export default AttributeGroup; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +/** + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + */ +/** + * AttributeGroup MetadataType + * + * @augments MetadataType + */ +declare class AttributeGroup extends MetadataType { + /** + * Retrieves Metadata of schema attribute groups. + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves Metadata of schema attribute groups for caching. + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single metadata + * @returns {MetadataTypeItem} metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace AttributeGroup { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + applicationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + applicationKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeCount: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeGroupIconKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeGroupType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeSetIdentifiers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].definitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].definitionName.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].namespace': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + canAddProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canAddRelationships: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canChangeProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canModify: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canRemove: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + connectingID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'connectingID.identifierType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; /** + * prepares for deployment + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} Promise + */ + containsSchemaAttributes: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'definitionName.value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + displayOrder: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fullyQualifiedName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isHidden: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isOwner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isPrimary: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isSystemDefined: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + localizedDescription: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceSetKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceValueKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + mID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + namespace: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + objectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requiredRelationships: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__attributeSet_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=AttributeGroup.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeGroup.d.ts.map b/types/ts/lib/metadataTypes/AttributeGroup.d.ts.map new file mode 100644 index 000000000..7d607189e --- /dev/null +++ b/types/ts/lib/metadataTypes/AttributeGroup.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeGroup.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/AttributeGroup.js"],"names":[],"mappings":";+BAOa,OAAO,wBAAwB,EAAE,gBAAgB;iCACjD,OAAO,wBAAwB,EAAE,kBAAkB;AAFhE;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA6D5B;CAOJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eANG;;;;;eAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhHkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeSet.d.ts b/types/ts/lib/metadataTypes/AttributeSet.d.ts new file mode 100644 index 000000000..1cd8fc8c5 --- /dev/null +++ b/types/ts/lib/metadataTypes/AttributeSet.d.ts @@ -0,0 +1,968 @@ +export default AttributeSet; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +/** + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + */ +/** + * AttributeSet MetadataType + * + * @augments MetadataType + */ +declare class AttributeSet extends MetadataType { + static systemValueDefinitions: any; + /** + * Retrieves Metadata of schema set Definitions. + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves Metadata of schema set definitions for caching. + * + * @returns {Promise.} Promise + */ + static retrieveForCache(): Promise; + /** + * used to identify updated shared data extensions that are used in attributeSets. + * helper for DataExtension.#fixShared_onBU + * + * @param {Object.} sharedDataExtensionMap ID-Key relationship of shared data extensions + * @param {object} fixShared_fields DataExtensionField.fixShared_fields + * @returns {Promise.} Promise of list of shared dataExtension IDs + */ + static fixShared_retrieve(sharedDataExtensionMap: { + [x: string]: string; + }, fixShared_fields: object): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single metadata + * @returns {MetadataTypeItem} metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * helper for {@link AttributeSet.postRetrieveTasks} + * + * @returns {object[]} all system value definitions + */ + static _getSystemValueDefinitions(): object[]; +} +declare namespace AttributeSet { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + createdDateField: string; + createdNameField: string; + lastmodDateField: any; + lastmodNameField: any; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + applicationID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + applicationKey: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + attributeCount: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + canAddValues: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + canChangeValues: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; /** + * Retrieves Metadata of schema set definitions for caching. + * + * @returns {Promise.} Promise + */ + canModify: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + canRemove: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + categoryID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'connectingID.identifierType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createDate: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + createdBy: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + customObjectOwnerMID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.isDeleteAtEndOfRetentionPeriod': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.isResetRetentionPeriodOnImport': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.isRowBasedRetention': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.periodUnitOfMeasure': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.setDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.periodLength': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + definitionID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + definitionKey: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + definitionName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'definitionName.value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fullyQualifiedName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isCustomObjectBacked: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isEvent: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isHidden: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isReadOnly: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isRoot: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isSendable: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isShared: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isSystemDefined: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isTestaable: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftConnectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.cardinality': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.cardinality ': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.identifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.relationshipType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + localizedDescription: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceSetKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceValueKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.value': { + isCreateable: boolean; /** + * Builds map of metadata entries mapped to their keyfields + * + * @param {object} body json of response body + * @param {string} [singleRetrieve] key of single item to filter by + * @returns {MetadataTypeMap} keyField => metadata map + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + nonStandardAttributeGroupReferences: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'nonStandardAttributeGroupReferences[].attributeGroupType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'nonStandardAttributeGroupReferences[].attributeGroupID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single metadata + * @returns {MetadataTypeItem} metadata + */ + template: any; + }; + 'nonStandardAttributeGroupReferences[].definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.maskType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.maskTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.storageType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.storageTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.valueDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.definitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.definitionName.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + parentID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + relationshipCount: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + relationships: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].canModify': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].canRemove': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].isGroupToSetRelationship': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].isHidden': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].isSystemDefined': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipIDs': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipIDs[].type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipIDs[].value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipReferenceType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].leftAttributeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].rightAttributeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].c__leftFullyQualifiedName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].c__rightFullyQualifiedName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightConnectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.cardinality': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.identifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.relationshipType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + sendAttributeStorageName: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + sendContactKeyStorageName: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + setDefinitionID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + setDefinitionKey: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'setDefinitionName.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageFieldReferenceID.type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageFieldReferenceID.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + storageLogicalType: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + storageName: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalIsRowIdentifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalObjectFieldAPIName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalObjectFieldDataTypeName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalObjectFieldLength': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + storageObjectIDs: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectInformation.externalObjectAPIName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageReferenceID.type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageReferenceID.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + valueDefinitions: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].baseType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].customerDataID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].connectingID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].dataSourceID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].dataSourceName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].dataType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].defaultValue': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].definitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].definitionName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].description': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].displayOrder': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].fullyQualifiedName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isHidden': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isIdentityValue': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isNullable': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isPrimaryKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isReadOnly': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isSystemDefined': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isUpdateable': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].length': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].localizedDescription': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].name': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.maskType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.maskTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.storageType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.storageTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.valueDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].ordinal': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].parentDefinition': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].parentIdentifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].parentType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].restrictionLookupListID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].scale': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].setDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].setDefinitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].setDefinitionName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageFieldReferenceID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageFieldReferenceID.type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageFieldReferenceID.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].valueDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].valueDefinitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + r__folder_Path: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + r__dataExtension_key: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=AttributeSet.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeSet.d.ts.map b/types/ts/lib/metadataTypes/AttributeSet.d.ts.map new file mode 100644 index 000000000..5c2abf9b3 --- /dev/null +++ b/types/ts/lib/metadataTypes/AttributeSet.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeSet.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/AttributeSet.js"],"names":[],"mappings":";+BAQa,OAAO,wBAAwB,EAAE,gBAAgB;8BACjD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;AAHhE;;;;GAIG;AAEH;;;;GAIG;AACH;IACI,mCAA8B;IAC9B;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAaxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;;;;OAOG;IACH;YAJmB,MAAM,GAAE,MAAM;yBACtB,MAAM,GACJ,QAAS,MAAM,EAAE,CAAC,CAiG9B;IAoBD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAwK5B;IAED;;;;OAIG;IACH,qCAFa,MAAM,EAAE,CAgBpB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eArUG;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA6GH;;;;;;mBAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAYH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9KkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Automation.d.ts b/types/ts/lib/metadataTypes/Automation.d.ts new file mode 100644 index 000000000..99faab377 --- /dev/null +++ b/types/ts/lib/metadataTypes/Automation.d.ts @@ -0,0 +1,915 @@ +export default Automation; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SDKError = import('../../types/mcdev.d.js').SDKError; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type AutomationItem = import('../../types/mcdev.d.js').AutomationItem; +export type AutomationItemObj = import('../../types/mcdev.d.js').AutomationItemObj; +export type AutomationMap = import('../../types/mcdev.d.js').AutomationMap; +export type AutomationMapObj = import('../../types/mcdev.d.js').AutomationMapObj; +export type AutomationSchedule = import('../../types/mcdev.d.js').AutomationSchedule; +export type AutomationScheduleSoap = import('../../types/mcdev.d.js').AutomationScheduleSoap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').AutomationItem} AutomationItem + * @typedef {import('../../types/mcdev.d.js').AutomationItemObj} AutomationItemObj + * @typedef {import('../../types/mcdev.d.js').AutomationMap} AutomationMap + * @typedef {import('../../types/mcdev.d.js').AutomationMapObj} AutomationMapObj + * @typedef {import('../../types/mcdev.d.js').AutomationSchedule} AutomationSchedule + * @typedef {import('../../types/mcdev.d.js').AutomationScheduleSoap} AutomationScheduleSoap + */ +/** + * Automation MetadataType + * + * @augments MetadataType + */ +declare class Automation extends MetadataType { + static notificationUpdates: {}; + static createdKeyMap: any; + static _skipNotificationRetrieve: boolean; + /** @type {AutomationMap} */ + static _cachedMetadataMap: AutomationMap; + /** + * Retrieves Metadata of Automation + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * helper for {@link Automation.retrieve} to get Automation Notifications + * + * @param {MetadataTypeMap} metadataMap keyField => metadata map + * @returns {Promise.} Promise of automation legacy api response + */ + static "__#2@#getAutomationNotificationsREST"(metadataMap: MetadataTypeMap): Promise; + /** + * Retrieves Metadata of Automation + * + * @returns {Promise.} Promise of metadata + */ + static retrieveChangelog(): Promise; + /** + * Retrieves automation metadata for caching + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; + /** + * Retrieve a specific Automation Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise; + /** + * helper for {@link Automation.postRetrieveTasks} and {@link Automation.execute} + * + * @param {AutomationItem} metadata a single automation + * @returns {boolean} true if the automation schedule is valid + */ + static "__#2@#isValidSchedule"(metadata: AutomationItem): boolean; + /** + * manages post retrieve steps + * + * @param {AutomationItem} metadata a single automation + * @returns {AutomationItem | void} parsed item + */ + static postRetrieveTasks(metadata: AutomationItem): AutomationItem | void; + /** + * helper for {@link Automation.execute} + * + * @param {AutomationMap} metadataMap map of metadata + * @param {string} key key of the metadata + * @returns {Promise.<{key:string, response:object}>} metadata key and API response + */ + static "__#2@#executeItem"(metadataMap: AutomationMap, key: string): Promise<{ + key: string; + response: object; + }>; + /** + * helper for {@link Automation.execute} + * + * @param {AutomationItem} metadataEntry metadata object + * @returns {Promise.<{key:string, response:object}>} metadata key and API response + */ + static "__#2@#runOnce"(metadataEntry: AutomationItem): Promise<{ + key: string; + response: object; + }>; + /** + * helper for {@link Automation.pause} + * + * @param {AutomationItem} metadata automation metadata + * @returns {Promise.<{key:string, response:object}>} metadata key and API response + */ + static "__#2@#pauseItem"(metadata: AutomationItem): Promise<{ + key: string; + response: object; + }>; + /** + * Deploys automation - the saved file is the original one due to large differences required for deployment + * + * @param {AutomationMap} metadata metadata mapped by their keyField + * @param {string} targetBU name/shorthand of target businessUnit for mapping + * @param {string} retrieveDir directory where metadata after deploy should be saved + * @returns {Promise.} Promise + */ + static deploy(metadata: AutomationMap, targetBU: string, retrieveDir: string): Promise; + /** + * Creates a single automation + * + * @param {AutomationItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static create(metadata: AutomationItem): Promise; + /** + * Updates a single automation + * + * @param {AutomationItem} metadata single metadata entry + * @param {AutomationItem} metadataBefore metadata mapped by their keyField + * @returns {Promise} Promise + */ + static update(metadata: AutomationItem, metadataBefore: AutomationItem): Promise; + /** + * helper for {@link Automation.preDeployTasks} and {@link Automation.execute} + * + * @param {AutomationItem} metadata metadata mapped by their keyField + */ + static "__#2@#preDeploySchedule"(metadata: AutomationItem): void; + /** + * Gets executed before deploying metadata + * + * @param {AutomationItem} metadata metadata mapped by their keyField + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: AutomationItem): Promise; + /** + * Validates the automation to be sure it can be deployed. + * Whitelisted Activites are deployed but require configuration + * + * @param {AutomationItem} metadata single automation record + * @returns {boolean} result if automation can be deployed based on steps + */ + static validateDeployMetadata(metadata: AutomationItem): boolean; + /** + * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @returns {Promise.} - + */ + static _postChangeKeyTasks(metadataEntry: MetadataTypeItem): Promise; + /** + * Gets executed after deployment of metadata type + * + * @param {AutomationMap} metadataMap metadata mapped by their keyField + * @param {AutomationMap} originalMetadataMap metadata to be updated (contains additioanl fields) + * @returns {Promise.} - + */ + static postDeployTasks(metadataMap: AutomationMap, originalMetadataMap: AutomationMap): Promise; + /** + * helper for {@link Automation.postDeployTasks} + * + * @param {AutomationMap} metadataMap metadata mapped by their keyField + * @param {string} key current customer key + * @returns {Promise.} - + */ + static "__#2@#updateNotificationInfoREST"(metadataMap: AutomationMap, key: string): Promise; + /** + * helper for {@link Automation.postDeployTasks} + * + * @param {AutomationMap} metadataMap metadata mapped by their keyField + * @param {AutomationMap} originalMetadataMap metadata to be updated (contains additioanl fields) + * @param {string} key current customer key + * @param {string} [oldKey] old customer key before fixKey / changeKeyValue / changeKeyField + * @returns {Promise.<{key:string, response:object}>} metadata key and API response + */ + static "__#2@#scheduleAutomation"(metadataMap: AutomationMap, originalMetadataMap: AutomationMap, key: string, oldKey?: string): Promise<{ + key: string; + response: object; + }>; + /** + * Builds a schedule object to be used for scheduling an automation + * based on combination of ical string and start/end dates. + * + * @param {AutomationSchedule} scheduleObject child of automation metadata used for scheduling + * @returns {AutomationScheduleSoap} Schedulable object for soap API (currently not rest supported) + */ + static _buildSchedule(scheduleObject: AutomationSchedule): AutomationScheduleSoap; + /** + * used to convert dates to the system timezone required for startDate + * + * @param {number} offsetServer stack4: US Mountain time (UTC-7); other stacks: US Central (UTC-6) + * @param {string|Date} dateInput date in ISO format (2021-12-05T20:00:00.983) + * @param {string} [offsetInput] timzone difference (+02:00) + * @returns {string} date in server + */ + static _calcTime(offsetServer: number, dateInput: string | Date, offsetInput?: string): string; + /** + * Experimental: Only working for DataExtensions: + * Saves json content to a html table in the local file system. Will create the parent directory if it does not exist. + * The json's first level of keys must represent the rows and the secend level the columns + * + * @private + * @param {AutomationItem} json dataextension + * @param {object[][]} tabled prepped array for output in tabular format + * @returns {string} file content + */ + private static _generateDocMd; + /** + * Saves json content to a html table in the local file system. Will create the parent directory if it does not exist. + * The json's first level of keys must represent the rows and the secend level the columns + * + * @private + * @param {string} directory directory the file will be written to + * @param {string} filename name of the file without '.json' ending + * @param {AutomationItem} json dataextension.columns + * @param {'html'|'md'} mode html or md + * @returns {Promise.} Promise of success of saving the file + */ + private static _writeDoc; + /** + * Parses metadata into a readable Markdown/HTML format then saves it + * + * @param {AutomationMap} [metadata] a list of dataExtension definitions + * @returns {Promise.} - + */ + static document(metadata?: AutomationMap): Promise; + /** + * helper to allow us to select single metadata entries via REST + * + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + static "__#2@#getObjectIdForSingleRetrieve"(key: string): Promise; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {Promise.} - + */ + static postDeleteTasks(customerKey: string): Promise; +} +declare namespace Automation { + let retrieveDir: string; + let definition: { + activityTypeMapping: { + dataExtract: number; + dataFactoryUtility: number; + emailSend: number; + fileTransfer: number; + filter: number; + fireEvent: number; + importFile: number; + journeyEntry: number; + journeyEntryOld: number; + query: number; + script: number; + verification: number; + wait: number; + push: number; + sms: number; + reportDefinition: number; + refreshMobileFilteredList: number; + refreshGroup: number; + interactions: number; + interactionStudioData: number; + importMobileContact: number; + }; + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + hasExtended: boolean; + filter: { + description: string[]; + }; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + createdDateField: string; /** + * @typedef {import('../../types/mcdev.d.js').AutomationItem} AutomationItem + * @typedef {import('../../types/mcdev.d.js').AutomationItemObj} AutomationItemObj + * @typedef {import('../../types/mcdev.d.js').AutomationMap} AutomationMap + * @typedef {import('../../types/mcdev.d.js').AutomationMapObj} AutomationMapObj + * @typedef {import('../../types/mcdev.d.js').AutomationSchedule} AutomationSchedule + * @typedef {import('../../types/mcdev.d.js').AutomationScheduleSoap} AutomationScheduleSoap + */ + createdNameField: string; + lastmodDateField: string; + lastmodNameField: string; + restPagination: boolean; + maxKeyLength: number; + scheduleTypeMapping: { + MINUTELY: number; + HOURLY: number; + DAILY: number; + WEEKLY: number; + MONTHLY: number; + }; + statusMapping: { + AwaitingTrigger: number; + Building: number; + /** + * Automation MetadataType + * + * @augments MetadataType + */ + BuildingError: number; + Error: number; + InactiveTrigger: number; + PausedSchedule: number; + Ready: number; + Running: number; + Scheduled: number; + Stopped: number; + }; + timeZoneMapping: { + 'Afghanistan Standard Time': number; + 'Alaskan Standard Time': number; + 'Arab Standard Time': number; + 'Arabian Standard Time': number; + 'Arabic Standard Time': number; + 'Argentina Standard Time': number; + 'Atlantic Standard Time': number; + 'AUS Central Standard Time': number; + 'AUS Eastern Standard Time': number; + 'Azerbaijan Standard Time': number; + 'Azores Standard Time': number; + 'Canada Central Standard Time': number; + 'Cape Verde Standard Time': number; + 'Caucasus Standard Time': number; + 'Cen. Australia Standard Time': number; /** @type {SoapRequestParams} */ + 'Central America Standard Time': number; + 'Central Asia Standard Time': number; + 'Central Brazilian Standard Time': number; + 'Central Europe Standard Time': number; + 'Central European Standard Time': number; + 'Central Pacific Standard Time': number; + 'Central Standard Time': number; + 'Central Standard Time (Mexico)': number; + 'Central Standard Time (no DST)': number; + 'China Standard Time': number; + 'Dateline Standard Time': number; + 'E. Africa Standard Time': number; + 'E. Australia Standard Time': number; + 'E. Europe Standard Time': number; + 'E. South America Standard Time': number; + 'Eastern Standard Time': number; + 'Egypt Standard Time': number; + 'Ekaterinburg Standard Time': number; + 'Fiji Standard Time': number; + 'FLE Standard Time': number; + 'Georgian Standard Time': number; + 'GMT Standard Time': number; + 'Greenland Standard Time': number; + 'Greenwich Standard Time': number; + 'GTB Standard Time': number; + 'Hawaiian Standard Time': number; + 'India Standard Time': number; + 'Iran Standard Time': number; + 'Israel Standard Time': number; + 'Jordan Standard Time': number; + 'Korea Standard Time': number; + 'Mauritius Standard Time': number; + 'Mid-Atlantic Standard Time': number; + 'Middle East Standard Time': number; + 'Montevideo Standard Time': number; + 'Morocco Standard Time': number; + 'Mountain Standard Time': number; + 'Mountain Standard Time (Mexico)': number; + 'Myanmar Standard Time': number; + 'N. Central Asia Standard Time': number; + 'Namibia Standard Time': number; + 'Nepal Standard Time': number; + 'New Zealand Standard Time': number; + 'Newfoundland Standard Time': number; + 'North Asia East Standard Time': number; + 'North Asia Standard Time': number; + 'Pacific SA Standard Time': number; + 'Pacific Standard Time': number; + 'Pacific Standard Time (Mexico)': number; + 'Pakistan Standard Time': number; + 'Romance Standard Time': number; + 'Russian Standard Time': number; + 'SA Pacific Standard Time': number; + 'SA Western Standard Time': number; + 'Samoa Standard Time': number; + 'SE Asia Standard Time': number; + 'Singapore Standard Time': number; + 'South Africa Standard Time': number; + 'Sri Lanka Standard Time': number; + 'Taipei Standard Time': number; + 'Tasmania Standard Time': number; + 'Tokyo Standard Time': number; + 'Tonga Standard Time': number; + 'US Eastern Standard Time': number; + 'US Mountain Standard Time': number; + 'Venezuela Standard Time': number; + 'Vladivostok Standard Time': number; + 'W. Australia Standard Time': number; + 'W. Central Africa Standard Time': number; + 'W. Europe Standard Time': number; + 'West Asia Standard Time': number; + 'West Pacific Standard Time': number; + 'Yakutsk Standard Time': number; + }; + timeZoneDifference: { + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + 14: string; + 15: string; + 16: string; + 17: string; + 18: string; + 19: string; + 20: string; + 21: string; + 22: string; + 23: string; + 24: string; + 25: string; + 26: string; + 27: string; + 28: string; + 29: string; + 30: string; + 31: string; + 32: string; + 33: string; + 34: string; + 35: string; + 36: string; + 37: string; + 38: string; + 39: string; + 40: string; + 41: string; + 42: string; + 43: string; + 44: string; + 45: string; + 46: string; + 47: string; + 48: string; + 49: string; + 50: string; + 51: string; + 52: string; + 53: string; + 54: string; + 55: string; + 56: string; + 57: string; + 58: string; + 59: string; + 60: string; + 61: string; + 62: string; + 63: string; + 64: string; + 65: string; + 66: string; + 67: string; + 68: string; + 69: string; + 70: string; + 71: string; + 72: string; + 73: string; + 74: string; + 75: string; + 76: string; + 77: string; + 78: string; + 79: string; + 80: string; + 81: string; + 82: string; + 83: string; + 84: string; + 85: string; + 86: string; + 87: string; + 88: string; + 89: string; + 90: string; + 91: string; + 92: string; + }; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + manualDeployTypes: string[]; + fields: { + categoryId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.fileNamePatternTypeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.fileNamingPattern': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.folderLocationText': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.isPublished': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.queueFiles': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.triggerActive': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastRunInstanceId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastRunTime: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + legacyId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastSavedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastSavedByName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdByName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + updateInProgress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + notifications: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].message': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + /** @type {AutomationMap} */ + template: boolean; + }; + 'notifications[].channelType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].type': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].notificationType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + startSource: { + skipValidation: boolean; + }; + 'schedule.endDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.icalRecur': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.occurrences': { + isCreateable: boolean; + /** + * Retrieve a specific Automation Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.pattern': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.rangeTypeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduleStatus': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.statusId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.timezoneId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.timezoneName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.typeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + statusId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + steps: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].activityObjectId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].displayOrder': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].objectTypeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].targetDataExtensions': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].serializedObject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].r__type': { + skipValidation: boolean; + }; + 'steps[].activities[].r__key': { + skipValidation: boolean; + }; + 'steps[].description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].annotation': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].step': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].stepNumber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + typeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Automation.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Automation.d.ts.map b/types/ts/lib/metadataTypes/Automation.d.ts.map new file mode 100644 index 000000000..ea9c3c7e6 --- /dev/null +++ b/types/ts/lib/metadataTypes/Automation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Automation.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8B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AAC,CA8B1B;IA4BD;;;;;OAKG;IACH,iDAHW,MAAM,GACJ,QAAS,MAAM,CAAC,CAW5B;IAiBD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAM1B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kCAnlDD;;;;;;;WAOG;;;;;;;;;;;;;;;;YAEH;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;oDA0BS,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyNpC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8BhC;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAzTkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Campaign.d.ts b/types/ts/lib/metadataTypes/Campaign.d.ts new file mode 100644 index 000000000..c4e99860f --- /dev/null +++ b/types/ts/lib/metadataTypes/Campaign.d.ts @@ -0,0 +1,190 @@ +export default Campaign; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * Campaign MetadataType + * + * @augments MetadataType + */ +declare class Campaign extends MetadataType { + /** + * Retrieves Metadata of campaigns. Afterwards, starts metadata retrieval for their campaign assets + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves event definition metadata for caching + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; + /** + * Parses campaign asset response body and returns metadata entries mapped to their id + * + * @param {string} retrieveDir folder where to save + * @param {string} campaignId of camapaign to retrieve + * @param {string} name of camapaign for saving + * @returns {Promise.} Campaign Asset Object + */ + static getAssetTags(retrieveDir: string, campaignId: string, name: string): Promise; +} +declare namespace Campaign { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + hasExtended: boolean; + idField: string; + keepId: boolean; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ownerId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + externalKey: { + isCreateable: boolean; /** + * Parses campaign asset response body and returns metadata entries mapped to their id + * + * @param {string} retrieveDir folder where to save + * @param {string} campaignId of camapaign to retrieve + * @param {string} name of camapaign for saving + * @returns {Promise.} Campaign Asset Object + */ + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignCode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'display.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'display.value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + isFavorite: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignOwnerName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignOwner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignStatus: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Campaign.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Campaign.d.ts.map b/types/ts/lib/metadataTypes/Campaign.d.ts.map new file mode 100644 index 000000000..79d9b3ba1 --- /dev/null +++ b/types/ts/lib/metadataTypes/Campaign.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Campaign.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Campaign.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAqBxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,iCALW,MAAM,cACN,MAAM,QACN,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAaxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCApBG;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApEkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/ContentArea.d.ts b/types/ts/lib/metadataTypes/ContentArea.d.ts new file mode 100644 index 000000000..e468f6fb9 --- /dev/null +++ b/types/ts/lib/metadataTypes/ContentArea.d.ts @@ -0,0 +1,250 @@ +export default ContentArea; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * ContentArea MetadataType + * + * @augments MetadataType + */ +declare class ContentArea extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * parses retrieved Metadata before saving + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} parsed item + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace ContentArea { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keepId: boolean; /** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + restPagination: any; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + BackgroundColor: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BorderColor: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BorderWidth: { + isCreateable: boolean; + isUpdateable: boolean; /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + retrieving: boolean; + templating: boolean; + }; + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Cellpadding: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Cellspacing: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Content: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FontFamily: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HasFontSize: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsBlank: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsDynamicContent: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsLocked: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSurvey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Layout: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Width: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=ContentArea.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/ContentArea.d.ts.map b/types/ts/lib/metadataTypes/ContentArea.d.ts.map new file mode 100644 index 000000000..fcab071aa --- /dev/null +++ b/types/ts/lib/metadataTypes/ContentArea.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ContentArea.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/ContentArea.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAmBxC;IA2BD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;CACJ;;;;;;;yBA/FD;;;;;;;;;;;WAWG;;;;;;;;;;;;;;;;;;;;;;;;;uCAQC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/BkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtension.d.ts b/types/ts/lib/metadataTypes/DataExtension.d.ts new file mode 100644 index 000000000..9c95f329f --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtension.d.ts @@ -0,0 +1,571 @@ +export default DataExtension; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type DataExtensionFieldItem = import('../../types/mcdev.d.js').DataExtensionFieldItem; +export type DataExtensionFieldMap = import('../../types/mcdev.d.js').DataExtensionFieldMap; +export type DataExtensionItem = import('../../types/mcdev.d.js').DataExtensionItem; +export type DataExtensionMap = import('../../types/mcdev.d.js').DataExtensionMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldItem} DataExtensionFieldItem + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldMap} DataExtensionFieldMap + * @typedef {import('../../types/mcdev.d.js').DataExtensionItem} DataExtensionItem + * @typedef {import('../../types/mcdev.d.js').DataExtensionMap} DataExtensionMap + */ +/** + * DataExtension MetadataType + * + * @augments MetadataType + */ +declare class DataExtension extends MetadataType { + /** @type {DataExtensionFieldMap} */ + static oldFields: DataExtensionFieldMap; + /** + * Upserts dataExtensions after retrieving them from source and target to compare + * if create or update operation is needed. + * + * @param {DataExtensionMap} metadataMap dataExtensions mapped by their customerKey + * @returns {Promise} Promise + */ + static upsert(metadataMap: DataExtensionMap): Promise; + /** + * helper for {@link DataExtension.upsert} + * + * @param {object} res - + * @returns {boolean} true: keep, false: discard + */ + static "__#3@#filterUpsertResults"(res: object): boolean; + /** + * Create a single dataExtension. Also creates their columns in 'dataExtension.columns' + * + * @param {DataExtensionItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static create(metadata: DataExtensionItem): Promise; + /** + * SFMC saves a date in "RetainUntil" under certain circumstances even + * if that field duplicates whats in the period fields + * during deployment, that extra value is not accepted by the APIs which is why it needs to be removed + * + * @param {DataExtensionItem} metadata single metadata entry + * @returns {void} + */ + static "__#3@#cleanupRetentionPolicyFields"(metadata: DataExtensionItem): void; + /** + * Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' + * + * @param {DataExtensionItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static update(metadata: DataExtensionItem): Promise; + /** + * Gets executed after deployment of metadata type + * + * @param {DataExtensionMap} upsertedMetadata metadata mapped by their keyField + * @param {DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) + * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates + * @returns {Promise.} - + */ + static postDeployTasks(upsertedMetadata: DataExtensionMap, originalMetadata: DataExtensionMap, createdUpdated: { + created: number; + updated: number; + }): Promise; + /** + * takes care of updating attribute groups on child BUs after an update to Shared DataExtensions + * helper for {@link DataExtension.postDeployTasks} + * fixes an issue where shared data extensions are not visible in data designer on child BU; SF known issue: https://issues.salesforce.com/#q=W-11031095 + * + * @param {DataExtensionMap} upsertedMetadata metadata mapped by their keyField + * @param {DataExtensionMap} originalMetadata metadata to be updated (contains additioanl fields) + * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates + * @returns {Promise.} - + */ + static "__#3@#fixShared"(upsertedMetadata: DataExtensionMap, originalMetadata: DataExtensionMap, createdUpdated: { + created: number; + updated: number; + }): Promise; + /** + * helper for {@link DataExtension.#fixShared} + * + * @returns {Promise.} list of selected BU names + */ + static "__#3@#fixShared_getBUs"(): Promise; + /** + * helper for {@link DataExtension.#fixShared} + * + * @param {string} childBuName name of child BU to fix + * @param {BuObject} buObjectParent bu object for parent BU + * @param {object} clientParent SDK for parent BU + * @param {Object.} sharedDataExtensionMap ID-Key relationship of shared data extensions + * @returns {Promise.} updated shared DE keys on BU + */ + static "__#3@#fixShared_onBU"(childBuName: string, buObjectParent: BuObject, clientParent: object, sharedDataExtensionMap: { + [x: string]: string; + }): Promise; + /** + * method that actually takes care of triggering the update for a particular BU-sharedDe combo + * helper for {@link DataExtension.#fixShared_onBU} + * + * @param {string} deId data extension ObjectID + * @param {string} deKey dataExtension key + * @param {BuObject} buObjectChildBu BU object for Child BU + * @param {object} clientChildBu SDK for child BU + * @param {BuObject} buObjectParent BU object for Parent BU + * @param {object} clientParent SDK for parent BU + * @returns {Promise.} flag that signals if the fix was successful + */ + static "__#3@#fixShared_item"(deId: string, deKey: string, buObjectChildBu: BuObject, clientChildBu: object, buObjectParent: BuObject, clientParent: object): Promise; + /** + * add a new field to the shared DE to trigger an update to the data model + * helper for {@link DataExtension.#fixShared_item} + * + * @param {BuObject} buObjectChildBu BU object for Child BU + * @param {object} clientChildBu SDK for child BU + * @param {string} deKey dataExtension key + * @param {string} deId dataExtension ObjectID + * @returns {Promise.} randomSuffix + */ + static "__#3@#fixShared_item_addField"(buObjectChildBu: BuObject, clientChildBu: object, deKey: string, deId: string): Promise; + /** + * get ID of the field added by {@link DataExtension.#fixShared_item_addField} on the shared DE via parent BU + * helper for {@link DataExtension.#fixShared_item} + * + * @param {string} randomSuffix - + * @param {BuObject} buObjectParent BU object for Parent BU + * @param {object} clientParent SDK for parent BU + * @param {string} deKey dataExtension key + * @returns {Promise.} fieldObjectID + */ + static "__#3@#fixShared_item_getFieldId"(randomSuffix: string, buObjectParent: BuObject, clientParent: object, deKey: string): Promise; + /** + * delete the field added by {@link DataExtension.#fixShared_item_addField} + * helper for {@link DataExtension.#fixShared_item} + * + * @param {string} randomSuffix - + * @param {BuObject} buObjectChildBu BU object for Child BU + * @param {object} clientChildBu SDK for child BU + * @param {string} deKey dataExtension key + * @param {string} fieldObjectID field ObjectID + * @returns {Promise} - + */ + static "__#3@#fixShared_item_deleteField"(randomSuffix: string, buObjectChildBu: BuObject, clientChildBu: object, deKey: string, fieldObjectID: string): Promise; + /** + * Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {void | string[]} [_] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise of item map + */ + static retrieve(retrieveDir: string, additionalFields?: string[], _?: void | string[], key?: string): Promise<{ + metadata: DataExtensionMap; + type: string; + }>; + /** + * get shared dataExtensions from parent BU and merge them into the cache + * helper for {@link DataExtension.retrieve} and for AttributeSet.fixShared_retrieve + * + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.} keyField => metadata map + */ + static retrieveSharedForCache(additionalFields?: string[]): Promise; + /** + * helper to retrieve all dataExtension fields and attach them to the dataExtension metadata + * + * @param {DataExtensionMap} metadata already cached dataExtension metadata + * @param {SoapRequestParams} [fieldOptions] optionally filter results + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.} - + */ + static "__#3@#attachFields"(metadata: DataExtensionMap, fieldOptions?: SoapRequestParams, additionalFields?: string[]): Promise; + /** + * Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval + * + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise of item map + */ + static retrieveChangelog(additionalFields?: string[]): Promise<{ + metadata: DataExtensionMap; + type: string; + }>; + /** + * manages post retrieve steps + * + * @param {DataExtensionItem} metadata a single dataExtension + * @returns {Promise.} metadata + */ + static postRetrieveTasks(metadata: DataExtensionItem): Promise; + /** + * Helper to retrieve Data Extension Fields + * + * @private + * @param {SoapRequestParams} [options] options (e.g. continueRequest) + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.} Promise of items + */ + private static _retrieveFields; + /** + * helps retrieving fields during templating and deploy where we dont want the full list + * + * @private + * @param {DataExtensionMap} metadata list of DEs + * @param {string} customerKey external key of single DE + * @returns {Promise.} - + */ + private static _retrieveFieldsForSingleDe; + /** + * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @returns {Promise.} - + */ + static _postChangeKeyTasks(metadataEntry: MetadataTypeItem): Promise; + /** + * prepares a DataExtension for deployment + * + * @param {DataExtensionItem} metadata a single data Extension + * @returns {Promise.} Promise of updated single DE + */ + static preDeployTasks(metadata: DataExtensionItem): Promise; + /** + * Saves json content to a html table in the local file system. Will create the parent directory if it does not exist. + * The json's first level of keys must represent the rows and the secend level the columns + * + * @private + * @param {DataExtensionItem} json single dataextension + * @param {object[][]} tabled prepped array for output in tabular format + * @returns {string} file content + */ + private static _generateDocHtml; + /** + * Experimental: Only working for DataExtensions: + * Saves json content to a html table in the local file system. Will create the parent directory if it does not exist. + * The json's first level of keys must represent the rows and the secend level the columns + * + * @private + * @param {DataExtensionItem} json dataextension + * @param {object[][]} tabled prepped array for output in tabular format + * @returns {string} file content + */ + private static _generateDocMd; + /** + * Saves json content to a html table in the local file system. Will create the parent directory if it does not exist. + * The json's first level of keys must represent the rows and the secend level the columns + * + * @private + * @param {string} directory directory the file will be written to + * @param {string} filename name of the file without '.json' ending + * @param {DataExtensionItem} json dataextension.columns + * @param {'html'|'md'} mode html or md + * @param {string[]} [fieldsToKeep] list of keys(columns) to show. This will also specify + * @returns {Promise.} Promise of success of saving the file + */ + private static _writeDoc; + /** + * Parses metadata into a readable Markdown/HTML format then saves it + * + * @param {DataExtensionMap} [metadataMap] a list of dataExtension definitions + * @returns {Promise.} - + */ + static document(metadataMap?: DataExtensionMap): Promise; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {Promise.} - promise + */ + static postDeleteTasks(customerKey: string): Promise; + /** + * Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. + * + * @returns {Promise.<{metadata: DataExtensionMap, type: string}>} Promise + */ + static retrieveForCache(): Promise<{ + metadata: DataExtensionMap; + type: string; + }>; + /** + * Retrieves dataExtension metadata in template format. + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata item + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.<{metadata: DataExtensionItem, type: string}>} Promise of items + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise<{ + metadata: DataExtensionItem; + type: string; + }>; + /** + * Retrieves dataExtension metadata and cleans it + * + * @private + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {SoapRequestParams} [options] e.g. filter + * @returns {Promise.} keyField => metadata map + */ + private static _retrieveAll; +} +declare namespace DataExtension { + let deployedSharedKeys: any; + let buObject: import("../../types/mcdev.d.js").BuObject; + let client: any; + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + filter: { + CustomerKey: string[]; + Name: string[]; + }; + templateFields: { + AudienceBuilderResult: string[]; + CONTEXTUAL_SUPPRESSION_LISTS: string[]; + DomainExclusion: string[]; + 'Event DE Template': string[]; + PushSendLog: string[]; + SendLog: string[]; + 'SmartCapture - Contacts Template Extension': string[]; + SmsSendLog: string[]; + SMSMessageTracking: any; + SMSSubscriptionLog: any; + TriggeredSendDataExtension: string[]; + }; + dataRetentionPeriodUnitOfMeasureMapping: { + Days: number; + Weeks: number; + Months: number; + Years: number; + }; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + CategoryID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriod: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodUnitOfMeasure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DeleteAtEndOfRetentionPeriod: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Fields: { + skipValidation: boolean; + }; + folderContentType: { + skipValidation: boolean; + }; + IsPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsSendable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsTestable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; /** + * helper for {@link MetadataType.upsert} + * + * @param {MetadataTypeMap} metadataMap list of metadata + * @param {string} metadataKey key of item we are looking at + * @param {boolean} hasError error flag from previous code + * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {MetadataTypeItem[]} metadataToCreate list of items to create + * @returns {Promise.<'create'|'update'|'skip'>} action to take + */ + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ResetRetentionPeriodOnImport: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RetainUntil: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RowBasedRetention: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SendableDataExtensionField.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SendableDataExtensionField.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SendableDataExtensionField.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendableSubscriberField: { + skipValidation: boolean; + }; + 'SendableSubscriberField.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Template.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Template.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Template.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_ContentType: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + r__dataExtensionTemplate_name: { + skipValidation: boolean; + }; + c__retentionPolicy: { + skipValidation: boolean; + }; + c__retainUntil: { + skipValidation: boolean; + }; + c__dataRetentionPeriodUnitOfMeasure: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=DataExtension.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtension.d.ts.map b/types/ts/lib/metadataTypes/DataExtension.d.ts.map new file mode 100644 index 000000000..489a1c53d --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtension.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtension.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtension.js"],"names":[],"mappings":";uBAea,OAAO,wBAAwB,EAAE,QAAQ;+BACzC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;qCAG5C,OAAO,wBAAwB,EAAE,sBAAsB;oCACvD,OAAO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AE,MAAM,CAAA;KAAC,CAAC,CAIhE;IACD;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS;QAAC,QAAQ,EAAE,iBAAiB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAgDjE;IA4DD;;;;;;;OAOG;IACH,4BAWC;CA4BJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAh8CG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArJkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionField.d.ts b/types/ts/lib/metadataTypes/DataExtensionField.d.ts new file mode 100644 index 000000000..a982012ec --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtensionField.d.ts @@ -0,0 +1,236 @@ +export default DataExtensionField; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type DataExtensionFieldMap = import('../../types/mcdev.d.js').DataExtensionFieldMap; +export type DataExtensionFieldItem = import('../../types/mcdev.d.js').DataExtensionFieldItem; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldMap} DataExtensionFieldMap + * @typedef {import('../../types/mcdev.d.js').DataExtensionFieldItem} DataExtensionFieldItem + */ +/** + * DataExtensionField MetadataType + * + * @augments MetadataType + */ +declare class DataExtensionField extends MetadataType { + static fixShared_fields: any; + /** + * Retrieves all records and saves it to disk + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.<{metadata: DataExtensionFieldMap, type: string}>} Promise of items + */ + static retrieve(retrieveDir: string, additionalFields?: string[]): Promise<{ + metadata: DataExtensionFieldMap; + type: string; + }>; + /** + * Retrieves all records for caching + * + * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.<{metadata: DataExtensionFieldMap, type: string}>} Promise of items + */ + static retrieveForCacheDE(requestParams?: SoapRequestParams, additionalFields?: string[]): Promise<{ + metadata: DataExtensionFieldMap; + type: string; + }>; + /** + * helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array + * + * @param {DataExtensionFieldMap} fieldsObj customerKey-based list of fields for one dataExtension + * @returns {DataExtensionFieldItem[]} sorted array of field objects + */ + static convertToSortedArray(fieldsObj: DataExtensionFieldMap): DataExtensionFieldItem[]; + /** + * sorting method to ensure `Ordinal` is respected + * + * @param {DataExtensionFieldItem} a - + * @param {DataExtensionFieldItem} b - + * @returns {number} sorting based on Ordinal + */ + static sortDeFields(a: DataExtensionFieldItem, b: DataExtensionFieldItem): number; + /** + * manages post retrieve steps; only used by DataExtension class + * + * @param {DataExtensionFieldItem} metadata a single item + * @returns {DataExtensionFieldItem} metadata + */ + static postRetrieveTasksDE(metadata: DataExtensionFieldItem): DataExtensionFieldItem; + /** + * Mofifies passed deployColumns for update by mapping ObjectID to their target column's values. + * Removes FieldType field if its the same in deploy and target column, because it results in an error even if its of the same type + * + * @param {DataExtensionFieldItem[]} deployColumns Columns of data extension that will be deployed + * @param {string} deKey external/customer key of Data Extension + * @returns {Promise.>} existing fields by their original name to allow re-adding FieldType after update + */ + static prepareDeployColumnsOnUpdate(deployColumns: DataExtensionFieldItem[], deKey: string): Promise<{ + [x: string]: DataExtensionFieldItem; + }>; + /** + * Delete a data extension from the specified business unit + * + * @param {string} customerKey Identifier of metadata + * @param {string} [fieldId] for programmatic deletes only one can pass in the ID directly + * @returns {Promise.} deletion success flag + */ + static deleteByKeySOAP(customerKey: string, fieldId?: string): Promise; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {Promise.} - + */ + static postDeleteTasks(customerKey: string): Promise; +} +declare namespace DataExtensionField { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + filter: {}; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DataExtension.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DataExtension.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DataExtension.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultValue: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + FieldType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsPrimaryKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsRequired: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + MaxLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + /** + * helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array + * + * @param {DataExtensionFieldMap} fieldsObj customerKey-based list of fields for one dataExtension + * @returns {DataExtensionFieldItem[]} sorted array of field objects + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Ordinal: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Scale: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=DataExtensionField.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionField.d.ts.map b/types/ts/lib/metadataTypes/DataExtensionField.d.ts.map new file mode 100644 index 000000000..a257b8ab5 --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtensionField.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionField.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtensionField.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;oCAG5C,OAAO,wBAAwB,EAAE,qBAAqB;qCACtD,OAAO,wBAAwB,EAAE,sBAAsB;AAdpE;;;;;;;;;;;GAWG;AACH;;;GAGG;AACH;;;;GAIG;AACH;IACI,6BAAwB;IACxB;;;;;;OAMG;IACH,6BAJW,MAAM,qBACN,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrE;IACD;;;;;;OAMG;IACH,0CAJW,iBAAiB,qBACjB,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrE;IACD;;;;;OAKG;IACH,uCAHW,qBAAqB,GACnB,sBAAsB,EAAE,CASpC;IAED;;;;;;OAMG;IACH,uBAJW,sBAAsB,KACtB,sBAAsB,GACpB,MAAM,CAIlB;IACD;;;;;OAKG;IACH,qCAHW,sBAAsB,GACpB,sBAAsB,CAelC;IACD;;;;;;;OAOG;IACH,mDAJW,sBAAsB,EAAE,SACxB,MAAM,GACJ;YAAiB,MAAM,GAAE,sBAAsB;MAAE,CAoK7D;IAYD;;;;;;OAMG;IACH,oCAJW,MAAM,YACN,MAAM,GACJ,QAAS,OAAO,CAAC,CAuD7B;IACD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAO1B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA5SG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts b/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts new file mode 100644 index 000000000..c4ee4e6c1 --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts @@ -0,0 +1,175 @@ +export default DataExtensionTemplate; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * DataExtensionTemplate MetadataType + * + * @augments MetadataType + */ +declare class DataExtensionTemplate extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; +} +declare namespace DataExtensionTemplate { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + filter: {}; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; /** @type {SoapRequestParams} */ + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsSendable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsTestable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendableCustomObjectField: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendableSubscriberField: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodUnitOfMeasure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RowBasedRetention: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ResetRetentionPeriodOnImport: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DeleteAtEndOfRetentionPeriod: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RetainUntil: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=DataExtensionTemplate.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map b/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map new file mode 100644 index 000000000..fbac61c35 --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionTemplate.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtensionTemplate.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAbO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/Bf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtract.d.ts b/types/ts/lib/metadataTypes/DataExtract.d.ts new file mode 100644 index 000000000..9c11fbea1 --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtract.d.ts @@ -0,0 +1,217 @@ +export default DataExtract; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * DataExtract MetadataType + * + * @augments MetadataType + */ +declare class DataExtract extends MetadataType { + /** + * Retrieves Metadata of Data Extract Activity. + * Endpoint /automation/v1/dataextracts/ returns all Data Extracts + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves Metadata of Data Extract Activity for caching + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; + /** + * Retrieve a specific dataExtract Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise; + /** + * Creates a single Data Extract + * + * @param {MetadataTypeItem} dataExtract a single Data Extract + * @returns {Promise} Promise + */ + static create(dataExtract: MetadataTypeItem): Promise; + /** + * Updates a single Data Extract + * + * @param {MetadataTypeItem} dataExtract a single Data Extract + * @returns {Promise} Promise + */ + static update(dataExtract: MetadataTypeItem): Promise; + /** + * prepares a dataExtract for deployment + * + * @param {MetadataTypeItem} metadata a single dataExtract activity definition + * @returns {MetadataTypeItem} metadata object + */ + static preDeployTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + private static _getObjectIdForSingleRetrieve; +} +declare namespace DataExtract { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + createdDateField: string; + createdNameField: string; + lastmodDateField: string; + lastmodNameField: string; + nameField: string; + restPagination: boolean; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dataExtractDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; /** + * Retrieves Metadata of Data Extract Activity. + * Endpoint /automation/v1/dataextracts/ returns all Data Extracts + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + retrieving: boolean; + template: boolean; + }; + dataExtractTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dataFields: { + skipValidation: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + endDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileSpec: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + intervalType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * Retrieve a specific dataExtract Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata + */ + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + startDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__dataExtractType_name: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=DataExtract.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtract.d.ts.map b/types/ts/lib/metadataTypes/DataExtract.d.ts.map new file mode 100644 index 000000000..378beed17 --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtract.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtract.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtract.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CA4CzC;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,gBAAgB,CAW5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiB5B;IACD;;;;;;OAMG;IACH,6CASC;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAxKG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAaH;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtractType.d.ts b/types/ts/lib/metadataTypes/DataExtractType.d.ts new file mode 100644 index 000000000..177c95050 --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtractType.d.ts @@ -0,0 +1,80 @@ +export default DataExtractType; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * DataExtractType MetadataType + * Only for Caching No retrieve/upsert is required + * as this is a configuration in the EID + * + * @augments MetadataType + */ +declare class DataExtractType extends MetadataType { + /** + * Retrieves Metadata of Data Extract Type. + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves Metadata of Data Extract Type for caching. + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; +} +declare namespace DataExtractType { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + extractId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=DataExtractType.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtractType.d.ts.map b/types/ts/lib/metadataTypes/DataExtractType.d.ts.map new file mode 100644 index 000000000..4c028dbdf --- /dev/null +++ b/types/ts/lib/metadataTypes/DataExtractType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtractType.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtractType.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3CwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DeliveryProfile.d.ts b/types/ts/lib/metadataTypes/DeliveryProfile.d.ts new file mode 100644 index 000000000..7b9c5df7a --- /dev/null +++ b/types/ts/lib/metadataTypes/DeliveryProfile.d.ts @@ -0,0 +1,102 @@ +export default DeliveryProfile; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * DeliveryProfile MetadataType + * + * @augments MetadataType + */ +declare class DeliveryProfile extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] not used + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; +} +declare namespace DeliveryProfile { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + filter: {}; + hasExtended: boolean; + idField: string; + keyField: string; + keyIsFixed: boolean; + maxKeyLength: number; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=DeliveryProfile.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map b/types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map new file mode 100644 index 000000000..f0271dc43 --- /dev/null +++ b/types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DeliveryProfile.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DeliveryProfile.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtCwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Discovery.d.ts b/types/ts/lib/metadataTypes/Discovery.d.ts new file mode 100644 index 000000000..9a693da59 --- /dev/null +++ b/types/ts/lib/metadataTypes/Discovery.d.ts @@ -0,0 +1,189 @@ +export default Discovery; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * ImportFile MetadataType + * + * @augments MetadataType + */ +declare class Discovery extends MetadataType { + /** + * Retrieves API endpoint + * documentation: https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/routes.htm + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] not used + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; +} +declare namespace Discovery { + let definition: { + bodyIteratorField: any; + dependencies: any[]; + endPointMapping: { + Address: string; + Asset: string; + Automation: string; + Contacts: string; + Data: string; + Device: string; + Email: string; + Guide: string; + Hub: string; + Interaction: string; + 'Interaction-Experimental': string; + Legacy: string; + Messaging: string; + 'Messaging-Experimental': string; + OTT: string; + 'OTT-Experimental': string; + Platform: string; + 'Platform-Experimental': string; + Provisioning: string; + Push: string; + SMS: string; + }; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + basePath: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + baseUrl: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + discoveryVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + documentationLink: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + kind: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + methods: { + skipValidation: boolean; + }; + metadata: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metadata.supportsResponseEncoding': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + protocol: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + resources: { + skipValidation: boolean; + }; + rootUrl: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + schemas: { + skipValidation: boolean; + }; + servicePath: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + title: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + version: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Discovery.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Discovery.d.ts.map b/types/ts/lib/metadataTypes/Discovery.d.ts.map new file mode 100644 index 000000000..654eebc3c --- /dev/null +++ b/types/ts/lib/metadataTypes/Discovery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Discovery.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Discovery.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AACH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA0BxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAxDwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Email.d.ts b/types/ts/lib/metadataTypes/Email.d.ts new file mode 100644 index 000000000..cb1e39d3f --- /dev/null +++ b/types/ts/lib/metadataTypes/Email.d.ts @@ -0,0 +1,384 @@ +export default Email; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * Email MetadataType + * + * @augments MetadataType + */ +declare class Email extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single query + * @returns {MetadataTypeItem} Array with one metadata object and one query string + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace Email { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keepId: boolean; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + restPagination: any; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CharacterSet: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + /** + * Email MetadataType + * + * @augments MetadataType + */ + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + templating: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ClonedFromID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ContentAreas: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; /** @type {SoapRequestParams} */ + }; + 'ContentAreas.CategoryID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.Content': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; /** + * Helper for writing Metadata to disk, used for Retrieve and deploy + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve + * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata + */ + 'ContentAreas.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsBlank': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsDynamicContent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsLocked': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsSurvey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.Key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].CategoryID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].Content': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsBlank': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsDynamicContent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsLocked': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsSurvey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].Key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ContentCheckStatus: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + EmailType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Folder: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HasDynamicSubjectLine: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HTMLBody: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsActive: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsHTMLPaste: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PreHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Subject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SyncTextWithHTML: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TextBody: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Email.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Email.d.ts.map b/types/ts/lib/metadataTypes/Email.d.ts.map new file mode 100644 index 000000000..946e7bf01 --- /dev/null +++ b/types/ts/lib/metadataTypes/Email.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Email.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAgBxC;IAmBD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAvED;;;;mBAIG;;;qCAEC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;qCAEC,gCAAgC;;;;;;;;;;;;;;;;;;;eAcpC;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/EmailSend.d.ts b/types/ts/lib/metadataTypes/EmailSend.d.ts new file mode 100644 index 000000000..32feb1088 --- /dev/null +++ b/types/ts/lib/metadataTypes/EmailSend.d.ts @@ -0,0 +1,652 @@ +export default EmailSend; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * MessageSendActivity MetadataType + * + * @augments MetadataType + */ +declare class EmailSend extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static update(metadataItem: MetadataTypeItem): Promise; + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static create(metadataItem: MetadataTypeItem): Promise; + /** + * prepares a single item for deployment + * + * @param {MetadataTypeItem} metadata a single script activity definition + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single query + * @returns {MetadataTypeItem} Array with one metadata object and one query string + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace EmailSend { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + hasExtended: boolean; + idField: string; + keepId: boolean; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: any; + maxKeyLength: number; + type: string; + soapType: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + Additional: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + AutoBccEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BccEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CCEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DeduplicateByEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.DomainType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.FooterContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.FooterSalutationSource': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.HeaderContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.HeaderSalutationSource': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.PrivateDomain': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.PrivateIP': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.SourceAddressType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DeliveryScheduledTime: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DomainType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DynamicEmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.Subject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.Status': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + EmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ExclusionFilter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FooterContentArea: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FooterSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HeaderContentArea: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HeaderSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IntegratedTracking: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + InteractionObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsMultipart: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSeedListSend: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSendLogging: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsWrapped: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Keyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + MessageDeliveryType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PreHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PrivateDomain: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PrivateIP: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToDisplayName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SeedListOccurance: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList.CustomObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendDefinitionList: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].CustomObjectID': { + skipValidation: boolean; + }; + 'SendDefinitionList[].SendDefinitionListType': { + skipValidation: boolean; + }; + 'SendDefinitionList[].DataSourceTypeID': { + skipValidation: boolean; + }; + 'SendDefinitionList[].IsTestObject': { + skipValidation: boolean; + }; + 'SendDefinitionList[].SalesForceObjectID': { + skipValidation: boolean; + }; + 'SendDefinitionList[].Name': { + skipValidation: boolean; + }; + 'SendDefinitionList[].r__dataExtension_Key': { + skipValidation: boolean; + }; + 'SendDefinitionList[].List.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].List.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].r__list_PathName': { + skipValidation: boolean; + }; + 'SenderProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.FromAddress': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.FromName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendLimit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowClose: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowDelete: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowOpen: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SourceAddressType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SuppressTracking: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TestEmailAddr: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TimeZone: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TrackingUsers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + r__asset_name_readOnly: { + skipValidation: boolean; + }; + r__asset_key: { + skipValidation: boolean; + }; + r__email_name: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + r__senderProfile_key: { + skipValidation: boolean; + }; + r__sendClassification_key: { + skipValidation: boolean; + }; + r__deliveryProfile_key: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=EmailSend.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/EmailSend.d.ts.map b/types/ts/lib/metadataTypes/EmailSend.d.ts.map new file mode 100644 index 000000000..7981f1ab5 --- /dev/null +++ b/types/ts/lib/metadataTypes/EmailSend.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EmailSend.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/EmailSend.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAmCxC;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAuJtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAsJ5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAzZwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Event.d.ts b/types/ts/lib/metadataTypes/Event.d.ts new file mode 100644 index 000000000..2921ff8e9 --- /dev/null +++ b/types/ts/lib/metadataTypes/Event.d.ts @@ -0,0 +1,958 @@ +export default Event; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * Event MetadataType + * + * @augments MetadataType + */ +declare class Event extends MetadataType { + /** + * Retrieves Metadata of Event Definition. + * Endpoint /interaction/v1/eventDefinitions return all Event Definitions with all details. + * Currently it is not needed to loop over Imports with endpoint /interaction/v1/eventDefinitions/{id} + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves event definition metadata for caching + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; + /** + * Retrieve a specific Event Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise; + /** + * Creates a single Event Definition + * + * @param {MetadataTypeItem} metadata a single Event Definition + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; + /** + * Updates a single Event Definition (using PUT method since PATCH isn't supported) + * + * @param {MetadataTypeItem} metadataEntry a single Event Definition + * @returns {Promise} Promise + */ + static update(metadataEntry: MetadataTypeItem): Promise; + /** + * prepares an event definition for deployment + * + * @param {MetadataTypeItem} metadata a single eventDefinition + * @returns {MetadataTypeItem} parsed version + */ + static preDeployTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * parses retrieved Metadata before saving + * + * @param {MetadataTypeItem} metadata a single event definition + * @returns {MetadataTypeItem} parsed metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace Event { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: string; + lastmodDateField: string; + lastmodNameField: string; + restPagination: boolean; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + validTypes: string[]; + fields: { + 'arguments.audienceCount': { + isCreateable: boolean; /** + * Event MetadataType + * + * @augments MetadataType + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.audienceDefinitionID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.audienceDescription': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.audienceSource': { + skipValidation: boolean; + }; + 'arguments.audienceName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.automationId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.buildAudienceDefinitionID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.contactAttributeGroup': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.contactAttributeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.contactAttributeName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.criteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dataExtensionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dataTargetName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.formName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dateOffset': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dateOffsetUnit': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dateType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.eid': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.eventDefinitionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.eventDefinitionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.mid': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.resetHighWatermark': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.serializedObjectType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.transactionKeyDataExtension': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.transactionKeyEvent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.useHighWatermark': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + automationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + category: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + configurationArguments: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dataExtensionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dataExtensionName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + disableDEDataLogging: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + eventDefinitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + filterDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + filterDefinitionTemplate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + iconUrl: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + interactionCount: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isVisibleInPicker: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.attributeName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.automationType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.categoryId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.folderPath': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.guidId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.isPlatformObject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastRunInstance': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastRunTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSaveDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSavedBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSavedBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSavedBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.memberId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.modifiedDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.notifications': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.processes': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.schedule': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.createdBy': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.iCalRecur': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.lastUpdatedBy': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.scheduleState': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.scheduleStatus': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.timeZone': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.timeZoneId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduledTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.selectedCategoryId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.selectedCategoryId[]': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.status': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.updateInProgress': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.criteriaDescription': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.customAttributeName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.formattedDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.formattedTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.icon': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.original_icon': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.isConfigured': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.runOnceScheduleMode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.scheduleFlowMode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.scheduleState': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.timeZone': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys.0': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys.0.from': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys.0.to': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + mode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + publishedInteractionCount: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledDayOfWeek': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledWeek': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.endDateTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.endType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.frequency': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.interval': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.occurrences': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.recurrencePattern': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledDay': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.startDateTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.timeZone': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.monday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.tuesday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.wednesday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.thursday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.friday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.saturday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.sunday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].dataType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].defaultValue': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].isDevicePreference': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].isNullable': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].isPrimaryKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].maxLength': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.sendableCustomObjectField': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.sendableSubscriberField': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.isPlatformObject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sourceApplicationExtensionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__dataExtension_CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Event.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Event.d.ts.map b/types/ts/lib/metadataTypes/Event.d.ts.map new file mode 100644 index 000000000..b541f168e --- /dev/null +++ b/types/ts/lib/metadataTypes/Event.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Event.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;OAUG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileLocation.d.ts b/types/ts/lib/metadataTypes/FileLocation.d.ts new file mode 100644 index 000000000..014ca98eb --- /dev/null +++ b/types/ts/lib/metadataTypes/FileLocation.d.ts @@ -0,0 +1,101 @@ +export default FtpLocation; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * ImportFile MetadataType + * + * @augments MetadataType + */ +declare class FtpLocation extends MetadataType { + /** + * Retrieves Metadata of FtpLocation + * Endpoint /automation/v1/ftplocations/ return all FtpLocations + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves folder metadata into local filesystem. Also creates a uniquePath attribute for each folder. + * + * @returns {Promise.} Promise + */ + static retrieveForCache(): Promise; +} +declare namespace FtpLocation { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: any; + createdNameField: any; + lastmodDateField: any; + lastmodNameField: any; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + locationTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + locationUrl: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + relPath: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=FileLocation.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileLocation.d.ts.map b/types/ts/lib/metadataTypes/FileLocation.d.ts.map new file mode 100644 index 000000000..2cda24d59 --- /dev/null +++ b/types/ts/lib/metadataTypes/FileLocation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileLocation.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/FileLocation.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3CwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileTransfer.d.ts b/types/ts/lib/metadataTypes/FileTransfer.d.ts new file mode 100644 index 000000000..ec22b2f6b --- /dev/null +++ b/types/ts/lib/metadataTypes/FileTransfer.d.ts @@ -0,0 +1,228 @@ +export default FileTransfer; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * FileTransfer MetadataType + * + * @augments MetadataType + */ +declare class FileTransfer extends MetadataType { + /** + * Retrieves Metadata of FileTransfer Activity. + * Endpoint /automation/v1/filetransfers/ returns all File Transfers + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves Metadata of FileTransfer Activity for caching + * + * @returns {Promise.} Promise + */ + static retrieveForCache(): Promise; + /** + * Retrieve a specific File Transfer Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise; + /** + * Creates a single File Transfer + * + * @param {MetadataTypeItem} fileTransfer a single File Transfer + * @returns {Promise} Promise + */ + static create(fileTransfer: MetadataTypeItem): Promise; + /** + * Updates a single File Transfer + * + * @param {MetadataTypeItem} fileTransfer a single File Transfer + * @returns {Promise} Promise + */ + static update(fileTransfer: MetadataTypeItem): Promise; + /** + * prepares a fileTransfer for deployment + * + * @param {MetadataTypeItem} metadata a single fileTransfer activity definition + * @returns {Promise} Promise + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single fileTransfer activity definition + * @returns {MetadataTypeItem} parsed metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + private static _getObjectIdForSingleRetrieve; +} +declare namespace FileTransfer { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileSpec: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileTransferLocationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isCompressed: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isEncrypted: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isFileSpecLocalized: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; /** + * Retrieve a specific File Transfer Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise + */ + template: boolean; + }; + isPgp: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isUpload: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxFileAge: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxFileAgeScheduleOffset: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxImportFrequency: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + publicKeyManagementId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__fileLocation_name: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=FileTransfer.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileTransfer.d.ts.map b/types/ts/lib/metadataTypes/FileTransfer.d.ts.map new file mode 100644 index 000000000..300e769c4 --- /dev/null +++ b/types/ts/lib/metadataTypes/FileTransfer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileTransfer.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/FileTransfer.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CA4CzC;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,gBAkB1B;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;IAED;;;;;;OAMG;IACH,6CASC;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAxJG;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Filter.d.ts b/types/ts/lib/metadataTypes/Filter.d.ts new file mode 100644 index 000000000..45c957990 --- /dev/null +++ b/types/ts/lib/metadataTypes/Filter.d.ts @@ -0,0 +1,145 @@ +export default Filter; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * Filter MetadataType + * + * @augments MetadataType + */ +declare class Filter extends MetadataType { + /** + * Retrieves Metadata of Filter. + * Endpoint /automation/v1/filters/ returns all Filters, + * but only with some of the fields. So it is needed to loop over + * Filters with the endpoint /automation/v1/filters/{id} + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; +} +declare namespace Filter { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + categoryId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customerKey: { + isCreateable: any; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationObjectId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + filterActivityId: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + }; + filterDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: any; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sourceObjectId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sourceTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + statusId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Filter.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Filter.d.ts.map b/types/ts/lib/metadataTypes/Filter.d.ts.map new file mode 100644 index 000000000..d09517631 --- /dev/null +++ b/types/ts/lib/metadataTypes/Filter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Filter.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;;OAWG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApCwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Folder.d.ts b/types/ts/lib/metadataTypes/Folder.d.ts new file mode 100644 index 000000000..3cd1da051 --- /dev/null +++ b/types/ts/lib/metadataTypes/Folder.d.ts @@ -0,0 +1,287 @@ +export default Folder; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * Folder MetadataType + * + * @augments MetadataType + */ +declare class Folder extends MetadataType { + /** + * Retrieves metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {string[]} [subTypeArr] content type of folder + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise} Promise + */ + static retrieve(retrieveDir: string, additionalFields?: string[], subTypeArr?: string[], key?: string): Promise; + /** + * Retrieves folder metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {string[]} [subTypeArr] content type of folder + * @returns {Promise} Promise + */ + static retrieveForCache(_?: void | string[], subTypeArr?: string[]): Promise; + /** + * Folder upsert (copied from Metadata Upsert), after retrieving from target + * and comparing to check if create or update operation is needed. + * Copied due to having a dependency on itself, meaning the created need to be serial + * + * @param {MetadataTypeMap} metadata metadata mapped by their keyField + * @returns {Promise.} Promise of saved metadata + */ + static upsert(metadata: MetadataTypeMap): Promise; + /** + * creates a folder based on metatadata + * + * @param {MetadataTypeItem} metadataEntry metadata of the folder + * @returns {Promise} Promise + */ + static create(metadataEntry: MetadataTypeItem): Promise; + /** + * Updates a single Folder. + * + * @param {MetadataTypeItem} metadataEntry single metadata entry + * @returns {Promise} Promise + */ + static update(metadataEntry: MetadataTypeItem): Promise; + /** + * prepares a folder for deployment + * + * @param {MetadataTypeItem} metadata a single folder definition + * @returns {Promise.} Promise of parsed folder metadata + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * Returns file contents mapped to their filename without '.json' ending + * + * @param {string} dir directory that contains '.json' files to be read + * @param {boolean} [listBadKeys] do not print errors, used for badKeys() + * @returns {MetadataTypeMap} fileName => fileContent map + */ + static getJsonFromFS(dir: string, listBadKeys?: boolean): MetadataTypeMap; + /** + * Helper to retrieve the folders as promise + * + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {boolean} [queryAllAccounts] which queryAllAccounts setting to use + * @param {string[]} [contentTypeList] content type of folder + * @returns {Promise.} soap object + */ + static retrieveHelper(additionalFields?: string[], queryAllAccounts?: boolean, contentTypeList?: string[]): Promise; + /** + * Gets executed after retreive of metadata type + * + * @param {MetadataTypeItem} metadata metadata mapped by their keyField + * @returns {MetadataTypeItem} cloned metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * Helper for writing Metadata to disk, used for Retrieve and deploy + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve + * @param {number | string} mid unused parameter + * @returns {Promise.} Promise of saved metadata + */ + static saveResults(results: MetadataTypeMap, retrieveDir: string, mid: number | string): Promise; +} +declare namespace Folder { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + subTypes: string[]; + deployFolderTypes: string[]; + deployFolderBlacklist: string[]; + folderTypesFromParent: string[]; + hasExtended: boolean; + idField: string; + keepId: boolean; + keyIsFixed: boolean; + keyField: string; + nameField: string; + restPagination: boolean; + type: string; + soapType: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + $: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + '@_xsi:type': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ContentType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsActive: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsEditable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AllowChildren: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.Path': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Path: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + _generated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + catType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + parentCatId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Folder.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Folder.d.ts.map b/types/ts/lib/metadataTypes/Folder.d.ts.map new file mode 100644 index 000000000..bf56ce39f --- /dev/null +++ b/types/ts/lib/metadataTypes/Folder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Folder.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Folder.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,qBACN,MAAM,EAAE,eACR,MAAM,EAAE,QACR,MAAM,gBA8HhB;IAED;;;;;;OAMG;IACH,4BAJW,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,gBAKlB;IAED;;;;;;;OAOG;IACH,wBAHW,eAAe,GACb,QAAS,MAAM,CAAC,CA8J5B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBA+C1B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBAyB1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAgDtC;IAED;;;;;;OAMG;IACH,0BAJW,MAAM,gBACN,OAAO,GACL,eAAe,CAkE3B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,EAAE,qBACR,OAAO,oBACP,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA+B5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAI5B;IACD;;;;;;;OAOG;IACH,4BALW,eAAe,eACf,MAAM,OACN,MAAM,GAAG,MAAM,GACb,QAAS,MAAM,CAAC,CAuD5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9oBwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/ImportFile.d.ts b/types/ts/lib/metadataTypes/ImportFile.d.ts new file mode 100644 index 000000000..f213f4c1c --- /dev/null +++ b/types/ts/lib/metadataTypes/ImportFile.d.ts @@ -0,0 +1,409 @@ +export default ImportFile; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * ImportFile MetadataType + * + * @augments MetadataType + */ +declare class ImportFile extends MetadataType { + /** + * Retrieves Metadata of Import File. + * Endpoint /automation/v1/imports/ return all Import Files with all details. + * Currently it is not needed to loop over Imports with endpoint /automation/v1/imports/{id} + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves import definition metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieveForCache(_?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieve a specific Import Definition by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise; + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + private static _getObjectIdForSingleRetrieve; + /** + * Creates a single Import File + * + * @param {MetadataTypeItem} importFile a single Import File + * @returns {Promise} Promise + */ + static create(importFile: MetadataTypeItem): Promise; + /** + * Updates a single Import File + * + * @param {MetadataTypeItem} importFile a single Import File + * @returns {Promise} Promise + */ + static update(importFile: MetadataTypeItem): Promise; + /** + * prepares a import definition for deployment + * + * @param {MetadataTypeItem} metadata a single importDef + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} parsed metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace ImportFile { + let smsImports: {}; + let dataExtensionsLegacy: {}; + let definition: { + bodyIteratorField: string; + dependencies: string[]; + destinationObjectTypeMapping: { + unknown: number; + DataExtension: number; + List: number; + SMS: number; + Push: number; + }; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + subscriberImportTypeMapping: { + DataExtension: number; + Email: number; + }; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + updateTypeMapping: { + Add: number; + AddUpdate: number; + Overwrite: number; + Update: number; + }; /** + * ImportFile MetadataType + * + * @augments MetadataType + */ + blankFileProcessingTypeMapping: { + Fail: number; + Process: number; + Skip: number; + }; + fields: { + allowErrors: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + blankFileProcessingType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dateFormatLocale: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + deleteFile: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationObjectId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationObjectTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + encodingName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fieldMappingType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fieldMappings: { + skipValidation: boolean; + }; + fileNamingPattern: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileTransferLocationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileTransferLocationName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileTransferLocationTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + filter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + hasColumnHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + importDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isOrderedImport: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isSequential: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxFileAgeHours: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxFileAgeScheduleOffsetHours: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxImportFrequencyHours: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + }; + notificationEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + otherDelimiter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sendEmailNotification: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + standardQuotedStrings: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + subscriberImportTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + updateTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__dataAction: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'source.r__dataExtension_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.r__dataExtension_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.c__destinationType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.r__list_PathName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'source.r__fileLocation_name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__subscriberImportType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__blankFileProcessing: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=ImportFile.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/ImportFile.d.ts.map b/types/ts/lib/metadataTypes/ImportFile.d.ts.map new file mode 100644 index 000000000..dfb252c69 --- /dev/null +++ b/types/ts/lib/metadataTypes/ImportFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportFile.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/ImportFile.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;OAUG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiDxC;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CAuCzC;IACD;;;;;;OAMG;IACH,6CAeC;IAED;;;;;OAKG;IACH,0BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,0BAHW,gBAAgB,gBAQ1B;IAgCD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAuHtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkH5B;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA7cD;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Journey.d.ts b/types/ts/lib/metadataTypes/Journey.d.ts new file mode 100644 index 000000000..c320cf370 --- /dev/null +++ b/types/ts/lib/metadataTypes/Journey.d.ts @@ -0,0 +1,527 @@ +export default Journey; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * Journey MetadataType + * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! + * id: A unique id of the journey assigned by the journey’s API during its creation + * key: A unique id of the journey within the MID. Can be generated by the developer + * definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version of a journey has a unique DefinitionID while the Id and Key remain the same. Version 1 will have id == definitionId + * + * @augments MetadataType + */ +declare class Journey extends MetadataType { + /** + * Retrieves Metadata of Journey + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static update(metadata: MetadataTypeItem): Promise; + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; + /** + * helper for Journey's {@link Journey.saveResults}. Gets executed after retreive of metadata type and + * + * @param {MetadataTypeMap} metadataMap key=customer key, value=metadata + */ + static _postRetrieveTasksBulk(metadataMap: MetadataTypeMap): Promise; + /** + * manages post retrieve steps + * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} Array with one metadata object + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * helper for {@link Journey.postRetrieveTasks} + * + * @private + * @param {MetadataTypeItem} metadata a single item + */ + private static _postRetrieveTasks_activities; + /** + * prepares a TSD for deployment + * ! BETA RELEASE of journey support (v4.3.0); it so far only resolves a limited amount of dependencies and will likely break during cross-BU deployments! + * + * @param {MetadataTypeItem} metadata of a single TSD + * @returns {Promise.} metadata object + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * helper for {@link Journey.preDeployTasks} + * + * @private + * @param {MetadataTypeItem} metadata a single item + */ + private static _preDeployTasks_activities; +} +declare namespace Journey { + let definition: { + folderType: string; + bodyIteratorField: string; + dependencies: string[]; + folderIdField: string; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + priorityMapping: { + High: number; + Medium: number; + Low: number; + }; + fields: { + activities: { + skipValidation: boolean; + }; + categoryId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + channel: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'defaults.email': { + skipValidation: boolean; + }; + 'defaults.mobileNumber': { + skipValidation: boolean; + }; + 'defaults.properties.analyticsTracking.enabled': { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + 'defaults.properties.analyticsTracking.analyticsType': { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + 'defaults.properties.analyticsTracking.urlDomainsToTrack': { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + entryMode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + executionMode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + exits: { + skipValidation: boolean; + }; + goals: { + skipValidation: boolean; + }; + healthStats: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastPublishedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.templateId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + scheduledStatus: { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + stats: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + triggers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].type': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].outcomes': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.startActivityKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.dequeueReason': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.lastExecutedActivityKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.filterResult': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.eventDataConfig': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.primaryObjectFilterCriteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.relatedObjectFilterCriteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.salesforceTriggerCriteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.objectAPIName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.version': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.contactKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.contactPersonType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.primaryObjectFilterSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.relatedObjectFilterSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.eventDataSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.evaluationCriteriaSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.applicationExtensionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.passThroughArgument': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.filterDefinitionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.criteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.schemaVersionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.sourceInteractionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.eventDefinitionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.eventDefinitionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.chainType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.configurationRequired': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * Creates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + }; + 'triggers[].metaData.iconUrl': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.title': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + version: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + workflowApiVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + metaData: { + skipValidation: boolean; + }; + notifiers: { + skipValidation: boolean; + }; + tags: { + skipValidation: boolean; + }; + r__folder_Path: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Journey.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Journey.d.ts.map b/types/ts/lib/metadataTypes/Journey.d.ts.map new file mode 100644 index 000000000..f80e177fc --- /dev/null +++ b/types/ts/lib/metadataTypes/Journey.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiIxC;IA6ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAkBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA2J5B;IACD;;;;;OAKG;IACH,6CAiVC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAiHtC;IAED;;;;;OAKG;IACH,0CAkLC;CAoDJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAh5BG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArQkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/List.d.ts b/types/ts/lib/metadataTypes/List.d.ts new file mode 100644 index 000000000..cc1375a9e --- /dev/null +++ b/types/ts/lib/metadataTypes/List.d.ts @@ -0,0 +1,191 @@ +export default List; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * List MetadataType + * + * @augments MetadataType + */ +declare class List extends MetadataType { + /** + * Retrieves Metadata of Lists + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Gets metadata cache with limited fields and does not store value to disk + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; + /** + * helper for @link retrieveForCache and @link retrieve + * + * @private + * @param {MetadataTypeMapObj} results metadata from retrieve for current BU + * @returns {Promise.} Promise + */ + private static _retrieveParentAllSubs; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} list a single list + * @returns {MetadataTypeItem} metadata + */ + static postRetrieveTasks(list: MetadataTypeItem): MetadataTypeItem; + /** + * parses retrieved Metadata before saving + * + * @param {MetadataTypeItem} metadata a single list definition + * @param {boolean} [parseForCache] if set to true, the Category ID is kept + * @returns {MetadataTypeItem} Array with one metadata object and one sql string + */ + static parseMetadata(metadata: MetadataTypeItem, parseForCache?: boolean): MetadataTypeItem; +} +declare namespace List { + let client: any; + let buObject: import("../../types/mcdev.d.js").BuObject; + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + restPagination: any; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + 'AutomatedEmail.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'AutomatedEmail.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'AutomatedEmail.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Category: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; /** @type {SoapRequestParams} */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ListClassification: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ListName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=List.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/List.d.ts.map b/types/ts/lib/metadataTypes/List.d.ts.map new file mode 100644 index 000000000..00ea9aed6 --- /dev/null +++ b/types/ts/lib/metadataTypes/List.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/List.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAyBxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;;OAMG;IACH,sCAqEC;IAYD;;;;;OAKG;IACH,+BAHW,gBAAgB,GACd,gBAAgB,CAI5B;IACD;;;;;;OAMG;IACH,+BAJW,gBAAgB,kBAChB,OAAO,GACL,gBAAgB,CAsB5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCApLO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnCf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MetadataType.d.ts b/types/ts/lib/metadataTypes/MetadataType.d.ts new file mode 100644 index 000000000..7887122ba --- /dev/null +++ b/types/ts/lib/metadataTypes/MetadataType.d.ts @@ -0,0 +1,654 @@ +export default MetadataType; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type SDK = import('../../types/mcdev.d.js').SDK; +export type SDKError = import('../../types/mcdev.d.js').SDKError; +export type SOAPError = import('../../types/mcdev.d.js').SOAPError; +export type RestError = import('../../types/mcdev.d.js').RestError; +/** + * MetadataType class that gets extended by their specific metadata type class. + * Provides default functionality that can be overwritten by child metadata type classes + * + */ +declare class MetadataType { + /** + * Returns file contents mapped to their filename without '.json' ending + * + * @param {string} dir directory that contains '.json' files to be read + * @param {boolean} [listBadKeys] do not print errors, used for badKeys() + * @param {string[]} [selectedSubType] asset, message, ... + * @returns {MetadataTypeMap} fileName => fileContent map + */ + static getJsonFromFS(dir: string, listBadKeys?: boolean, selectedSubType?: string[]): MetadataTypeMap; + /** + * Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. + * + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {boolean} [isCaching] if true, then check if field should be skipped for caching + * @returns {string[]} Fieldnames + */ + static getFieldNamesToRetrieve(additionalFields?: string[], isCaching?: boolean): string[]; + /** + * Deploys metadata + * + * @param {MetadataTypeMap} metadata metadata mapped by their keyField + * @param {string} deployDir directory where deploy metadata are saved + * @param {string} retrieveDir directory where metadata after deploy should be saved + * @returns {Promise.} Promise of keyField => metadata map + */ + static deploy(metadata: MetadataTypeMap, deployDir: string, retrieveDir: string): Promise; + /** + * Gets executed after deployment of metadata type + * + * @param {MetadataTypeMap} upsertResults metadata mapped by their keyField as returned by update/create + * @param {MetadataTypeMap} originalMetadata metadata to be updated (contains additioanl fields) + * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates + * @returns {void} + */ + static postDeployTasks(upsertResults: MetadataTypeMap, originalMetadata: MetadataTypeMap, createdUpdated: { + created: number; + updated: number; + }): void; + /** + * helper for {@link MetadataType.createREST} + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @param {MetadataTypeItem} metadataEntryWithAllFields like metadataEntry but before non-creatable fields were stripped + * @returns {void} + */ + static postCreateTasks(metadataEntry: MetadataTypeItem, apiResponse: object, metadataEntryWithAllFields: MetadataTypeItem): void; + /** + * helper for {@link MetadataType.updateREST} + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @returns {void} + */ + static postUpdateTasks(metadataEntry: MetadataTypeItem, apiResponse: object): void; + /** + * helper for {@link MetadataType.createREST} when legacy API endpoints as these do not return the created item but only their new id + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @returns {Promise.} - + */ + static postDeployTasks_legacyApi(metadataEntry: MetadataTypeItem, apiResponse: object): Promise; + /** + * Gets executed after retreive of metadata type + * + * @param {MetadataTypeItem} metadata a single item + * @param {string} targetDir folder where retrieves should be saved + * @param {boolean} [isTemplating] signals that we are retrieving templates + * @returns {MetadataTypeItem} cloned metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem, targetDir: string, isTemplating?: boolean): MetadataTypeItem; + /** + * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve + * + * @param {MetadataTypeItem} metadata a single item + */ + static setFolderPath(metadata: MetadataTypeItem): void; + /** + * generic script that retrieves the folder ID from cache and updates the given metadata with it before deploy + * + * @param {MetadataTypeItem} metadata a single item + */ + static setFolderId(metadata: MetadataTypeItem): void; + /** + * Gets metadata from Marketing Cloud + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} metadata + */ + static retrieve(retrieveDir: string, additionalFields?: string[], subTypeArr?: string[], key?: string): Promise; + /** + * Gets metadata from Marketing Cloud + * + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @returns {Promise.} metadata + */ + static retrieveChangelog(additionalFields?: string[], subTypeArr?: string[]): Promise; + /** + * Gets metadata cache with limited fields and does not store value to disk + * + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} metadata + */ + static retrieveForCache(additionalFields?: string[], subTypeArr?: string[], key?: string): Promise; + /** + * Gets metadata cache with limited fields and does not store value to disk + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} [subType] optionally limit to a single subtype + * @returns {Promise.} metadata + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap, subType?: string): Promise; + /** + * Retrieve a specific Script by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} uri rest endpoint for GET + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} name name (not key) of the metadata item + * @returns {Promise.<{metadata: MetadataTypeItem, type: string}>} Promise + */ + static retrieveTemplateREST(templateDir: string, uri: string, templateVariables: TemplateMap, name: string): Promise<{ + metadata: MetadataTypeItem; + type: string; + }>; + /** + * Gets metadata cache with limited fields and does not store value to disk + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string} templateDir (List of) Directory where built definitions will be saved + * @param {string} key name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} single metadata + */ + static buildTemplate(retrieveDir: string, templateDir: string, key: string, templateVariables: TemplateMap): Promise; + /** + * Gets executed before deploying metadata + * + * @param {MetadataTypeItem} metadata a single metadata item + * @param {string} deployDir folder where files for deployment are stored + * @returns {Promise.} Promise of a single metadata item + */ + static preDeployTasks(metadata: MetadataTypeItem, deployDir: string): Promise; + /** + * Abstract create method that needs to be implemented in child metadata type + * + * @param {MetadataTypeItem} metadata single metadata entry + * @param {string} deployDir directory where deploy metadata are saved + * @returns {Promise. | null} Promise of API response or null in case of an error + */ + static create(metadata: MetadataTypeItem, deployDir: string): Promise | null; + /** + * Abstract update method that needs to be implemented in child metadata type + * + * @param {MetadataTypeItem} metadata single metadata entry + * @param {MetadataTypeItem} [metadataBefore] metadata mapped by their keyField + * @returns {Promise. | null} Promise of API response or null in case of an error + */ + static update(metadata: MetadataTypeItem, metadataBefore?: MetadataTypeItem): Promise | null; + /** + * Abstract refresh method that needs to be implemented in child metadata type + * + * @returns {void} + */ + static refresh(): void; + /** + * Abstract execute method that needs to be implemented in child metadata type + * + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were executed + */ + static execute(keyArr: string[]): Promise; + /** + * Abstract pause method that needs to be implemented in child metadata type + * + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} Returns list of keys that were paused + */ + static pause(keyArr: string[]): Promise; + /** + * test if metadata was actually changed or not to potentially skip it during deployment + * + * @param {MetadataTypeItem} cachedVersion cached version from the server + * @param {MetadataTypeItem} metadata item to upload + * @param {string} [fieldName] optional field name to use for identifying the record in logs + * @returns {boolean} true if metadata was changed + */ + static hasChanged(cachedVersion: MetadataTypeItem, metadata: MetadataTypeItem, fieldName?: string): boolean; + /** + * test if metadata was actually changed or not to potentially skip it during deployment + * + * @param {MetadataTypeItem} cachedVersion cached version from the server + * @param {MetadataTypeItem} metadata item to upload + * @param {string} [fieldName] optional field name to use for identifying the record in logs + * @param {boolean} [silent] optionally suppress logging + * @returns {boolean} true on first identified deviation or false if none are found + */ + static hasChangedGeneric(cachedVersion: MetadataTypeItem, metadata: MetadataTypeItem, fieldName?: string, silent?: boolean): boolean; + /** + * MetadataType upsert, after retrieving from target and comparing to check if create or update operation is needed. + * + * @param {MetadataTypeMap} metadataMap metadata mapped by their keyField + * @param {string} deployDir directory where deploy metadata are saved + * @returns {Promise.} keyField => metadata map + */ + static upsert(metadataMap: MetadataTypeMap, deployDir: string): Promise; + /** + * helper for {@link MetadataType.upsert} + * + * @param {MetadataTypeMap} metadataMap list of metadata + * @param {string} metadataKey key of item we are looking at + * @param {boolean} hasError error flag from previous code + * @param {MetadataTypeItemDiff[]} metadataToUpdate list of items to update + * @param {MetadataTypeItem[]} metadataToCreate list of items to create + * @returns {Promise.<'create' | 'update' | 'skip'>} action to take + */ + static createOrUpdate(metadataMap: MetadataTypeMap, metadataKey: string, hasError: boolean, metadataToUpdate: MetadataTypeItemDiff[], metadataToCreate: MetadataTypeItem[]): Promise<'create' | 'update' | 'skip'>; + /** + * Creates a single metadata entry via REST + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {string} uri rest endpoint for POST + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {Promise. | null} Promise of API response or null in case of an error + */ + static createREST(metadataEntry: MetadataTypeItem, uri: string, handleOutside?: boolean): Promise | null; + /** + * Creates a single metadata entry via fuel-soap (generic lib not wrapper) + * + * @param {MetadataTypeItem} metadataEntry single metadata entry + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {Promise. | null} Promise of API response or null in case of an error + */ + static createSOAP(metadataEntry: MetadataTypeItem, handleOutside?: boolean): Promise | null; + /** + * Updates a single metadata entry via REST + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {string} uri rest endpoint for PATCH + * @param {'patch'|'post'|'put'} [httpMethod] defaults to 'patch'; some update requests require PUT instead of PATCH + * @returns {Promise. | null} Promise of API response or null in case of an error + */ + static updateREST(metadataEntry: MetadataTypeItem, uri: string, httpMethod?: 'patch' | 'post' | 'put'): Promise | null; + /** + * helper for {@link MetadataType.updateREST} and {@link MetadataType.updateSOAP} that removes old files after the key was changed + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {boolean} [keepMap] some types require to check the old-key new-key relationship in their postDeployTasks; currently used by dataExtension only + * @returns {Promise.} - + */ + static _postChangeKeyTasks(metadataEntry: MetadataTypeItem, keepMap?: boolean): Promise; + /** + * Updates a single metadata entry via fuel-soap (generic lib not wrapper) + * + * @param {MetadataTypeItem} metadataEntry single metadata entry + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {Promise. | null} Promise of API response or null in case of an error + */ + static updateSOAP(metadataEntry: MetadataTypeItem, handleOutside?: boolean): Promise | null; + /** + * + * @param {SOAPError} ex error that occured + * @param {'creating'|'updating'|'retrieving'|'executing'|'pausing'} msg what to print in the log + * @param {MetadataTypeItem} [metadataEntry] single metadata entry + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + */ + static _handleSOAPErrors(ex: any, msg: 'creating' | 'updating' | 'retrieving' | 'executing' | 'pausing', metadataEntry?: MetadataTypeItem, handleOutside?: boolean): void; + /** + * helper for {@link MetadataType._handleSOAPErrors} + * + * @param {SOAPError} ex error that occured + * @returns {string} error message + */ + static getSOAPErrorMsg(ex: any): string; + /** + * Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {string} [singleRetrieve] key of single item to filter by + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.} Promise of item map + */ + static retrieveSOAP(retrieveDir?: string, requestParams?: SoapRequestParams, singleRetrieve?: string, additionalFields?: string[]): Promise; + /** + * Retrieves Metadata for Rest Types + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {string} uri rest endpoint for GET + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @param {string} [singleRetrieve] key of single item to filter by + * @returns {Promise.<{metadata: (MetadataTypeMap | MetadataTypeItem), type: string}>} Promise of item map (single item for templated result) + */ + static retrieveREST(retrieveDir: string, uri: string, templateVariables?: TemplateMap, singleRetrieve?: string): Promise<{ + metadata: (MetadataTypeMap | MetadataTypeItem); + type: string; + }>; + /** + * + * @param {object[]} urlArray {uri: string, id: string} combo of URL and ID/key of metadata + * @param {number} [concurrentRequests] optionally set a different amount of concurrent requests + * @param {boolean} [logAmountOfUrls] if true, prints an info message about to-be loaded amount of metadata + * @returns {Promise.<{metadata: (MetadataTypeMap | MetadataTypeItem), type: string}>} Promise of item map (single item for templated result) + */ + static retrieveRESTcollection(urlArray: object[], concurrentRequests?: number, logAmountOfUrls?: boolean): Promise<{ + metadata: (MetadataTypeMap | MetadataTypeItem); + type: string; + }>; + /** + * helper for {@link this.retrieveRESTcollection} + * + * @param {RestError} ex exception + * @param {string} id id or key of item + * @returns {Promise.} - + */ + static handleRESTErrors(ex: any, id: string): Promise; + /** + * Used to execute a query/automation etc. + * + * @param {string} uri REST endpoint where the POST request should be sent + * @param {string} key item key + * @returns {Promise.<{key:string, response:string}>} metadata key and API response (OK or error) + */ + static executeREST(uri: string, key: string): Promise<{ + key: string; + response: string; + }>; + /** + * Used to execute a query/automation etc. + * + * @param {MetadataTypeItem} [metadataEntry] single metadata entry + * @returns {Promise.<{key:string, response:object}>} metadata key and API response + */ + static executeSOAP(metadataEntry?: MetadataTypeItem): Promise<{ + key: string; + response: object; + }>; + /** + * helper for {@link MetadataType.retrieveREST} and {@link MetadataType.retrieveSOAP} + * + * @param {string|number} singleRetrieve key of single item to filter by + * @param {MetadataTypeMap} metadataMap saved metadata + * @returns {Promise.} - + */ + static runDocumentOnRetrieve(singleRetrieve: string | number, metadataMap: MetadataTypeMap): Promise; + /** + * Builds map of metadata entries mapped to their keyfields + * + * @param {object} body json of response body + * @param {string} [singleRetrieve] key of single item to filter by + * @returns {MetadataTypeMap} keyField => metadata map + */ + static parseResponseBody(body: object, singleRetrieve?: string): MetadataTypeMap; + /** + * Deletes a field in a metadata entry if the selected definition property equals false. + * + * @example + * Removes field (or nested fields childs) that are not updateable + * deleteFieldByDefinition(metadataEntry, 'CustomerKey', 'isUpdateable'); + * @param {MetadataTypeItem} metadataEntry One entry of a metadataType + * @param {string} fieldPath field path to be checked if it conforms to the definition (dot seperated if nested): 'fuu.bar' + * @param {'isCreateable'|'isUpdateable'|'retrieving'|'template'} definitionProperty delete field if definitionProperty equals false for specified field. Options: [isCreateable | isUpdateable] + * @param {string} origin string of parent object, required when using arrays as these are parsed slightly differently. + * @returns {void} + */ + static deleteFieldByDefinition(metadataEntry: MetadataTypeItem, fieldPath: string, definitionProperty: 'isCreateable' | 'isUpdateable' | 'retrieving' | 'template', origin: string): void; + /** + * Remove fields from metadata entry that are not createable + * + * @param {MetadataTypeItem} metadataEntry metadata entry + * @returns {void} + */ + static removeNotCreateableFields(metadataEntry: MetadataTypeItem): void; + /** + * Remove fields from metadata entry that are not updateable + * + * @param {MetadataTypeItem} metadataEntry metadata entry + * @returns {void} + */ + static removeNotUpdateableFields(metadataEntry: MetadataTypeItem): void; + /** + * Remove fields from metadata entry that are not needed in the template + * + * @param {MetadataTypeItem} metadataEntry metadata entry + * @returns {void} + */ + static keepTemplateFields(metadataEntry: MetadataTypeItem): void; + /** + * Remove fields from metadata entry that are not needed in the stored metadata + * + * @param {MetadataTypeItem} metadataEntry metadata entry + * @returns {void} + */ + static keepRetrieveFields(metadataEntry: MetadataTypeItem): void; + /** + * checks if the current metadata entry should be saved on retrieve or not + * + * @static + * @param {MetadataTypeItem} metadataEntry metadata entry + * @param {boolean} [include] true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude + * @returns {boolean} true: skip saving == filtered; false: continue with saving + * @memberof MetadataType + */ + static isFiltered(metadataEntry: MetadataTypeItem, include?: boolean): boolean; + /** + * optionally filter by what folder something is in + * + * @static + * @param {object} metadataEntry metadata entry + * @param {boolean} [include] true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude + * @returns {boolean} true: filtered == do NOT save; false: not filtered == do save + * @memberof MetadataType + */ + static isFilteredFolder(metadataEntry: object, include?: boolean): boolean; + /** + * internal helper + * + * @private + * @param {object} myFilter include/exclude filter object + * @param {string} r__folder_Path already determined folder path + * @returns {?boolean} true: filter value found; false: filter value not found; null: no filter defined + */ + private static _filterFolder; + /** + * internal helper + * + * @private + * @param {object} myFilter include/exclude filter object + * @param {object} metadataEntry metadata entry + * @returns {?boolean} true: filter value found; false: filter value not found; null: no filter defined + */ + private static _filterOther; + /** + * Helper for writing Metadata to disk, used for Retrieve and deploy + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve + * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata + */ + static saveResults(results: MetadataTypeMap, retrieveDir: string, overrideType?: string, templateVariables?: TemplateMap): Promise; + /** + * helper for {@link MetadataType.buildDefinitionForNested} + * searches extracted file for template variable names and applies the market values + * + * @param {string} code code from extracted code + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {string} code with markets applied + */ + static applyTemplateValues(code: string, templateVariables: TemplateMap): string; + /** + * helper for {@link MetadataType.buildTemplateForNested} + * searches extracted file for template variable values and applies the market variable names + * + * @param {string} code code from extracted code + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {string} code with markets applied + */ + static applyTemplateNames(code: string, templateVariables: TemplateMap): string; + /** + * helper for {@link MetadataType.buildDefinition} + * handles extracted code if any are found for complex types (e.g script, asset, query) + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string | string[]} targetDir Directory where built definitions will be saved + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} variables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildDefinitionForNested(templateDir: string, targetDir: string | string[], metadata: MetadataTypeItem, variables: TemplateMap, templateName: string): Promise; + /** + * helper for {@link MetadataType.buildTemplate} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildTemplateForNested(templateDir: string, targetDir: string | string[], metadata: MetadataTypeItem, templateVariables: TemplateMap, templateName: string): Promise; + /** + * check template directory for complex types that open subfolders for their subtypes + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string} templateName name of the metadata file + * @returns {Promise.} subtype name + */ + static findSubType(templateDir: string, templateName: string): Promise; + /** + * optional method used for some types to try a different folder structure + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string[]} typeDirArr current subdir for this type + * @param {string} templateName name of the metadata template + * @param {string} fileName name of the metadata template file w/o extension + * @param {Error} ex error from first attempt + * @returns {Promise.} metadata in string form + */ + static readSecondaryFolder(templateDir: string, typeDirArr: string[], templateName: string, fileName: string, ex: Error): Promise; + /** + * Builds definition based on template + * NOTE: Most metadata files should use this generic method, unless custom + * parsing is required (for example scripts & queries) + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string | string[]} targetDir (List of) Directory where built definitions will be saved + * @param {string} templateName name of the metadata file + * @param {TemplateMap} variables variables to be replaced in the metadata + * @returns {Promise.} Promise of item map + */ + static buildDefinition(templateDir: string, targetDir: string | string[], templateName: string, variables: TemplateMap): Promise; + /** + * Standardizes a check for multiple messages + * + * @param {object} ex response payload from REST API + * @returns {string[]} formatted Error Message + */ + static getErrorsREST(ex: object): string[]; + /** + * Gets metadata cache with limited fields and does not store value to disk + * + * @param {MetadataTypeMap} [metadata] a list of type definitions + * @param {boolean} [isDeploy] used to skip non-supported message during deploy + * @returns {void} + */ + static document(metadata?: MetadataTypeMap, isDeploy?: boolean): void; + /** + * get name & key for provided id + * + * @param {string} id Identifier of metadata + * @returns {Promise.<{key:string, name:string}>} key, name and path of metadata; null if not found + */ + static resolveId(id: string): Promise<{ + key: string; + name: string; + }>; + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {Promise.} deletion success status + */ + static deleteByKey(customerKey: string): Promise; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @param {string[]} [additionalExtensions] additional file extensions to delete on top of `${this.definition.type}-meta.json` + * @returns {Promise.} - Promise + */ + static postDeleteTasks(customerKey: string, additionalExtensions?: string[]): Promise; + /** + * Delete a data extension from the specified business unit + * + * @param {string} customerKey Identifier of metadata + * @param {string} [overrideKeyField] optionally change the name of the key field if the api uses a different name + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {Promise.} deletion success flag + */ + static deleteByKeySOAP(customerKey: string, overrideKeyField?: string, handleOutside?: boolean): Promise; + /** + * Delete a data extension from the specified business unit + * + * @param {string} url endpoint + * @param {string} key Identifier of metadata + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {Promise.} deletion success flag + */ + static deleteByKeyREST(url: string, key: string, handleOutside?: boolean): Promise; + /** + * Returns metadata of a business unit that is saved locally + * + * @param {string} readDir root directory of metadata. + * @param {boolean} [listBadKeys] do not print errors, used for badKeys() + * @param {object} [buMetadata] Metadata of BU in local directory + * @returns {object} Metadata of BU in local directory + */ + static readBUMetadataForType(readDir: string, listBadKeys?: boolean, buMetadata?: object): object; + /** + * should return only the json for all but asset, query and script that are saved as multiple files + * additionally, the documentation for dataExtension and automation should be returned + * + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + */ + static getFilesToCommit(keyArr: string[]): Promise; + /** + * + * @param {MetadataTypeMap} metadataMap metadata mapped by their keyField + * @returns {string[]} list of keys + */ + static getKeysForFixing(metadataMap: MetadataTypeMap): string[]; + /** + * helper for getKeysForFixing and createOrUpdate + * + * @param {string} baseField name of the field to start the new key with + * @param {MetadataTypeItem} metadataItem - + * @param {number} maxKeyLength - + * @returns {string} newKey + */ + static getNewKey(baseField: string, metadataItem: MetadataTypeItem, maxKeyLength: number): string; +} +declare namespace MetadataType { + namespace definition { + let bodyIteratorField: string; + let dependencies: any[]; + let fields: any; + let hasExtended: any; + let idField: string; + let keyField: string; + let nameField: string; + let type: string; + } + let client: SDK; + let properties: Mcdevrc; + let subType: string; + let buObject: BuObject; +} +//# sourceMappingURL=MetadataType.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MetadataType.d.ts.map b/types/ts/lib/metadataTypes/MetadataType.d.ts.map new file mode 100644 index 000000000..3f3fc7f7d --- /dev/null +++ b/types/ts/lib/metadataTypes/MetadataType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;kBAC5C,OAAO,wBAAwB,EAAE,GAAG;uBACpC,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;wBAC1C,OAAO,wBAAwB,EAAE,SAAS;AAavD;;;;GAIG;AACH;IACI;;;;;;;OAOG;IACH,0BALW,MAAM,gBACN,OAAO,oBACP,MAAM,EAAE,GACN,eAAe,CAuC3B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,EAAE,cACR,OAAO,GACL,MAAM,EAAE,CAkBpB;IAED;;;;;;;OAOG;IACH,wBALW,eAAe,aACf,MAAM,eACN,MAAM,GACJ,QAAS,eAAe,CAAC,CAcrC;IAED;;;;;;;OAOG;IACH,sCALW,eAAe,oBACf,eAAe,kBACf;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,GAChC,IAAI,CAEyD;IAE1E;;;;;;;OAOG;IACH,sCALW,gBAAgB,eAChB,MA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T,QAAS,kBAAkB,CAAC,CAyFxC;IACD;;;;;OAKG;IACH,yBAHW,MAAM,GACJ,MAAM,EAAE,CAkCpB;IAED;;;;;;OAMG;IACH,2BAJW,eAAe,aACf,OAAO,GACL,IAAI,CAMhB;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,QAAS;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC,CAK/C;IAED;;;;;OAKG;IACH,gCAHW,MAAM,GACJ,QAAS,OAAO,CAAC,CAK7B;IACD;;;;;;OAMG;IACH,oCAJW,MAAM,yBACN,MAAM,EAAE,GACN,QAAS,IAAI,CAAC,CAe1B;IAED;;;;;;;OAOG;IACH,oCALW,MAAM,qBACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CA6B7B;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,OACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CAoB7B;IACD;;;;;;;OAOG;IACH,sCALW,MAAM,gBACN,OAAO,eACP,MAAM,GACJ,MAAM,CAgBlB;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileCode.d.ts b/types/ts/lib/metadataTypes/MobileCode.d.ts new file mode 100644 index 000000000..aa0ed40a3 --- /dev/null +++ b/types/ts/lib/metadataTypes/MobileCode.d.ts @@ -0,0 +1,225 @@ +export default MobileCode; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * MobileCode MetadataType + * + * @augments MetadataType + */ +declare class MobileCode extends MetadataType { + /** + * Retrieves Metadata of Mobile Keywords + * Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves event definition metadata for caching + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; +} +declare namespace MobileCode { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * Retrieves Metadata of Mobile Keywords + * Endpoint /legacy/v1/beta/mobile/code/ return all Mobile Codes with all details. + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + }; + startDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + endDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordLimit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordsUsed: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + code: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + codeType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isShortCode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordsUsedOther: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isGsmCharacterSetOnly: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isMms: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isStackIndependant: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + supportsConcatenation: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isClientOwned: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isOwner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dipSwitches: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sendableCountries: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sendableCountries[].countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sendableCountries[].vendor': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sendableCountries[].fromNameSupported': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + countryCode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + moEngineVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=MobileCode.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileCode.d.ts.map b/types/ts/lib/metadataTypes/MobileCode.d.ts.map new file mode 100644 index 000000000..59df25740 --- /dev/null +++ b/types/ts/lib/metadataTypes/MobileCode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileCode.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MobileCode.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA3BG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9BkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileKeyword.d.ts b/types/ts/lib/metadataTypes/MobileKeyword.d.ts new file mode 100644 index 000000000..2bef62d76 --- /dev/null +++ b/types/ts/lib/metadataTypes/MobileKeyword.d.ts @@ -0,0 +1,432 @@ +export default MobileKeyword; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * MobileKeyword MetadataType + * + * @augments MetadataType + */ +declare class MobileKeyword extends MetadataType { + /** + * Retrieves Metadata of Mobile Keywords + * Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all details. + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * helper for {@link MobileKeyword.parseResponseBody} that creates a custom key field for this type based on mobileCode and keyword + * + * @param {MetadataTypeItem} metadata single item + */ + static "__#4@#createCustomKeyField"(metadata: MetadataTypeItem): void; + /** + * helper for {@link MobileKeyword.preDeployTasks} and {@link MobileKeyword.createOrUpdate} to ensure we have code & keyword properly set + * + * @param {MetadataTypeItem} metadata single item + */ + static "__#4@#setCodeAndKeyword"(metadata: MetadataTypeItem): void; + /** + * Retrieves event definition metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(_?: void | string[], __?: void | string[], key?: string): Promise; + /** + * retrieve an item and create a template from it + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} key name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.} Promise of metadata + */ + static retrieveAsTemplate(templateDir: string, key: string, templateVariables: TemplateMap): Promise; + /** + * helper for {@link MobileKeyword.retrieve} and {@link MobileKeyword.retrieveAsTemplate} + * + * @param {string} key customer key of single item to retrieve / name of the metadata file + * @returns {Array} key, queryParams + */ + static "__#4@#getRetrieveKeyAndUrl"(key: string): any[]; + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static update(metadata: MetadataTypeItem): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {CodeExtractItem | MetadataTypeItem | void} Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered + */ + static postRetrieveTasks(metadata: MetadataTypeItem): CodeExtractItem | MetadataTypeItem | void; + /** + * helper for {@link MobileKeyword.postRetrieveTasks} and {@link MobileKeyword._buildForNested} + * + * @param {string} metadataScript the code of the file + * @returns {{fileExt:string,code:string}} returns found extension and file content + */ + static prepExtractedCode(metadataScript: string): { + fileExt: string; + code: string; + }; + /** + * helper for {@link MobileKeyword.buildTemplateForNested} / {@link MobileKeyword.buildDefinitionForNested} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @param {'definition'|'template'} mode defines what we use this helper for + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static _buildForNested(templateDir: string, targetDir: string | string[], metadata: MetadataTypeItem, templateVariables: TemplateMap, templateName: string, mode: 'definition' | 'template'): Promise; + /** + * helper for {@link MetadataType.createREST} + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @returns {Promise.} - + */ + static postCreateTasks(metadataEntry: MetadataTypeItem, apiResponse: object): Promise; + /** + * helper for {@link MetadataType.updateREST} + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @returns {Promise.} - + */ + static postUpdateTasks(metadataEntry: MetadataTypeItem, apiResponse: object): Promise; + /** + * helper for {@link MobileKeyword.preDeployTasks} that loads extracted code content back into JSON + * + * @param {MetadataTypeItem} metadata a single definition + * @param {string} deployDir directory of deploy files + * @param {string} [templateName] name of the template used to built defintion (prior applying templating) + * @returns {Promise.} content for metadata.script + */ + static _mergeCode(metadata: MetadataTypeItem, deployDir: string, templateName?: string): Promise; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {Promise.} - + */ + static postDeleteTasks(customerKey: string): Promise; +} +declare namespace MobileKeyword { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: string; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__codeKeyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + startDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + endDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dipSwitches: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isInherited: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + decodedId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + restriction: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + companyName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + responseMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + messages: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + code: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.code': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.endDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordLimit': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsed': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.codeType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isShortCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsedOther': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isGsmCharacterSetOnly': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isMms': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isStackIndependant': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.supportsConcatenation': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isClientOwned': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isOwner': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.dipSwitches': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.moEngineVersion': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=MobileKeyword.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileKeyword.d.ts.map b/types/ts/lib/metadataTypes/MobileKeyword.d.ts.map new file mode 100644 index 000000000..7a2db8bdb --- /dev/null +++ b/types/ts/lib/metadataTypes/MobileKeyword.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileKeyword.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MobileKeyword.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAwBxC;IAoDD;;;;OAIG;IACH,8CAFW,gBAAgB,QAI1B;IAED;;;;OAIG;IACH,2CAFW,gBAAgB,QAY1B;IAiCD;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,OACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CAuBzC;IAED;;;;;OAKG;IACH,yCAHW,MAAM,SAwBhB;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IACD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,eAAe,GAAG,gBAAgB,GAAG,IAAI,CA+BrD;IACD;;;;;OAKG;IACH,yCAHW,MAAM,GACJ;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAOxC;IAyDD;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,gBAAgB,qBAChB,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAwDhC;IA8BD;;;;;;OAMG;IACH,sCAJW,gBAAgB,eAChB,MAAM,GACJ,QAAS,IAAI,CAAC,CAI1B;IACD;;;;;;OAMG;IACH,sCAJW,gBAAgB,eAChB,MAAM,GACJ,QAAS,IAAI,CAAC,CAI1B;IAED;;;;;;;OAOG;IACH,4BALW,gBAAgB,aAChB,MAAM,iBACN,MAAM,GACJ,QAAS,MAAM,CAAC,CAqB5B;IAsBD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAM1B;CAsBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAljBwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileMessage.d.ts b/types/ts/lib/metadataTypes/MobileMessage.d.ts new file mode 100644 index 000000000..8f44d733d --- /dev/null +++ b/types/ts/lib/metadataTypes/MobileMessage.d.ts @@ -0,0 +1,931 @@ +export default MobileMessage; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * MobileMessage MetadataType + * + * @augments MetadataType + */ +declare class MobileMessage extends MetadataType { + /** + * Retrieves Metadata of Mobile Keywords + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves event definition metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(_?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static update(metadata: MetadataTypeItem): Promise; + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; + /** + * helper for {@link MobileMessage.preDeployTasks} that loads extracted code content back into JSON + * + * @param {MetadataTypeItem} metadata a single definition + * @param {string} deployDir directory of deploy files + * @param {string} [templateName] name of the template used to built defintion (prior applying templating) + * @returns {Promise.} code + */ + static _mergeCode(metadata: MetadataTypeItem, deployDir: string, templateName?: string): Promise; + /** + * helper for {@link MobileMessage.postRetrieveTasks} and {@link MobileMessage._buildForNested} + * + * @param {string} code the code of the file + * @returns {{fileExt:string,code:string}} returns found extension and file content + */ + static prepExtractedCode(code: string): { + fileExt: string; + code: string; + }; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single query + * @returns {CodeExtractItem} Array with one metadata object and one query string + */ + static postRetrieveTasks(metadata: MetadataTypeItem): CodeExtractItem; + /** + * helper for {@link MetadataType.createREST} + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @returns {Promise.} - + */ + static postCreateTasks(metadataEntry: MetadataTypeItem, apiResponse: object): Promise; + /** + * helper for {@link MetadataType.updateREST} + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @returns {Promise.} - + */ + static postUpdateTasks(metadataEntry: MetadataTypeItem, apiResponse: object): Promise; + /** + * helper for {@link MobileMessage.buildTemplateForNested} / {@link MobileMessage.buildDefinitionForNested} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @param {'definition'|'template'} mode defines what we use this helper for + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static _buildForNested(templateDir: string, targetDir: string | string[], metadata: MetadataTypeItem, templateVariables: TemplateMap, templateName: string, mode: 'definition' | 'template'): Promise; +} +declare namespace MobileMessage { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keepId: boolean; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: any; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + allowSingleOptin: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + audience: { + skipValidation: boolean; + }; + 'audience[]': { + skipValidation: boolean; + }; + campaigns: { + /** + * MobileMessage MetadataType + * + * @augments MetadataType + */ + skipValidation: boolean; + }; + 'campaigns[]': { + skipValidation: boolean; + }; /** + * Retrieves Metadata of Mobile Keywords + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + r__mobileCode_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.code': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.codeType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.dipSwitches': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.endDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isClientOwned': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isGsmCharacterSetOnly': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isMms': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isOwner': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isShortCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isStackIndependant': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordLimit': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsed': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsedOther': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.moEngineVersion': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[]': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[].countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[].vendor': { + isCreateable: boolean; /** + * helper for {@link MobileMessage.postRetrieveTasks} and {@link MobileMessage._buildForNested} + * + * @param {string} code the code of the file + * @returns {{fileExt:string,code:string}} returns found extension and file content + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[].fromNameSupported': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.supportsConcatenation': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + concatenateMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + currentEditStep: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + doubleOptinConfirmMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + doubleOptinInitialMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + doubleOptinValidResponses: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + duplicateOptInResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + expireHours: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + fromName: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + invalidMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isCertified: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isDuplicationAllowed: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isExpireSet: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isFromNameCertificationAccepted: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isSentImmediately: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isSubscriberResponseToAnySubscriptionForShortCode: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isSuppressMt: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isTest: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isTimeZoneBased: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.isInherited': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.keyword': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.keywordType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.restriction': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + messageObjectId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + messagesPerPeriod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + minutesPerPeriod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + moStartDate: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + moEndDate: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'moTimezone.name': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'moTimezone.offset': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.key': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.createdDate': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.createdBy': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.lastUpdated': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.lastUpdatedBy': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.name': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.description': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.startDate': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.iCalRecur': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.timeZone': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.timeZoneId': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; /** + * helper for {@link MetadataType.buildDefinition} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + mtSendDate: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + nextJob: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + nextKeyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + numberMessagesPerPeriod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinErrorMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinInvalidAgeMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinMinimumAge: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinType: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + origin: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + outboundSendBehaviorFlag: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + outboundSendTypeFlag: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + periodType: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + programId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + publishedMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + responseMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sendMethod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + smsTriggeredSendDefinitionId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + statistics: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.sent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.delivered': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.undelivered': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.unknown': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + statusId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.keyword': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.restriction': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.isInherited': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.keyword': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.restriction': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.isInherited': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + subscriberResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyCorrectResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyIncorrectResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyResponsesAllowed: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyTooManyEntriesMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyType: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.description': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.icon': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.lastUpdated': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.name': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + text: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + triggeredSendId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + triggeredSendName: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__campaign_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'r__campaign_key[]': { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=MobileMessage.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileMessage.d.ts.map b/types/ts/lib/metadataTypes/MobileMessage.d.ts.map new file mode 100644 index 000000000..bfa776324 --- /dev/null +++ b/types/ts/lib/metadataTypes/MobileMessage.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileMessage.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MobileMessage.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+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AAE,CAAC,CAsDhC;CAcJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAldD;;;;mBAIG;;;;;eAEC;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA0FH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA+NH;;;;;;;;;;eAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAxWkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Query.d.ts b/types/ts/lib/metadataTypes/Query.d.ts new file mode 100644 index 000000000..22aefe238 --- /dev/null +++ b/types/ts/lib/metadataTypes/Query.d.ts @@ -0,0 +1,299 @@ +export default Query; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type QueryItem = import('../../types/mcdev.d.js').QueryItem; +export type QueryMap = import('../../types/mcdev.d.js').QueryMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').QueryItem} QueryItem + * @typedef {import('../../types/mcdev.d.js').QueryMap} QueryMap + */ +/** + * Query MetadataType + * + * @augments MetadataType + */ +declare class Query extends MetadataType { + /** + * Retrieves Metadata of queries + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.<{metadata: QueryMap, type: string}>} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise<{ + metadata: QueryMap; + type: string; + }>; + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + private static _getObjectIdForSingleRetrieve; + /** + * Retrieves query metadata for caching + * + * @returns {Promise.<{metadata: QueryMap, type: string}>} Promise of metadata + */ + static retrieveForCache(): Promise<{ + metadata: QueryMap; + type: string; + }>; + /** + * Retrieve a specific Query by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.<{metadata: Query, type: string}>} Promise of metadata + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise<{ + metadata: Query; + type: string; + }>; + /** + * manages post retrieve steps + * + * @param {QueryItem} metadata a single query + * @returns {CodeExtractItem} Array with one metadata object and one query string + */ + static postRetrieveTasks(metadata: QueryItem): CodeExtractItem; + /** + * Creates a single query + * + * @param {QueryItem} query a single query + * @returns {Promise} Promise + */ + static create(query: QueryItem): Promise; + /** + * Updates a single query + * + * @param {QueryItem} query a single query + * @returns {Promise} Promise + */ + static update(query: QueryItem): Promise; + /** + * prepares a Query for deployment + * + * @param {QueryItem} metadata a single query activity + * @param {string} deployDir directory of deploy files + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: QueryItem, deployDir: string): Promise; + /** + * helper for {@link MetadataType.buildDefinition} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {QueryItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildDefinitionForNested(templateDir: string, targetDir: string | string[], metadata: QueryItem, templateVariables: TemplateMap, templateName: string): Promise; + /** + * helper for {@link MetadataType.buildTemplate} + * handles extracted code if any are found for complex types + * + * @example queries are saved as 1 json and 1 sql file. both files need to be run through templating + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {QueryItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildTemplateForNested(templateDir: string, targetDir: string | string[], metadata: QueryItem, templateVariables: TemplateMap, templateName: string): Promise; + /** + * helper for {@link Query.buildTemplateForNested} / {@link Query.buildDefinitionForNested} + * handles extracted code if any are found for complex types + * + * @private + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {QueryItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @param {'definition'|'template'} mode defines what we use this helper for + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + private static _buildForNested; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {Promise.} - + */ + static postDeleteTasks(customerKey: string): Promise; + /** + * Gets executed after deployment of metadata type + * + * @param {MetadataTypeMap} upsertResults metadata mapped by their keyField as returned by update/create + */ + static postDeployTasks(upsertResults: MetadataTypeMap): Promise; +} +declare namespace Query { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + filter: { + description: string[]; + }; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + targetUpdateTypeMapping: { + Append: number; + Overwrite: number; + Update: number; + }; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + categoryId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isFrozen: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + queryDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + queryText: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + targetDescription: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + targetId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + targetKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + targetName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + targetUpdateTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + targetUpdateTypeName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + validatedQueryText: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__dataExtension_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Query.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Query.d.ts.map b/types/ts/lib/metadataTypes/Query.d.ts.map new file mode 100644 index 000000000..efabb10a5 --- /dev/null +++ b/types/ts/lib/metadataTypes/Query.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Query.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;wBAI5C,OAAO,wBAAwB,EAAE,SAAS;uBAC1C,OAAO,wBAAwB,EAAE,QAAQ;AAftD;;;;;;;;;;;GAWG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAsBxD;IA6BD;;;;;;OAMG;IACH,6CAiBC;IAED;;;;OAIG;IACH,2BAFa,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIxD;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS;QAAC,QAAQ,EAAE,KAAK,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CASrD;IAED;;;;;OAKG;IACH,mCAHW,SAAS,GACP,eAAe,CAwD3B;IAED;;;;;OAKG;IACH,qBAHW,SAAS,gBAMnB;IAED;;;;;OAKG;IACH,qBAHW,SAAS,gBAMnB;IAED;;;;;;OAMG;IACH,gCAJW,SAAS,aACT,MAAM,GACJ,QAAS,SAAS,CAAC,CAgC/B;IAwBD;;;;;;;;;;OAUG;IACH,6CAPW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,SAAS,qBACT,WAAW,gBACX,MAAM,GACJ,QAAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IACD;;;;;;;;;;;OAWG;IACH,2CAPW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,SAAS,qBACT,WAAW,gBACX,MAAM,GACJ,QAAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IACD;;;;;;;;;;;;OAYG;IACH,+BAkDC;IAoDD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAM1B;IACD;;;;OAIG;IACH,sCAFW,eAAe,iBAOzB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3dwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Role.d.ts b/types/ts/lib/metadataTypes/Role.d.ts new file mode 100644 index 000000000..5f954947e --- /dev/null +++ b/types/ts/lib/metadataTypes/Role.d.ts @@ -0,0 +1,164 @@ +export default Role; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type SoapSDKFilterSimple = import('../../types/mcdev.d.js').SoapSDKFilterSimple; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').SoapSDKFilterSimple} SoapSDKFilterSimple + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * ImportFile MetadataType + * + * @augments MetadataType + */ +declare class Role extends MetadataType { + /** + * Gets metadata from Marketing Cloud + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] Returns specified fields even if their retrieve definition is not set to true + * @param {void | string[]} [___] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Metadata store object + */ + static retrieve(retrieveDir: string, _?: void | string[], ___?: void | string[], key?: string): Promise; + /** + * Gets executed before deploying metadata + * + * @param {MetadataTypeItem} metadata a single metadata item + * @returns {MetadataTypeItem} Promise of a single metadata item + */ + static preDeployTasks(metadata: MetadataTypeItem): MetadataTypeItem; + /** + * Create a single Role. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; + /** + * Updates a single Role. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static update(metadata: MetadataTypeItem): Promise; + /** + * Creates markdown documentation of all roles + * + * @param {MetadataTypeMap} [metadata] role definitions + * @returns {Promise.} - + */ + static document(metadata?: MetadataTypeMap): Promise; + /** + * iterates through permissions to output proper row-names for nested permissionss + * + * @static + * @param {string} role name of the user role + * @param {object} element data of the permission + * @param {string} [permission] name of the permission + * @param {string} [isAllowed] "true" / "false" from the parent + * @memberof Role + * @returns {void} + */ + static _traverseRoles(role: string, element: object, permission?: string, isAllowed?: string): void; +} +declare namespace Role { + let allPermissions: {}; + let definition: { + bodyIteratorField: string; + dependencies: any[]; + deployBlacklist: string[]; + documentInOneFile: boolean; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsSystemDefined: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PermissionSets: { + retrieving: boolean; + skipCache: boolean; + skipValidation: boolean; + }; + c__notAssignable: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Role.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Role.d.ts.map b/types/ts/lib/metadataTypes/Role.d.ts.map new file mode 100644 index 000000000..3d50e867b --- /dev/null +++ b/types/ts/lib/metadataTypes/Role.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Role.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Role.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;kCAClD,OAAO,wBAAwB,EAAE,mBAAmB;0BACpD,OAAO,wBAAwB,EAAE,WAAW;AAXzD;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,QACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAsFxC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,gBAAgB,CAS5B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,2BAHW,eAAe,GACb,QAAS,IAAI,CAAC,CA0G1B;IAED;;;;;;;;;;OAUG;IACH,4BAPW,MAAM,WACN,MAAM,eACN,MAAM,cACN,MAAM,GAEJ,IAAI,CAyDhB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7UwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Script.d.ts b/types/ts/lib/metadataTypes/Script.d.ts new file mode 100644 index 000000000..f0094adc8 --- /dev/null +++ b/types/ts/lib/metadataTypes/Script.d.ts @@ -0,0 +1,283 @@ +export default Script; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type ScriptItem = import('../../types/mcdev.d.js').ScriptItem; +export type ScriptMap = import('../../types/mcdev.d.js').ScriptMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').ScriptItem} ScriptItem + * @typedef {import('../../types/mcdev.d.js').ScriptMap} ScriptMap + */ +/** + * Script MetadataType + * + * @augments MetadataType + */ +declare class Script extends MetadataType { + /** + * Retrieves Metadata of Script + * Endpoint /automation/v1/scripts/ return all Scripts with all details. + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.<{metadata: ScriptMap, type: string}>} Promise + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise<{ + metadata: ScriptMap; + type: string; + }>; + /** + * Retrieves script metadata for caching + * + * @returns {Promise.<{metadata: ScriptMap, type: string}>} Promise + */ + static retrieveForCache(): Promise<{ + metadata: ScriptMap; + type: string; + }>; + /** + * Retrieve a specific Script by Name + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @returns {Promise.<{metadata: ScriptItem, type: string}>} Promise + */ + static retrieveAsTemplate(templateDir: string, name: string, templateVariables: TemplateMap): Promise<{ + metadata: ScriptItem; + type: string; + }>; + /** + * Updates a single Script + * + * @param {MetadataTypeItem} script a single Script + * @returns {Promise} Promise + */ + static update(script: MetadataTypeItem): Promise; + /** + * Creates a single Script + * + * @param {MetadataTypeItem} script a single Script + * @returns {Promise} Promise + */ + static create(script: MetadataTypeItem): Promise; + /** + * helper for {@link Script.preDeployTasks} that loads extracted code content back into JSON + * + * @param {ScriptItem} metadata a single asset definition + * @param {string} deployDir directory of deploy files + * @param {string} [templateName] name of the template used to built defintion (prior applying templating) + * @returns {Promise.} content for metadata.script + */ + static _mergeCode(metadata: ScriptItem, deployDir: string, templateName?: string): Promise; + /** + * prepares a Script for deployment + * + * @param {ScriptItem} metadata a single script activity definition + * @param {string} dir directory of deploy files + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: ScriptItem, dir: string): Promise; + /** + * helper for {@link MetadataType.buildDefinition} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {ScriptItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildDefinitionForNested(templateDir: string, targetDir: string | string[], metadata: ScriptItem, templateVariables: TemplateMap, templateName: string): Promise; + /** + * helper for {@link MetadataType.buildTemplate} + * handles extracted code if any are found for complex types + * + * @example scripts are saved as 1 json and 1 ssjs file. both files need to be run through templating + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {ScriptItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static buildTemplateForNested(templateDir: string, targetDir: string | string[], metadata: ScriptItem, templateVariables: TemplateMap, templateName: string): Promise; + /** + * helper for {@link Script.buildTemplateForNested} / {@link Script.buildDefinitionForNested} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {ScriptItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @param {'definition'|'template'} mode defines what we use this helper for + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static _buildForNested(templateDir: string, targetDir: string | string[], metadata: ScriptItem, templateVariables: TemplateMap, templateName: string, mode: 'definition' | 'template'): Promise; + /** + * manages post retrieve steps + * + * @param {ScriptItem} metadata a single item + * @returns {CodeExtractItem} a single item with code parts extracted + */ + static postRetrieveTasks(metadata: ScriptItem): CodeExtractItem; + /** + * helper for {@link Script.postRetrieveTasks} and {@link Script._buildForNested} + * + * @param {string} metadataScript the code of the file + * @param {string} metadataName the name of the metadata + * @returns {{fileExt:string,code:string}} returns found extension and file content + */ + static prepExtractedCode(metadataScript: string, metadataName: string): { + fileExt: string; + code: string; + }; + /** + * helper to allow us to select single metadata entries via REST + * + * @private + * @param {string} key customer key + * @returns {Promise.} objectId or enpty string + */ + private static _getObjectIdForSingleRetrieve; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {Promise.} - + */ + static postDeleteTasks(customerKey: string): Promise; +} +declare namespace Script { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + createdDateField: string; + createdNameField: string; + lastmodDateField: string; + lastmodNameField: string; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + categoryId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * @typedef {import('../../types/mcdev.d.js').ScriptItem} ScriptItem + * @typedef {import('../../types/mcdev.d.js').ScriptMap} ScriptMap + */ + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + folderLocationText: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + script: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ssjsActivityId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + statusId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Script.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Script.d.ts.map b/types/ts/lib/metadataTypes/Script.d.ts.map new file mode 100644 index 000000000..4e30a5c88 --- /dev/null +++ b/types/ts/lib/metadataTypes/Script.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;yBAI5C,OAAO,wBAAwB,EAAE,UAAU;wBAC3C,OAAO,wBAAwB,EAAE,SAAS;AAfvD;;;;;;;;;;;GAWG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAKzD;IACD;;;;OAIG;IACH,2BAFa,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIzD;IAED;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/SendClassification.d.ts b/types/ts/lib/metadataTypes/SendClassification.d.ts new file mode 100644 index 000000000..de1cad697 --- /dev/null +++ b/types/ts/lib/metadataTypes/SendClassification.d.ts @@ -0,0 +1,221 @@ +export default SendClassification; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * SendClassification MetadataType + * + * @augments MetadataType + */ +declare class SendClassification extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static update(metadataItem: MetadataTypeItem): Promise; + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static create(metadataItem: MetadataTypeItem): Promise; + /** + * prepares a import definition for deployment + * + * @param {MetadataTypeItem} metadata a single importDef + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} parsed metadata + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace SendClassification { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + filter: {}; + hasExtended: boolean; + idField: string; + keyField: string; + keyIsFixed: boolean; + maxKeyLength: number; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + sendClassificationTypeMapping: { + Commercial: string; + Transactional: string; + }; + fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ArchiveEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DeliveryProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DeliveryProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DeliveryProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + HonorPublicationListOptOutsForTransactionalSends: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendClassificationType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SenderProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SenderProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SenderProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendPriority: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__classification: { + skipValidation: boolean; + }; + r__deliveryProfile_key: { + skipValidation: boolean; + }; + r__senderProfile_key: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=SendClassification.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/SendClassification.d.ts.map b/types/ts/lib/metadataTypes/SendClassification.d.ts.map new file mode 100644 index 000000000..49e770bfc --- /dev/null +++ b/types/ts/lib/metadataTypes/SendClassification.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SendClassification.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/SendClassification.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAWD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CA4BtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiC5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnJwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/SenderProfile.d.ts b/types/ts/lib/metadataTypes/SenderProfile.d.ts new file mode 100644 index 000000000..27ae024ea --- /dev/null +++ b/types/ts/lib/metadataTypes/SenderProfile.d.ts @@ -0,0 +1,254 @@ +export default SenderProfile; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * SenderProfile MetadataType + * + * @augments MetadataType + */ +declare class SenderProfile extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static update(metadataItem: MetadataTypeItem): Promise; + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadataItem a single item + * @returns {Promise} Promise + */ + static create(metadataItem: MetadataTypeItem): Promise; + /** + * prepares a single item for deployment + * + * @param {MetadataTypeItem} metadata a single query activity + * @returns {Promise.} Promise + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; +} +declare namespace SenderProfile { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + filter: {}; + hasExtended: boolean; + idField: string; + keyField: string; + keyIsFixed: boolean; + maxKeyLength: number; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; /** @type {SoapRequestParams} */ + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoForwardToEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoForwardToName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoForwardTriggeredSend: { + /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {Promise.} deletion success status + */ + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoReply: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * prepares a single item for deployment + * + * @param {MetadataTypeItem} metadata a single query activity + * @returns {Promise.} Promise + */ + }; + AutoReplyTriggeredSend: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodUnitOfMeasure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DirectForward: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + FromAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + FromName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ReplyManagementRuleSet: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ReplyToAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ReplyToDisplayName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SenderHeaderEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SenderHeaderName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + UseDefaultRMMRules: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=SenderProfile.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/SenderProfile.d.ts.map b/types/ts/lib/metadataTypes/SenderProfile.d.ts.map new file mode 100644 index 000000000..9d39ebb8b --- /dev/null +++ b/types/ts/lib/metadataTypes/SenderProfile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SenderProfile.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/SenderProfile.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyBtC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAzEO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiCpC;;;;;mBAKG;;;;;;;;;;mCAKH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhFkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalEmail.d.ts b/types/ts/lib/metadataTypes/TransactionalEmail.d.ts new file mode 100644 index 000000000..ead20ba8c --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalEmail.d.ts @@ -0,0 +1,230 @@ +export default TransactionalEmail; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * TransactionalEmail MetadataType + * + * @augments TransactionalMessage + */ +declare class TransactionalEmail extends TransactionalMessage { + static subType: string; + /** @type {Array} */ + static _createdJourneyKeys: any[]; + /** + * prepares for deployment + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise.} - + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * helper for {@link TransactionalEmail.createREST} + * + * @param {MetadataTypeItem} _ not used + * @param {object} apiResponse varies depending on the API call + * @returns {Promise.} - + */ + static postCreateTasks(_: MetadataTypeItem, apiResponse: object): Promise; + /** + * Gets executed after deployment of metadata type + * + * @returns {void} + */ + static postDeployTasks(): void; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} a single item + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace TransactionalEmail { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requestId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + classification: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'content.customerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.dataExtension': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.r__dataExtension_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.list': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.r__list_PathName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.autoAddSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.updateSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.trackLinks': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.cc': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.bcc': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.createJourney': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + journey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'journey.interactionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__asset_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__journey_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import TransactionalMessage from './TransactionalMessage.js'; +//# sourceMappingURL=TransactionalEmail.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map b/types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map new file mode 100644 index 000000000..336b20780 --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalEmail.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalEmail.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAyB;IACzB,oBAAoB;IACpB,kCAA2B;IAqB3B;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyCtC;IACD;;;;;;OAMG;IACH,0BAJW,gBAAgB,eAChB,MAAM,GACJ,QAAS,IAAI,CAAC,CAe1B;IACD;;;;OAIG;IACH,0BAFa,IAAI,CAWhB;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAmF5B;CA2BJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCApPgC,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalMessage.d.ts b/types/ts/lib/metadataTypes/TransactionalMessage.d.ts new file mode 100644 index 000000000..02d928af3 --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalMessage.d.ts @@ -0,0 +1,163 @@ +export default TransactionalMessage; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * TransactionalMessage MetadataType + * + * @augments MetadataType + */ +declare class TransactionalMessage extends MetadataType { + static subType: any; + /** + * Retrieves Metadata + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves event definition metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {void | string[]} [__] parameter not used + * @param {string} [key] customer key of single item to cache + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(_?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Updates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static update(metadata: MetadataTypeItem): Promise; + /** + * Creates a single item + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; +} +declare namespace TransactionalMessage { + let definition: { + bodyIteratorField: string; + dependencies: any[]; + hasExtended: boolean; + /** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ + /** + * TransactionalMessage MetadataType + * + * @augments MetadataType + */ + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requestId: { + isCreateable: boolean; + isUpdateable: boolean; + /** + * Retrieves Metadata + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + retrieving: boolean; + template: boolean; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=TransactionalMessage.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map b/types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map new file mode 100644 index 000000000..e24781171 --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalMessage.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalMessage.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IAEI,oBAAe;IACf;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2CxC;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAOxC;IACD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;CAcJ;;;;;;QA1HD;;;;;;;;;;;WAWG;QAEH;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhCkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalPush.d.ts b/types/ts/lib/metadataTypes/TransactionalPush.d.ts new file mode 100644 index 000000000..9d430b781 --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalPush.d.ts @@ -0,0 +1,175 @@ +export default TransactionalPush; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * TransactionalPush TransactionalMessage + * + * @augments TransactionalMessage + */ +declare class TransactionalPush extends TransactionalMessage { + static subType: string; + /** + * prepares for deployment + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise.} - + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} a single item + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem; +} +declare namespace TransactionalPush { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; /** + * TransactionalPush TransactionalMessage + * + * @augments TransactionalMessage + */ + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requestId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'content.customerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem} a single item + */ + }; + r__asset_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.badge': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.sound': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.customKeys': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.customKeys[].value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.customKeys[].key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + applicationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import TransactionalMessage from './TransactionalMessage.js'; +//# sourceMappingURL=TransactionalPush.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalPush.d.ts.map b/types/ts/lib/metadataTypes/TransactionalPush.d.ts.map new file mode 100644 index 000000000..402a10f0f --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalPush.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalPush.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalPush.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAwB;IAExB;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqBtC;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA4B5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAnED;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA8BC;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAxD0B,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalSMS.d.ts b/types/ts/lib/metadataTypes/TransactionalSMS.d.ts new file mode 100644 index 000000000..c4efb093b --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalSMS.d.ts @@ -0,0 +1,205 @@ +export default TransactionalSMS; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * TransactionalSMS MetadataType + * + * @augments TransactionalMessage + */ +declare class TransactionalSMS extends TransactionalMessage { + static subType: string; + /** + * clean up after deleting a metadata item + * + * @param {string} customerKey Identifier of metadata item + * @returns {Promise.} - + */ + static postDeleteTasks(customerKey: string): Promise; + /** + * helper for {@link TransactionalSMS.preDeployTasks} that loads extracted code content back into JSON + * + * @param {MetadataTypeItem} metadata a single definition + * @param {string} deployDir directory of deploy files + * @param {string} [templateName] name of the template used to built defintion (prior applying templating) + * @returns {Promise.} content for metadata.script + */ + static _mergeCode(metadata: MetadataTypeItem, deployDir: string, templateName?: string): Promise; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {Promise.} Array with one metadata object and one ssjs string + */ + static postRetrieveTasks(metadata: MetadataTypeItem): Promise; + /** + * helper for {@link TransactionalSMS.postRetrieveTasks} and {@link TransactionalSMS._buildForNested} + * + * @param {string} metadataScript the code of the file + * @returns {Promise.<{fileExt:string,code:string}>} returns found extension and file content + */ + static prepExtractedCode(metadataScript: string): Promise<{ + fileExt: string; + code: string; + }>; + /** + * helper for {@link TransactionalSMS.buildTemplateForNested} / {@link TransactionalSMS.buildDefinitionForNested} + * handles extracted code if any are found for complex types + * + * @param {string} templateDir Directory where metadata templates are stored + * @param {string|string[]} targetDir (List of) Directory where built definitions will be saved + * @param {MetadataTypeItem} metadata main JSON file that was read from file system + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {string} templateName name of the template to be built + * @param {'definition'|'template'} mode defines what we use this helper for + * @returns {Promise.} list of extracted files with path-parts provided as an array + */ + static _buildForNested(templateDir: string, targetDir: string | string[], metadata: MetadataTypeItem, templateVariables: TemplateMap, templateName: string, mode: 'definition' | 'template'): Promise; + /** + * very simplified test for HTML code in our SMS + * + * @param {string} code sms source code + * @returns {boolean} true if HTML is found + */ + static _isHTML(code: string): boolean; +} +declare namespace TransactionalSMS { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: boolean; + restPageSize: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requestId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; /** + * prepares for deployment + * + * @param {MetadataTypeItem} metadata a single item + * @param {string} deployDir directory of deploy files + * @returns {Promise.} Promise + */ + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'content.message': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.shortCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.autoAddSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.updateSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.keyword': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import TransactionalMessage from './TransactionalMessage.js'; +//# sourceMappingURL=TransactionalSMS.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map b/types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map new file mode 100644 index 000000000..0df29737e --- /dev/null +++ b/types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalSMS.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalSMS.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAuB;IACvB;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAM1B;IAqDD;;;;;;;OAOG;IACH,4BALW,gBAAgB,aAChB,MAAM,iBACN,MAAM,GACJ,QAAS,MAAM,CAAC,CAmB5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,QAAS,eAAe,CAAC,CAqErC;IACD;;;;;OAKG;IACH,yCAHW,MAAM,GACJ,QAAS;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC,CAOlD;IAyDD;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,gBAAgB,qBAChB,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAqDhC;IACD;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;CAsBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAzTG;;;;;;eAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA3C0B,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TriggeredSend.d.ts b/types/ts/lib/metadataTypes/TriggeredSend.d.ts new file mode 100644 index 000000000..9aa435e4b --- /dev/null +++ b/types/ts/lib/metadataTypes/TriggeredSend.d.ts @@ -0,0 +1,671 @@ +export default TriggeredSend; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * MessageSendActivity MetadataType + * + * @augments MetadataType + */ +declare class TriggeredSend extends MetadataType { + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * Create a single TSD. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; + /** + * Updates a single TSD. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static update(metadata: MetadataTypeItem): Promise; + /** + * parses retrieved Metadata before saving + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem | void} Array with one metadata object and one sql string + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem | void; + /** + * prepares a TSD for deployment + * + * @param {MetadataTypeItem} metadata of a single TSD + * @returns {Promise.} metadata object + */ + static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * TSD-specific refresh method that finds active TSDs and refreshes them + * + * @param {string[]} [keyArr] metadata keys + * @param {boolean} [checkKey] whether to check if the key is valid + * @returns {Promise.} - + */ + static refresh(keyArr?: string[], checkKey?: boolean): Promise; + /** + * helper for {@link TriggeredSend.refresh} that extracts the keys from the TSD item map and eli + * + * @param {MetadataTypeMap} metadata TSD item map + * @returns {Promise.} keyArr + */ + static getKeysForValidTSDs(metadata: MetadataTypeMap): Promise; + /** + * helper for {@link TriggeredSend.refresh} that finds active TSDs on the server and filters it by the same rules that {@link TriggeredSend.retrieve} is using to avoid refreshing TSDs with broken dependencies + * + * @param {boolean} [assetLoaded] if run after Asset.deploy via --refresh option this will skip caching assets + * @returns {Promise.} Promise of TSD item map + */ + static findRefreshableItems(assetLoaded?: boolean): Promise; + /** + * helper for {@link TriggeredSend.refresh} that pauses, publishes and starts a triggered send + * + * @param {string} key external key of triggered send item + * @param {boolean} checkKey whether to check if key exists on the server + * @returns {Promise.} true if refresh was successful + */ + static _refreshItem(key: string, checkKey: boolean): Promise; +} +declare namespace TriggeredSend { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: string; + hasExtended: boolean; + idField: string; + keepId: boolean; + keyIsFixed: boolean; + keyField: string; + nameField: string; + folderIdField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: any; + restPagination: any; + maxKeyLength: number; + type: string; + soapType: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + priorityMapping: { + High: number; + Medium: number; + Low: number; + }; + fields: { + AllowedSlots: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + AutoAddSubscribers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + AutoUpdateSubscribers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BatchInterval: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BccEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CCEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DataSchemas: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; /** + * parses retrieved Metadata before saving + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem | void} Array with one metadata object and one sql string + */ + retrieving: boolean; + templating: boolean; + }; + DisableOnEmailBuildError: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DomainType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DynamicEmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + EmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ExclusionFilter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ExclusionListCollection: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'FooterContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FooterSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'HeaderContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HeaderSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + InteractionObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsAlwaysOn: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsMultipart: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSendLogging: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsWrapped: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + KeepExistingEmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Keyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'List.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'List.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'List.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + NewSlotTrigger: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + OptionFlags: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + OptionFlagsUpdateMask: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + OptionVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PreHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Priority: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateDomain.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateDomain.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateIP.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateIP.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + RefreshContent: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToDisplayName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + RequestExpirationSeconds: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendLimit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendSourceCustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendSourceDataExtension: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; /** + * helper for {@link TriggeredSend.refresh} that finds active TSDs on the server and filters it by the same rules that {@link TriggeredSend.retrieve} is using to avoid refreshing TSDs with broken dependencies + * + * @param {boolean} [assetLoaded] if run after Asset.deploy via --refresh option this will skip caching assets + * @returns {Promise.} Promise of TSD item map + */ + templating: boolean; + }; + SendWindowClose: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowDelete: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowOpen: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SourceAddressType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SuppressTracking: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TestEmailAddr: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendClass: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendStatus: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendSubClass: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendVersionID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + r__asset_name_readOnly: { + skipValidation: boolean; + }; + r__asset_key: { + skipValidation: boolean; + }; + r__email_name: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + /** @type {SoapRequestParams} */ + r__list_PathName: { + skipValidation: boolean; + }; /** @type {SoapRequestParams} */ + c__priority: { + skipValidation: boolean; + }; + r__sendClassification_key: { + skipValidation: boolean; + }; + r__senderProfile_key: { + skipValidation: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=TriggeredSend.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TriggeredSend.d.ts.map b/types/ts/lib/metadataTypes/TriggeredSend.d.ts.map new file mode 100644 index 000000000..e00ac2fec --- /dev/null +++ b/types/ts/lib/metadataTypes/TriggeredSend.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAO1B;IAYD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAwGnC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqFtC;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,aACR,OAAO,GACL,QAAS,IAAI,CAAC,CAkB1B;IAED;;;;;OAKG;IACH,qCAHW,eAAe,GACb,QAAS,MAAM,EAAE,CAAC,CAS9B;IACD;;;;;OAKG;IACH,0CAHW,OAAO,GACL,QAAS,kBAAkB,CAAC,CAqDxC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,YACN,OAAO,GACL,QAAS,OAAO,CAAC,CA8F7B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA7YG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAyOH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2CC,gCAAgC;;;eAAhC,gCAAgC;;;;;;;;;;;;;yBA5Xf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/User.d.ts b/types/ts/lib/metadataTypes/User.d.ts new file mode 100644 index 000000000..eae766f77 --- /dev/null +++ b/types/ts/lib/metadataTypes/User.d.ts @@ -0,0 +1,677 @@ +export default User; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type UserDocument = import('../../types/mcdev.d.js').UserDocument; +export type UserDocumentDocument = import('../../types/mcdev.d.js').UserDocumentDocument; +export type UserDocumentDiff = import('../../types/mcdev.d.js').UserDocumentDiff; +export type UserDocumentMap = import('../../types/mcdev.d.js').UserDocumentMap; +export type AccountUserConfiguration = import('../../types/mcdev.d.js').AccountUserConfiguration; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + */ +/** + * @typedef {import('../../types/mcdev.d.js').UserDocument} UserDocument + * @typedef {import('../../types/mcdev.d.js').UserDocumentDocument} UserDocumentDocument + * @typedef {import('../../types/mcdev.d.js').UserDocumentDiff} UserDocumentDiff + * @typedef {import('../../types/mcdev.d.js').UserDocumentMap} UserDocumentMap + * @typedef {import('../../types/mcdev.d.js').AccountUserConfiguration} AccountUserConfiguration + */ +/** + * MetadataType + * + * @augments MetadataType + */ +declare class User extends MetadataType { + static userBUassignments: any; + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} _ unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir: string, _: void | string[], __?: void | string[], key?: string): Promise; + /** + * Retrieves import definition metadata for caching + * + * @returns {Promise.} Promise + */ + static retrieveForCache(): Promise; + /** + * Create a single item. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static create(metadata: MetadataTypeItem): Promise; + /** + * Updates a single item. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + static update(metadata: MetadataTypeItem): Promise; + /** + * prepares a item for deployment + * + * @param {UserDocument} metadata of a single item + * @returns {Promise.} metadata object + */ + static preDeployTasks(metadata: UserDocument): Promise; + /** + * helper for {@link MetadataType.upsert} + * + * @param {MetadataTypeMap} metadata list of metadata + * @param {string} metadataKey key of item we are looking at + * @param {boolean} hasError error flag from previous code + * @param {UserDocumentDiff[]} metadataToUpdate list of items to update + * @param {UserDocument[]} metadataToCreate list of items to create + * @returns {Promise.<'create'|'update'|'skip'>} action to take + */ + static createOrUpdate(metadata: MetadataTypeMap, metadataKey: string, hasError: boolean, metadataToUpdate: UserDocumentDiff[], metadataToCreate: UserDocument[]): Promise<'create' | 'update' | 'skip'>; + /** + * + * @private + * @param {MetadataTypeItem} metadata single metadata itme + * @param {UserDocumentDiff} [updateItem] item to update + * @param {UserDocument} [createItem] item to create + */ + private static _prepareBuAssignments; + /** + * Gets executed after deployment of metadata type + * + * @param {UserDocumentMap} upsertResults metadata mapped by their keyField + * @returns {Promise.} promise + */ + static postDeployTasks(upsertResults: UserDocumentMap): Promise; + /** + * create/update business unit assignments + * + * @private + * @param {UserDocumentMap} upsertResults metadata mapped by their keyField + * @returns {Promise.} - + */ + private static _handleBuAssignments; + /** + * helper for {@link User.createOrUpdate} + * + * @private + * @param {UserDocument} metadata single created user + * @returns {void} + */ + private static _setPasswordForNewUser; + /** + * helper for {@link User.createOrUpdate} + * It searches for roles that were removed from the user and unassigns them; it also prints a summary of added/removed roles + * Adding roles works automatically for roles listed on the user + * + * @private + * @param {UserDocumentDiff} item updated user with before and after state + * @returns {void} + */ + private static _prepareRoleAssignments; + /** + * helper for {@link User._prepareRoleAssignments} + * + * @param {string} roleId role.ObjectID + * @param {string} roleName role.Name + * @param {number} userId user.AccountUserID + * @param {boolean} assignmentOnly if true, only assignment configuration will be returned + * @param {boolean} [isRoleRemovale] if true, role will be removed from user; otherwise added + * @returns {object} format needed by API + */ + static _getRoleObjectForDeploy(roleId: string, roleName: string, userId: number, assignmentOnly: boolean, isRoleRemovale?: boolean): object; + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @returns {Promise.} Promise of metadata + */ + static retrieveChangelog(): Promise; + /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @private + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + private static _retrieve; + /** + * Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {SoapRequestParams} [requestParams] required for the specific request (filter for example) + * @param {string} [singleRetrieve] key of single item to filter by + * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true + * @returns {Promise.} Promise of item map + */ + static retrieveSOAP(retrieveDir: string, requestParams?: SoapRequestParams, singleRetrieve?: string, additionalFields?: string[]): Promise; + /** + * helper for {@link User.retrieveSOAP} + * + * @private + * @param {SoapRequestParams} requestParams required for the specific request (filter for example) + * @param {string} soapType e.g. AccountUser + * @param {string[]} fields list of fields to retrieve + * @param {object} resultsBulk actual return value of this method + * @returns {Promise.} success flag + */ + private static _retrieveSOAP_installedPackage; + /** + * + * @param {string} dateStr first date + * @param {string} interval defaults to 'days' + * @returns {string} time difference + */ + static "__#5@#timeSinceDate"(dateStr: string, interval?: string): string; + /** + * helper to print bu names + * + * @private + * @param {number} id bu id + * @returns {string} "bu name (bu id)"" + */ + private static _getBuName; + /** + * helper that gets BU names from config + * + * @private + */ + private static _getBuNames; + /** + * helper for {@link User.createOrUpdate} to generate a random initial password for new users + * note: possible minimum length values in SFMC are 6, 8, 10, 15 chars. Therefore we should default here to 15 chars. + * + * @private + * @param {number} [length] length of password; defaults to 15 + * @returns {string} random password + */ + private static _generatePassword; + /** + * Creates markdown documentation of all roles + * + * @param {UserDocumentMap} [metadata] user list + * @returns {Promise.} - + */ + static document(metadata?: UserDocumentMap): Promise; + /** + * + * @private + * @param {object[]} users list of users and installed package + * @param {'Installed Package'|'User'|'Inactivated User'} type choose what sub type to print + * @param {Array[]} columnsToPrint helper array + * @returns {string} markdown + */ + private static _generateDocMd; + /** + * manages post retrieve steps + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem | void} a single item + */ + static postRetrieveTasks(metadata: MetadataTypeItem): MetadataTypeItem | void; +} +declare namespace User { + let userIdBuMap: {}; + let buIdName: {}; + let definition: { + bodyIteratorField: string; + dependencies: string[]; + folderType: any; + hasExtended: boolean; + idField: string; + keepId: boolean; + keyIsFixed: boolean; + keyField: string; + nameField: string; + createdDateField: string; + createdNameField: any; + lastmodDateField: string; + lastmodNameField: string; + maxKeyLength: number; + type: string; + soapType: string; + typeDescription: string; + typeName: string; + typeRetrieveByDefault: boolean; + documentInOneFile: boolean; + stringifyFieldsBeforeTemplate: string[]; + fields: { + AccountUserID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ActiveFlag: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AssociatedBusinessUnits: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + BusinessUnit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} _ unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + }; + ChallengeAnswer: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ChallengePhrase: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ModifiedBy': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; /** + * Create a single item. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultApplication: { + isCreateable: boolean; /** + * Updates a single item. + * + * @param {MetadataTypeItem} metadata single metadata entry + * @returns {Promise} Promise + */ + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultBusinessUnit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultBusinessUnitObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Delete: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Email: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsAPIUser: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsLocked: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'LanguageLocale.LocaleCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + LastSuccessfulLogin: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Locale.LocaleCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Locale.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Locale.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + MustChangePassword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + NotificationEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + ObjectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Password: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Roles: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Roles.Role': { + skipValidation: boolean; + }; + 'Roles.Role[].Client': { + skipValidation: boolean; + }; + SsoIdentities: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SsoIdentities.SsoIdentity': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SsoIdentities.SsoIdentity[].IsActive': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SsoIdentities.SsoIdentity[].FederatedID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Unlock: { + skipValidation: boolean; + isCreateable: boolean; + isUpdateable: boolean; + template: boolean; + }; + UserID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + UserPermissions: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.PartnerKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.ID': { + skipValidation: boolean; + }; + 'UserPermissions.ObjectID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Name': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Description': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Delete': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].PartnerKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].ID': { + skipValidation: boolean; + }; + 'UserPermissions[].ObjectID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Name': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Description': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Delete': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + c__type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieve: any; + template: boolean; + }; + c__AssociatedBusinessUnits: { + skipValidation: boolean; + }; + c__RoleNamesGlobal: { + skipValidation: boolean; + }; + c__LocaleCode: { + skipValidation: boolean; + }; + c__TimeZoneName: { + skipValidation: boolean; + }; + c__AccountUserID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieve: any; + template: boolean; + }; + c__IsLocked_readOnly: { + isCreateable: boolean; + isUpdateable: boolean; + retrieve: any; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=User.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/User.d.ts.map b/types/ts/lib/metadataTypes/User.d.ts.map new file mode 100644 index 000000000..6691d9d53 --- /dev/null +++ b/types/ts/lib/metadataTypes/User.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/User.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,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,mBACjB,MAAM,qBACN,MAAM,EAAE,GACN,QAAS,kBAAkB,CAAC,CA4IxC;IAED;;;;;;;;;OASG;IACH,8CAqEC;IAED;;;;;OAKG;IACH,sCAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAqDlB;IACD;;;;;;OAMG;IACH,0BAGC;IAED;;;;OAIG;IACH,2BAOC;IACD;;;;;;;OAOG;IACH,iCAmBC;IACD;;;;;OAKG;IACH,2BAHW,eAAe,GACb,QAAS,IAAI,CAAC,CAsI1B;IACD;;;;;;;OAOG;IACH,8BAeC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAoEnC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAzoCG;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAiBH;;;;;mBAKG;;;;;;;;;;;;;;;;uCASH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7EkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Verification.d.ts b/types/ts/lib/metadataTypes/Verification.d.ts new file mode 100644 index 000000000..8b7d5ba96 --- /dev/null +++ b/types/ts/lib/metadataTypes/Verification.d.ts @@ -0,0 +1,188 @@ +export default Verification; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type RestError = import('../../types/mcdev.d.js').RestError; +export type VerificationItem = import('../../types/mcdev.d.js').VerificationItem; +/** + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').RestError} RestError + */ +/** + * @typedef {import('../../types/mcdev.d.js').VerificationItem} VerificationItem + */ +/** + * Verification MetadataType + * + * @augments MetadataType + */ +declare class Verification extends MetadataType { + /** + * Retrieves Metadata of Data Verification Activity. + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ + static retrieve(retrieveDir?: string, _?: void | string[], __?: void | string[], key?: string): Promise; + /** + * helper for {@link this.retrieveRESTcollection} + * + * @param {RestError} ex exception + * @param {string} id id or key of item + * @returns {null} - + */ + static handleRESTErrors(ex: any, id: string): null; + /** + * Retrieves Metadata of Data Extract Activity for caching + * + * @returns {Promise.} Promise of metadata + */ + static retrieveForCache(): Promise; + /** + * Creates a single Data Extract + * + * @param {VerificationItem} metadata a single Data Extract + * @returns {Promise} Promise + */ + static create(metadata: VerificationItem): Promise; + /** + * helper for {@link MetadataType.createREST} + * + * @param {MetadataTypeItem} metadataEntry a single metadata Entry + * @param {object} apiResponse varies depending on the API call + * @param {MetadataTypeItem} metadataEntryWithAllFields like metadataEntry but before non-creatable fields were stripped + * @returns {Promise.} - + */ + static postCreateTasks(metadataEntry: MetadataTypeItem, apiResponse: object, metadataEntryWithAllFields: MetadataTypeItem): Promise; + /** + * Updates a single Data Extract + * + * @param {VerificationItem} metadata a single Data Extract + * @returns {Promise} Promise + */ + static update(metadata: VerificationItem): Promise; + /** + * prepares a verification for deployment + * + * @param {VerificationItem} metadata a single verification activity definition + * @returns {Promise.} metadata object + */ + static preDeployTasks(metadata: VerificationItem): Promise; + /** + * parses retrieved Metadata before saving + * + * @param {VerificationItem} metadata a single verification activity definition + * @returns {VerificationItem} Array with one metadata object and one sql string + */ + static postRetrieveTasks(metadata: VerificationItem): VerificationItem; +} +declare namespace Verification { + let definition: { + bodyIteratorField: string; + dependencies: string[]; + hasExtended: boolean; + idField: string; + keyIsFixed: boolean; + keyField: string; + createdDateField: any; + createdNameField: string; + lastmodDateField: any; + lastmodNameField: any; + nameField: string; + restPagination: boolean; + maxKeyLength: number; + type: string; + typeDescription: string; + typeRetrieveByDefault: boolean; + typeName: string; + fields: { + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dataVerificationDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + notificationEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + notificationEmailMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + shouldEmailOnFailure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + shouldStopOnFailure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + targetObjectId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + value1: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + value2: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + verificationType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__dataExtension_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; + }; +} +import MetadataType from './MetadataType.js'; +//# sourceMappingURL=Verification.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Verification.d.ts.map b/types/ts/lib/metadataTypes/Verification.d.ts.map new file mode 100644 index 000000000..3af0d9f5a --- /dev/null +++ b/types/ts/lib/metadataTypes/Verification.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Verification.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Verification.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;wBAC5C,OAAO,wBAAwB,EAAE,SAAS;+BAI1C,OAAO,wBAAwB,EAAE,gBAAgB;AAf9D;;;;;;;;;;;;GAYG;AAEH;;GAEG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAsExC;IACD;;;;;;OAMG;IACH,qCAHW,MAAM,GACJ,IAAI,CAehB;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;;;OAOG;IACH,sCALW,gBAAgB,eAChB,MAAM,8BACN,gBAAgB,GACd,QAAS,IAAI,CAAC,CAuB1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAWtC;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiB5B;CAUJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9OwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts new file mode 100644 index 000000000..5f9489b6b --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts @@ -0,0 +1,692 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: string; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: string; + let lastmodDateField: string; + let lastmodNameField: string; + let restPagination: boolean; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: string[]; + let typeName: string; + let fields: { + activeDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + allowedBlocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + assetType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'assetType.displayName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'assetType.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'assetType.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + availableViews: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modelVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + blocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + businessUnitAvailability: { + skipValidation: boolean; + }; + category: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'category.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'category.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'category.parentId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + channels: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + content: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + contentType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.userId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customFields: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'data.campaigns': { + skipValidation: boolean; + }; + 'data.approvals': { + skipValidation: boolean; + }; + 'data.email.attributes': { + skipValidation: boolean; + }; + 'data.email.legacy': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'data.email.options': { + skipValidation: boolean; + }; + 'data.portfolio': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + design: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + enterpriseId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + file: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.fileName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.extension': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.externalUrl': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.fileSize': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.fileCreatedDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.width': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.height': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileProperties.publishedURL': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + legacyData: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + locked: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxBlocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + memberId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + meta: { + skipValidation: boolean; + }; + minBlocks: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'modifiedBy.userId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + objectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'owner.userId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sharingProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sharingProperties.localAssets': { + skipValidation: boolean; + }; + 'sharingProperties.sharedWith': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sharingProperties.sharingType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + slots: { + skipValidation: boolean; + }; + 'status.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'status.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + superContent: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + tags: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + template: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + thumbnail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + version: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + views: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; + let subTypes: string[]; + let binarySubtypes: string[]; + namespace extendedSubTypes { + let asset: string[]; + let image: string[]; + let rawimage: string[]; + let video: string[]; + let document: string[]; + let audio: string[]; + let archive: string[]; + let code: string[]; + let textfile: string[]; + let block: string[]; + let template: string[]; + let message: string[]; + let other: string[]; + } + let typeMapping: { + asset: number; + file: number; + block: number; + template: number; + message: number; + custom: number; + default: number; + image: number; + rawimage: number; + video: number; + document: number; + audio: number; + archive: number; + code: number; + textfile: number; + ai: number; + psd: number; + pdd: number; + eps: number; + gif: number; + jpe: number; + jpeg: number; + jpg: number; + jp2: number; + jpx: number; + pict: number; + pct: number; + png: number; + tif: number; + tiff: number; + tga: number; + bmp: number; + wmf: number; + vsd: number; + pnm: number; + pgm: number; + pbm: number; + ppm: number; + svg: number; + '3fr': number; + ari: number; + arw: number; + bay: number; + cap: number; + crw: number; + cr2: number; + dcr: number; + dcs: number; + dng: number; + drf: number; + eip: number; + erf: number; + fff: number; + iiq: number; + k25: number; + kdc: number; + mef: number; + mos: number; + mrw: number; + nef: number; + nrw: number; + orf: number; + pef: number; + ptx: number; + pxn: number; + raf: number; + raw: number; + rw2: number; + rwl: number; + rwz: number; + srf: number; + sr2: number; + srw: number; + x3f: number; + '3gp': number; + '3gpp': number; + '3g2': number; + '3gp2': number; + asf: number; + avi: number; + m2ts: number; + mts: number; + dif: number; + dv: number; + mkv: number; + mpg: number; + f4v: number; + flv: number; + mjpg: number; + mjpeg: number; + mxf: number; + mpeg: number; + mp4: number; + m4v: number; + mp4v: number; + mov: number; + swf: number; + wmv: number; + rm: number; + ogv: number; + indd: number; + indt: number; + incx: number; + wwcx: number; + doc: number; + docx: number; + dot: number; + dotx: number; + mdb: number; + mpp: number; + ics: number; + xls: number; + xlsx: number; + xlk: number; + xlsm: number; + xlt: number; + xltm: number; + csv: number; + tsv: number; + tab: number; + pps: number; + ppsx: number; + ppt: number; + pptx: number; + pot: number; + thmx: number; + pdf: number; + ps: number; + qxd: number; + rtf: number; + sxc: number; + sxi: number; + sxw: number; + odt: number; + ods: number; + ots: number; + odp: number; + otp: number; + epub: number; + dvi: number; + key: number; + keynote: number; + pez: number; + aac: number; + m4a: number; + au: number; + aif: number; + aiff: number; + aifc: number; + mp3: number; + wav: number; + wma: number; + midi: number; + oga: number; + ogg: number; + ra: number; + vox: number; + voc: number; + '7z': number; + arj: number; + bz2: number; + cab: number; + gz: number; + gzip: number; + iso: number; + lha: number; + sit: number; + tgz: number; + jar: number; + rar: number; + tar: number; + zip: number; + gpg: number; + htm: number; + html: number; + xhtml: number; + xht: number; + css: number; + less: number; + sass: number; + js: number; + json: number; + atom: number; + rss: number; + xml: number; + xsl: number; + xslt: number; + md: number; + markdown: number; + as: number; + fla: number; + eml: number; + text: number; + txt: number; + freeformblock: number; + textblock: number; + htmlblock: number; + textplusimageblock: number; + imageblock: number; + abtestblock: number; + dynamicblock: number; + stylingblock: number; + einsteincontentblock: number; + webpage: number; + webtemplate: number; + templatebasedemail: number; + htmlemail: number; + textonlyemail: number; + socialshareblock: number; + socialfollowblock: number; + buttonblock: number; + layoutblock: number; + defaulttemplate: number; + smartcaptureblock: number; + smartcaptureformfieldblock: number; + smartcapturesubmitoptionsblock: number; + slotpropertiesblock: number; + externalcontentblock: number; + codesnippetblock: number; + rssfeedblock: number; + formstylingblock: number; + referenceblock: number; + imagecarouselblock: number; + customblock: number; + liveimageblock: number; + livesettingblock: number; + contentmap: number; + jsonmessage: number; + icemailformblock: number; + }; +} +export default _default; +//# sourceMappingURL=Asset.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map new file mode 100644 index 000000000..12733d84b --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Asset.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Asset.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts b/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts new file mode 100644 index 000000000..cca3a4155 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts @@ -0,0 +1,246 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + applicationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + applicationKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeCount: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeGroupIconKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeGroupType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + attributeSetIdentifiers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].definitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].definitionName.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'attributeSetIdentifiers[].namespace': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + canAddProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canAddRelationships: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canChangeProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canModify: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + canRemove: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + connectingID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'connectingID.identifierType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + containsSchemaAttributes: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'definitionName.value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + displayOrder: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fullyQualifiedName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isHidden: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isOwner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isPrimary: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isSystemDefined: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + localizedDescription: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceSetKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceValueKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + mID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + namespace: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + objectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requiredRelationships: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__attributeSet_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=AttributeGroup.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map new file mode 100644 index 000000000..ac45b8e77 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeGroup.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/AttributeGroup.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts b/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts new file mode 100644 index 000000000..11254f264 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts @@ -0,0 +1,893 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let createdDateField: string; + let createdNameField: string; + let lastmodDateField: any; + let lastmodNameField: any; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + applicationID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + applicationKey: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + attributeCount: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + canAddValues: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + canChangeValues: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + canModify: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + canRemove: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + categoryID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'connectingID.identifierType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createDate: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + createdBy: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + customObjectOwnerMID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.isDeleteAtEndOfRetentionPeriod': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.isResetRetentionPeriodOnImport': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.isRowBasedRetention': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.periodUnitOfMeasure': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.setDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'dataRetentionProperties.periodLength': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + definitionID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + definitionKey: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + definitionName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'definitionName.value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fullyQualifiedName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isCustomObjectBacked: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isEvent: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isHidden: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isReadOnly: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isRoot: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isSendable: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isShared: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isSystemDefined: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + isTestaable: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftConnectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.cardinality': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.cardinality ': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.identifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'leftItem.relationshipType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + localizedDescription: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceSetKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.resourceValueKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'localizedDescription.value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + nonStandardAttributeGroupReferences: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'nonStandardAttributeGroupReferences[].attributeGroupType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'nonStandardAttributeGroupReferences[].attributeGroupID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'nonStandardAttributeGroupReferences[].definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.maskType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.maskTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.storageType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.storageTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'obfuscationProperties.valueDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.definitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'parentDefinition.definitionName.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + parentID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + relationshipCount: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + relationships: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].canModify': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].canRemove': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].isGroupToSetRelationship': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].isHidden': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].isSystemDefined': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipIDs': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipIDs[].type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipIDs[].value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].leftRelationshipReferenceType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].leftAttributeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].rightAttributeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].c__leftFullyQualifiedName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipAttributes[].c__rightFullyQualifiedName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'relationships[].relationshipID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightConnectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.cardinality': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.connectingID.identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.identifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'rightItem.relationshipType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + sendAttributeStorageName: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + sendContactKeyStorageName: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + setDefinitionID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + setDefinitionKey: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'setDefinitionName.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageFieldReferenceID.type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageFieldReferenceID.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + storageLogicalType: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + storageName: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalIsRowIdentifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalObjectFieldAPIName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalObjectFieldDataTypeName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectFieldInformation.externalObjectFieldLength': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + storageObjectIDs: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageObjectInformation.externalObjectAPIName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageReferenceID.type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'storageReferenceID.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + valueDefinitions: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].baseType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].customerDataID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].connectingID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].dataSourceID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].dataSourceName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].dataType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].defaultValue': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].definitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].definitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].definitionName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].description': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].displayOrder': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].fullyQualifiedName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].identifierType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isHidden': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isIdentityValue': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isNullable': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isPrimaryKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isReadOnly': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isSystemDefined': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].isUpdateable': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].length': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].localizedDescription': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].name': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.maskType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.maskTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.storageType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.storageTypeID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].obfuscationProperties.valueDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].ordinal': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].parentDefinition': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].parentIdentifier': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].parentType': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].restrictionLookupListID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].scale': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].setDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].setDefinitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].setDefinitionName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageFieldReferenceID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageFieldReferenceID.type': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageFieldReferenceID.value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].storageName': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].valueDefinitionID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + 'valueDefinitions[].valueDefinitionKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + r__folder_Path: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + r__dataExtension_key: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + }; +} +export default _default; +//# sourceMappingURL=AttributeSet.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map new file mode 100644 index 000000000..e50e1081c --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeSet.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/AttributeSet.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts new file mode 100644 index 000000000..73a2be3a0 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts @@ -0,0 +1,616 @@ +declare namespace _default { + export namespace activityTypeMapping { + let dataExtract: number; + let dataFactoryUtility: number; + let emailSend: number; + let fileTransfer: number; + let filter: number; + let fireEvent: number; + let importFile: number; + let journeyEntry: number; + let journeyEntryOld: number; + let query: number; + let script: number; + let verification: number; + let wait: number; + let push: number; + let sms: number; + let reportDefinition: number; + let refreshMobileFilteredList: number; + let refreshGroup: number; + let interactions: number; + let interactionStudioData: number; + let importMobileContact: number; + } + export let bodyIteratorField: string; + export let dependencies: string[]; + export let folderType: string; + export let hasExtended: boolean; + export namespace filter_1 { + let description: string[]; + } + export { filter_1 as filter }; + export let idField: string; + export let keyIsFixed: boolean; + export let keyField: string; + export let nameField: string; + export let folderIdField: string; + export let createdDateField: string; + export let createdNameField: string; + export let lastmodDateField: string; + export let lastmodNameField: string; + export let restPagination: boolean; + export let maxKeyLength: number; + export namespace scheduleTypeMapping { + let MINUTELY: number; + let HOURLY: number; + let DAILY: number; + let WEEKLY: number; + let MONTHLY: number; + } + export namespace statusMapping { + let AwaitingTrigger: number; + let Building: number; + let BuildingError: number; + let Error: number; + let InactiveTrigger: number; + let PausedSchedule: number; + let Ready: number; + let Running: number; + let Scheduled: number; + let Stopped: number; + } + export let timeZoneMapping: { + 'Afghanistan Standard Time': number; + 'Alaskan Standard Time': number; + 'Arab Standard Time': number; + 'Arabian Standard Time': number; + 'Arabic Standard Time': number; + 'Argentina Standard Time': number; + 'Atlantic Standard Time': number; + 'AUS Central Standard Time': number; + 'AUS Eastern Standard Time': number; + 'Azerbaijan Standard Time': number; + 'Azores Standard Time': number; + 'Canada Central Standard Time': number; + 'Cape Verde Standard Time': number; + 'Caucasus Standard Time': number; + 'Cen. Australia Standard Time': number; + 'Central America Standard Time': number; + 'Central Asia Standard Time': number; + 'Central Brazilian Standard Time': number; + 'Central Europe Standard Time': number; + 'Central European Standard Time': number; + 'Central Pacific Standard Time': number; + 'Central Standard Time': number; + 'Central Standard Time (Mexico)': number; + 'Central Standard Time (no DST)': number; + 'China Standard Time': number; + 'Dateline Standard Time': number; + 'E. Africa Standard Time': number; + 'E. Australia Standard Time': number; + 'E. Europe Standard Time': number; + 'E. South America Standard Time': number; + 'Eastern Standard Time': number; + 'Egypt Standard Time': number; + 'Ekaterinburg Standard Time': number; + 'Fiji Standard Time': number; + 'FLE Standard Time': number; + 'Georgian Standard Time': number; + 'GMT Standard Time': number; + 'Greenland Standard Time': number; + 'Greenwich Standard Time': number; + 'GTB Standard Time': number; + 'Hawaiian Standard Time': number; + 'India Standard Time': number; + 'Iran Standard Time': number; + 'Israel Standard Time': number; + 'Jordan Standard Time': number; + 'Korea Standard Time': number; + 'Mauritius Standard Time': number; + 'Mid-Atlantic Standard Time': number; + 'Middle East Standard Time': number; + 'Montevideo Standard Time': number; + 'Morocco Standard Time': number; + 'Mountain Standard Time': number; + 'Mountain Standard Time (Mexico)': number; + 'Myanmar Standard Time': number; + 'N. Central Asia Standard Time': number; + 'Namibia Standard Time': number; + 'Nepal Standard Time': number; + 'New Zealand Standard Time': number; + 'Newfoundland Standard Time': number; + 'North Asia East Standard Time': number; + 'North Asia Standard Time': number; + 'Pacific SA Standard Time': number; + 'Pacific Standard Time': number; + 'Pacific Standard Time (Mexico)': number; + 'Pakistan Standard Time': number; + 'Romance Standard Time': number; + 'Russian Standard Time': number; + 'SA Pacific Standard Time': number; + 'SA Western Standard Time': number; + 'Samoa Standard Time': number; + 'SE Asia Standard Time': number; + 'Singapore Standard Time': number; + 'South Africa Standard Time': number; + 'Sri Lanka Standard Time': number; + 'Taipei Standard Time': number; + 'Tasmania Standard Time': number; + 'Tokyo Standard Time': number; + 'Tonga Standard Time': number; + 'US Eastern Standard Time': number; + 'US Mountain Standard Time': number; + 'Venezuela Standard Time': number; + 'Vladivostok Standard Time': number; + 'W. Australia Standard Time': number; + 'W. Central Africa Standard Time': number; + 'W. Europe Standard Time': number; + 'West Asia Standard Time': number; + 'West Pacific Standard Time': number; + 'Yakutsk Standard Time': number; + }; + export let timeZoneDifference: { + 1: string; + 2: string; + 3: string; + 4: string; + 5: string; + 6: string; + 7: string; + 8: string; + 9: string; + 10: string; + 11: string; + 12: string; + 13: string; + 14: string; + 15: string; + 16: string; + 17: string; + 18: string; + 19: string; + 20: string; + 21: string; + 22: string; + 23: string; + 24: string; + 25: string; + 26: string; + 27: string; + 28: string; + 29: string; + 30: string; + 31: string; + 32: string; + 33: string; + 34: string; + 35: string; + 36: string; + 37: string; + 38: string; + 39: string; + 40: string; + 41: string; + 42: string; + 43: string; + 44: string; + 45: string; + 46: string; + 47: string; + 48: string; + 49: string; + 50: string; + 51: string; + 52: string; + 53: string; + 54: string; + 55: string; + 56: string; + 57: string; + 58: string; + 59: string; + 60: string; + 61: string; + 62: string; + 63: string; + 64: string; + 65: string; + 66: string; + 67: string; + 68: string; + 69: string; + 70: string; + 71: string; + 72: string; + 73: string; + 74: string; + 75: string; + 76: string; + 77: string; + 78: string; + 79: string; + 80: string; + 81: string; + 82: string; + 83: string; + 84: string; + 85: string; + 86: string; + 87: string; + 88: string; + 89: string; + 90: string; + 91: string; + 92: string; + }; + export let type: string; + export let typeDescription: string; + export let typeRetrieveByDefault: boolean; + export let typeName: string; + export let manualDeployTypes: string[]; + export let fields: { + categoryId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.fileNamePatternTypeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.fileNamingPattern': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.folderLocationText': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.isPublished': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.queueFiles': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'fileTrigger.triggerActive': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastRunInstanceId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastRunTime: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + legacyId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastSavedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastSavedByName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdByName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + updateInProgress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + notifications: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].message': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].channelType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].type': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'notifications[].notificationType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + startSource: { + skipValidation: boolean; + }; + 'schedule.endDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.icalRecur': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.occurrences': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.pattern': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.rangeTypeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduleStatus': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.statusId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.timezoneId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.timezoneName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.typeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + statusId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + steps: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].activityObjectId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].displayOrder': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].objectTypeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].targetDataExtensions': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].serializedObject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].activities[].r__type': { + skipValidation: boolean; + }; + 'steps[].activities[].r__key': { + skipValidation: boolean; + }; + 'steps[].description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].annotation': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].step': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'steps[].stepNumber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + typeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=Automation.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map new file mode 100644 index 000000000..4a2dbc6b8 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Automation.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Automation.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts new file mode 100644 index 000000000..da04e76cc --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts @@ -0,0 +1,126 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ownerId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + externalKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignCode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'display.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'display.value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + isFavorite: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignOwnerName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignOwner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + campaignStatus: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=Campaign.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map new file mode 100644 index 000000000..b011a54cd --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Campaign.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Campaign.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts b/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts new file mode 100644 index 000000000..a8e1a3044 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts @@ -0,0 +1,182 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let restPagination: any; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + BackgroundColor: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BorderColor: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BorderWidth: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Cellpadding: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Cellspacing: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Content: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FontFamily: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HasFontSize: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsBlank: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsDynamicContent: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsLocked: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSurvey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Layout: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Width: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=ContentArea.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map new file mode 100644 index 000000000..774052e56 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ContentArea.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/ContentArea.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts b/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts new file mode 100644 index 000000000..0c3c70dbe --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts @@ -0,0 +1,237 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: string; + namespace filter { + let CustomerKey: string[]; + let Name: string[]; + } + let templateFields: { + AudienceBuilderResult: string[]; + CONTEXTUAL_SUPPRESSION_LISTS: string[]; + DomainExclusion: string[]; + 'Event DE Template': string[]; + PushSendLog: string[]; + SendLog: string[]; + 'SmartCapture - Contacts Template Extension': string[]; + SmsSendLog: string[]; + SMSMessageTracking: any; + SMSSubscriptionLog: any; + TriggeredSendDataExtension: string[]; + }; + namespace dataRetentionPeriodUnitOfMeasureMapping { + let Days: number; + let Weeks: number; + let Months: number; + let Years: number; + } + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + CategoryID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriod: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodUnitOfMeasure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DeleteAtEndOfRetentionPeriod: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Fields: { + skipValidation: boolean; + }; + folderContentType: { + skipValidation: boolean; + }; + IsPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsSendable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsTestable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ResetRetentionPeriodOnImport: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RetainUntil: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RowBasedRetention: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SendableDataExtensionField.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SendableDataExtensionField.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SendableDataExtensionField.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendableSubscriberField: { + skipValidation: boolean; + }; + 'SendableSubscriberField.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Template.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Template.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Template.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_ContentType: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + r__dataExtensionTemplate_name: { + skipValidation: boolean; + }; + c__retentionPolicy: { + skipValidation: boolean; + }; + c__retainUntil: { + skipValidation: boolean; + }; + c__dataRetentionPeriodUnitOfMeasure: { + skipValidation: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=DataExtension.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map new file mode 100644 index 000000000..290e73d6f --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtension.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtension.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts b/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts new file mode 100644 index 000000000..8b4e09205 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts @@ -0,0 +1,121 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let filter: {}; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DataExtension.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DataExtension.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DataExtension.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultValue: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + FieldType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsPrimaryKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsRequired: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + MaxLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Ordinal: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Scale: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=DataExtensionField.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map new file mode 100644 index 000000000..68ca65388 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionField.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtensionField.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts b/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts new file mode 100644 index 000000000..f83811c34 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts @@ -0,0 +1,133 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let filter: {}; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsSendable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsTestable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendableCustomObjectField: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendableSubscriberField: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodUnitOfMeasure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RowBasedRetention: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ResetRetentionPeriodOnImport: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DeleteAtEndOfRetentionPeriod: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + RetainUntil: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=DataExtensionTemplate.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map new file mode 100644 index 000000000..30f5eb839 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionTemplate.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtensionTemplate.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts b/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts new file mode 100644 index 000000000..22143771d --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts @@ -0,0 +1,156 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let createdDateField: string; + let createdNameField: string; + let lastmodDateField: string; + let lastmodNameField: string; + let nameField: string; + let restPagination: boolean; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace createdBy { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace createdDate { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace dataExtractDefinitionId { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace dataExtractTypeId { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace dataFields { + let skipValidation: boolean; + } + namespace description { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace endDate { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + namespace fileSpec { + let isCreateable_6: boolean; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: boolean; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + namespace intervalType { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_7: boolean; + export { template_7 as template }; + } + namespace key { + let isCreateable_8: boolean; + export { isCreateable_8 as isCreateable }; + let isUpdateable_8: boolean; + export { isUpdateable_8 as isUpdateable }; + let retrieving_8: boolean; + export { retrieving_8 as retrieving }; + let template_8: boolean; + export { template_8 as template }; + } + namespace modifiedBy { + let isCreateable_9: boolean; + export { isCreateable_9 as isCreateable }; + let isUpdateable_9: boolean; + export { isUpdateable_9 as isUpdateable }; + let retrieving_9: boolean; + export { retrieving_9 as retrieving }; + let template_9: boolean; + export { template_9 as template }; + } + namespace modifiedDate { + let isCreateable_10: boolean; + export { isCreateable_10 as isCreateable }; + let isUpdateable_10: boolean; + export { isUpdateable_10 as isUpdateable }; + let retrieving_10: boolean; + export { retrieving_10 as retrieving }; + let template_10: boolean; + export { template_10 as template }; + } + namespace name { + let isCreateable_11: boolean; + export { isCreateable_11 as isCreateable }; + let isUpdateable_11: boolean; + export { isUpdateable_11 as isUpdateable }; + let retrieving_11: boolean; + export { retrieving_11 as retrieving }; + let template_11: boolean; + export { template_11 as template }; + } + namespace startDate { + let isCreateable_12: boolean; + export { isCreateable_12 as isCreateable }; + let isUpdateable_12: boolean; + export { isUpdateable_12 as isUpdateable }; + let retrieving_12: boolean; + export { retrieving_12 as retrieving }; + let template_12: boolean; + export { template_12 as template }; + } + namespace r__dataExtractType_name { + let skipValidation_1: boolean; + export { skipValidation_1 as skipValidation }; + } + } +} +export default _default; +//# sourceMappingURL=DataExtract.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map new file mode 100644 index 000000000..ee27b0599 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtract.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtract.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts b/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts new file mode 100644 index 000000000..a689dd1b1 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts @@ -0,0 +1,34 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace name { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace extractId { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + } +} +export default _default; +//# sourceMappingURL=DataExtractType.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map new file mode 100644 index 000000000..7ee37fb41 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtractType.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtractType.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts b/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts new file mode 100644 index 000000000..2553f2e57 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts @@ -0,0 +1,80 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let filter: {}; + let hasExtended: boolean; + let idField: string; + let keyField: string; + let keyIsFixed: boolean; + let maxKeyLength: number; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace id { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace key { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace name { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace description { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace createdDate { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace lastUpdated { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + } +} +export default _default; +//# sourceMappingURL=DeliveryProfile.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map new file mode 100644 index 000000000..fe52bac3e --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DeliveryProfile.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DeliveryProfile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts new file mode 100644 index 000000000..044abea44 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts @@ -0,0 +1,146 @@ +declare namespace _default { + let bodyIteratorField: any; + let dependencies: any[]; + let endPointMapping: { + Address: string; + Asset: string; + Automation: string; + Contacts: string; + Data: string; + Device: string; + Email: string; + Guide: string; + Hub: string; + Interaction: string; + 'Interaction-Experimental': string; + Legacy: string; + Messaging: string; + 'Messaging-Experimental': string; + OTT: string; + 'OTT-Experimental': string; + Platform: string; + 'Platform-Experimental': string; + Provisioning: string; + Push: string; + SMS: string; + }; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + basePath: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + baseUrl: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + discoveryVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + documentationLink: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + kind: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + methods: { + skipValidation: boolean; + }; + metadata: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metadata.supportsResponseEncoding': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + protocol: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + resources: { + skipValidation: boolean; + }; + rootUrl: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + schemas: { + skipValidation: boolean; + }; + servicePath: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + title: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + version: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=Discovery.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map new file mode 100644 index 000000000..5d2e545a8 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Discovery.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Discovery.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts new file mode 100644 index 000000000..e6247d6ea --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts @@ -0,0 +1,314 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let restPagination: any; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CharacterSet: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ClonedFromID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ContentAreas: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.CategoryID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.Content': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsBlank': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsDynamicContent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsLocked': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.IsSurvey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.Key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].CategoryID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].Content': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsBlank': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsDynamicContent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsLocked': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].IsSurvey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].Key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'ContentAreas[].PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ContentCheckStatus: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + EmailType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Folder: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HasDynamicSubjectLine: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HTMLBody: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsActive: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsHTMLPaste: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PreHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Subject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SyncTextWithHTML: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TextBody: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=Email.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map new file mode 100644 index 000000000..d2e2b699e --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Email.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Email.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts b/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts new file mode 100644 index 000000000..9638d3d7f --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts @@ -0,0 +1,582 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: string; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: any; + let maxKeyLength: number; + let type: string; + let soapType: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + Additional: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + AutoBccEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BccEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CCEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DeduplicateByEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.DomainType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.FooterContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.FooterSalutationSource': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.HeaderContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.HeaderSalutationSource': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.PrivateDomain': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.PrivateIP': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.SourceAddressType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DeliveryScheduledTime: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DomainType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DynamicEmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.Subject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.Status': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + EmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ExclusionFilter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FooterContentArea: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FooterSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HeaderContentArea: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HeaderSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IntegratedTracking: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + InteractionObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsMultipart: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSeedListSend: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSendLogging: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsWrapped: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Keyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + MessageDeliveryType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PreHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PrivateDomain: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PrivateIP: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToDisplayName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SeedListOccurance: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList.CustomObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendDefinitionList: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].CustomObjectID': { + skipValidation: boolean; + }; + 'SendDefinitionList[].SendDefinitionListType': { + skipValidation: boolean; + }; + 'SendDefinitionList[].DataSourceTypeID': { + skipValidation: boolean; + }; + 'SendDefinitionList[].IsTestObject': { + skipValidation: boolean; + }; + 'SendDefinitionList[].SalesForceObjectID': { + skipValidation: boolean; + }; + 'SendDefinitionList[].Name': { + skipValidation: boolean; + }; + 'SendDefinitionList[].r__dataExtension_Key': { + skipValidation: boolean; + }; + 'SendDefinitionList[].List.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].List.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendDefinitionList[].r__list_PathName': { + skipValidation: boolean; + }; + 'SenderProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.FromAddress': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.FromName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendLimit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowClose: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowDelete: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowOpen: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SourceAddressType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SuppressTracking: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TestEmailAddr: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TimeZone: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TrackingUsers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + r__asset_name_readOnly: { + skipValidation: boolean; + }; + r__asset_key: { + skipValidation: boolean; + }; + r__email_name: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + r__senderProfile_key: { + skipValidation: boolean; + }; + r__sendClassification_key: { + skipValidation: boolean; + }; + r__deliveryProfile_key: { + skipValidation: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=EmailSend.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map new file mode 100644 index 000000000..4c41f7b00 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EmailSend.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/EmailSend.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts new file mode 100644 index 000000000..a50b3719d --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts @@ -0,0 +1,867 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: string; + let lastmodDateField: string; + let lastmodNameField: string; + let restPagination: boolean; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let validTypes: string[]; + let fields: { + 'arguments.audienceCount': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.audienceDefinitionID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.audienceDescription': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.audienceSource': { + skipValidation: boolean; + }; + 'arguments.audienceName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.automationId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.buildAudienceDefinitionID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.contactAttributeGroup': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.contactAttributeId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.contactAttributeName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.criteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dataExtensionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dataTargetName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.formName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dateOffset': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dateOffsetUnit': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.dateType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.eid': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.eventDefinitionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.eventDefinitionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.mid': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.resetHighWatermark': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.serializedObjectType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.transactionKeyDataExtension': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.transactionKeyEvent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'arguments.useHighWatermark': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + automationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + category: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + configurationArguments: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dataExtensionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dataExtensionName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + disableDEDataLogging: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + eventDefinitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + filterDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + filterDefinitionTemplate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + iconUrl: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + interactionCount: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isVisibleInPicker: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.attributeName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.automationType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.categoryId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.folderPath': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.guidId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.isPlatformObject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastRunInstance': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastRunTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSaveDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSavedBy.email': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSavedBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.lastSavedBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.memberId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.modifiedDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.notifications': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.processes': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.schedule': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.createdBy': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.iCalRecur': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.lastUpdatedBy': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.scheduleState': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.scheduleStatus': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.timeZone': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduleObject.timeZoneId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.scheduledTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.selectedCategoryId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.selectedCategoryId[]': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.status': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.automationData.updateInProgress': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.criteriaDescription': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.customAttributeName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.formattedDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.formattedTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.icon': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.original_icon': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.isConfigured': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.runOnceScheduleMode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.scheduleFlowMode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.scheduleState': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.timeZone': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys.0': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys.0.from': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.transactionKeys.0.to': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + mode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + publishedInteractionCount: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledDayOfWeek': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledWeek': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.endDateTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.endType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.frequency': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.interval': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.occurrences': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.recurrencePattern': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.scheduledDay': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.startDateTime': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.timeZone': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.monday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.tuesday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.wednesday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.thursday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.friday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.saturday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schedule.sunday': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].dataType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].defaultValue': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].isDevicePreference': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].isNullable': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].isPrimaryKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].maxLength': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.fields[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.sendableCustomObjectField': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.sendableSubscriberField': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'schema.isPlatformObject': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sourceApplicationExtensionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__dataExtension_CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=Event.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map new file mode 100644 index 000000000..0a325c821 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Event.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Event.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts b/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts new file mode 100644 index 000000000..fedf92c3b --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts @@ -0,0 +1,68 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: any; + let createdNameField: any; + let lastmodDateField: any; + let lastmodNameField: any; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace id { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace locationTypeId { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace locationUrl { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace name { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace relPath { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + } +} +export default _default; +//# sourceMappingURL=FileLocation.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map new file mode 100644 index 000000000..cd784f34a --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileLocation.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/FileLocation.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts b/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts new file mode 100644 index 000000000..ed4736edb --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts @@ -0,0 +1,191 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace createdDate { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace customerKey { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace description { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace fileSpec { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace fileTransferLocationId { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace id { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + namespace isCompressed { + let isCreateable_6: boolean; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: boolean; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + namespace isEncrypted { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_7: boolean; + export { template_7 as template }; + } + namespace isFileSpecLocalized { + let isCreateable_8: boolean; + export { isCreateable_8 as isCreateable }; + let isUpdateable_8: boolean; + export { isUpdateable_8 as isUpdateable }; + let retrieving_8: boolean; + export { retrieving_8 as retrieving }; + let template_8: boolean; + export { template_8 as template }; + } + namespace isPgp { + let isCreateable_9: boolean; + export { isCreateable_9 as isCreateable }; + let isUpdateable_9: boolean; + export { isUpdateable_9 as isUpdateable }; + let retrieving_9: boolean; + export { retrieving_9 as retrieving }; + let template_9: boolean; + export { template_9 as template }; + } + namespace isUpload { + let isCreateable_10: boolean; + export { isCreateable_10 as isCreateable }; + let isUpdateable_10: boolean; + export { isUpdateable_10 as isUpdateable }; + let retrieving_10: boolean; + export { retrieving_10 as retrieving }; + let template_10: boolean; + export { template_10 as template }; + } + namespace maxFileAge { + let isCreateable_11: boolean; + export { isCreateable_11 as isCreateable }; + let isUpdateable_11: boolean; + export { isUpdateable_11 as isUpdateable }; + let retrieving_11: boolean; + export { retrieving_11 as retrieving }; + let template_11: boolean; + export { template_11 as template }; + } + namespace maxFileAgeScheduleOffset { + let isCreateable_12: boolean; + export { isCreateable_12 as isCreateable }; + let isUpdateable_12: boolean; + export { isUpdateable_12 as isUpdateable }; + let retrieving_12: boolean; + export { retrieving_12 as retrieving }; + let template_12: boolean; + export { template_12 as template }; + } + namespace maxImportFrequency { + let isCreateable_13: boolean; + export { isCreateable_13 as isCreateable }; + let isUpdateable_13: boolean; + export { isUpdateable_13 as isUpdateable }; + let retrieving_13: boolean; + export { retrieving_13 as retrieving }; + let template_13: boolean; + export { template_13 as template }; + } + namespace modifiedDate { + let isCreateable_14: boolean; + export { isCreateable_14 as isCreateable }; + let isUpdateable_14: boolean; + export { isUpdateable_14 as isUpdateable }; + let retrieving_14: boolean; + export { retrieving_14 as retrieving }; + let template_14: boolean; + export { template_14 as template }; + } + namespace name { + let isCreateable_15: boolean; + export { isCreateable_15 as isCreateable }; + let isUpdateable_15: boolean; + export { isUpdateable_15 as isUpdateable }; + let retrieving_15: boolean; + export { retrieving_15 as retrieving }; + let template_15: boolean; + export { template_15 as template }; + } + namespace publicKeyManagementId { + let isCreateable_16: boolean; + export { isCreateable_16 as isCreateable }; + let isUpdateable_16: boolean; + export { isUpdateable_16 as isUpdateable }; + let retrieving_16: boolean; + export { retrieving_16 as retrieving }; + let template_16: boolean; + export { template_16 as template }; + } + namespace r__fileLocation_name { + let skipValidation: boolean; + } + } +} +export default _default; +//# sourceMappingURL=FileTransfer.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map new file mode 100644 index 000000000..53b447267 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileTransfer.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/FileTransfer.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts new file mode 100644 index 000000000..5a4a12037 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts @@ -0,0 +1,147 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace categoryId { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace createdDate { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace customerKey { + let isCreateable_2: any; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace description { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace destinationObjectId { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace destinationTypeId { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + namespace filterActivityId { + let isCreateable_6: any; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: any; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + } + namespace filterDefinitionId { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + namespace modifiedDate { + let isCreateable_8: boolean; + export { isCreateable_8 as isCreateable }; + let isUpdateable_8: boolean; + export { isUpdateable_8 as isUpdateable }; + let retrieving_8: boolean; + export { retrieving_8 as retrieving }; + let template_7: boolean; + export { template_7 as template }; + } + namespace name { + let isCreateable_9: any; + export { isCreateable_9 as isCreateable }; + let isUpdateable_9: boolean; + export { isUpdateable_9 as isUpdateable }; + let retrieving_9: boolean; + export { retrieving_9 as retrieving }; + let template_8: boolean; + export { template_8 as template }; + } + namespace sourceObjectId { + let isCreateable_10: boolean; + export { isCreateable_10 as isCreateable }; + let isUpdateable_10: boolean; + export { isUpdateable_10 as isUpdateable }; + let retrieving_10: boolean; + export { retrieving_10 as retrieving }; + let template_9: boolean; + export { template_9 as template }; + } + namespace sourceTypeId { + let isCreateable_11: boolean; + export { isCreateable_11 as isCreateable }; + let isUpdateable_11: boolean; + export { isUpdateable_11 as isUpdateable }; + let retrieving_11: boolean; + export { retrieving_11 as retrieving }; + let template_10: boolean; + export { template_10 as template }; + } + namespace statusId { + let isCreateable_12: boolean; + export { isCreateable_12 as isCreateable }; + let isUpdateable_12: boolean; + export { isUpdateable_12 as isUpdateable }; + let retrieving_12: boolean; + export { retrieving_12 as retrieving }; + let template_11: boolean; + export { template_11 as template }; + } + } +} +export default _default; +//# sourceMappingURL=Filter.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map new file mode 100644 index 000000000..5db22cb9b --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Filter.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Filter.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts new file mode 100644 index 000000000..8b125445f --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts @@ -0,0 +1,174 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let subTypes: string[]; + let deployFolderTypes: string[]; + let deployFolderBlacklist: string[]; + let folderTypesFromParent: string[]; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let restPagination: boolean; + let type: string; + let soapType: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + $: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + '@_xsi:type': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ContentType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsActive: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsEditable: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AllowChildren: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'ParentFolder.Path': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Path: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + _generated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + catType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + parentCatId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=Folder.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map new file mode 100644 index 000000000..67ea36ba5 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Folder.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Folder.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts b/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts new file mode 100644 index 000000000..451574d2b --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts @@ -0,0 +1,306 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + namespace destinationObjectTypeMapping { + let unknown: number; + let DataExtension: number; + let List: number; + let SMS: number; + let Push: number; + } + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + namespace subscriberImportTypeMapping { + let DataExtension_1: number; + export { DataExtension_1 as DataExtension }; + export let Email: number; + } + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace updateTypeMapping { + let Add: number; + let AddUpdate: number; + let Overwrite: number; + let Update: number; + } + namespace blankFileProcessingTypeMapping { + let Fail: number; + let Process: number; + let Skip: number; + } + let fields: { + allowErrors: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + blankFileProcessingType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + customerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dateFormatLocale: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + deleteFile: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationObjectId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + destinationObjectTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + encodingName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fieldMappingType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fieldMappings: { + skipValidation: boolean; + }; + fileNamingPattern: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileTransferLocationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileTransferLocationName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileTransferLocationTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + fileType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + filter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + hasColumnHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + importDefinitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isOrderedImport: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isSequential: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxFileAgeHours: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxFileAgeScheduleOffsetHours: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + maxImportFrequencyHours: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + }; + notificationEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + otherDelimiter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sendEmailNotification: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + standardQuotedStrings: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + subscriberImportTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + updateTypeId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__dataAction: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'source.r__dataExtension_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.r__dataExtension_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.c__destinationType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'destination.r__list_PathName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'source.r__fileLocation_name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__subscriberImportType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__blankFileProcessing: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=ImportFile.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map new file mode 100644 index 000000000..327808834 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportFile.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/ImportFile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts new file mode 100644 index 000000000..405a9e6f6 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts @@ -0,0 +1,426 @@ +declare namespace _default { + let folderType: string; + let bodyIteratorField: string; + let dependencies: string[]; + let folderIdField: string; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace priorityMapping { + let High: number; + let Medium: number; + let Low: number; + } + let fields: { + activities: { + skipValidation: boolean; + }; + categoryId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + channel: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'defaults.email': { + skipValidation: boolean; + }; + 'defaults.mobileNumber': { + skipValidation: boolean; + }; + 'defaults.properties.analyticsTracking.enabled': { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + 'defaults.properties.analyticsTracking.analyticsType': { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + 'defaults.properties.analyticsTracking.urlDomainsToTrack': { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + entryMode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + executionMode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + exits: { + skipValidation: boolean; + }; + goals: { + skipValidation: boolean; + }; + healthStats: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastPublishedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'metaData.templateId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + scheduledStatus: { + isCreateable: any; + isUpdateable: any; + retrieving: any; + template: any; + }; + stats: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + triggers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].description': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].type': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].outcomes': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.startActivityKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.dequeueReason': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.lastExecutedActivityKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].arguments.filterResult': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.eventDataConfig': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.primaryObjectFilterCriteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.relatedObjectFilterCriteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.salesforceTriggerCriteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.objectAPIName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.version': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.contactKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.contactPersonType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.primaryObjectFilterSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.relatedObjectFilterSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.eventDataSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.evaluationCriteriaSummary': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.applicationExtensionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.passThroughArgument': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.filterDefinitionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.criteria': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].configurationArguments.schemaVersionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.sourceInteractionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.eventDefinitionId': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.eventDefinitionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.chainType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.configurationRequired': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.iconUrl': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'triggers[].metaData.title': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + version: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + workflowApiVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + metaData: { + skipValidation: boolean; + }; + notifiers: { + skipValidation: boolean; + }; + tags: { + skipValidation: boolean; + }; + r__folder_Path: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=Journey.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map new file mode 100644 index 000000000..c243959a7 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Journey.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Journey.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/List.definition.d.ts b/types/ts/lib/metadataTypes/definitions/List.definition.d.ts new file mode 100644 index 000000000..c452a4ece --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/List.definition.d.ts @@ -0,0 +1,118 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: string; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let restPagination: any; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + 'AutomatedEmail.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'AutomatedEmail.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'AutomatedEmail.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Category: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ListClassification: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ListName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=List.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map new file mode 100644 index 000000000..df1aa5d03 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"List.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/List.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts b/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts new file mode 100644 index 000000000..e1087fb58 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts @@ -0,0 +1,167 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + startDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + endDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordLimit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordsUsed: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + code: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + codeType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isShortCode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordsUsedOther: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isGsmCharacterSetOnly: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isMms: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isStackIndependant: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + supportsConcatenation: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isClientOwned: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isOwner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dipSwitches: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sendableCountries: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sendableCountries[].countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sendableCountries[].vendor': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'sendableCountries[].fromNameSupported': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + countryCode: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + moEngineVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=MobileCode.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map new file mode 100644 index 000000000..0f02645fa --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileCode.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/MobileCode.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts b/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts new file mode 100644 index 000000000..421e5c25e --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts @@ -0,0 +1,276 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: string; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__codeKeyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + startDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + endDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdBy: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'createdBy.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + dipSwitches: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isInherited: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + decodedId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + restriction: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + keywordType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + companyName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + responseMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + messages: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + code: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.code': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.endDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordLimit': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsed': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.codeType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isShortCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsedOther': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isGsmCharacterSetOnly': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isMms': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isStackIndependant': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.supportsConcatenation': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isClientOwned': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isOwner': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.dipSwitches': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.moEngineVersion': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=MobileKeyword.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map new file mode 100644 index 000000000..c3fb878e7 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileKeyword.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/MobileKeyword.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts b/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts new file mode 100644 index 000000000..0170d10e9 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts @@ -0,0 +1,783 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: any; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + allowSingleOptin: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + audience: { + skipValidation: boolean; + }; + 'audience[]': { + skipValidation: boolean; + }; + campaigns: { + skipValidation: boolean; + }; + 'campaigns[]': { + skipValidation: boolean; + }; + r__mobileCode_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.code': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.codeType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.createdDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.dipSwitches': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.endDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isClientOwned': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isGsmCharacterSetOnly': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isMms': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isOwner': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isShortCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.isStackIndependant': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordLimit': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsed': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.keywordsUsedOther': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.lastUpdated': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.moEngineVersion': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[]': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[].countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[].vendor': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.sendableCountries[].fromNameSupported': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.startDate': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'code.supportsConcatenation': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + concatenateMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + currentEditStep: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + doubleOptinConfirmMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + doubleOptinInitialMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + doubleOptinValidResponses: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + duplicateOptInResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + expireHours: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + fromName: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + id: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + invalidMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + isCertified: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isDuplicationAllowed: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isExpireSet: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isFromNameCertificationAccepted: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isSentImmediately: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isSubscriberResponseToAnySubscriptionForShortCode: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isSuppressMt: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isTest: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + isTimeZoneBased: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.id': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.isInherited': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.keyword': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.keywordType': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'keyword.restriction': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + lastUpdated: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + messageObjectId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + messagesPerPeriod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + minutesPerPeriod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + moStartDate: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + moEndDate: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'moTimezone.name': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'moTimezone.offset': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.key': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.createdDate': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.createdBy': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.lastUpdated': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.lastUpdatedBy': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.name': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.description': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.startDate': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.iCalRecur': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.timeZone': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'mtRecurrence.timeZoneId': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + mtSendDate: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + nextJob: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + nextKeyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + numberMessagesPerPeriod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinErrorMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinInvalidAgeMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinMinimumAge: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + optinType: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + origin: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + outboundSendBehaviorFlag: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + outboundSendTypeFlag: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + periodType: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + programId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + publishedMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + responseMessage: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + sendMethod: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + smsTriggeredSendDefinitionId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + statistics: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.sent': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.delivered': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.undelivered': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'statistics.outbound.unknown': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + statusId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.keyword': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.restriction': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptionKeyword.isInherited': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.keyword': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.restriction': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'nextKeyword.isInherited': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + subscriberResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyCorrectResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyIncorrectResponseMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyResponsesAllowed: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyTooManyEntriesMessage: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + surveyType: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.description': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.icon': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.id': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.lastUpdated': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + 'template.name': { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + text: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + triggeredSendId: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + triggeredSendName: { + isCreatable: boolean; + isUpdatable: boolean; + retrieving: boolean; + template: boolean; + }; + type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__campaign_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'r__campaign_key[]': { + skipValidation: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=MobileMessage.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map new file mode 100644 index 000000000..ea6197a18 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileMessage.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/MobileMessage.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts new file mode 100644 index 000000000..4fcc076f9 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts @@ -0,0 +1,203 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: string; + namespace filter { + let description: string[]; + } + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + namespace targetUpdateTypeMapping { + let Append: number; + let Overwrite: number; + let Update: number; + } + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + export namespace categoryId { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + export namespace createdDate { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + export namespace description_1 { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + export { description_1 as description }; + export namespace isFrozen { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + export namespace key { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + export namespace modifiedDate { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + export namespace name { + let isCreateable_6: boolean; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: boolean; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + export namespace queryDefinitionId { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_7: boolean; + export { template_7 as template }; + } + export namespace queryText { + let isCreateable_8: boolean; + export { isCreateable_8 as isCreateable }; + let isUpdateable_8: boolean; + export { isUpdateable_8 as isUpdateable }; + let retrieving_8: boolean; + export { retrieving_8 as retrieving }; + let template_8: boolean; + export { template_8 as template }; + } + export namespace targetDescription { + let isCreateable_9: boolean; + export { isCreateable_9 as isCreateable }; + let isUpdateable_9: boolean; + export { isUpdateable_9 as isUpdateable }; + let retrieving_9: boolean; + export { retrieving_9 as retrieving }; + let template_9: boolean; + export { template_9 as template }; + } + export namespace targetId { + let isCreateable_10: boolean; + export { isCreateable_10 as isCreateable }; + let isUpdateable_10: boolean; + export { isUpdateable_10 as isUpdateable }; + let retrieving_10: boolean; + export { retrieving_10 as retrieving }; + let template_10: boolean; + export { template_10 as template }; + } + export namespace targetKey { + let isCreateable_11: boolean; + export { isCreateable_11 as isCreateable }; + let isUpdateable_11: boolean; + export { isUpdateable_11 as isUpdateable }; + let retrieving_11: boolean; + export { retrieving_11 as retrieving }; + let template_11: boolean; + export { template_11 as template }; + } + export namespace targetName { + let isCreateable_12: boolean; + export { isCreateable_12 as isCreateable }; + let isUpdateable_12: boolean; + export { isUpdateable_12 as isUpdateable }; + let retrieving_12: boolean; + export { retrieving_12 as retrieving }; + let template_12: boolean; + export { template_12 as template }; + } + export namespace targetUpdateTypeId { + let isCreateable_13: boolean; + export { isCreateable_13 as isCreateable }; + let isUpdateable_13: boolean; + export { isUpdateable_13 as isUpdateable }; + let retrieving_13: boolean; + export { retrieving_13 as retrieving }; + let template_13: boolean; + export { template_13 as template }; + } + export namespace targetUpdateTypeName { + let isCreateable_14: boolean; + export { isCreateable_14 as isCreateable }; + let isUpdateable_14: boolean; + export { isUpdateable_14 as isUpdateable }; + let retrieving_14: boolean; + export { retrieving_14 as retrieving }; + let template_14: boolean; + export { template_14 as template }; + } + export namespace validatedQueryText { + let isCreateable_15: boolean; + export { isCreateable_15 as isCreateable }; + let isUpdateable_15: boolean; + export { isUpdateable_15 as isUpdateable }; + let retrieving_15: boolean; + export { retrieving_15 as retrieving }; + let template_15: boolean; + export { template_15 as template }; + } + export namespace r__dataExtension_key { + let isCreateable_16: boolean; + export { isCreateable_16 as isCreateable }; + let isUpdateable_16: boolean; + export { isUpdateable_16 as isUpdateable }; + let retrieving_16: boolean; + export { retrieving_16 as retrieving }; + let template_16: boolean; + export { template_16 as template }; + } + export namespace r__folder_Path { + let skipValidation: boolean; + } + } +} +export default _default; +//# sourceMappingURL=Query.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map new file mode 100644 index 000000000..0e0f8fd27 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Query.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Query.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts new file mode 100644 index 000000000..9b755897c --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts @@ -0,0 +1,108 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let deployBlacklist: string[]; + let documentInOneFile: boolean; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace CreatedDate { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace CustomerKey { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace Description { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace ModifiedDate { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace Name { + let isCreateable_4: any; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: any; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + } + namespace ObjectID { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace PartnerKey { + let isCreateable_6: boolean; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: boolean; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + namespace IsSystemDefined { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + namespace PermissionSets { + let retrieving_8: boolean; + export { retrieving_8 as retrieving }; + export let skipCache: boolean; + export let skipValidation: boolean; + } + namespace c__notAssignable { + let skipValidation_1: boolean; + export { skipValidation_1 as skipValidation }; + } + } +} +export default _default; +//# sourceMappingURL=Role.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map new file mode 100644 index 000000000..d0fdd257f --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Role.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Role.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts new file mode 100644 index 000000000..6f30423d1 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts @@ -0,0 +1,153 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: string; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let createdDateField: string; + let createdNameField: string; + let lastmodDateField: string; + let lastmodNameField: string; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace categoryId { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace createdBy { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace createdDate { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace description { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace folderLocationText { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace key { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + namespace modifiedBy { + let isCreateable_6: boolean; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: boolean; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + namespace modifiedDate { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_7: boolean; + export { template_7 as template }; + } + namespace name { + let isCreateable_8: boolean; + export { isCreateable_8 as isCreateable }; + let isUpdateable_8: boolean; + export { isUpdateable_8 as isUpdateable }; + let retrieving_8: boolean; + export { retrieving_8 as retrieving }; + let template_8: boolean; + export { template_8 as template }; + } + namespace script { + let isCreateable_9: boolean; + export { isCreateable_9 as isCreateable }; + let isUpdateable_9: boolean; + export { isUpdateable_9 as isUpdateable }; + let retrieving_9: boolean; + export { retrieving_9 as retrieving }; + let template_9: boolean; + export { template_9 as template }; + } + namespace ssjsActivityId { + let isCreateable_10: boolean; + export { isCreateable_10 as isCreateable }; + let isUpdateable_10: boolean; + export { isUpdateable_10 as isUpdateable }; + let retrieving_10: boolean; + export { retrieving_10 as retrieving }; + let template_10: boolean; + export { template_10 as template }; + } + namespace status { + let isCreateable_11: boolean; + export { isCreateable_11 as isCreateable }; + let isUpdateable_11: boolean; + export { isUpdateable_11 as isUpdateable }; + let retrieving_11: boolean; + export { retrieving_11 as retrieving }; + let template_11: boolean; + export { template_11 as template }; + } + namespace statusId { + let isCreateable_12: boolean; + export { isCreateable_12 as isCreateable }; + let isUpdateable_12: boolean; + export { isUpdateable_12 as isUpdateable }; + let retrieving_12: boolean; + export { retrieving_12 as retrieving }; + let template_12: boolean; + export { template_12 as template }; + } + namespace r__folder_Path { + let skipValidation: boolean; + } + } +} +export default _default; +//# sourceMappingURL=Script.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map new file mode 100644 index 000000000..c109b6504 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Script.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Script.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts b/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts new file mode 100644 index 000000000..0a299318e --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts @@ -0,0 +1,151 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let filter: {}; + let hasExtended: boolean; + let idField: string; + let keyField: string; + let keyIsFixed: boolean; + let maxKeyLength: number; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace sendClassificationTypeMapping { + let Commercial: string; + let Transactional: string; + } + let fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ArchiveEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DeliveryProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DeliveryProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'DeliveryProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + HonorPublicationListOptOutsForTransactionalSends: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendClassificationType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SenderProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SenderProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SenderProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SendPriority: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + c__classification: { + skipValidation: boolean; + }; + r__deliveryProfile_key: { + skipValidation: boolean; + }; + r__senderProfile_key: { + skipValidation: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=SendClassification.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map new file mode 100644 index 000000000..e531e22d1 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SendClassification.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/SendClassification.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts b/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts new file mode 100644 index 000000000..ce42d0aa7 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts @@ -0,0 +1,180 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let filter: {}; + let hasExtended: boolean; + let idField: string; + let keyField: string; + let keyIsFixed: boolean; + let maxKeyLength: number; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoForwardToEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoForwardToName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoForwardTriggeredSend: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoReply: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AutoReplyTriggeredSend: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodLength: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DataRetentionPeriodUnitOfMeasure: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DirectForward: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + FromAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + FromName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ReplyManagementRuleSet: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ReplyToAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ReplyToDisplayName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SenderHeaderEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + SenderHeaderName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + UseDefaultRMMRules: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=SenderProfile.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map new file mode 100644 index 000000000..7f723e9ac --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SenderProfile.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/SenderProfile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts b/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts new file mode 100644 index 000000000..aded749ff --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts @@ -0,0 +1,167 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requestId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + classification: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'content.customerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.dataExtension': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.r__dataExtension_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.list': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.r__list_PathName': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.autoAddSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.updateSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.trackLinks': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.cc': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.bcc': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.createJourney': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + journey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'journey.interactionKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__asset_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__journey_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=TransactionalEmail.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map new file mode 100644 index 000000000..66d8a26cf --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalEmail.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalEmail.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts b/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts new file mode 100644 index 000000000..0ee877033 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts @@ -0,0 +1,99 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: any[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace name { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace definitionKey { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace description { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace requestId { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace definitionId { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace status { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + namespace createdDate { + let isCreateable_6: boolean; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: boolean; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + namespace modifiedDate { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_7: boolean; + export { template_7 as template }; + } + } +} +export default _default; +//# sourceMappingURL=TransactionalMessage.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map new file mode 100644 index 000000000..34a85c99f --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalMessage.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalMessage.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts b/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts new file mode 100644 index 000000000..003e96dc8 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts @@ -0,0 +1,119 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requestId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'content.customerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + r__asset_key: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.badge': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.sound': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.customKeys': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.customKeys[].value': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'options.customKeys[].key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + applicationId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=TransactionalPush.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map new file mode 100644 index 000000000..3e87c9cac --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalPush.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalPush.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts b/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts new file mode 100644 index 000000000..30fcfb0e5 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts @@ -0,0 +1,113 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: boolean; + let restPageSize: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + let fields: { + name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + requestId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + definitionId: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + status: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + createdDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + modifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'content.message': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.shortCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.countryCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.autoAddSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.updateSubscriber': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.keyword': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'subscriptions.r__mobileKeyword_key': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=TransactionalSMS.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map new file mode 100644 index 000000000..6059b7b1e --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalSMS.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalSMS.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts b/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts new file mode 100644 index 000000000..019d56689 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts @@ -0,0 +1,560 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: string; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let folderIdField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: any; + let restPagination: any; + let maxKeyLength: number; + let type: string; + let soapType: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace priorityMapping { + let High: number; + let Medium: number; + let Low: number; + } + let fields: { + AllowedSlots: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + AutoAddSubscribers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + AutoUpdateSubscribers: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BatchInterval: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + BccEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CategoryID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CCEmail: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DataSchemas: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'DeliveryProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DisableOnEmailBuildError: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DomainType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DynamicEmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'Email.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + EmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ExclusionFilter: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ExclusionListCollection: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'FooterContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FooterSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + FromName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'HeaderContentArea.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + HeaderSalutationSource: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + InteractionObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsAlwaysOn: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsMultipart: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsPlatformObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsSendLogging: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + IsWrapped: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + KeepExistingEmailSubject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Keyword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'List.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'List.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'List.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + NewSlotTrigger: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ObjectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + OptionFlags: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + OptionFlagsUpdateMask: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + OptionVersion: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + PreHeader: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + Priority: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateDomain.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateDomain.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateIP.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'PrivateIP.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + RefreshContent: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + ReplyToDisplayName: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + RequestExpirationSeconds: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SendClassification.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.CustomerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + 'SenderProfile.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendLimit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendSourceCustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendSourceDataExtension: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowClose: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowDelete: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SendWindowOpen: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SourceAddressType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + SuppressTracking: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TestEmailAddr: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendClass: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendStatus: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendSubClass: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendType: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + TriggeredSendVersionID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + r__asset_name_readOnly: { + skipValidation: boolean; + }; + r__asset_key: { + skipValidation: boolean; + }; + r__email_name: { + skipValidation: boolean; + }; + r__folder_Path: { + skipValidation: boolean; + }; + r__list_PathName: { + skipValidation: boolean; + }; + c__priority: { + skipValidation: boolean; + }; + r__sendClassification_key: { + skipValidation: boolean; + }; + r__senderProfile_key: { + skipValidation: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=TriggeredSend.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map new file mode 100644 index 000000000..265fff45c --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TriggeredSend.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TriggeredSend.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/User.definition.d.ts b/types/ts/lib/metadataTypes/definitions/User.definition.d.ts new file mode 100644 index 000000000..0ad3264e3 --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/User.definition.d.ts @@ -0,0 +1,423 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let folderType: any; + let hasExtended: boolean; + let idField: string; + let keepId: boolean; + let keyIsFixed: boolean; + let keyField: string; + let nameField: string; + let createdDateField: string; + let createdNameField: any; + let lastmodDateField: string; + let lastmodNameField: string; + let maxKeyLength: number; + let type: string; + let soapType: string; + let typeDescription: string; + let typeName: string; + let typeRetrieveByDefault: boolean; + let documentInOneFile: boolean; + let stringifyFieldsBeforeTemplate: string[]; + let fields: { + AccountUserID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ActiveFlag: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + AssociatedBusinessUnits: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + BusinessUnit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ChallengeAnswer: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ChallengePhrase: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.ModifiedBy': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Client.PartnerClientKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CorrelationID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CreatedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + CustomerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultApplication: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultBusinessUnit: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + DefaultBusinessUnitObject: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Delete: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Email: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsAPIUser: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + IsLocked: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'LanguageLocale.LocaleCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + LastSuccessfulLogin: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Locale.LocaleCode': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Locale.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Locale.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ModifiedDate: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + MustChangePassword: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Name: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + NotificationEmailAddress: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + ObjectID: { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: any; + }; + ObjectState: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Owner: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerKey: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + PartnerProperties: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Password: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Roles: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'Roles.Role': { + skipValidation: boolean; + }; + 'Roles.Role[].Client': { + skipValidation: boolean; + }; + SsoIdentities: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SsoIdentities.SsoIdentity': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SsoIdentities.SsoIdentity[].IsActive': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'SsoIdentities.SsoIdentity[].FederatedID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.ID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.Name': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.ObjectID': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'TimeZone.PartnerKey': { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + Unlock: { + skipValidation: boolean; + isCreateable: boolean; + isUpdateable: boolean; + template: boolean; + }; + UserID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + UserPermissions: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.PartnerKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.ID': { + skipValidation: boolean; + }; + 'UserPermissions.ObjectID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Name': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Description': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions.Delete': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].PartnerKey': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].ID': { + skipValidation: boolean; + }; + 'UserPermissions[].ObjectID': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Name': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Value': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Description': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + 'UserPermissions[].Delete': { + isCreateable: any; + isUpdateable: any; + retrieving: boolean; + template: boolean; + }; + c__type: { + isCreateable: boolean; + isUpdateable: boolean; + retrieve: any; + template: boolean; + }; + c__AssociatedBusinessUnits: { + skipValidation: boolean; + }; + c__RoleNamesGlobal: { + skipValidation: boolean; + }; + c__LocaleCode: { + skipValidation: boolean; + }; + c__TimeZoneName: { + skipValidation: boolean; + }; + c__AccountUserID: { + isCreateable: boolean; + isUpdateable: boolean; + retrieve: any; + template: boolean; + }; + c__IsLocked_readOnly: { + isCreateable: boolean; + isUpdateable: boolean; + retrieve: any; + template: boolean; + }; + }; +} +export default _default; +//# sourceMappingURL=User.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map new file mode 100644 index 000000000..92f4c2e9c --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"User.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/User.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts b/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts new file mode 100644 index 000000000..b037dcd5c --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts @@ -0,0 +1,129 @@ +declare namespace _default { + let bodyIteratorField: string; + let dependencies: string[]; + let hasExtended: boolean; + let idField: string; + let keyIsFixed: boolean; + let keyField: string; + let createdDateField: any; + let createdNameField: string; + let lastmodDateField: any; + let lastmodNameField: any; + let nameField: string; + let restPagination: boolean; + let maxKeyLength: number; + let type: string; + let typeDescription: string; + let typeRetrieveByDefault: boolean; + let typeName: string; + namespace fields { + namespace createdBy { + let isCreateable: boolean; + let isUpdateable: boolean; + let retrieving: boolean; + let template: boolean; + } + namespace dataVerificationDefinitionId { + let isCreateable_1: boolean; + export { isCreateable_1 as isCreateable }; + let isUpdateable_1: boolean; + export { isUpdateable_1 as isUpdateable }; + let retrieving_1: boolean; + export { retrieving_1 as retrieving }; + let template_1: boolean; + export { template_1 as template }; + } + namespace notificationEmailAddress { + let isCreateable_2: boolean; + export { isCreateable_2 as isCreateable }; + let isUpdateable_2: boolean; + export { isUpdateable_2 as isUpdateable }; + let retrieving_2: boolean; + export { retrieving_2 as retrieving }; + let template_2: boolean; + export { template_2 as template }; + } + namespace notificationEmailMessage { + let isCreateable_3: boolean; + export { isCreateable_3 as isCreateable }; + let isUpdateable_3: boolean; + export { isUpdateable_3 as isUpdateable }; + let retrieving_3: boolean; + export { retrieving_3 as retrieving }; + let template_3: boolean; + export { template_3 as template }; + } + namespace shouldEmailOnFailure { + let isCreateable_4: boolean; + export { isCreateable_4 as isCreateable }; + let isUpdateable_4: boolean; + export { isUpdateable_4 as isUpdateable }; + let retrieving_4: boolean; + export { retrieving_4 as retrieving }; + let template_4: boolean; + export { template_4 as template }; + } + namespace shouldStopOnFailure { + let isCreateable_5: boolean; + export { isCreateable_5 as isCreateable }; + let isUpdateable_5: boolean; + export { isUpdateable_5 as isUpdateable }; + let retrieving_5: boolean; + export { retrieving_5 as retrieving }; + let template_5: boolean; + export { template_5 as template }; + } + namespace targetObjectId { + let isCreateable_6: boolean; + export { isCreateable_6 as isCreateable }; + let isUpdateable_6: boolean; + export { isUpdateable_6 as isUpdateable }; + let retrieving_6: boolean; + export { retrieving_6 as retrieving }; + let template_6: boolean; + export { template_6 as template }; + } + namespace value1 { + let isCreateable_7: boolean; + export { isCreateable_7 as isCreateable }; + let isUpdateable_7: boolean; + export { isUpdateable_7 as isUpdateable }; + let retrieving_7: boolean; + export { retrieving_7 as retrieving }; + let template_7: boolean; + export { template_7 as template }; + } + namespace value2 { + let isCreateable_8: boolean; + export { isCreateable_8 as isCreateable }; + let isUpdateable_8: boolean; + export { isUpdateable_8 as isUpdateable }; + let retrieving_8: boolean; + export { retrieving_8 as retrieving }; + let template_8: boolean; + export { template_8 as template }; + } + namespace verificationType { + let isCreateable_9: boolean; + export { isCreateable_9 as isCreateable }; + let isUpdateable_9: boolean; + export { isUpdateable_9 as isUpdateable }; + let retrieving_9: boolean; + export { retrieving_9 as retrieving }; + let template_9: boolean; + export { template_9 as template }; + } + namespace r__dataExtension_key { + let isCreateable_10: boolean; + export { isCreateable_10 as isCreateable }; + let isUpdateable_10: boolean; + export { isUpdateable_10 as isUpdateable }; + let retrieving_10: boolean; + export { retrieving_10 as retrieving }; + let template_10: boolean; + export { template_10 as template }; + } + } +} +export default _default; +//# sourceMappingURL=Verification.definition.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map new file mode 100644 index 000000000..a8230bbaf --- /dev/null +++ b/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Verification.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Verification.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/retrieveChangelog.d.ts b/types/ts/lib/retrieveChangelog.d.ts new file mode 100644 index 000000000..c1441fa8d --- /dev/null +++ b/types/ts/lib/retrieveChangelog.d.ts @@ -0,0 +1,3 @@ +#!/usr/bin/env node +export {}; +//# sourceMappingURL=retrieveChangelog.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/retrieveChangelog.d.ts.map b/types/ts/lib/retrieveChangelog.d.ts.map new file mode 100644 index 000000000..a45ee5547 --- /dev/null +++ b/types/ts/lib/retrieveChangelog.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"retrieveChangelog.d.ts","sourceRoot":"","sources":["../../../lib/retrieveChangelog.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/util/auth.d.ts b/types/ts/lib/util/auth.d.ts new file mode 100644 index 000000000..6df674726 --- /dev/null +++ b/types/ts/lib/util/auth.d.ts @@ -0,0 +1,41 @@ +export default Auth; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +declare namespace Auth { + /** + * For each business unit, set up base credentials to be used. + * + * @param {AuthObject} authObject details for + * @param {string} credential of the instance + * @returns {Promise.} - + */ + function saveCredential(authObject: import("../../types/mcdev.d.js").AuthObject, credential: string): Promise; + /** + * Returns an SDK instance to be used for API calls + * + * @param {BuObject} buObject information about current context + * @returns {SDK} auth object + */ + function getSDK(buObject: import("../../types/mcdev.d.js").BuObject): SDK; + /** + * helper to clear all auth sessions + * + * @returns {void} + */ + function clearSessions(): void; +} +//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/auth.d.ts.map b/types/ts/lib/util/auth.d.ts.map new file mode 100644 index 000000000..e3a845ee7 --- /dev/null +++ b/types/ts/lib/util/auth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../lib/util/auth.js"],"names":[],"mappings":";yBAMa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAYtD;;;;;;OAMG;IACH,oHA8BC;IACD;;;;;OAKG;IACH,0EAkBC;IACD;;;;OAIG;IACH,+BAGC"} \ No newline at end of file diff --git a/types/ts/lib/util/businessUnit.d.ts b/types/ts/lib/util/businessUnit.d.ts new file mode 100644 index 000000000..b87dd89c4 --- /dev/null +++ b/types/ts/lib/util/businessUnit.d.ts @@ -0,0 +1,21 @@ +export default BusinessUnit; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +declare namespace BusinessUnit { + function refreshBUProperties(properties: import("../../types/mcdev.d.js").Mcdevrc, credentialsName: string): Promise; +} +//# sourceMappingURL=businessUnit.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/businessUnit.d.ts.map b/types/ts/lib/util/businessUnit.d.ts.map new file mode 100644 index 000000000..00234a1f2 --- /dev/null +++ b/types/ts/lib/util/businessUnit.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"businessUnit.d.ts","sourceRoot":"","sources":["../../../../lib/util/businessUnit.js"],"names":[],"mappings":";yBAOa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAcjC,8HAqFpB"} \ No newline at end of file diff --git a/types/ts/lib/util/cache.d.ts b/types/ts/lib/util/cache.d.ts new file mode 100644 index 000000000..a55e75ece --- /dev/null +++ b/types/ts/lib/util/cache.d.ts @@ -0,0 +1,64 @@ +declare namespace _default { + function initCache(buObject: import("../../types/mcdev.d.js").BuObject): void; + function getCache(): { + [x: string]: { + [x: string]: any; + }; + }; + function clearCache(mid?: number): void; + function getByKey(type: string, key: string): any; + function setMetadata(type: string, metadataMap: { + [x: string]: any; + }): void; + function mergeMetadata(type: string, metadataMap: { + [x: string]: any; + }, overrideMID?: number): void; + /** + * standardized method for getting data from cache. + * + * @param {string} metadataType metadata type ie. query + * @param {string|number|boolean} searchValue unique identifier of metadata being looked for + * @param {string} searchField field name (key in object) which contains the unique identifer + * @param {string} returnField field which should be returned + * @param {number} [overrideMID] ignore currentMID and use alternative (for example parent MID) + * @returns {string} value of specified field. Error is thrown if not found + */ + function searchForField(metadataType: string, searchValue: string | number | boolean, searchField: string, returnField: string, overrideMID?: number): string; + /** + * standardized method for getting data from cache - adapted for special case of lists + * ! keeping this in util/cache.js rather than in metadataTypes/List.js to avoid potential circular dependencies + * + * @param {string} searchValue unique identifier of metadata being looked for + * @param {'ObjectID'|'ID'|'CustomerKey'} searchField ObjectID:string(uuid), ID:numeric, CustomerKey:string(name + folder ID) + * @returns {string} unique folderPath/ListName combo of list + */ + function getListPathName(searchValue: string, searchField: "ID" | "CustomerKey" | "ObjectID"): string; + /** + * standardized method for getting data from cache - adapted for special case of lists + * ! keeping this in util/cache.js rather than in metadataTypes/List.js to avoid potential circular dependencies + * + * @param {string} listPathName folderPath/ListName combo of list + * @param {'ObjectID'|'ID'|'CustomerKey'|'ListName'} returnField ObjectID:string(uuid), ID:numeric, CustomerKey:string(name + folder ID) + * @returns {string} unique ObjectId of list + */ + function getListObjectId(listPathName: string, returnField: "ID" | "CustomerKey" | "ObjectID" | "ListName"): string; +} +export default _default; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +//# sourceMappingURL=cache.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/cache.d.ts.map b/types/ts/lib/util/cache.d.ts.map new file mode 100644 index 000000000..0ae3124ad --- /dev/null +++ b/types/ts/lib/util/cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../lib/util/cache.js"],"names":[],"mappings":";IAkCe,8EAWV;IAMS;;;;MAA2B;IASzB,wCAG4D;IAU9D,kDAAmD;IAQhD;;aAEZ;IASc;;mCAUd;IACD;;;;;;;;;OASG;IACH,8JAgCC;IACD;;;;;;;OAOG;IACH,sGA4BC;IACD;;;;;;;OAOG;IACH,oHAyBC;;;yBArNQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY"} \ No newline at end of file diff --git a/types/ts/lib/util/cli.d.ts b/types/ts/lib/util/cli.d.ts new file mode 100644 index 000000000..de84d451a --- /dev/null +++ b/types/ts/lib/util/cli.d.ts @@ -0,0 +1,125 @@ +export default Cli; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +export type ExplainType = import('../../types/mcdev.d.js').ExplainType; +declare namespace Cli { + /** + * used when initially setting up a project. + * loads default config and adds first credential + * + * @returns {Promise.} success of init + */ + function initMcdevConfig(): Promise; + /** + * Extends template file for properties.json + * + * @param {Mcdevrc} properties config file's json + * @returns {Promise.} status + */ + function addExtraCredential(properties: import("../../types/mcdev.d.js").Mcdevrc): Promise; + /** + * + * @param {string[]} dependentTypes types that depent on type + * @returns {Promise.} true if user wants to continue with retrieve + */ + function postFixKeysReretrieve(dependentTypes: string[]): Promise; + /** + * helper that logs to cli which credentials are already existing in our config file + * + * @param {Mcdevrc} properties config file's json + * @returns {void} + */ + function logExistingCredentials(properties: import("../../types/mcdev.d.js").Mcdevrc): void; + /** + * Extends template file for properties.json + * update credentials + * + * @param {Mcdevrc} properties config file's json + * @param {string} credName name of credential that needs updating + * @param {boolean} [refreshBUs] if this was triggered by mcdev join, do not refresh BUs + * @returns {Promise.} success of update + */ + function updateCredential(properties: import("../../types/mcdev.d.js").Mcdevrc, credName: string, refreshBUs?: boolean): Promise; + /** + * Returns Object with parameters required for accessing API + * + * @param {Mcdevrc} properties object of all configuration including credentials + * @param {string} target code of BU to use + * @param {boolean | string} [isCredentialOnly] true:don't ask for BU | string: name of BU + * @param {boolean} [allowAll] Offer ALL as option in BU selection + * @returns {Promise.} credential to be used for Business Unit + */ + function getCredentialObject(properties: import("../../types/mcdev.d.js").Mcdevrc, target: string, isCredentialOnly?: string | boolean, allowAll?: boolean): Promise; + /** + * helps select the right credential in case of bad initial input + * + * @param {Mcdevrc} properties config file's json + * @param {string} [credential] name of valid credential + * @param {boolean} [isCredentialOnly] don't ask for BU if true + * @param {boolean} [allowAll] Offer ALL as option in BU selection + * @returns {Promise.<{businessUnit:string, credential:string}>} selected credential/BU combo + */ + function _selectBU(properties: import("../../types/mcdev.d.js").Mcdevrc, credential?: string, isCredentialOnly?: boolean, allowAll?: boolean): Promise<{ + businessUnit: string; + credential: string; + }>; + /** + * helper around _askCredentials + * + * @param {Mcdevrc} properties from config file + * @param {string} [credName] name of credential that needs updating + * @param {boolean} [refreshBUs] if this was triggered by mcdev join, do not refresh BUs + * @returns {Promise.} success of refresh or credential name + */ + function _setCredential(properties: import("../../types/mcdev.d.js").Mcdevrc, credName?: string, refreshBUs?: boolean): Promise; + /** + * helper for {@link Cli.addExtraCredential} + * + * @param {Mcdevrc} properties from config file + * @param {string} [credName] name of credential that needs updating + * @returns {Promise.} credential info + */ + function _askCredentials(properties: import("../../types/mcdev.d.js").Mcdevrc, credName?: string): Promise; + /** + * allows updating the metadata types that shall be retrieved + * + * @param {Mcdevrc} properties config file's json + * @param {string[]} [setTypesArr] skip user prompt and overwrite with this list if given + * @returns {Promise.} - + */ + function selectTypes(properties: import("../../types/mcdev.d.js").Mcdevrc, setTypesArr?: string[]): Promise; + /** + * helper for {@link Cli.selectTypes} that converts subtypes back to main type if all and only defaults were selected + * this keeps the config automatically upgradable when we add new subtypes or change what is selected by default + * + * @param {object} responses wrapper object for respones + * @param {string[]} responses.selectedTypes what types the user selected + * @param {string} type metadata type + * @returns {void} + */ + function _summarizeSubtypes(responses: { + selectedTypes: string[]; + }, type: string): void; + /** + * shows metadata type descriptions + * + * @returns {ExplainType[]} list of supported types with their apiNames + */ + function explainTypes(): import("../../types/mcdev.d.js").ExplainType[]; +} +//# sourceMappingURL=cli.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/cli.d.ts.map b/types/ts/lib/util/cli.d.ts.map new file mode 100644 index 000000000..a33ba8d11 --- /dev/null +++ b/types/ts/lib/util/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../lib/util/cli.js"],"names":[],"mappings":";yBAca,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;;IAQrD;;;;;OAKG;IACH,sDAQC;IACD;;;;;OAKG;IACH,6GAgBC;IAED;;;;OAIG;IACH,2EAgCC;IACD;;;;;OAKG;IACH,4FAOC;IACD;;;;;;;;OAQG;IACH,mJAQC;IACD;;;;;;;;OAQG;IACH,gNAqEC;IACD;;;;;;;;OAQG;IACH;;;OAsEC;IACD;;;;;;;OAOG;IACH,kJA4DC;IAED;;;;;;OAMG;IACH,gHAmFC;IACD;;;;;;OAMG;IACH,kHAmGC;IACD;;;;;;;;OAQG;IACH;;2BAsBC;IAED;;;;OAIG;IACH,wEAoGC"} \ No newline at end of file diff --git a/types/ts/lib/util/config.d.ts b/types/ts/lib/util/config.d.ts new file mode 100644 index 000000000..0780f909a --- /dev/null +++ b/types/ts/lib/util/config.d.ts @@ -0,0 +1,45 @@ +export default config; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +declare namespace config { + let properties: any; + /** + * loads central properties from config file + * + * @param {boolean} [silent] omit throwing errors and print messages; assuming not silent if not set + * @param {boolean} [isInit] don't tell the user to run init + * @returns {Promise.} central properties object + */ + function getProperties(silent?: boolean, isInit?: boolean): Promise; + /** + * check if the config file is correctly formatted and has values + * + * @param {Mcdevrc} properties javascript object in .mcdevrc.json + * @param {boolean} [silent] set to true for internal use w/o cli output + * @returns {Promise.} file structure ok OR list of fields to be fixed + */ + function checkProperties(properties: import("../../types/mcdev.d.js").Mcdevrc, silent?: boolean): Promise; + /** + * defines how the properties.json should look like + * used for creating a template and for checking if variables are set + * + * @returns {Promise.} default properties + */ + function getDefaultProperties(): Promise; +} +//# sourceMappingURL=config.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/config.d.ts.map b/types/ts/lib/util/config.d.ts.map new file mode 100644 index 000000000..217cd3bf5 --- /dev/null +++ b/types/ts/lib/util/config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../lib/util/config.js"],"names":[],"mappings":";yBASa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;;IAStD;;;;;;OAMG;IACH,8GAyDC;IACD;;;;;;OAMG;IACH,8HAmMC;IACD;;;;;OAKG;IACH,mFAcC"} \ No newline at end of file diff --git a/types/ts/lib/util/devops.d.ts b/types/ts/lib/util/devops.d.ts new file mode 100644 index 000000000..de4d798a8 --- /dev/null +++ b/types/ts/lib/util/devops.d.ts @@ -0,0 +1,62 @@ +export default DevOps; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +declare namespace DevOps { + /** + * Extracts the delta between a commit and the current state for deployment. + * Interactive commit selection if no commits are passed. + * + * @param {Mcdevrc} properties central properties object + * @param {string} [range] git commit range + * @param {boolean} [saveToDeployDir] if true, copy metadata changes into deploy directory + * @param {string} [filterPathsCSV] filter file paths that start with any specified path (comma separated) + * @param {number} [commitHistory] cli option to override default commit history value in config + * @returns {Promise.} - + */ + function getDeltaList(properties: import("../../types/mcdev.d.js").Mcdevrc, range?: string, saveToDeployDir?: boolean, filterPathsCSV?: string, commitHistory?: number): Promise; + /** + * wrapper around DevOps.getDeltaList, Builder.buildTemplate and M + * + * @param {Mcdevrc} properties project config file + * @param {string} range git commit range + * @param {DeltaPkgItem[]} [diffArr] instead of running git diff the method can also get a list of files to process + * @param {number} [commitHistory] cli option to override default commit history value in config + * @returns {Promise.} - + */ + function buildDeltaDefinitions(properties: import("../../types/mcdev.d.js").Mcdevrc, range: string, diffArr?: import("../../types/mcdev.d.js").DeltaPkgItem[], commitHistory?: number): Promise; + /** + * create markdown file for deployment listing + * + * @param {string} directory - + * @param {object} jsonReport - + * @returns {void} + */ + function document(directory: string, jsonReport: any): void; + /** + * should return only the json for all but asset, query and script that are saved as multiple files + * additionally, the documentation for dataExtension and automation should be returned + * + * @param {Mcdevrc} properties central properties object + * @param {BuObject} buObject references credentials + * @param {string} metadataType metadata type to build + * @param {string[]} keyArr customerkey of the metadata + * @returns {Promise.} list of all files that need to be committed in a flat array ['path/file1.ext', 'path/file2.ext'] + */ + function getFilesToCommit(properties: import("../../types/mcdev.d.js").Mcdevrc, buObject: import("../../types/mcdev.d.js").BuObject, metadataType: string, keyArr: string[]): Promise; +} +//# sourceMappingURL=devops.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/devops.d.ts.map b/types/ts/lib/util/devops.d.ts.map new file mode 100644 index 000000000..8e0a743df --- /dev/null +++ b/types/ts/lib/util/devops.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"devops.d.ts","sourceRoot":"","sources":["../../../../lib/util/devops.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAOtD;;;;;;;;;;OAUG;IACH,kOAqTC;IACD;;;;;;;;OAQG;IACH,iPA+KC;IAED;;;;;;OAMG;IACH,4DA2BC;IACD;;;;;;;;;OASG;IACH,gMAIC"} \ No newline at end of file diff --git a/types/ts/lib/util/file.d.ts b/types/ts/lib/util/file.d.ts new file mode 100644 index 000000000..452f27ee0 --- /dev/null +++ b/types/ts/lib/util/file.d.ts @@ -0,0 +1,20 @@ +export default FileFs; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +declare const FileFs: any; +//# sourceMappingURL=file.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/file.d.ts.map b/types/ts/lib/util/file.d.ts.map new file mode 100644 index 000000000..c27deb34b --- /dev/null +++ b/types/ts/lib/util/file.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../lib/util/file.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;AAsiB1D,0BAAkC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.config.d.ts b/types/ts/lib/util/init.config.d.ts new file mode 100644 index 000000000..7f3fb8bfa --- /dev/null +++ b/types/ts/lib/util/init.config.d.ts @@ -0,0 +1,66 @@ +export default Init; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +declare namespace Init { + /** + * helper method for this.upgradeProject that upgrades project config if needed + * + * @param {Mcdevrc} properties config file's json + * @returns {Promise.} returns true if worked without errors + */ + function fixMcdevConfig(properties: import("../../types/mcdev.d.js").Mcdevrc): Promise; + /** + * handles creation/update of all config file from the boilerplate + * + * @param {string} versionBeforeUpgrade 'x.y.z' + * @returns {Promise.} status of config file creation + */ + function createIdeConfigFiles(versionBeforeUpgrade: string): Promise; + /** + * recursive helper for {@link Init.fixMcdevConfig} that adds missing settings + * + * @param {object} propertiersCur current sub-object of project settings + * @param {object} defaultPropsCur current sub-object of default settings + * @param {string} fieldName dot-concatenated object-path that needs adding + * @returns {void} + */ + function _updateLeaf(propertiersCur: any, defaultPropsCur: any, fieldName: string): void; + /** + * returns list of files that need to be updated + * + * @param {string} projectVersion version found in config file of the current project + * @returns {Promise.} relevant files with path that need to be updated + */ + function _getForcedUpdateList(projectVersion: string): Promise; + /** + * handles creation/update of one config file from the boilerplate at a time + * + * @param {string[]} fileNameArr 0: path, 1: filename, 2: extension with dot + * @param {string[]} relevantForcedUpdates if fileNameArr is in this list we require an override + * @param {string} [boilerplateFileContent] in case we cannot copy files 1:1 this can be used to pass in content + * @returns {Promise.} install successful or error occured + */ + function _createIdeConfigFile(fileNameArr: string[], relevantForcedUpdates: string[], boilerplateFileContent?: string): Promise; + /** + * helper method for this.upgradeProject that upgrades project config if needed + * + * @returns {Promise.} returns true if worked without errors + */ + function upgradeAuthFile(): Promise; +} +//# sourceMappingURL=init.config.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/init.config.d.ts.map b/types/ts/lib/util/init.config.d.ts.map new file mode 100644 index 000000000..7e0b38cbb --- /dev/null +++ b/types/ts/lib/util/init.config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.config.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.config.js"],"names":[],"mappings":";yBAaa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAQtD;;;;;OAKG;IACH,gGA0LC;IAED;;;;;OAKG;IACH,8EA+DC;IACD;;;;;;;OAOG;IACH,yFAgBC;IACD;;;;;OAKG;IACH,yEAsBC;IACD;;;;;;;OAOG;IACH,yIAiEC;IACD;;;;OAIG;IACH,6CAuBC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.d.ts b/types/ts/lib/util/init.d.ts new file mode 100644 index 000000000..a70bc34ca --- /dev/null +++ b/types/ts/lib/util/init.d.ts @@ -0,0 +1,72 @@ +export default Init; +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +declare namespace Init { + /** + * Creates template file for properties.json + * + * @param {Mcdevrc} properties config file's json + * @param {string} [credentialName] identifying name of the installed package / project; if set, will update this credential + * @param {boolean} [refreshBUs] if this was triggered by mcdev join, do not refresh BUs + * @returns {Promise.} - + */ + function initProject(properties: import("../../types/mcdev.d.js").Mcdevrc, credentialName?: string, refreshBUs?: boolean): Promise; + /** + * Creates template file for properties.json + * + * @returns {Promise.} - + */ + function joinProject(): Promise; + /** + * helper for @initProject that optionally creates markets and market lists for all BUs + */ + function _initMarkets(): Promise; + /** + * helper for {@link Init.initProject} + * + * @param {string} bu cred/bu or cred/* or * + * @param {string} gitStatus signals what state the git repo is in + * @returns {Promise.} - + */ + function _downloadAllBUs(bu: string, gitStatus: string): Promise; + /** + * wrapper around npm dependency & configuration file setup + * + * @param {Mcdevrc} properties config file's json + * @param {boolean} [initial] print message if not part of initial setup + * @param {string} [repoName] if git URL was provided earlier, the repo name was extracted to use it for npm init + * @returns {Promise.} success flag + */ + function upgradeProject(properties: import("../../types/mcdev.d.js").Mcdevrc, initial?: boolean, repoName?: string): Promise; + /** + * check if git repo is being saved on a cloud service and warn the user + * + * @private + * @returns {Promise.} true if path is good; false if project seems to be in a cloud service folder + */ + function _checkPathForCloud(): Promise; + /** + * finds credentials that are set up in config but not in auth file + * + * @private + * @param {Mcdevrc} properties javascript object in .mcdevrc.json + * @returns {string[]} list of credential names + */ + function _getMissingCredentials(properties: import("../../types/mcdev.d.js").Mcdevrc): string[]; +} +//# sourceMappingURL=init.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/init.d.ts.map b/types/ts/lib/util/init.d.ts.map new file mode 100644 index 000000000..11b633749 --- /dev/null +++ b/types/ts/lib/util/init.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.js"],"names":[],"mappings":";yBAaa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAQtD;;;;;;;OAOG;IACH,yIAyKC;IAED;;;;OAIG;IACH,sCAyEC;IACD;;OAEG;IACH,uCAwDC;IACD;;;;;;OAMG;IACH,uEAgCC;IACD;;;;;;;OAOG;IACH,sIAqCC;IACD;;;;;OAKG;IACH,gDAgDC;IAED;;;;;;OAMG;IACH,gGAuBC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.git.d.ts b/types/ts/lib/util/init.git.d.ts new file mode 100644 index 000000000..12db60e37 --- /dev/null +++ b/types/ts/lib/util/init.git.d.ts @@ -0,0 +1,40 @@ +export default Init; +declare namespace Init { + /** + * check if git repo exists and otherwise create one + * + * @returns {Promise.<{status: string, repoName: string}>} success flag + */ + function initGitRepo(): Promise<{ + status: string; + repoName: string; + }>; + /** + * offer to push the new repo straight to the server + * + * @returns {Promise.} - + */ + function gitPush(): Promise; + /** + * offers to add the git remote origin + * + * @returns {Promise.} repo name (optionally) + */ + function _addGitRemote(): Promise; + /** + * checks global config and ask to config the user info and then store it locally + * + * @returns {Promise.} - + */ + function _updateGitConfigUser(): Promise; + /** + * retrieves the global user.name and user.email values + * + * @returns {Promise.<{'user.name': string, 'user.email': string}>} user.name and user.email + */ + function _getGitConfigUser(): Promise<{ + 'user.name': string; + 'user.email': string; + }>; +} +//# sourceMappingURL=init.git.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/init.git.d.ts.map b/types/ts/lib/util/init.git.d.ts.map new file mode 100644 index 000000000..7f119f07c --- /dev/null +++ b/types/ts/lib/util/init.git.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.git.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.git.js"],"names":[],"mappings":";;IAcI;;;;OAIG;IACH;;;OAyDC;IACD;;;;OAIG;IACH,kCAwCC;IACD;;;;OAIG;IACH,0CAgDC;IACD;;;;OAIG;IACH,+CAkEC;IACD;;;;OAIG;IACH;;;OAKC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.npm.d.ts b/types/ts/lib/util/init.npm.d.ts new file mode 100644 index 000000000..02d10378f --- /dev/null +++ b/types/ts/lib/util/init.npm.d.ts @@ -0,0 +1,24 @@ +export default Init; +declare namespace Init { + /** + * initiates npm project and then + * takes care of loading the pre-configured dependency list + * from the boilerplate directory to them as dev-dependencies + * + * @param {string} [repoName] if git URL was provided earlier, the repo name was extracted to use it for npm init + * @returns {Promise.} install successful or error occured + */ + function installDependencies(repoName?: string): Promise; + /** + * ensure we have certain default values in our config + * + * @param {object} [currentContent] what was read from existing package.json file + * @returns {Promise.<{script: object, author: string, license: string}>} extended currentContent + */ + function _getDefaultPackageJson(currentContent?: any): Promise<{ + script: any; + author: string; + license: string; + }>; +} +//# sourceMappingURL=init.npm.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/init.npm.d.ts.map b/types/ts/lib/util/init.npm.d.ts.map new file mode 100644 index 000000000..7b02de068 --- /dev/null +++ b/types/ts/lib/util/init.npm.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.npm.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.npm.js"],"names":[],"mappings":";;IAcI;;;;;;;OAOG;IACH,kEAsGC;IACD;;;;;OAKG;IACH;;;;OAwBC"} \ No newline at end of file diff --git a/types/ts/lib/util/util.d.ts b/types/ts/lib/util/util.d.ts new file mode 100644 index 000000000..6b972a563 --- /dev/null +++ b/types/ts/lib/util/util.d.ts @@ -0,0 +1,302 @@ +export namespace Util { + let isRunViaVSCodeExtension: boolean; + let authFileName: string; + let boilerplateDirectory: string; + let configFileName: string; + let defaultGitBranch: string; + let parentBuName: string; + let standardizedSplitChar: string; + let skipInteraction: SkipInteraction; + let packageJsonMcdev: any; + let OPTIONS: {}; + let changedKeysMap: {}; + /** + * helper that allows filtering an object by its keys + * + * @param {Object.} originalObj object that you want to filter + * @param {string[]} [whitelistArr] positive filter. if not provided, returns originalObj without filter + * @returns {Object.} filtered object that only contains keys you provided + */ + function filterObjByKeys(originalObj: { + [x: string]: any; + }, whitelistArr?: string[]): { + [x: string]: any; + }; + /** + * extended Array.includes method that allows check if an array-element starts with a certain string + * + * @param {string[]} arr your array of strigns + * @param {string} search the string you are looking for + * @returns {boolean} found / not found + */ + function includesStartsWith(arr: string[], search: string): boolean; + /** + * extended Array.includes method that allows check if an array-element starts with a certain string + * + * @param {string[]} arr your array of strigns + * @param {string} search the string you are looking for + * @returns {number} array index 0..n or -1 of not found + */ + function includesStartsWithIndex(arr: string[], search: string): number; + /** + * check if a market name exists in current mcdev config + * + * @param {string} market market localizations + * @param {Mcdevrc} properties local mcdev config + * @returns {boolean} found market or not + */ + function checkMarket(market: string, properties: import("../../types/mcdev.d.js").Mcdevrc): boolean; + /** + * ensure provided MarketList exists and it's content including markets and BUs checks out + * + * @param {string} mlName name of marketList + * @param {Mcdevrc} properties General configuration to be used in retrieve + */ + function verifyMarketList(mlName: string, properties: import("../../types/mcdev.d.js").Mcdevrc): void; + /** + * used to ensure the program tells surrounding software that an unrecoverable error occured + * + * @returns {void} + */ + function signalFatalError(): void; + /** + * SFMC accepts multiple true values for Boolean attributes for which we are checking here. + * The same problem occurs when evaluating boolean CLI flags + * + * @param {*} attrValue value + * @returns {boolean} attribute value == true ? true : false + */ + function isTrue(attrValue: any): boolean; + /** + * SFMC accepts multiple false values for Boolean attributes for which we are checking here. + * The same problem occurs when evaluating boolean CLI flags + * + * @param {*} attrValue value + * @returns {boolean} attribute value == false ? true : false + */ + function isFalse(attrValue: any): boolean; + /** + * helper for Mcdev.retrieve, Mcdev.retrieveAsTemplate and Mcdev.deploy + * + * @param {string} selectedType type or type-subtype + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {boolean} type ok or not + */ + function _isValidType(selectedType: string, handleOutside?: boolean): boolean; + /** + * helper that deals with extracting type and subtype + * + * @param {string} selectedType "type" or "type-subtype" + * @returns {{type:string, subType:string}} first elem is type, second elem is subType + */ + function getTypeAndSubType(selectedType: string): { + type: string; + subType: string; + }; + /** + * helper for getDefaultProperties() + * + * @returns {string[]} type choices + */ + function getRetrieveTypeChoices(): string[]; + function _createNewLoggerTransport(noLogFile?: boolean): any; + let loggerTransports: any; + let logger: Logger; + function startLogger(restart?: boolean, noLogFile?: boolean): void; + function metadataLogger(level: string, type: string, method: string, payload: any, source?: string): void; + function replaceByObject(str: any, obj: { + [x: string]: string; + }): any; + function inverseGet(objs: any, val: string | number): string; + /** + *helper for Mcdev.fixKeys. Retrieve dependent metadata + * + * @param {string} fixedType type of the metadata passed as a parameter to fixKeys function + * @returns {string[]} array of types that depend on the given type + */ + function getDependentMetadata(fixedType: string): string[]; + /** + * Returns Order in which metadata needs to be retrieved/deployed + * + * @param {string[]} metadataTypes which should be retrieved/deployed + * @returns {Object.} retrieve/deploy order as array + */ + function getMetadataHierachy(metadataTypes: string[]): { + [x: string]: string[]; + }; + /** + * let's you dynamically walk down an object and get a value + * + * @param {string} path 'fieldA.fieldB.fieldC' + * @param {object} obj some parent object + * @returns {any} value of obj.path + */ + function resolveObjPath(path: string, obj: any): any; + /** + * helper to run other commands as if run manually by user + * + * @param {string} cmd to be executed command + * @param {string[]} [args] list of arguments + * @param {boolean} [hideOutput] if true, output of command will be hidden from CLI + * @returns {string|void} output of command if hideOutput is true + */ + function execSync(cmd: string, args?: string[], hideOutput?: boolean): string | void; + /** + * standardize check to ensure only one result is returned from template search + * + * @param {MetadataTypeItem[]} results array of metadata + * @param {string} keyToSearch the field which contains the searched value + * @param {string} searchValue the value which is being looked for + * @returns {MetadataTypeItem} metadata to be used in building template + */ + function templateSearchResult(results: any[], keyToSearch: string, searchValue: string): any; + /** + * configures what is displayed in the console + * + * @param {object} argv list of command line parameters given by user + * @param {boolean} [argv.silent] only errors printed to CLI + * @param {boolean} [argv.verbose] chatty user CLI output + * @param {boolean} [argv.debug] enables developer output & features + * @returns {void} + */ + function setLoggingLevel(argv: { + silent?: boolean; + verbose?: boolean; + debug?: boolean; + }): void; + /** + * outputs a warning that the given type is still in beta + * + * @param {string} type api name of the type thats in beta + */ + function logBeta(type: string): void; + namespace color { + let reset: string; + let dim: string; + let bright: string; + let underscore: string; + let blink: string; + let reverse: string; + let hidden: string; + let fgBlack: string; + let fgRed: string; + let fgGreen: string; + let fgYellow: string; + let fgBlue: string; + let fgMagenta: string; + let fgCyan: string; + let fgWhite: string; + let fgGray: string; + let bgBlack: string; + let bgRed: string; + let bgGreen: string; + let bgYellow: string; + let bgBlue: string; + let bgMagenta: string; + let bgCyan: string; + let bgWhite: string; + let bgGray: string; + } + /** + * helper that wraps a message in the correct color codes to have them printed gray + * + * @param {string} msg log message that should be wrapped with color codes + * @returns {string} gray msg + */ + function getGrayMsg(msg: string): string; + /** + * helper to print the subtypes we filtered by + * + * @param {string[]} subTypeArr list of subtypes to be printed + * @returns {void} + */ + function logSubtypes(subTypeArr: string[]): void; + /** + * helper to print the subtypes we filtered by + * + * @param {string[] | string} keyArr list of subtypes to be printed + * @param {boolean} [isId] optional flag to indicate if key is an id + * @returns {string} string to be appended to log message + */ + function getKeysString(keyArr: string | string[], isId?: boolean): string; + /** + * pause execution of code; useful when multiple server calls are dependent on each other and might not be executed right away + * + * @param {number} ms time in miliseconds to wait + * @returns {Promise.} - promise to wait for + */ + function sleep(ms: number): Promise; + /** + * helper for Asset.extractCode and Script.prepExtractedCode to determine if a code block is a valid SSJS block + * + * @example the following is invalid: + * + * + * + * the following is valid: + * + * @param {string} code code block to check + * @returns {string} the SSJS code if code block is a valid SSJS block, otherwise null + */ + function getSsjs(code: string): string; + /** + * allows us to filter just like with SQL's LIKE operator + * + * @param {string} testString field value to test + * @param {string} search search string in SQL LIKE format + * @returns {boolean} true if testString matches search + */ + function stringLike(testString: string, search: string): boolean; + /** + * returns true if no LIKE filter is defined or if all filters match + * + * @param {MetadataTypeItem} metadata a single metadata item + * @param {object} [filters] only used in recursive calls + * @returns {boolean} true if no LIKE filter is defined or if all filters match + */ + function fieldsLike(metadata: any, filters?: any): boolean; + /** + * helper used by SOAP methods to ensure the type always uses an upper-cased first letter + * + * @param {string} str string to capitalize + * @returns {string} str with first letter capitalized + */ + function capitalizeFirstLetter(str: string): string; + /** + * helper for Retriever and Deployer class + * + * @param {string[]} typeArr - + * @param {string[]} keyArr - + * @param {boolean} [returnEmpty] returns array with null element if false/not set; Retriever needs this to be false; Deployer needs it to be true + * @returns {TypeKeyCombo} - + */ + function createTypeKeyCombo(typeArr: string[], keyArr: string[], returnEmpty?: boolean): any; +} +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type McdevLogger = import('../../types/mcdev.d.js').McdevLogger; +export type Logger = import('../../types/mcdev.d.js').Logger; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SkipInteraction = import('../../types/mcdev.d.js').SkipInteraction; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +export type SDKError = import('../../types/mcdev.d.js').SDKError; +//# sourceMappingURL=util.d.ts.map \ No newline at end of file diff --git a/types/ts/lib/util/util.d.ts.map b/types/ts/lib/util/util.d.ts.map new file mode 100644 index 000000000..309f9679e --- /dev/null +++ b/types/ts/lib/util/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG;IACH,sGAqCC;IACD;;;;OAIG;IACH,kCAGC;IACD;;;;;;OAMG;IACH,yCAEC;IACD;;;;;;OAMG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,8EAkBC;IAED;;;;;OAKG;IACH;;;MASC;IAED;;;;OAIG;IACH,4CAyBC;IAO0B,6DAmE1B;;gBAMS,MAAM;IAUH,mEA8EZ;IAWe,0GAef;IASgB;;YAyBhB;IASW,6DAOX;IAED;;;;;OAKG;IACH,2DAiBC;IAED;;;;;OAKG;IACH;;MAqFC;IAED;;;;;;OAMG;IACH,qDAEC;IACD;;;;;;;OAOG;IACH,qFAqBC;IACD;;;;;;;OAOG;IACH,6FAYC;IACD;;;;;;;;OAQG;IACH;;;;aAyBC;IACD;;;;OAIG;IACH,qCAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BD;;;;;OAKG;IACH,yCAEC;IACD;;;;;OAKG;IACH,iDAQC;IACD;;;;;;OAMG;IACH,0EAcC;IACD;;;;;OAKG;IACH,0CAIC;IACD;;;;;;;;;;;;;;;;;OAiBG;IACH,uCA0BC;IACD;;;;;;OAMG;IACH,iEAaC;IACD;;;;;;OAMG;IACH,2DA6BC;IACD;;;;;OAKG;IACH,oDAEC;IACD;;;;;;;OAOG;IACH,6FAaC;;yBA16BQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file diff --git a/types/ts/types/mcdev.d.d.ts b/types/ts/types/mcdev.d.d.ts new file mode 100644 index 000000000..81b0f03d8 --- /dev/null +++ b/types/ts/types/mcdev.d.d.ts @@ -0,0 +1,1268 @@ +declare const _default: {}; +export default _default; +export type BuObject = { + /** + * installed package client id + */ + clientId?: string; + /** + * installed package client secret + */ + clientSecret?: string; + /** + * subdomain part of Authentication Base Uri + */ + tenant?: string; + /** + * Enterprise ID = MID of the parent BU + */ + eid?: number; + /** + * MID of the BU to work with + */ + mid?: number; + /** + * name of the BU to interact with + */ + businessUnit?: string; + /** + * name of the credential to interact with + */ + credential?: string; +}; +export type TemplateMap = { + [x: string]: string; +}; +export type SupportedMetadataTypes = 'asset' | 'asset-archive' | 'asset-asset' | 'asset-audio' | 'asset-block' | 'asset-code' | 'asset-document' | 'asset-image' | 'asset-message' | 'asset-other' | 'asset-rawimage' | 'asset-template' | 'asset-textfile' | 'asset-video' | 'attributeGroup' | 'attributeSet' | 'automation' | 'campaign' | 'contentArea' | 'dataExtension' | 'dataExtensionField' | 'dataExtensionTemplate' | 'dataExtract' | 'dataExtractType' | 'discovery' | 'deliveryProfile' | 'email' | 'emailSend' | 'event' | 'fileLocation' | 'fileTransfer' | 'filter' | 'folder' | 'importFile' | 'journey' | 'list' | 'mobileCode' | 'mobileKeyword' | 'mobileMessage' | 'query' | 'role' | 'script' | 'sendClassification' | 'senderProfile' | 'transactionalEmail' | 'transactionalPush' | 'transactionalSMS' | 'triggeredSend' | 'user' | 'verification'; +/** + * object-key=metadata type, value=array of external keys + */ +export type TypeKeyCombo = any; +/** + * generic metadata item + */ +export type MetadataTypeItem = any; +/** + * key=customer key + */ +export type MetadataTypeMap = { + [x: string]: MetadataTypeItem; +}; +/** + * key=Supported MetadataType + */ +export type MultiMetadataTypeMap = { + [x: string]: MetadataTypeMap; +}; +/** + * key=Supported MetadataType + */ +export type MultiMetadataTypeList = { + [x: string]: MetadataTypeItem[]; +}; +export type MetadataTypeMapObj = { + metadata: MetadataTypeMap; + type: string; +}; +export type MetadataTypeItemObj = { + metadata: MetadataTypeItem; + type: string; +}; +/** + * key=MID + */ +export type Cache = { + [x: number]: MultiMetadataTypeMap; +}; +/** + * used during update + */ +export type MetadataTypeItemDiff = { + before: MetadataTypeItem; + after: MetadataTypeItem; +}; +export type CodeExtractItem = { + /** + * metadata of one item w/o code + */ + json: MetadataTypeItem; + /** + * list of code snippets in this item + */ + codeArr: CodeExtract[]; + /** + * mostly set to null, otherwise list of subfolders + */ + subFolder: string[]; +}; +export type CodeExtract = { + /** + * mostly set to null, otherwise subfolders path split into elements + */ + subFolder: string[]; + /** + * name of file w/o extension + */ + fileName: string; + /** + * file extension + */ + fileExt: string; + /** + * file content + */ + content: string; + /** + * optional for binary files + */ + encoding?: 'base64'; +}; +export type QueryItem = { + /** + * name + */ + name: string; + /** + * key + */ + key: string; + /** + * - + */ + description: string; + /** + * Object ID of DE (removed before save) + */ + targetId?: string; + /** + * key of target data extension + */ + targetKey: string; + /** + * key of target data extension + */ + r__dataExtension_key: string; + /** + * e.g. "2020-09-14T01:42:03.017" + */ + createdDate: string; + /** + * e.g. "2020-09-14T01:42:03.017" + */ + modifiedDate: string; + /** + * defines how the query writes into the target data extension + */ + targetUpdateTypeName: 'Overwrite' | 'Update' | 'Append'; + /** + * 0|1|2, mapped to targetUpdateTypeName via this.definition.targetUpdateTypeMapping + */ + targetUpdateTypeId?: number; + /** + * Description DE (removed before save) + */ + targetDescription?: string; + /** + * looks like this is always set to false + */ + isFrozen: boolean; + /** + * contains SQL query with line breaks converted to '\n'. The content is extracted during retrieval and written into a separate *.sql file + */ + queryText?: string; + /** + * holds folder ID, replaced with r__folder_Path during retrieve + */ + categoryId?: string; + /** + * folder path in which this DE is saved + */ + r__folder_Path: string; + /** + * Object ID of query + */ + queryDefinitionId?: string; +}; +export type QueryMap = { + [x: string]: QueryItem; +}; +export type ScriptItem = { + /** + * name + */ + name: string; + /** + * key + */ + key: string; + /** + * - + */ + description: string; + /** + * e.g. "2020-09-14T01:42:03.017" + */ + createdDate: string; + /** + * e.g. "2020-09-14T01:42:03.017" + */ + modifiedDate: string; + /** + * contains script with line breaks converted to '\n'. The content is extracted during retrieval and written into a separate *.ssjs file + */ + script?: string; + /** + * holds folder ID, replaced with r__folder_Path during retrieve + */ + categoryId?: string; + /** + * folder path in which this DE is saved + */ + r__folder_Path: string; +}; +export type ScriptMap = { + [x: string]: ScriptItem; +}; +export type AssetItem = { + [x: string]: any; +}; +export type AssetMap = { + [x: string]: AssetItem; +}; +export type AssetSubType = 'archive' | 'asset' | 'audio' | 'block' | 'code' | 'document' | 'image' | 'message' | 'other' | 'rawimage' | 'template' | 'textfile' | 'video'; +export type DataExtensionFieldItem = { + /** + * id + */ + ObjectID?: string; + /** + * key in format [DEkey].[FieldName] + */ + CustomerKey?: string; + /** + * - + */ + DataExtension?: { + CustomerKey: string; + }; + /** + * name of field + */ + Name: string; + /** + * custom attribute that is only used when trying to rename a field from Name to Name_new + */ + Name_new?: string; + /** + * empty string for not set + */ + DefaultValue: string; + /** + * - + */ + IsRequired: true | false; + /** + * opposite of IsRequired + */ + IsNullable?: true | false; + /** + * - + */ + IsPrimaryKey: true | false; + /** + * 1, 2, 3, ... + */ + Ordinal: number; + /** + * can only be set on create + */ + FieldType: 'Text' | 'Number' | 'Date' | 'Boolean' | 'Decimal' | 'EmailAddress' | 'Phone' | 'Locale'; + /** + * field length + */ + MaxLength: number | string; + /** + * the number of places after the decimal that the field can hold; example: "0","1", ... + */ + Scale: string; +}; +export type DataExtensionFieldMap = { + [x: string]: DataExtensionFieldItem; +}; +export type DataExtensionItem = { + /** + * key + */ + CustomerKey: string; + /** + * name + */ + Name: string; + /** + * - + */ + Description: string; + /** + * iso format + */ + CreatedDate?: string; + /** + * iso format + */ + ModifiedDate?: string; + /** + * - + */ + IsSendable: true | false; + /** + * - + */ + IsTestable: true | false; + /** + * - + */ + SendableDataExtensionField: { + Name: string; + }; + /** + * - + */ + SendableSubscriberField: { + Name: string; + }; + /** + * list of DE fields + */ + Fields: DataExtensionFieldItem[]; + /** + * retrieved from associated folder + */ + r__folder_ContentType: 'dataextension' | 'salesforcedataextension' | 'synchronizeddataextension' | 'shared_dataextension' | 'shared_salesforcedataextension'; + /** + * folder path in which this DE is saved + */ + r__folder_Path: string; + /** + * holds folder ID, replaced with r__folder_Path during retrieve + */ + CategoryID?: string; + /** + * name of optionally associated DE template + */ + r__dataExtensionTemplate_name?: string; + /** + * - + */ + Template?: { + CustomerKey?: string; + }; + /** + * empty string or US date + 12:00:00 AM + */ + RetainUntil: string; + /** + * YYYY-MM-DD + */ + c__retainUntil: string; + /** + * readable name of retention policy + */ + c__retentionPolicy?: 'none' | 'allRecordsAndDataextension' | 'allRecords' | 'individialRecords'; + /** + * number of days/weeks/months/years before retention kicks in + */ + DataRetentionPeriodLength?: number; + /** + * 3:Days, 4:Weeks, 5:Months, 6:Years + */ + DataRetentionPeriodUnitOfMeasure?: number; + /** + * 3:Days, 4:Weeks, 5:Months, 6:Years + */ + c__dataRetentionPeriodUnitOfMeasure?: string; + /** + * true for retention policy individialRecords + */ + RowBasedRetention?: boolean; + /** + * ? + */ + ResetRetentionPeriodOnImport: boolean; + /** + * true for retention policy allRecords + */ + DeleteAtEndOfRetentionPeriod?: boolean; +}; +export type DataExtensionMap = { + [x: string]: DataExtensionItem; +}; +export type UserDocument = { + /** + * - + */ + TYPE: 'User' | 'Installed Package' | 'Inactivated User'; + /** + * equal to UserID; optional in update/create calls + */ + ID?: string; + /** + * equal to ID; required in update/create calls + */ + UserID: string; + /** + * user.AccountUserID + */ + AccountUserID?: number; + /** + * copy of AccountUserID + */ + c__AccountUserID: number; + /** + * user.CustomerKey + */ + CustomerKey: string; + /** + * user.Name + */ + Name: string; + /** + * user.Email + */ + Email: string; + /** + * user.NotificationEmailAddress + */ + NotificationEmailAddress: string; + /** + * user.ActiveFlag === true ? '✓' : '-' + */ + ActiveFlag: boolean; + /** + * user.IsAPIUser === true ? '✓' : '-' + */ + IsAPIUser: boolean; + /** + * user.MustChangePassword === true ? '✓' : '-' + */ + MustChangePassword: boolean; + /** + * default MID; BUName after we resolved it + */ + DefaultBusinessUnit: number; + /** + * associatedBus + */ + c__AssociatedBusinessUnits: number[]; + /** + * (API only) + */ + Roles?: { + Role?: object[]; + }; + /** + * roles + */ + c__RoleNamesGlobal: string[]; + /** + * userPermissions + */ + UserPermissions: string[]; + /** + * this.timeSinceDate(user.LastSuccessfulLogin) + */ + LastSuccessfulLogin: string; + /** + * user.CreatedDate + */ + CreatedDate: string; + /** + * user.ModifiedDate + */ + ModifiedDate: string; + /** + * - + */ + Client: { + ID?: number; + ModifiedBy?: number; + }; + /** + * - + */ + c__type: 'User' | 'Installed Package'; + /** + * (API only) + */ + IsLocked?: boolean | string; + /** + * used to unlock a user that has IsLocked === true + */ + Unlock?: boolean; + /** + * copy of IsLocked + */ + c__IsLocked_readOnly: boolean; + /** + * name of timezone + */ + c__TimeZoneName: string; + /** + * (API only) + */ + TimeZone?: { + Name?: string; + ID?: string; + }; + /** + * only used to set the password. cannot be retrieved + */ + Password?: string; + /** + * fr-CA, en-US, ... + */ + c__LocaleCode: 'en-US' | 'fr-CA' | 'fr-FR' | 'de-DE' | 'it-IT' | 'ja-JP' | 'pt-BR' | 'es-419' | 'es-ES'; + /** + * (API only) + */ + Locale?: { + LocaleCode?: 'en-US' | 'fr-CA' | 'fr-FR' | 'de-DE' | 'it-IT' | 'ja-JP' | 'pt-BR' | 'es-419' | 'es-ES'; + }; + /** + * - + */ + SsoIdentity?: object; + /** + * - + */ + SsoIdentities?: any[] | object; +}; +export type UserDocumentDiff = { + before: UserDocument; + after: UserDocument; +}; +/** + * key=customer key + */ +export type UserDocumentMap = { + [x: string]: UserDocument; +}; +export type UserDocumentDocument = UserDocument & object; +export type AccountUserConfiguration = { + /** + * wrapper + */ + Client: { + ID: number; + }; + /** + * empty string + */ + PartnerKey?: string; + /** + * User ID e.g:717133502 + */ + ID: number | string; + /** + * empty string + */ + ObjectID?: string; + /** + * 0,1 + */ + Delete?: number; + /** + * - + */ + BusinessUnitAssignmentConfiguration: BusinessUnitAssignmentConfiguration; +}; +export type BusinessUnitAssignmentConfiguration = { + /** + * wrapper + */ + BusinessUnitIds: { + BusinessUnitId: number[] | number; + }; + /** + * assign BU if false, remove assignment if true + */ + IsDelete: boolean; +}; +export type AutomationActivity = { + /** + * key of associated activity + */ + r__key: string; + /** + * name (not key) of associated activity + */ + name?: string; + /** + * Id of assoicated activity type; see this.definition.activityTypeMapping + */ + objectTypeId?: number; + /** + * Object Id of assoicated metadata item + */ + activityObjectId?: string; + /** + * order within step; starts with 1 or higher number + */ + displayOrder?: number; + /** + * see this.definition.activityTypeMapping + */ + r__type: string; +}; +export type AutomationStep = { + /** + * description + */ + name: string; + /** + * equals AutomationStep.name + */ + annotation?: string; + /** + * step iterator; starts with 1 + */ + step?: number; + /** + * step iterator, automatically set during deployment + */ + stepNumber?: number; + /** + * - + */ + activities: AutomationActivity[]; +}; +/** + * REST format + */ +export type AutomationSchedule = { + /** + * equals schedule.scheduleTypeId; upsert endpoint requires scheduleTypeId. retrieve endpoint returns typeId + */ + typeId: number; + /** + * equals schedule.typeId; upsert endpoint requires scheduleTypeId. retrieve endpoint returns typeId + */ + scheduleTypeId?: number; + /** + * example: '2021-05-07T09:00:00' + */ + startDate: string; + /** + * example: '2021-05-07T09:00:00' + */ + endDate: string; + /** + * example: 'FREQ=DAILY;UNTIL=20790606T160000;INTERVAL=1' + */ + icalRecur: string; + /** + * example: 'W. Europe Standard Time'; see this.definition.timeZoneMapping + */ + timezoneName: string; + /** + * see this.definition.timeZoneMapping + */ + timezoneId?: number; + /** + * ? + */ + rangeTypeId?: number; + /** + * ? + */ + pattern?: any; + /** + * ? + */ + scheduledTime?: any; + /** + * ? + */ + scheduledStatus?: string; +}; +/** + * SOAP format + */ +export type AutomationScheduleSoap = { + /** + * 'Minutely'|'Hourly'|'Daily'|'Weekly'|'Monthly'|'Yearly' + */ + RecurrenceType?: string; + /** + * - + */ + Recurrence: { + $?: object; + YearlyRecurrencePatternType?: 'ByYear'; + MonthlyRecurrencePatternType?: 'ByMonth'; + WeeklyRecurrencePatternType?: 'ByWeek'; + DailyRecurrencePatternType?: 'ByDay'; + MinutelyRecurrencePatternType?: 'Interval'; + HourlyRecurrencePatternType?: 'Interval'; + YearInterval?: number; + MonthInterval?: number; + WeekInterval?: number; + DayInterval?: number; + HourInterval?: number; + MinuteInterval?: number; + }; + /** + * internal variable for CLI output only + */ + _interval?: number; + /** + * - + */ + TimeZone: { + ID: number; + IDSpecified?: true; + }; + /** + * internal variable for CLI output only + */ + _timezoneString?: string; + /** + * AutomationSchedule.startDate + */ + StartDateTime: string; + /** + * AutomationSchedule.startDate; internal variable for CLI output only + */ + _StartDateTime?: string; + /** + * AutomationSchedule.endDate + */ + EndDateTime?: string; + /** + * set to 'EndOn' if AutomationSchedule.icalRecur contains 'UNTIL'; otherwise to 'EndAfter' + */ + RecurrenceRangeType: 'EndOn' | 'EndAfter'; + /** + * only exists if RecurrenceRangeType=='EndAfter' + */ + Occurrences?: number; +}; +export type AutomationItem = { + /** + * Object Id + */ + id: string; + /** + * legacy Object Id - used for handling notifications + */ + legacyId?: string; + /** + * Object Id as returned by SOAP API + */ + ObjectID?: string; + /** + * legacy id + */ + programId?: string; + /** + * key (Rest API) + */ + key: string; + /** + * key (SOAP API) + */ + CustomerKey?: string; + /** + * name (Rest API) + */ + name?: string; + /** + * name (SOAP API) + */ + Name?: string; + /** + * notifications + */ + notifications?: any; + /** + * - + */ + description?: string; + /** + * Starting Source = Schedule / File Drop + */ + type?: 'scheduled' | 'triggered'; + /** + * automation status + */ + status?: 'Scheduled' | 'Running' | 'Ready' | 'Building' | 'PausedSchedule' | 'InactiveTrigger'; + /** + * automation status + */ + statusId?: number; + /** + * only existing if type=scheduled + */ + schedule?: AutomationSchedule; + /** + * only existing if type=triggered + */ + fileTrigger?: { + fileNamingPattern: string; + fileNamePatternTypeId: number; + folderLocationText: string; + isPublished: boolean; + queueFiles: boolean; + triggerActive: boolean; + }; + /** + * - + */ + startSource?: { + schedule?: AutomationSchedule; + fileDrop?: { + fileNamePattern: string; + fileNamePatternTypeId: number; + folderLocation: string; + queueFiles: boolean; + }; + typeId: number; + }; + /** + * - + */ + steps?: AutomationStep[]; + /** + * folder path + */ + r__folder_Path?: string; + /** + * holds folder ID, replaced with r__folder_Path during retrieve + */ + categoryId?: string; +}; +export type VerificationItem = { + /** + * ID / Key + */ + dataVerificationDefinitionId: string; + /** + * key + */ + verificationType: 'IsEqualTo' | 'IsLessThan' | 'IsGreaterThan' | 'IsOutsideRange' | 'IsInsideRange' | 'IsNotEqualTo' | 'IsNotLessThan' | 'IsNotGreaterThan' | 'IsNotOutsideRange' | 'IsNotInsideRange'; + /** + * used for all verificationTypes; lower value for IsOutsideRange, IsInsideRange, IsNotOutsideRange, IsNotInsideRange + */ + value1: number; + /** + * only used for IsOutsideRange, IsInsideRange, IsNotOutsideRange, IsNotInsideRange; otherwise set to 0 + */ + value2: number; + /** + * flag to stop automation if verification fails + */ + shouldStopOnFailure: boolean; + /** + * flag to send email if verification fails + */ + shouldEmailOnFailure: boolean; + /** + * email address to send notification to; empty string if shouldEmailOnFailure=false + */ + notificationEmailAddress: string; + /** + * email message to send; empty string if shouldEmailOnFailure=false + */ + notificationEmailMessage: string; + /** + * user id of creator + */ + createdBy: number; + /** + * ObjectID of target data extension + */ + targetObjectId?: string; + /** + * key of target data extension + */ + r__dataExtension_key: string; +}; +export type AutomationMap = { + [x: string]: AutomationItem; +}; +export type AutomationMapObj = { + metadata: AutomationMap; + type: string; +}; +export type AutomationItemObj = { + metadata: object | AutomationItem; + type: string; +}; +export type McdevDeltaPkgItem = { + /** + * relative path to file + */ + file: string; + /** + * changed lines + */ + changes: number; + /** + * added lines + */ + insertions: number; + /** + * deleted lines + */ + deletions: number; + /** + * is a binary file + */ + binary: boolean; + /** + * git thinks this file was moved + */ + moved: boolean; + /** + * git thinks this relative path is where the file was before + */ + fromPath?: string; + /** + * metadata type + */ + type: string; + /** + * key + */ + externalKey: string; + /** + * name + */ + name: string; + /** + * what git recognized as an action + */ + gitAction: 'move' | 'add/update' | 'delete'; + /** + * mcdev credential name + */ + _credential: string; + /** + * mcdev business unit name inside of _credential + */ + _businessUnit: string; +}; +export type DeltaPkgItem = import('simple-git').DiffResultTextFile & McdevDeltaPkgItem; +export type SDKauth = any; +export type SDKrest = any; +export type SDKsoap = any; +export type RestError = any; +export type SOAPError = any; +export type SDKError = SOAPError & RestError; +export type SDK = { + /** + * SDKauth + */ + auth: any; + /** + * SDKrest + */ + rest: any; + /** + * SDKsoap + */ + soap: any; +}; +/** + * signals what to insert automatically for things usually asked via wizard + */ +export type SkipInteraction = { + /** + * client id of installed package + */ + client_id?: string; + /** + * client secret of installed package + */ + client_secret?: string; + /** + * tenant specific auth url of installed package + */ + auth_url?: string; + /** + * MID of the Parent Business Unit + */ + account_id?: number; + /** + * how you would like the credential to be named + */ + credentialName?: string; + /** + * URL of Git remote server + */ + gitRemoteUrl?: string; + /** + * will trigger re-downloading latest versions of dependent types after fixing keys + */ + fixKeysReretrieve?: boolean; + /** + * used by mcdev init to directly push to a remote + */ + gitPush?: string; + /** + * used by mcdev init to directly push to a remote + */ + developmentBu?: string; + /** + * used by mcdev init to directly push to a remote + */ + downloadBUs?: string; +}; +export type AuthObject = { + /** + * client_id client_id for sfmc-sdk auth + */ + client_id: string; + /** + * client_secret for sfmc-sdk auth + */ + client_secret: string; + /** + * mid of business unit to auth against + */ + account_id: number; + /** + * authentication base url + */ + auth_url: string; +}; +export type SoapRequestParams = { + /** + * request id + */ + continueRequest?: string; + /** + * additional options (CallsInConversation, Client, ConversationID, Priority, RequestType, SaveOptions, ScheduledTime, SendResponseTo, SequenceCode) + */ + options?: object; + /** + * ? + */ + clientIDs?: any; + /** + * simple or complex + * complex + */ + filter?: SoapSDKFilter; + /** + * all BUs or just one + */ + QueryAllAccounts?: boolean; +}; +export type SoapFilterSimple = { + /** + * field + */ + property: string; + /** + * various options + */ + simpleOperator: 'equals' | 'notEquals' | 'isNull' | 'isNotNull' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between' | 'IN' | 'in' | 'like'; + /** + * field value + */ + value?: string | number | boolean | string[] | number[]; +}; +export type SoapFilterComplex = { + /** + * string for simple or a new filter-object for complex + */ + leftOperand: SoapSDKFilter; + /** + * various options + */ + logicalOperator: 'AND' | 'OR'; + /** + * string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ + rightOperand: SoapSDKFilter; +}; +export type SoapSDKFilterSimple = { + /** + * string for simple or a new filter-object for complex + */ + leftOperand: SoapFilterSimple["property"]; + /** + * various options + */ + operator: SoapFilterSimple["simpleOperator"]; + /** + * string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ + rightOperand?: SoapFilterSimple["value"]; +}; +export type SoapSDKFilterComplex = { + /** + * string for simple or a new filter-object for complex + */ + leftOperand: SoapFilterComplex["leftOperand"]; + /** + * various options + */ + operator: SoapFilterComplex["logicalOperator"]; + /** + * string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ + rightOperand: SoapFilterComplex["rightOperand"]; +}; +export type SoapSDKFilter = SoapSDKFilterSimple | SoapSDKFilterComplex; +export type AssetRequestParams = { + /** + * request id + */ + continueRequest?: string; + /** + * additional options (CallsInConversation, Client, ConversationID, Priority, RequestType, SaveOptions, ScheduledTime, SendResponseTo, SequenceCode) + */ + options?: object; + /** + * ? + * complex + */ + clientIDs?: any; + /** + * pagination + */ + page?: object; + /** + * list of fields we want returned + */ + fields?: string[]; + /** + * pagination + */ + sort?: { + property: string; + direction: 'ASC' | 'DESC'; + }[]; + /** + * simple or complex filter + */ + query?: AssetFilter | AssetFilterSimple; +}; +export type AssetFilter = { + /** + * string for simple or a new filter-object for complex + */ + leftOperand: AssetFilter | AssetFilterSimple; + /** + * various options + */ + logicalOperator: 'AND' | 'OR'; + /** + * string for simple or a new filter-object for complex; omit for isNull and isNotNull + */ + rightOperand?: SoapSDKFilter | AssetFilterSimple; +}; +export type AssetFilterSimple = { + /** + * field + */ + property: string; + /** + * various options + */ + simpleOperator: 'equal' | 'notEquals' | 'isNull' | 'isNotNull' | 'greaterThan' | 'lessThan' | 'greaterThanOrEqual' | 'lessThanOrEqual' | 'between' | 'IN' | 'in' | 'like'; + /** + * field value + */ + value: string | number | boolean | any[]; +}; +export type Mcdevrc = { + /** + * list of credentials + */ + credentials: object; + /** + * configure options for mcdev + */ + options: object; + /** + * configure directories for mcdev to read/write to + */ + directories: { + businessUnits: string; + deploy: string; + docs: string; + retrieve: string; + template: string; + templateBuilds: string; + }; + /** + * templating variables grouped by markets + */ + markets: { + [x: string]: object; + }; + /** + * combination of markets and BUs for streamlined deployments + */ + marketList: object; + /** + * templating variables grouped by markets + */ + metaDataTypes: { + retrieve: string[]; + documentOnRetrieve: string[]; + }; + /** + * mcdev version that last updated the config file + */ + version: string; +}; +export type LoggerLevel = 'error' | 'verbose' | 'info' | 'debug'; +export type McdevLogger = { + /** + * (msg) print info message + */ + level?: LoggerLevel; + /** + * (msg) print error message + */ + error: Function; + /** + * (ex, msg) print error with trace message + */ + errorStack: Function; +}; +export type Logger = import('winston').Logger & McdevLogger; +export type ExplainType = { + /** + * readable name of type + */ + name: string; + /** + * api parameter name for type + */ + apiName: string; + /** + * more info on what this type is about + */ + description: string; + /** + * is it retrieved by default OR list of subtypes that are retrieved by default + */ + retrieveByDefault: boolean | string[]; + /** + * supported features + */ + supports: { + retrieve: boolean; + create: boolean; + update: boolean; + delete: boolean; + changeKey: boolean; + buildTemplate: boolean; + retrieveAsTemplate: boolean; + }; +}; +//# sourceMappingURL=mcdev.d.d.ts.map \ No newline at end of file diff --git a/types/ts/types/mcdev.d.d.ts.map b/types/ts/types/mcdev.d.d.ts.map new file mode 100644 index 000000000..9393413d6 --- /dev/null +++ b/types/ts/types/mcdev.d.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mcdev.d.d.ts","sourceRoot":"","sources":["../../mcdev.d.js"],"names":[],"mappings":";;;;;;eAEc,MAAM;;;;mBACN,MAAM;;;;aACN,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;mBACN,MAAM;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= Date: Thu, 23 May 2024 12:22:46 +0200 Subject: [PATCH 292/359] #1110: add reference to d.ts file --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index d0cd62ebb..d218e3393 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "rest" ], "main": "./lib/index.js", + "types": "./types/lib/index.d.ts", "exports": { ".": { "default": "./lib/index.js" From 7dd682cd071fb8f2b599dd6bc950d641a6d11a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 14:18:36 +0200 Subject: [PATCH 293/359] #1110: define types location in package.json > exports --- .husky/pre-commit | 2 +- {types/ts => @types}/lib/Builder.d.ts | 0 @types/lib/Builder.d.ts.map | 1 + {types/ts => @types}/lib/Deployer.d.ts | 0 @types/lib/Deployer.d.ts.map | 1 + {types/ts => @types}/lib/MetadataTypeDefinitions.d.ts | 0 @types/lib/MetadataTypeDefinitions.d.ts.map | 1 + {types/ts => @types}/lib/MetadataTypeInfo.d.ts | 0 @types/lib/MetadataTypeInfo.d.ts.map | 1 + {types/ts => @types}/lib/Retriever.d.ts | 0 @types/lib/Retriever.d.ts.map | 1 + {types/ts => @types}/lib/cli.d.ts | 0 @types/lib/cli.d.ts.map | 1 + {types/ts => @types}/lib/index.d.ts | 0 @types/lib/index.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Asset.d.ts | 0 @types/lib/metadataTypes/Asset.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/AttributeGroup.d.ts | 0 @types/lib/metadataTypes/AttributeGroup.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/AttributeSet.d.ts | 0 @types/lib/metadataTypes/AttributeSet.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Automation.d.ts | 0 @types/lib/metadataTypes/Automation.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Campaign.d.ts | 0 @types/lib/metadataTypes/Campaign.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/ContentArea.d.ts | 0 @types/lib/metadataTypes/ContentArea.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/DataExtension.d.ts | 0 @types/lib/metadataTypes/DataExtension.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/DataExtensionField.d.ts | 0 @types/lib/metadataTypes/DataExtensionField.d.ts.map | 1 + .../ts => @types}/lib/metadataTypes/DataExtensionTemplate.d.ts | 0 @types/lib/metadataTypes/DataExtensionTemplate.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/DataExtract.d.ts | 0 @types/lib/metadataTypes/DataExtract.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/DataExtractType.d.ts | 0 @types/lib/metadataTypes/DataExtractType.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/DeliveryProfile.d.ts | 0 @types/lib/metadataTypes/DeliveryProfile.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Discovery.d.ts | 0 @types/lib/metadataTypes/Discovery.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Email.d.ts | 0 @types/lib/metadataTypes/Email.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/EmailSend.d.ts | 0 @types/lib/metadataTypes/EmailSend.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Event.d.ts | 0 @types/lib/metadataTypes/Event.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/FileLocation.d.ts | 0 @types/lib/metadataTypes/FileLocation.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/FileTransfer.d.ts | 0 @types/lib/metadataTypes/FileTransfer.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Filter.d.ts | 0 @types/lib/metadataTypes/Filter.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Folder.d.ts | 0 @types/lib/metadataTypes/Folder.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/ImportFile.d.ts | 0 @types/lib/metadataTypes/ImportFile.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Journey.d.ts | 0 @types/lib/metadataTypes/Journey.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/List.d.ts | 0 @types/lib/metadataTypes/List.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/MetadataType.d.ts | 0 @types/lib/metadataTypes/MetadataType.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/MobileCode.d.ts | 0 @types/lib/metadataTypes/MobileCode.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/MobileKeyword.d.ts | 0 @types/lib/metadataTypes/MobileKeyword.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/MobileMessage.d.ts | 0 @types/lib/metadataTypes/MobileMessage.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Query.d.ts | 0 @types/lib/metadataTypes/Query.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Role.d.ts | 0 @types/lib/metadataTypes/Role.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Script.d.ts | 0 @types/lib/metadataTypes/Script.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/SendClassification.d.ts | 0 @types/lib/metadataTypes/SendClassification.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/SenderProfile.d.ts | 0 @types/lib/metadataTypes/SenderProfile.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/TransactionalEmail.d.ts | 0 @types/lib/metadataTypes/TransactionalEmail.d.ts.map | 1 + .../ts => @types}/lib/metadataTypes/TransactionalMessage.d.ts | 0 @types/lib/metadataTypes/TransactionalMessage.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/TransactionalPush.d.ts | 0 @types/lib/metadataTypes/TransactionalPush.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/TransactionalSMS.d.ts | 0 @types/lib/metadataTypes/TransactionalSMS.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/TriggeredSend.d.ts | 0 @types/lib/metadataTypes/TriggeredSend.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/User.d.ts | 0 @types/lib/metadataTypes/User.d.ts.map | 1 + {types/ts => @types}/lib/metadataTypes/Verification.d.ts | 0 @types/lib/metadataTypes/Verification.d.ts.map | 1 + .../lib/metadataTypes/definitions/Asset.definition.d.ts | 0 @types/lib/metadataTypes/definitions/Asset.definition.d.ts.map | 1 + .../metadataTypes/definitions/AttributeGroup.definition.d.ts | 0 .../definitions/AttributeGroup.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/AttributeSet.definition.d.ts | 0 .../metadataTypes/definitions/AttributeSet.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Automation.definition.d.ts | 0 .../metadataTypes/definitions/Automation.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Campaign.definition.d.ts | 0 .../lib/metadataTypes/definitions/Campaign.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/ContentArea.definition.d.ts | 0 .../metadataTypes/definitions/ContentArea.definition.d.ts.map | 1 + .../metadataTypes/definitions/DataExtension.definition.d.ts | 0 .../definitions/DataExtension.definition.d.ts.map | 1 + .../definitions/DataExtensionField.definition.d.ts | 0 .../definitions/DataExtensionField.definition.d.ts.map | 1 + .../definitions/DataExtensionTemplate.definition.d.ts | 0 .../definitions/DataExtensionTemplate.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/DataExtract.definition.d.ts | 0 .../metadataTypes/definitions/DataExtract.definition.d.ts.map | 1 + .../metadataTypes/definitions/DataExtractType.definition.d.ts | 0 .../definitions/DataExtractType.definition.d.ts.map | 1 + .../metadataTypes/definitions/DeliveryProfile.definition.d.ts | 0 .../definitions/DeliveryProfile.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Discovery.definition.d.ts | 0 .../metadataTypes/definitions/Discovery.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Email.definition.d.ts | 0 @types/lib/metadataTypes/definitions/Email.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/EmailSend.definition.d.ts | 0 .../metadataTypes/definitions/EmailSend.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Event.definition.d.ts | 0 @types/lib/metadataTypes/definitions/Event.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/FileLocation.definition.d.ts | 0 .../metadataTypes/definitions/FileLocation.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/FileTransfer.definition.d.ts | 0 .../metadataTypes/definitions/FileTransfer.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Filter.definition.d.ts | 0 .../lib/metadataTypes/definitions/Filter.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Folder.definition.d.ts | 0 .../lib/metadataTypes/definitions/Folder.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/ImportFile.definition.d.ts | 0 .../metadataTypes/definitions/ImportFile.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Journey.definition.d.ts | 0 .../lib/metadataTypes/definitions/Journey.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/List.definition.d.ts | 0 @types/lib/metadataTypes/definitions/List.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/MobileCode.definition.d.ts | 0 .../metadataTypes/definitions/MobileCode.definition.d.ts.map | 1 + .../metadataTypes/definitions/MobileKeyword.definition.d.ts | 0 .../definitions/MobileKeyword.definition.d.ts.map | 1 + .../metadataTypes/definitions/MobileMessage.definition.d.ts | 0 .../definitions/MobileMessage.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Query.definition.d.ts | 0 @types/lib/metadataTypes/definitions/Query.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Role.definition.d.ts | 0 @types/lib/metadataTypes/definitions/Role.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Script.definition.d.ts | 0 .../lib/metadataTypes/definitions/Script.definition.d.ts.map | 1 + .../definitions/SendClassification.definition.d.ts | 0 .../definitions/SendClassification.definition.d.ts.map | 1 + .../metadataTypes/definitions/SenderProfile.definition.d.ts | 0 .../definitions/SenderProfile.definition.d.ts.map | 1 + .../definitions/TransactionalEmail.definition.d.ts | 0 .../definitions/TransactionalEmail.definition.d.ts.map | 1 + .../definitions/TransactionalMessage.definition.d.ts | 0 .../definitions/TransactionalMessage.definition.d.ts.map | 1 + .../definitions/TransactionalPush.definition.d.ts | 0 .../definitions/TransactionalPush.definition.d.ts.map | 1 + .../metadataTypes/definitions/TransactionalSMS.definition.d.ts | 0 .../definitions/TransactionalSMS.definition.d.ts.map | 1 + .../metadataTypes/definitions/TriggeredSend.definition.d.ts | 0 .../definitions/TriggeredSend.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/User.definition.d.ts | 0 @types/lib/metadataTypes/definitions/User.definition.d.ts.map | 1 + .../lib/metadataTypes/definitions/Verification.definition.d.ts | 0 .../metadataTypes/definitions/Verification.definition.d.ts.map | 1 + {types/ts => @types}/lib/retrieveChangelog.d.ts | 0 @types/lib/retrieveChangelog.d.ts.map | 1 + {types/ts => @types}/lib/util/auth.d.ts | 0 @types/lib/util/auth.d.ts.map | 1 + {types/ts => @types}/lib/util/businessUnit.d.ts | 0 @types/lib/util/businessUnit.d.ts.map | 1 + {types/ts => @types}/lib/util/cache.d.ts | 0 @types/lib/util/cache.d.ts.map | 1 + {types/ts => @types}/lib/util/cli.d.ts | 0 @types/lib/util/cli.d.ts.map | 1 + {types/ts => @types}/lib/util/config.d.ts | 0 @types/lib/util/config.d.ts.map | 1 + {types/ts => @types}/lib/util/devops.d.ts | 0 @types/lib/util/devops.d.ts.map | 1 + {types/ts => @types}/lib/util/file.d.ts | 0 @types/lib/util/file.d.ts.map | 1 + {types/ts => @types}/lib/util/init.config.d.ts | 0 @types/lib/util/init.config.d.ts.map | 1 + {types/ts => @types}/lib/util/init.d.ts | 0 @types/lib/util/init.d.ts.map | 1 + {types/ts => @types}/lib/util/init.git.d.ts | 0 @types/lib/util/init.git.d.ts.map | 1 + {types/ts => @types}/lib/util/init.npm.d.ts | 0 @types/lib/util/init.npm.d.ts.map | 1 + {types/ts => @types}/lib/util/util.d.ts | 0 @types/lib/util/util.d.ts.map | 1 + {types/ts => @types}/types/mcdev.d.d.ts | 0 @types/types/mcdev.d.d.ts.map | 1 + package.json | 3 ++- tsconfig.json | 2 +- types/ts/lib/Builder.d.ts.map | 1 - types/ts/lib/Deployer.d.ts.map | 1 - types/ts/lib/MetadataTypeDefinitions.d.ts.map | 1 - types/ts/lib/MetadataTypeInfo.d.ts.map | 1 - types/ts/lib/Retriever.d.ts.map | 1 - types/ts/lib/cli.d.ts.map | 1 - types/ts/lib/index.d.ts.map | 1 - types/ts/lib/metadataTypes/Asset.d.ts.map | 1 - types/ts/lib/metadataTypes/AttributeGroup.d.ts.map | 1 - types/ts/lib/metadataTypes/AttributeSet.d.ts.map | 1 - types/ts/lib/metadataTypes/Automation.d.ts.map | 1 - types/ts/lib/metadataTypes/Campaign.d.ts.map | 1 - types/ts/lib/metadataTypes/ContentArea.d.ts.map | 1 - types/ts/lib/metadataTypes/DataExtension.d.ts.map | 1 - types/ts/lib/metadataTypes/DataExtensionField.d.ts.map | 1 - types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map | 1 - types/ts/lib/metadataTypes/DataExtract.d.ts.map | 1 - types/ts/lib/metadataTypes/DataExtractType.d.ts.map | 1 - types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map | 1 - types/ts/lib/metadataTypes/Discovery.d.ts.map | 1 - types/ts/lib/metadataTypes/Email.d.ts.map | 1 - types/ts/lib/metadataTypes/EmailSend.d.ts.map | 1 - types/ts/lib/metadataTypes/Event.d.ts.map | 1 - types/ts/lib/metadataTypes/FileLocation.d.ts.map | 1 - types/ts/lib/metadataTypes/FileTransfer.d.ts.map | 1 - types/ts/lib/metadataTypes/Filter.d.ts.map | 1 - types/ts/lib/metadataTypes/Folder.d.ts.map | 1 - types/ts/lib/metadataTypes/ImportFile.d.ts.map | 1 - types/ts/lib/metadataTypes/Journey.d.ts.map | 1 - types/ts/lib/metadataTypes/List.d.ts.map | 1 - types/ts/lib/metadataTypes/MetadataType.d.ts.map | 1 - types/ts/lib/metadataTypes/MobileCode.d.ts.map | 1 - types/ts/lib/metadataTypes/MobileKeyword.d.ts.map | 1 - types/ts/lib/metadataTypes/MobileMessage.d.ts.map | 1 - types/ts/lib/metadataTypes/Query.d.ts.map | 1 - types/ts/lib/metadataTypes/Role.d.ts.map | 1 - types/ts/lib/metadataTypes/Script.d.ts.map | 1 - types/ts/lib/metadataTypes/SendClassification.d.ts.map | 1 - types/ts/lib/metadataTypes/SenderProfile.d.ts.map | 1 - types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map | 1 - types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map | 1 - types/ts/lib/metadataTypes/TransactionalPush.d.ts.map | 1 - types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map | 1 - types/ts/lib/metadataTypes/TriggeredSend.d.ts.map | 1 - types/ts/lib/metadataTypes/User.d.ts.map | 1 - types/ts/lib/metadataTypes/Verification.d.ts.map | 1 - .../ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map | 1 - .../definitions/AttributeGroup.definition.d.ts.map | 1 - .../metadataTypes/definitions/AttributeSet.definition.d.ts.map | 1 - .../metadataTypes/definitions/Automation.definition.d.ts.map | 1 - .../lib/metadataTypes/definitions/Campaign.definition.d.ts.map | 1 - .../metadataTypes/definitions/ContentArea.definition.d.ts.map | 1 - .../definitions/DataExtension.definition.d.ts.map | 1 - .../definitions/DataExtensionField.definition.d.ts.map | 1 - .../definitions/DataExtensionTemplate.definition.d.ts.map | 1 - .../metadataTypes/definitions/DataExtract.definition.d.ts.map | 1 - .../definitions/DataExtractType.definition.d.ts.map | 1 - .../definitions/DeliveryProfile.definition.d.ts.map | 1 - .../metadataTypes/definitions/Discovery.definition.d.ts.map | 1 - .../ts/lib/metadataTypes/definitions/Email.definition.d.ts.map | 1 - .../metadataTypes/definitions/EmailSend.definition.d.ts.map | 1 - .../ts/lib/metadataTypes/definitions/Event.definition.d.ts.map | 1 - .../metadataTypes/definitions/FileLocation.definition.d.ts.map | 1 - .../metadataTypes/definitions/FileTransfer.definition.d.ts.map | 1 - .../lib/metadataTypes/definitions/Filter.definition.d.ts.map | 1 - .../lib/metadataTypes/definitions/Folder.definition.d.ts.map | 1 - .../metadataTypes/definitions/ImportFile.definition.d.ts.map | 1 - .../lib/metadataTypes/definitions/Journey.definition.d.ts.map | 1 - .../ts/lib/metadataTypes/definitions/List.definition.d.ts.map | 1 - .../metadataTypes/definitions/MobileCode.definition.d.ts.map | 1 - .../definitions/MobileKeyword.definition.d.ts.map | 1 - .../definitions/MobileMessage.definition.d.ts.map | 1 - .../ts/lib/metadataTypes/definitions/Query.definition.d.ts.map | 1 - .../ts/lib/metadataTypes/definitions/Role.definition.d.ts.map | 1 - .../lib/metadataTypes/definitions/Script.definition.d.ts.map | 1 - .../definitions/SendClassification.definition.d.ts.map | 1 - .../definitions/SenderProfile.definition.d.ts.map | 1 - .../definitions/TransactionalEmail.definition.d.ts.map | 1 - .../definitions/TransactionalMessage.definition.d.ts.map | 1 - .../definitions/TransactionalPush.definition.d.ts.map | 1 - .../definitions/TransactionalSMS.definition.d.ts.map | 1 - .../definitions/TriggeredSend.definition.d.ts.map | 1 - .../ts/lib/metadataTypes/definitions/User.definition.d.ts.map | 1 - .../metadataTypes/definitions/Verification.definition.d.ts.map | 1 - types/ts/lib/retrieveChangelog.d.ts.map | 1 - types/ts/lib/util/auth.d.ts.map | 1 - types/ts/lib/util/businessUnit.d.ts.map | 1 - types/ts/lib/util/cache.d.ts.map | 1 - types/ts/lib/util/cli.d.ts.map | 1 - types/ts/lib/util/config.d.ts.map | 1 - types/ts/lib/util/devops.d.ts.map | 1 - types/ts/lib/util/file.d.ts.map | 1 - types/ts/lib/util/init.config.d.ts.map | 1 - types/ts/lib/util/init.d.ts.map | 1 - types/ts/lib/util/init.git.d.ts.map | 1 - types/ts/lib/util/init.npm.d.ts.map | 1 - types/ts/lib/util/util.d.ts.map | 1 - types/ts/types/mcdev.d.d.ts.map | 1 - 297 files changed, 102 insertions(+), 101 deletions(-) rename {types/ts => @types}/lib/Builder.d.ts (100%) create mode 100644 @types/lib/Builder.d.ts.map rename {types/ts => @types}/lib/Deployer.d.ts (100%) create mode 100644 @types/lib/Deployer.d.ts.map rename {types/ts => @types}/lib/MetadataTypeDefinitions.d.ts (100%) create mode 100644 @types/lib/MetadataTypeDefinitions.d.ts.map rename {types/ts => @types}/lib/MetadataTypeInfo.d.ts (100%) create mode 100644 @types/lib/MetadataTypeInfo.d.ts.map rename {types/ts => @types}/lib/Retriever.d.ts (100%) create mode 100644 @types/lib/Retriever.d.ts.map rename {types/ts => @types}/lib/cli.d.ts (100%) create mode 100644 @types/lib/cli.d.ts.map rename {types/ts => @types}/lib/index.d.ts (100%) create mode 100644 @types/lib/index.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Asset.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Asset.d.ts.map rename {types/ts => @types}/lib/metadataTypes/AttributeGroup.d.ts (100%) create mode 100644 @types/lib/metadataTypes/AttributeGroup.d.ts.map rename {types/ts => @types}/lib/metadataTypes/AttributeSet.d.ts (100%) create mode 100644 @types/lib/metadataTypes/AttributeSet.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Automation.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Automation.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Campaign.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Campaign.d.ts.map rename {types/ts => @types}/lib/metadataTypes/ContentArea.d.ts (100%) create mode 100644 @types/lib/metadataTypes/ContentArea.d.ts.map rename {types/ts => @types}/lib/metadataTypes/DataExtension.d.ts (100%) create mode 100644 @types/lib/metadataTypes/DataExtension.d.ts.map rename {types/ts => @types}/lib/metadataTypes/DataExtensionField.d.ts (100%) create mode 100644 @types/lib/metadataTypes/DataExtensionField.d.ts.map rename {types/ts => @types}/lib/metadataTypes/DataExtensionTemplate.d.ts (100%) create mode 100644 @types/lib/metadataTypes/DataExtensionTemplate.d.ts.map rename {types/ts => @types}/lib/metadataTypes/DataExtract.d.ts (100%) create mode 100644 @types/lib/metadataTypes/DataExtract.d.ts.map rename {types/ts => @types}/lib/metadataTypes/DataExtractType.d.ts (100%) create mode 100644 @types/lib/metadataTypes/DataExtractType.d.ts.map rename {types/ts => @types}/lib/metadataTypes/DeliveryProfile.d.ts (100%) create mode 100644 @types/lib/metadataTypes/DeliveryProfile.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Discovery.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Discovery.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Email.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Email.d.ts.map rename {types/ts => @types}/lib/metadataTypes/EmailSend.d.ts (100%) create mode 100644 @types/lib/metadataTypes/EmailSend.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Event.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Event.d.ts.map rename {types/ts => @types}/lib/metadataTypes/FileLocation.d.ts (100%) create mode 100644 @types/lib/metadataTypes/FileLocation.d.ts.map rename {types/ts => @types}/lib/metadataTypes/FileTransfer.d.ts (100%) create mode 100644 @types/lib/metadataTypes/FileTransfer.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Filter.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Filter.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Folder.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Folder.d.ts.map rename {types/ts => @types}/lib/metadataTypes/ImportFile.d.ts (100%) create mode 100644 @types/lib/metadataTypes/ImportFile.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Journey.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Journey.d.ts.map rename {types/ts => @types}/lib/metadataTypes/List.d.ts (100%) create mode 100644 @types/lib/metadataTypes/List.d.ts.map rename {types/ts => @types}/lib/metadataTypes/MetadataType.d.ts (100%) create mode 100644 @types/lib/metadataTypes/MetadataType.d.ts.map rename {types/ts => @types}/lib/metadataTypes/MobileCode.d.ts (100%) create mode 100644 @types/lib/metadataTypes/MobileCode.d.ts.map rename {types/ts => @types}/lib/metadataTypes/MobileKeyword.d.ts (100%) create mode 100644 @types/lib/metadataTypes/MobileKeyword.d.ts.map rename {types/ts => @types}/lib/metadataTypes/MobileMessage.d.ts (100%) create mode 100644 @types/lib/metadataTypes/MobileMessage.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Query.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Query.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Role.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Role.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Script.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Script.d.ts.map rename {types/ts => @types}/lib/metadataTypes/SendClassification.d.ts (100%) create mode 100644 @types/lib/metadataTypes/SendClassification.d.ts.map rename {types/ts => @types}/lib/metadataTypes/SenderProfile.d.ts (100%) create mode 100644 @types/lib/metadataTypes/SenderProfile.d.ts.map rename {types/ts => @types}/lib/metadataTypes/TransactionalEmail.d.ts (100%) create mode 100644 @types/lib/metadataTypes/TransactionalEmail.d.ts.map rename {types/ts => @types}/lib/metadataTypes/TransactionalMessage.d.ts (100%) create mode 100644 @types/lib/metadataTypes/TransactionalMessage.d.ts.map rename {types/ts => @types}/lib/metadataTypes/TransactionalPush.d.ts (100%) create mode 100644 @types/lib/metadataTypes/TransactionalPush.d.ts.map rename {types/ts => @types}/lib/metadataTypes/TransactionalSMS.d.ts (100%) create mode 100644 @types/lib/metadataTypes/TransactionalSMS.d.ts.map rename {types/ts => @types}/lib/metadataTypes/TriggeredSend.d.ts (100%) create mode 100644 @types/lib/metadataTypes/TriggeredSend.d.ts.map rename {types/ts => @types}/lib/metadataTypes/User.d.ts (100%) create mode 100644 @types/lib/metadataTypes/User.d.ts.map rename {types/ts => @types}/lib/metadataTypes/Verification.d.ts (100%) create mode 100644 @types/lib/metadataTypes/Verification.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Asset.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Asset.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/AttributeSet.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Automation.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Automation.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Campaign.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Campaign.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/ContentArea.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/DataExtension.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/DataExtract.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/DataExtractType.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Discovery.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Discovery.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Email.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Email.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/EmailSend.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Event.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Event.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/FileLocation.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/FileTransfer.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Filter.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Filter.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Folder.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Folder.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/ImportFile.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Journey.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Journey.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/List.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/List.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/MobileCode.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/MobileMessage.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Query.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Query.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Role.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Role.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Script.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Script.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/SendClassification.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/SenderProfile.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/User.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/User.definition.d.ts.map rename {types/ts => @types}/lib/metadataTypes/definitions/Verification.definition.d.ts (100%) create mode 100644 @types/lib/metadataTypes/definitions/Verification.definition.d.ts.map rename {types/ts => @types}/lib/retrieveChangelog.d.ts (100%) create mode 100644 @types/lib/retrieveChangelog.d.ts.map rename {types/ts => @types}/lib/util/auth.d.ts (100%) create mode 100644 @types/lib/util/auth.d.ts.map rename {types/ts => @types}/lib/util/businessUnit.d.ts (100%) create mode 100644 @types/lib/util/businessUnit.d.ts.map rename {types/ts => @types}/lib/util/cache.d.ts (100%) create mode 100644 @types/lib/util/cache.d.ts.map rename {types/ts => @types}/lib/util/cli.d.ts (100%) create mode 100644 @types/lib/util/cli.d.ts.map rename {types/ts => @types}/lib/util/config.d.ts (100%) create mode 100644 @types/lib/util/config.d.ts.map rename {types/ts => @types}/lib/util/devops.d.ts (100%) create mode 100644 @types/lib/util/devops.d.ts.map rename {types/ts => @types}/lib/util/file.d.ts (100%) create mode 100644 @types/lib/util/file.d.ts.map rename {types/ts => @types}/lib/util/init.config.d.ts (100%) create mode 100644 @types/lib/util/init.config.d.ts.map rename {types/ts => @types}/lib/util/init.d.ts (100%) create mode 100644 @types/lib/util/init.d.ts.map rename {types/ts => @types}/lib/util/init.git.d.ts (100%) create mode 100644 @types/lib/util/init.git.d.ts.map rename {types/ts => @types}/lib/util/init.npm.d.ts (100%) create mode 100644 @types/lib/util/init.npm.d.ts.map rename {types/ts => @types}/lib/util/util.d.ts (100%) create mode 100644 @types/lib/util/util.d.ts.map rename {types/ts => @types}/types/mcdev.d.d.ts (100%) create mode 100644 @types/types/mcdev.d.d.ts.map delete mode 100644 types/ts/lib/Builder.d.ts.map delete mode 100644 types/ts/lib/Deployer.d.ts.map delete mode 100644 types/ts/lib/MetadataTypeDefinitions.d.ts.map delete mode 100644 types/ts/lib/MetadataTypeInfo.d.ts.map delete mode 100644 types/ts/lib/Retriever.d.ts.map delete mode 100644 types/ts/lib/cli.d.ts.map delete mode 100644 types/ts/lib/index.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Asset.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/AttributeGroup.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/AttributeSet.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Automation.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Campaign.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/ContentArea.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/DataExtension.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/DataExtensionField.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/DataExtract.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/DataExtractType.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Discovery.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Email.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/EmailSend.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Event.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/FileLocation.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/FileTransfer.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Filter.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Folder.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/ImportFile.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Journey.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/List.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/MetadataType.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/MobileCode.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/MobileKeyword.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/MobileMessage.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Query.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Role.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Script.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/SendClassification.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/SenderProfile.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/TransactionalPush.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/TriggeredSend.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/User.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/Verification.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map delete mode 100644 types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map delete mode 100644 types/ts/lib/retrieveChangelog.d.ts.map delete mode 100644 types/ts/lib/util/auth.d.ts.map delete mode 100644 types/ts/lib/util/businessUnit.d.ts.map delete mode 100644 types/ts/lib/util/cache.d.ts.map delete mode 100644 types/ts/lib/util/cli.d.ts.map delete mode 100644 types/ts/lib/util/config.d.ts.map delete mode 100644 types/ts/lib/util/devops.d.ts.map delete mode 100644 types/ts/lib/util/file.d.ts.map delete mode 100644 types/ts/lib/util/init.config.d.ts.map delete mode 100644 types/ts/lib/util/init.d.ts.map delete mode 100644 types/ts/lib/util/init.git.d.ts.map delete mode 100644 types/ts/lib/util/init.npm.d.ts.map delete mode 100644 types/ts/lib/util/util.d.ts.map delete mode 100644 types/ts/types/mcdev.d.d.ts.map diff --git a/.husky/pre-commit b/.husky/pre-commit index 629808a23..e29747d13 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -3,4 +3,4 @@ npx --no lint-staged # update typescript type declarations npx tsc -git add types/ts +git add @types diff --git a/types/ts/lib/Builder.d.ts b/@types/lib/Builder.d.ts similarity index 100% rename from types/ts/lib/Builder.d.ts rename to @types/lib/Builder.d.ts diff --git a/@types/lib/Builder.d.ts.map b/@types/lib/Builder.d.ts.map new file mode 100644 index 000000000..b1dc6192d --- /dev/null +++ b/@types/lib/Builder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../lib/Builder.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;AAZtD;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH;IAsEI;;;;;;;;OAQG;IACH,mCANW,MAAM,gBACN,MAAM,UACN,MAAM,EAAE,UACR,MAAM,GACJ,QAAS,qBAAqB,CAAC,CAuB3C;IAoCD;;;;;;;;OAQG;IACH,qCANW,MAAM,gBACN,MAAM,WACN,MAAM,EAAE,UACR,MAAM,GACJ,QAAS,qBAAqB,CAAC,CAuB3C;IACD;;;;;;;OAOG;IACH,qCALW,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CAoD5B;IAhOD;;;;;;OAMG;IACH,wBAJW,OAAO,YAEP,QAAQ,EAyBlB;IAtBG,kDAA4B;IAC5B,oBAAkD;IAClD,iBAIE;IACF,iDAAwB;IAMxB,oBAGC;IAED;;OAEG;IACH,UAFU,qBAAqB,CAEb;IAGtB;;;;;;;OAOG;IACH,+BALW,MAAM,WACN,MAAM,EAAE,qBACR,WAAW,GACT,QAAS,qBAAqB,CAAC,CA8B3C;IAgCD;;;;;;;OAOG;IACH,6BALW,MAAM,UACN,MAAM,EAAE,qBACR,WAAW,GACT,QAAS,qBAAqB,CAAC,CA4B3C;CA2FJ"} \ No newline at end of file diff --git a/types/ts/lib/Deployer.d.ts b/@types/lib/Deployer.d.ts similarity index 100% rename from types/ts/lib/Deployer.d.ts rename to @types/lib/Deployer.d.ts diff --git a/@types/lib/Deployer.d.ts.map b/@types/lib/Deployer.d.ts.map new file mode 100644 index 000000000..af0de6f5b --- /dev/null +++ b/@types/lib/Deployer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Deployer.d.ts","sourceRoot":"","sources":["../../lib/Deployer.js"],"names":[],"mappings":";uBAYa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;mCACzC,OAAO,qBAAqB,EAAE,oBAAoB;2BAClD,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH;IAwBI;;;;;;;OAOG;IACH,4BALW,MAAM,qBACN,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,oBAAoB;MAAE,CA2J3D;IACD;;;;;;;;;OASG;IACH,uBAPW,MAAM,MACN,MAAM,cACN,OAAO,YACP,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAmB1C;IAiHD;;;;;;;OAOG;IACH,iCALW,MAAM,YACN,MAAM,EAAE,gBACR,OAAO,GACL,oBAAoB,CA4BhC;IAED;;;;;;;OAOG;IACH,0CALW,MAAM,YACN,oBAAoB,mBACpB,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA6G5B;IA5dD;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAkBlB;IAfG,iDAAwB;IACxB,kDAA4B;IAC5B,eAIE;IACF,iBAIE;IAoMN;;;;;;OAMG;IACH,gBAJW,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAwG1C;IAhGO,mCAAmC;IACnC,UADW,oBAAoB,CACiC;CAyP3E"} \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeDefinitions.d.ts b/@types/lib/MetadataTypeDefinitions.d.ts similarity index 100% rename from types/ts/lib/MetadataTypeDefinitions.d.ts rename to @types/lib/MetadataTypeDefinitions.d.ts diff --git a/@types/lib/MetadataTypeDefinitions.d.ts.map b/@types/lib/MetadataTypeDefinitions.d.ts.map new file mode 100644 index 000000000..fa2ea63c7 --- /dev/null +++ b/@types/lib/MetadataTypeDefinitions.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MetadataTypeDefinitions.d.ts","sourceRoot":"","sources":["../../lib/MetadataTypeDefinitions.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEkB,iDAAiD;2BACxC,0DAA0D;yBAC5D,wDAAwD;uBAC1D,sDAAsD;qBACxD,oDAAoD;wBACjD,uDAAuD;0BACrD,yDAAyD;+BACpD,8DAA8D;kCAC3D,iEAAiE;wBAC3E,uDAAuD;4BACnD,2DAA2D;4BAC3D,2DAA2D;sBACjE,qDAAqD;kBACzD,iDAAiD;sBAC7C,qDAAqD;kBACzD,iDAAiD;yBAC1C,wDAAwD;yBACxD,wDAAwD;mBAC9D,kDAAkD;mBAClD,kDAAkD;uBAC9C,sDAAsD;oBACzD,mDAAmD;iBACtD,gDAAgD;uBAC1C,sDAAsD;0BACnD,yDAAyD;0BACzD,yDAAyD;kBACjE,iDAAiD;iBAClD,gDAAgD;mBAC9C,kDAAkD;+BACtC,8DAA8D;0BACnE,yDAAyD;iCAClD,gEAAgE;+BAClE,8DAA8D;8BAC/D,6DAA6D;6BAC9D,4DAA4D;0BAC/D,yDAAyD;iBAClE,gDAAgD;yBACxC,wDAAwD"} \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeInfo.d.ts b/@types/lib/MetadataTypeInfo.d.ts similarity index 100% rename from types/ts/lib/MetadataTypeInfo.d.ts rename to @types/lib/MetadataTypeInfo.d.ts diff --git a/@types/lib/MetadataTypeInfo.d.ts.map b/@types/lib/MetadataTypeInfo.d.ts.map new file mode 100644 index 000000000..b2a9a750b --- /dev/null +++ b/@types/lib/MetadataTypeInfo.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MetadataTypeInfo.d.ts","sourceRoot":"","sources":["../../lib/MetadataTypeInfo.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEkB,0BAA0B;2BACjB,mCAAmC;yBACrC,iCAAiC;uBACnC,+BAA+B;qBACjC,6BAA6B;wBAC1B,gCAAgC;0BAC9B,kCAAkC;+BAC7B,uCAAuC;kCACpC,0CAA0C;wBACpD,gCAAgC;4BAC5B,oCAAoC;4BACpC,oCAAoC;sBAC1C,8BAA8B;kBAClC,0BAA0B;sBACtB,8BAA8B;kBAClC,0BAA0B;yBACnB,iCAAiC;yBACjC,iCAAiC;mBACvC,2BAA2B;mBAC3B,2BAA2B;uBACvB,+BAA+B;oBAClC,4BAA4B;iBAC/B,yBAAyB;uBACnB,+BAA+B;0BAC5B,kCAAkC;0BAClC,kCAAkC;kBAC1C,0BAA0B;iBAC3B,yBAAyB;mBACvB,2BAA2B;+BACf,uCAAuC;0BAC5C,kCAAkC;+BAC7B,uCAAuC;8BACxC,sCAAsC;6BACvC,qCAAqC;0BACxC,kCAAkC;iBAC3C,yBAAyB;yBACjB,iCAAiC"} \ No newline at end of file diff --git a/types/ts/lib/Retriever.d.ts b/@types/lib/Retriever.d.ts similarity index 100% rename from types/ts/lib/Retriever.d.ts rename to @types/lib/Retriever.d.ts diff --git a/@types/lib/Retriever.d.ts.map b/@types/lib/Retriever.d.ts.map new file mode 100644 index 000000000..562e1b7c8 --- /dev/null +++ b/@types/lib/Retriever.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Retriever.d.ts","sourceRoot":"","sources":["../../lib/Retriever.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;gCAClD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH;IACI;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAYlB;IATG,iDAAwB;IACxB,kDAA4B;IAC5B,oBAAkD;IAClD,oBAAkD;IAClD,cAIE;IAGN;;;;;;;;OAQG;IACH,wBANW,MAAM,EAAE,gBACR,MAAM,EAAE,GAAG,YAAY,sBACvB,WAAW,kBACX,OAAO,GACL,QAAS,qBAAqB,CAAC,CA4I3C;IAED;;;;;OAKG;IACH,oCAHW,MAAM,EAAE,GACN,MAAM,EAAE,CAepB;CACJ"} \ No newline at end of file diff --git a/types/ts/lib/cli.d.ts b/@types/lib/cli.d.ts similarity index 100% rename from types/ts/lib/cli.d.ts rename to @types/lib/cli.d.ts diff --git a/@types/lib/cli.d.ts.map b/@types/lib/cli.d.ts.map new file mode 100644 index 000000000..3f71c0106 --- /dev/null +++ b/@types/lib/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../lib/cli.js"],"names":[],"mappings":";2BAaa,OAAO,qBAAqB,EAAE,YAAY"} \ No newline at end of file diff --git a/types/ts/lib/index.d.ts b/@types/lib/index.d.ts similarity index 100% rename from types/ts/lib/index.d.ts rename to @types/lib/index.d.ts diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map new file mode 100644 index 000000000..46fcd878c --- /dev/null +++ b/@types/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAmBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EA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AAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Asset.d.ts b/@types/lib/metadataTypes/Asset.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Asset.d.ts rename to @types/lib/metadataTypes/Asset.d.ts diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map new file mode 100644 index 000000000..5a7cf338b --- /dev/null +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAYa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;iCAC1C,OAAO,wBAAwB,EAAE,kBAAkB;AAdhE;;;;;;;;;GASG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,QACR,MAAM,GACJ,QAAS;QAAC,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4RH;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApfkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeGroup.d.ts b/@types/lib/metadataTypes/AttributeGroup.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/AttributeGroup.d.ts rename to @types/lib/metadataTypes/AttributeGroup.d.ts diff --git a/@types/lib/metadataTypes/AttributeGroup.d.ts.map b/@types/lib/metadataTypes/AttributeGroup.d.ts.map new file mode 100644 index 000000000..7f497fb46 --- /dev/null +++ b/@types/lib/metadataTypes/AttributeGroup.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeGroup.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/AttributeGroup.js"],"names":[],"mappings":";+BAOa,OAAO,wBAAwB,EAAE,gBAAgB;iCACjD,OAAO,wBAAwB,EAAE,kBAAkB;AAFhE;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA6D5B;CAOJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eANG;;;;;eAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhHkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeSet.d.ts b/@types/lib/metadataTypes/AttributeSet.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/AttributeSet.d.ts rename to @types/lib/metadataTypes/AttributeSet.d.ts diff --git a/@types/lib/metadataTypes/AttributeSet.d.ts.map b/@types/lib/metadataTypes/AttributeSet.d.ts.map new file mode 100644 index 000000000..b456d1dd1 --- /dev/null +++ b/@types/lib/metadataTypes/AttributeSet.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeSet.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/AttributeSet.js"],"names":[],"mappings":";+BAQa,OAAO,wBAAwB,EAAE,gBAAgB;8BACjD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;AAHhE;;;;GAIG;AAEH;;;;GAIG;AACH;IACI,mCAA8B;IAC9B;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAaxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;;;;OAOG;IACH;YAJmB,MAAM,GAAE,MAAM;yBACtB,MAAM,GACJ,QAAS,MAAM,EAAE,CAAC,CAiG9B;IAoBD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAwK5B;IAED;;;;OAIG;IACH,qCAFa,MAAM,EAAE,CAgBpB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eArUG;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA6GH;;;;;;mBAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAYH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9KkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Automation.d.ts b/@types/lib/metadataTypes/Automation.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Automation.d.ts rename to @types/lib/metadataTypes/Automation.d.ts diff --git a/@types/lib/metadataTypes/Automation.d.ts.map b/@types/lib/metadataTypes/Automation.d.ts.map new file mode 100644 index 000000000..3c94b44b3 --- /dev/null +++ b/@types/lib/metadataTypes/Automation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Automation.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;uBACnD,OAAO,wBAAwB,EAAE,QAAQ;gCACzC,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;6BAG5C,OAAO,wBAAwB,EAAE,cAAc;gCAC/C,OAAO,wBAAwB,EAAE,iBAAiB;4BAClD,OAAO,wBAAwB,EAAE,aAAa;+BAC9C,OAAO,wBAAwB,EAAE,gBAAgB;iCACjD,OAAO,wBAAwB,EAAE,kBAAkB;qCACnD,OAAO,wBAAwB,EAAE,sBAAsB;AAnBpE;;;;;;;;;;;;GAYG;AACH;;;;;;;GAOG;AAEH;;;;GAIG;AACH;IACI,+BAAgC;IAChC,0BAAqB;IACrB,0CAAyC;IACzC,4BAA4B;IAC5B,2BADW,aAAa,CACE;IAC1B;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,gBAAgB,CAAC,CAkEtC;IAuBD;;;;;OAKG;IACH,2DAHW,eAAe,GACb,QAAS,MAAM,CAAC,CAuE5B;IAED;;;;OAIG;IACH,4BAFa,QAAS,gBAAgB,CAAC,CAwCtC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAzTkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Campaign.d.ts b/@types/lib/metadataTypes/Campaign.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Campaign.d.ts rename to @types/lib/metadataTypes/Campaign.d.ts diff --git a/@types/lib/metadataTypes/Campaign.d.ts.map b/@types/lib/metadataTypes/Campaign.d.ts.map new file mode 100644 index 000000000..0e72af56a --- /dev/null +++ b/@types/lib/metadataTypes/Campaign.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Campaign.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Campaign.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAqBxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,iCALW,MAAM,cACN,MAAM,QACN,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAaxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCApBG;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApEkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/ContentArea.d.ts b/@types/lib/metadataTypes/ContentArea.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/ContentArea.d.ts rename to @types/lib/metadataTypes/ContentArea.d.ts diff --git a/@types/lib/metadataTypes/ContentArea.d.ts.map b/@types/lib/metadataTypes/ContentArea.d.ts.map new file mode 100644 index 000000000..f1c414998 --- /dev/null +++ b/@types/lib/metadataTypes/ContentArea.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ContentArea.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/ContentArea.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAmBxC;IA2BD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;CACJ;;;;;;;yBA/FD;;;;;;;;;;;WAWG;;;;;;;;;;;;;;;;;;;;;;;;;uCAQC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/BkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtension.d.ts b/@types/lib/metadataTypes/DataExtension.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/DataExtension.d.ts rename to @types/lib/metadataTypes/DataExtension.d.ts diff --git a/@types/lib/metadataTypes/DataExtension.d.ts.map b/@types/lib/metadataTypes/DataExtension.d.ts.map new file mode 100644 index 000000000..c350f87ef --- /dev/null +++ b/@types/lib/metadataTypes/DataExtension.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtension.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtension.js"],"names":[],"mappings":";uBAea,OAAO,wBAAwB,EAAE,QAAQ;+BACzC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;qCAG5C,OAAO,wBAAwB,EAAE,sBAAsB;oCACvD,OAAO,wBAAwB,EAAE,qBAAqB;gCACtD,OAAO,wBAAwB,EAAE,iBAAiB;+BAClD,OAAO,wBAAwB,EAAE,gBAAgB;AAZ9D;;;;;;;GAOG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI,oCAAoC;IACpC,kBADW,qBAAqB,CACf;IACjB;;;;;;OAMG;IACH,2BAHW,gBAAgB,gBAoG1B;IAyED;;;;;OAKG;IACH,wCAHW,MAAM,GACJ,OAAO,CA0BnB;IAED;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAh8CG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArJkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionField.d.ts b/@types/lib/metadataTypes/DataExtensionField.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/DataExtensionField.d.ts rename to @types/lib/metadataTypes/DataExtensionField.d.ts diff --git a/@types/lib/metadataTypes/DataExtensionField.d.ts.map b/@types/lib/metadataTypes/DataExtensionField.d.ts.map new file mode 100644 index 000000000..97c603163 --- /dev/null +++ b/@types/lib/metadataTypes/DataExtensionField.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionField.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtensionField.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;oCAG5C,OAAO,wBAAwB,EAAE,qBAAqB;qCACtD,OAAO,wBAAwB,EAAE,sBAAsB;AAdpE;;;;;;;;;;;GAWG;AACH;;;GAGG;AACH;;;;GAIG;AACH;IACI,6BAAwB;IACxB;;;;;;OAMG;IACH,6BAJW,MAAM,qBACN,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrE;IACD;;;;;;OAMG;IACH,0CAJW,iBAAiB,qBACjB,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrE;IACD;;;;;OAKG;IACH,uCAHW,qBAAqB,GACnB,sBAAsB,EAAE,CASpC;IAED;;;;;;OAMG;IACH,uBAJW,sBAAsB,KACtB,sBAAsB,GACpB,MAAM,CAIlB;IACD;;;;;OAKG;IACH,qCAHW,sBAAsB,GACpB,sBAAsB,CAelC;IACD;;;;;;;OAOG;IACH,mDAJW,sBAAsB,EAAE,SACxB,MAAM,GACJ;YAAiB,MAAM,GAAE,sBAAsB;MAAE,CAoK7D;IAYD;;;;;;OAMG;IACH,oCAJW,MAAM,YACN,MAAM,GACJ,QAAS,OAAO,CAAC,CAuD7B;IACD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAO1B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA5SG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts b/@types/lib/metadataTypes/DataExtensionTemplate.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts rename to @types/lib/metadataTypes/DataExtensionTemplate.d.ts diff --git a/@types/lib/metadataTypes/DataExtensionTemplate.d.ts.map b/@types/lib/metadataTypes/DataExtensionTemplate.d.ts.map new file mode 100644 index 000000000..461558b45 --- /dev/null +++ b/@types/lib/metadataTypes/DataExtensionTemplate.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionTemplate.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtensionTemplate.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAbO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/Bf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtract.d.ts b/@types/lib/metadataTypes/DataExtract.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/DataExtract.d.ts rename to @types/lib/metadataTypes/DataExtract.d.ts diff --git a/@types/lib/metadataTypes/DataExtract.d.ts.map b/@types/lib/metadataTypes/DataExtract.d.ts.map new file mode 100644 index 000000000..91d719413 --- /dev/null +++ b/@types/lib/metadataTypes/DataExtract.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtract.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtract.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CA4CzC;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,gBAAgB,CAW5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiB5B;IACD;;;;;;OAMG;IACH,6CASC;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAxKG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAaH;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtractType.d.ts b/@types/lib/metadataTypes/DataExtractType.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/DataExtractType.d.ts rename to @types/lib/metadataTypes/DataExtractType.d.ts diff --git a/@types/lib/metadataTypes/DataExtractType.d.ts.map b/@types/lib/metadataTypes/DataExtractType.d.ts.map new file mode 100644 index 000000000..602531a83 --- /dev/null +++ b/@types/lib/metadataTypes/DataExtractType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtractType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DataExtractType.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3CwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DeliveryProfile.d.ts b/@types/lib/metadataTypes/DeliveryProfile.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/DeliveryProfile.d.ts rename to @types/lib/metadataTypes/DeliveryProfile.d.ts diff --git a/@types/lib/metadataTypes/DeliveryProfile.d.ts.map b/@types/lib/metadataTypes/DeliveryProfile.d.ts.map new file mode 100644 index 000000000..bcc190c61 --- /dev/null +++ b/@types/lib/metadataTypes/DeliveryProfile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DeliveryProfile.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/DeliveryProfile.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtCwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Discovery.d.ts b/@types/lib/metadataTypes/Discovery.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Discovery.d.ts rename to @types/lib/metadataTypes/Discovery.d.ts diff --git a/@types/lib/metadataTypes/Discovery.d.ts.map b/@types/lib/metadataTypes/Discovery.d.ts.map new file mode 100644 index 000000000..8f3389628 --- /dev/null +++ b/@types/lib/metadataTypes/Discovery.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Discovery.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Discovery.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AACH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA0BxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAxDwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Email.d.ts b/@types/lib/metadataTypes/Email.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Email.d.ts rename to @types/lib/metadataTypes/Email.d.ts diff --git a/@types/lib/metadataTypes/Email.d.ts.map b/@types/lib/metadataTypes/Email.d.ts.map new file mode 100644 index 000000000..e8f112815 --- /dev/null +++ b/@types/lib/metadataTypes/Email.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Email.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAgBxC;IAmBD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAvED;;;;mBAIG;;;qCAEC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;qCAEC,gCAAgC;;;;;;;;;;;;;;;;;;;eAcpC;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/EmailSend.d.ts b/@types/lib/metadataTypes/EmailSend.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/EmailSend.d.ts rename to @types/lib/metadataTypes/EmailSend.d.ts diff --git a/@types/lib/metadataTypes/EmailSend.d.ts.map b/@types/lib/metadataTypes/EmailSend.d.ts.map new file mode 100644 index 000000000..6557e2933 --- /dev/null +++ b/@types/lib/metadataTypes/EmailSend.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EmailSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/EmailSend.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAzZwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Event.d.ts b/@types/lib/metadataTypes/Event.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Event.d.ts rename to @types/lib/metadataTypes/Event.d.ts diff --git a/@types/lib/metadataTypes/Event.d.ts.map b/@types/lib/metadataTypes/Event.d.ts.map new file mode 100644 index 000000000..efc085497 --- /dev/null +++ b/@types/lib/metadataTypes/Event.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Event.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;OAUG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAwBxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CAqDzC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileLocation.d.ts b/@types/lib/metadataTypes/FileLocation.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/FileLocation.d.ts rename to @types/lib/metadataTypes/FileLocation.d.ts diff --git a/@types/lib/metadataTypes/FileLocation.d.ts.map b/@types/lib/metadataTypes/FileLocation.d.ts.map new file mode 100644 index 000000000..81d9a7114 --- /dev/null +++ b/@types/lib/metadataTypes/FileLocation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileLocation.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/FileLocation.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3CwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileTransfer.d.ts b/@types/lib/metadataTypes/FileTransfer.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/FileTransfer.d.ts rename to @types/lib/metadataTypes/FileTransfer.d.ts diff --git a/@types/lib/metadataTypes/FileTransfer.d.ts.map b/@types/lib/metadataTypes/FileTransfer.d.ts.map new file mode 100644 index 000000000..0c76e3a12 --- /dev/null +++ b/@types/lib/metadataTypes/FileTransfer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileTransfer.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/FileTransfer.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CA4CzC;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,gBAkB1B;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;IAED;;;;;;OAMG;IACH,6CASC;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAxJG;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Filter.d.ts b/@types/lib/metadataTypes/Filter.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Filter.d.ts rename to @types/lib/metadataTypes/Filter.d.ts diff --git a/@types/lib/metadataTypes/Filter.d.ts.map b/@types/lib/metadataTypes/Filter.d.ts.map new file mode 100644 index 000000000..f95679c57 --- /dev/null +++ b/@types/lib/metadataTypes/Filter.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Filter.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;;OAWG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApCwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Folder.d.ts b/@types/lib/metadataTypes/Folder.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Folder.d.ts rename to @types/lib/metadataTypes/Folder.d.ts diff --git a/@types/lib/metadataTypes/Folder.d.ts.map b/@types/lib/metadataTypes/Folder.d.ts.map new file mode 100644 index 000000000..d505b90f0 --- /dev/null +++ b/@types/lib/metadataTypes/Folder.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Folder.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Folder.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,qBACN,MAAM,EAAE,eACR,MAAM,EAAE,QACR,MAAM,gBA8HhB;IAED;;;;;;OAMG;IACH,4BAJW,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,gBAKlB;IAED;;;;;;;OAOG;IACH,wBAHW,eAAe,GACb,QAAS,MAAM,CAAC,CA8J5B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBA+C1B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBAyB1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAgDtC;IAED;;;;;;OAMG;IACH,0BAJW,MAAM,gBACN,OAAO,GACL,eAAe,CAkE3B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,EAAE,qBACR,OAAO,oBACP,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA+B5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAI5B;IACD;;;;;;;OAOG;IACH,4BALW,eAAe,eACf,MAAM,OACN,MAAM,GAAG,MAAM,GACb,QAAS,MAAM,CAAC,CAuD5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9oBwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/ImportFile.d.ts b/@types/lib/metadataTypes/ImportFile.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/ImportFile.d.ts rename to @types/lib/metadataTypes/ImportFile.d.ts diff --git a/@types/lib/metadataTypes/ImportFile.d.ts.map b/@types/lib/metadataTypes/ImportFile.d.ts.map new file mode 100644 index 000000000..5e111daee --- /dev/null +++ b/@types/lib/metadataTypes/ImportFile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportFile.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/ImportFile.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;OAUG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiDxC;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CAuCzC;IACD;;;;;;OAMG;IACH,6CAeC;IAED;;;;;OAKG;IACH,0BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,0BAHW,gBAAgB,gBAQ1B;IAgCD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAuHtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkH5B;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA7cD;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Journey.d.ts b/@types/lib/metadataTypes/Journey.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Journey.d.ts rename to @types/lib/metadataTypes/Journey.d.ts diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map new file mode 100644 index 000000000..3bb13b4f9 --- /dev/null +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiIxC;IA6ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAkBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA2J5B;IACD;;;;;OAKG;IACH,6CAiVC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAiHtC;IAED;;;;;OAKG;IACH,0CAkLC;CAoDJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAh5BG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArQkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/List.d.ts b/@types/lib/metadataTypes/List.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/List.d.ts rename to @types/lib/metadataTypes/List.d.ts diff --git a/@types/lib/metadataTypes/List.d.ts.map b/@types/lib/metadataTypes/List.d.ts.map new file mode 100644 index 000000000..014d034ea --- /dev/null +++ b/@types/lib/metadataTypes/List.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/List.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAyBxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;;OAMG;IACH,sCAqEC;IAYD;;;;;OAKG;IACH,+BAHW,gBAAgB,GACd,gBAAgB,CAI5B;IACD;;;;;;OAMG;IACH,+BAJW,gBAAgB,kBAChB,OAAO,GACL,gBAAgB,CAsB5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCApLO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnCf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MetadataType.d.ts b/@types/lib/metadataTypes/MetadataType.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/MetadataType.d.ts rename to @types/lib/metadataTypes/MetadataType.d.ts diff --git a/@types/lib/metadataTypes/MetadataType.d.ts.map b/@types/lib/metadataTypes/MetadataType.d.ts.map new file mode 100644 index 000000000..c6604e669 --- /dev/null +++ b/@types/lib/metadataTypes/MetadataType.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;kBAC5C,OAAO,wBAAwB,EAAE,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ACJ,MAAM,CAgBlB;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileCode.d.ts b/@types/lib/metadataTypes/MobileCode.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/MobileCode.d.ts rename to @types/lib/metadataTypes/MobileCode.d.ts diff --git a/@types/lib/metadataTypes/MobileCode.d.ts.map b/@types/lib/metadataTypes/MobileCode.d.ts.map new file mode 100644 index 000000000..ed8d7d8ae --- /dev/null +++ b/@types/lib/metadataTypes/MobileCode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileCode.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MobileCode.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA3BG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9BkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileKeyword.d.ts b/@types/lib/metadataTypes/MobileKeyword.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/MobileKeyword.d.ts rename to @types/lib/metadataTypes/MobileKeyword.d.ts diff --git a/@types/lib/metadataTypes/MobileKeyword.d.ts.map b/@types/lib/metadataTypes/MobileKeyword.d.ts.map new file mode 100644 index 000000000..dd1e21465 --- /dev/null +++ b/@types/lib/metadataTypes/MobileKeyword.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileKeyword.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MobileKeyword.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAljBwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileMessage.d.ts b/@types/lib/metadataTypes/MobileMessage.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/MobileMessage.d.ts rename to @types/lib/metadataTypes/MobileMessage.d.ts diff --git a/@types/lib/metadataTypes/MobileMessage.d.ts.map b/@types/lib/metadataTypes/MobileMessage.d.ts.map new file mode 100644 index 000000000..9f36eec1d --- /dev/null +++ b/@types/lib/metadataTypes/MobileMessage.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileMessage.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MobileMessage.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA+NH;;;;;;;;;;eAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAxWkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Query.d.ts b/@types/lib/metadataTypes/Query.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Query.d.ts rename to @types/lib/metadataTypes/Query.d.ts diff --git a/@types/lib/metadataTypes/Query.d.ts.map b/@types/lib/metadataTypes/Query.d.ts.map new file mode 100644 index 000000000..6f5934b0d --- /dev/null +++ b/@types/lib/metadataTypes/Query.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Query.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCA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,CAiBhC;IACD;;;;;;;;;;;;OAYG;IACH,+BAkDC;IAoDD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAM1B;IACD;;;;OAIG;IACH,sCAFW,eAAe,iBAOzB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3dwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Role.d.ts b/@types/lib/metadataTypes/Role.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Role.d.ts rename to @types/lib/metadataTypes/Role.d.ts diff --git a/@types/lib/metadataTypes/Role.d.ts.map b/@types/lib/metadataTypes/Role.d.ts.map new file mode 100644 index 000000000..96e4cbf20 --- /dev/null +++ b/@types/lib/metadataTypes/Role.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Role.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Role.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;kCAClD,OAAO,wBAAwB,EAAE,mBAAmB;0BACpD,OAAO,wBAAwB,EAAE,WAAW;AAXzD;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,QACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAsFxC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,gBAAgB,CAS5B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,2BAHW,eAAe,GACb,QAAS,IAAI,CAAC,CA0G1B;IAED;;;;;;;;;;OAUG;IACH,4BAPW,MAAM,WACN,MAAM,eACN,MAAM,cACN,MAAM,GAEJ,IAAI,CAyDhB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7UwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Script.d.ts b/@types/lib/metadataTypes/Script.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Script.d.ts rename to @types/lib/metadataTypes/Script.d.ts diff --git a/@types/lib/metadataTypes/Script.d.ts.map b/@types/lib/metadataTypes/Script.d.ts.map new file mode 100644 index 000000000..5c92bab2f --- /dev/null +++ b/@types/lib/metadataTypes/Script.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;yBAI5C,OAAO,wBAAwB,EAAE,UAAU;wBAC3C,OAAO,w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AAM,EAAE,EAAE,CAAC,CAsDhC;IAED;;;;;OAKG;IACH,mCAHW,UAAU,GACR,eAAe,CAmB3B;IAED;;;;;;OAMG;IACH,yCAJW,MAAM,gBACN,MAAM,GACJ;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAiBxC;IAwBD;;;;;;OAMG;IACH,6CAWC;IAiBD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAU1B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA7WD;;;mBAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/SendClassification.d.ts b/@types/lib/metadataTypes/SendClassification.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/SendClassification.d.ts rename to @types/lib/metadataTypes/SendClassification.d.ts diff --git a/@types/lib/metadataTypes/SendClassification.d.ts.map b/@types/lib/metadataTypes/SendClassification.d.ts.map new file mode 100644 index 000000000..ecd666f65 --- /dev/null +++ b/@types/lib/metadataTypes/SendClassification.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SendClassification.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/SendClassification.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAWD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CA4BtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiC5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnJwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/SenderProfile.d.ts b/@types/lib/metadataTypes/SenderProfile.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/SenderProfile.d.ts rename to @types/lib/metadataTypes/SenderProfile.d.ts diff --git a/@types/lib/metadataTypes/SenderProfile.d.ts.map b/@types/lib/metadataTypes/SenderProfile.d.ts.map new file mode 100644 index 000000000..b4ef21b66 --- /dev/null +++ b/@types/lib/metadataTypes/SenderProfile.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SenderProfile.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/SenderProfile.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyBtC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAzEO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiCpC;;;;;mBAKG;;;;;;;;;;mCAKH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhFkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalEmail.d.ts b/@types/lib/metadataTypes/TransactionalEmail.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/TransactionalEmail.d.ts rename to @types/lib/metadataTypes/TransactionalEmail.d.ts diff --git a/@types/lib/metadataTypes/TransactionalEmail.d.ts.map b/@types/lib/metadataTypes/TransactionalEmail.d.ts.map new file mode 100644 index 000000000..be34aa627 --- /dev/null +++ b/@types/lib/metadataTypes/TransactionalEmail.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalEmail.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TransactionalEmail.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAyB;IACzB,oBAAoB;IACpB,kCAA2B;IAqB3B;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyCtC;IACD;;;;;;OAMG;IACH,0BAJW,gBAAgB,eAChB,MAAM,GACJ,QAAS,IAAI,CAAC,CAe1B;IACD;;;;OAIG;IACH,0BAFa,IAAI,CAWhB;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAmF5B;CA2BJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCApPgC,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalMessage.d.ts b/@types/lib/metadataTypes/TransactionalMessage.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/TransactionalMessage.d.ts rename to @types/lib/metadataTypes/TransactionalMessage.d.ts diff --git a/@types/lib/metadataTypes/TransactionalMessage.d.ts.map b/@types/lib/metadataTypes/TransactionalMessage.d.ts.map new file mode 100644 index 000000000..9194b5e09 --- /dev/null +++ b/@types/lib/metadataTypes/TransactionalMessage.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalMessage.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TransactionalMessage.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IAEI,oBAAe;IACf;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2CxC;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAOxC;IACD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;CAcJ;;;;;;QA1HD;;;;;;;;;;;WAWG;QAEH;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhCkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalPush.d.ts b/@types/lib/metadataTypes/TransactionalPush.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/TransactionalPush.d.ts rename to @types/lib/metadataTypes/TransactionalPush.d.ts diff --git a/@types/lib/metadataTypes/TransactionalPush.d.ts.map b/@types/lib/metadataTypes/TransactionalPush.d.ts.map new file mode 100644 index 000000000..31d4b8252 --- /dev/null +++ b/@types/lib/metadataTypes/TransactionalPush.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalPush.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TransactionalPush.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAwB;IAExB;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqBtC;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA4B5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAnED;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA8BC;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAxD0B,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalSMS.d.ts b/@types/lib/metadataTypes/TransactionalSMS.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/TransactionalSMS.d.ts rename to @types/lib/metadataTypes/TransactionalSMS.d.ts diff --git a/@types/lib/metadataTypes/TransactionalSMS.d.ts.map b/@types/lib/metadataTypes/TransactionalSMS.d.ts.map new file mode 100644 index 000000000..d7fbb11a9 --- /dev/null +++ b/@types/lib/metadataTypes/TransactionalSMS.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalSMS.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TransactionalSMS.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAuB;IACvB;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAM1B;IAqDD;;;;;;;OAOG;IACH,4BALW,gBAAgB,aAChB,MAAM,iBACN,MAAM,GACJ,QAAS,MAAM,CAAC,CAmB5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,QAAS,eAAe,CAAC,CAqErC;IACD;;;;;OAKG;IACH,yCAHW,MAAM,GACJ,QAAS;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC,CAOlD;IAyDD;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,gBAAgB,qBAChB,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAqDhC;IACD;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;CAsBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAzTG;;;;;;eAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA3C0B,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TriggeredSend.d.ts b/@types/lib/metadataTypes/TriggeredSend.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/TriggeredSend.d.ts rename to @types/lib/metadataTypes/TriggeredSend.d.ts diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts.map b/@types/lib/metadataTypes/TriggeredSend.d.ts.map new file mode 100644 index 000000000..a30298c50 --- /dev/null +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAO1B;IAYD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAwGnC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqFtC;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,aACR,OAAO,GACL,QAAS,IAAI,CAAC,CAkB1B;IAED;;;;;OAKG;IACH,qCAHW,eAAe,GACb,QAAS,MAAM,EAAE,CAAC,CAS9B;IACD;;;;;OAKG;IACH,0CAHW,OAAO,GACL,QAAS,kBAAkB,CAAC,CAqDxC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,YACN,OAAO,GACL,QAAS,OAAO,CAAC,CA8F7B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA7YG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAyOH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2CC,gCAAgC;;;eAAhC,gCAAgC;;;;;;;;;;;;;yBA5Xf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/User.d.ts b/@types/lib/metadataTypes/User.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/User.d.ts rename to @types/lib/metadataTypes/User.d.ts diff --git a/@types/lib/metadataTypes/User.d.ts.map b/@types/lib/metadataTypes/User.d.ts.map new file mode 100644 index 000000000..c1e343c67 --- /dev/null +++ b/@types/lib/metadataTypes/User.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/User.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAI5C,OAAO,wBAAwB,EAAE,YAAY;mCAC7C,OAAO,wBAAwB,EAAE,oBAAoB;+BACrD,OAAO,wBAAwB,EAAE,gBAAgB;8BACjD,OAAO,wBAAwB,EAAE,eAAe;uCAChD,OAAO,wBAAwB,EAAE,wBAAwB;AAlBtE;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AAEH;;;;GAIG;AACH;IACI,8BAAyB;IACzB;;;;;;;;OAQG;IACH,6BANW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAQxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IACD;;;;;OAKG;IACH,gCAHW,YAAY,GACV,QAAS,YAAY,CAAC,CA2HlC;IACD;;;;;;;;;OASG;IACH,gCAPW,eAAe,eACf,MAAM,YACN,OAAO,oBACP,gBAAgB,EAAE,oBAClB,YAAY,EAAE,GACZ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7EkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Verification.d.ts b/@types/lib/metadataTypes/Verification.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/Verification.d.ts rename to @types/lib/metadataTypes/Verification.d.ts diff --git a/@types/lib/metadataTypes/Verification.d.ts.map b/@types/lib/metadataTypes/Verification.d.ts.map new file mode 100644 index 000000000..f666fa919 --- /dev/null +++ b/@types/lib/metadataTypes/Verification.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Verification.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Verification.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;wBAC5C,OAAO,wBAAwB,EAAE,SAAS;+BAI1C,OAAO,wBAAwB,EAAE,gBAAgB;AAf9D;;;;;;;;;;;;GAYG;AAEH;;GAEG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAsExC;IACD;;;;;;OAMG;IACH,qCAHW,MAAM,GACJ,IAAI,CAehB;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;;;OAOG;IACH,sCALW,gBAAgB,eAChB,MAAM,8BACN,gBAAgB,GACd,QAAS,IAAI,CAAC,CAuB1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAWtC;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiB5B;CAUJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9OwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts b/@types/lib/metadataTypes/definitions/Asset.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts rename to @types/lib/metadataTypes/definitions/Asset.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Asset.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Asset.definition.d.ts.map new file mode 100644 index 000000000..a42902167 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Asset.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Asset.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Asset.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts b/@types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts rename to @types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map b/@types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map new file mode 100644 index 000000000..c2e765326 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeGroup.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/AttributeGroup.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts b/@types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts rename to @types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map b/@types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map new file mode 100644 index 000000000..938075179 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"AttributeSet.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/AttributeSet.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts b/@types/lib/metadataTypes/definitions/Automation.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts rename to @types/lib/metadataTypes/definitions/Automation.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Automation.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Automation.definition.d.ts.map new file mode 100644 index 000000000..0651d8713 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Automation.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Automation.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Automation.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts b/@types/lib/metadataTypes/definitions/Campaign.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts rename to @types/lib/metadataTypes/definitions/Campaign.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Campaign.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Campaign.definition.d.ts.map new file mode 100644 index 000000000..b1bc1b5ff --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Campaign.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Campaign.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Campaign.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts b/@types/lib/metadataTypes/definitions/ContentArea.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts rename to @types/lib/metadataTypes/definitions/ContentArea.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map b/@types/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map new file mode 100644 index 000000000..63874950b --- /dev/null +++ b/@types/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ContentArea.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/ContentArea.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts b/@types/lib/metadataTypes/definitions/DataExtension.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts rename to @types/lib/metadataTypes/definitions/DataExtension.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map b/@types/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map new file mode 100644 index 000000000..1ed66312c --- /dev/null +++ b/@types/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtension.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/DataExtension.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts b/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts rename to @types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map b/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map new file mode 100644 index 000000000..2a063ffae --- /dev/null +++ b/@types/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionField.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/DataExtensionField.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts b/@types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts rename to @types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map b/@types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map new file mode 100644 index 000000000..250fb5823 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtensionTemplate.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/DataExtensionTemplate.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts b/@types/lib/metadataTypes/definitions/DataExtract.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts rename to @types/lib/metadataTypes/definitions/DataExtract.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map b/@types/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map new file mode 100644 index 000000000..043d14425 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtract.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/DataExtract.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts b/@types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts rename to @types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map b/@types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map new file mode 100644 index 000000000..12479160a --- /dev/null +++ b/@types/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DataExtractType.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/DataExtractType.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts b/@types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts rename to @types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map b/@types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map new file mode 100644 index 000000000..191378906 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"DeliveryProfile.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/DeliveryProfile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts b/@types/lib/metadataTypes/definitions/Discovery.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts rename to @types/lib/metadataTypes/definitions/Discovery.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Discovery.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Discovery.definition.d.ts.map new file mode 100644 index 000000000..3ad189934 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Discovery.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Discovery.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Discovery.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts b/@types/lib/metadataTypes/definitions/Email.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Email.definition.d.ts rename to @types/lib/metadataTypes/definitions/Email.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Email.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Email.definition.d.ts.map new file mode 100644 index 000000000..3fe666023 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Email.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Email.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Email.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts b/@types/lib/metadataTypes/definitions/EmailSend.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts rename to @types/lib/metadataTypes/definitions/EmailSend.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map b/@types/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map new file mode 100644 index 000000000..f5e9718d2 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"EmailSend.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/EmailSend.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts b/@types/lib/metadataTypes/definitions/Event.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Event.definition.d.ts rename to @types/lib/metadataTypes/definitions/Event.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Event.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Event.definition.d.ts.map new file mode 100644 index 000000000..5e575ee49 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Event.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Event.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Event.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts b/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts rename to @types/lib/metadataTypes/definitions/FileLocation.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map b/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map new file mode 100644 index 000000000..0500b8650 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileLocation.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/FileLocation.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts b/@types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts rename to @types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map b/@types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map new file mode 100644 index 000000000..b9254d252 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"FileTransfer.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/FileTransfer.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts b/@types/lib/metadataTypes/definitions/Filter.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts rename to @types/lib/metadataTypes/definitions/Filter.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Filter.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Filter.definition.d.ts.map new file mode 100644 index 000000000..4ec6a7e9f --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Filter.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Filter.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Filter.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts b/@types/lib/metadataTypes/definitions/Folder.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts rename to @types/lib/metadataTypes/definitions/Folder.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Folder.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Folder.definition.d.ts.map new file mode 100644 index 000000000..906ed18cc --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Folder.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Folder.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Folder.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts b/@types/lib/metadataTypes/definitions/ImportFile.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts rename to @types/lib/metadataTypes/definitions/ImportFile.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map b/@types/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map new file mode 100644 index 000000000..162bec723 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ImportFile.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/ImportFile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts b/@types/lib/metadataTypes/definitions/Journey.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts rename to @types/lib/metadataTypes/definitions/Journey.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Journey.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Journey.definition.d.ts.map new file mode 100644 index 000000000..1671e93e0 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Journey.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Journey.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Journey.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/List.definition.d.ts b/@types/lib/metadataTypes/definitions/List.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/List.definition.d.ts rename to @types/lib/metadataTypes/definitions/List.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/List.definition.d.ts.map b/@types/lib/metadataTypes/definitions/List.definition.d.ts.map new file mode 100644 index 000000000..b47c1a2f7 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/List.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"List.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/List.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts b/@types/lib/metadataTypes/definitions/MobileCode.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts rename to @types/lib/metadataTypes/definitions/MobileCode.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map b/@types/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map new file mode 100644 index 000000000..97b5663e0 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileCode.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/MobileCode.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts b/@types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts rename to @types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map b/@types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map new file mode 100644 index 000000000..91621d4ce --- /dev/null +++ b/@types/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileKeyword.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/MobileKeyword.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts b/@types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts rename to @types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map b/@types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map new file mode 100644 index 000000000..676c59a9d --- /dev/null +++ b/@types/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MobileMessage.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/MobileMessage.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts b/@types/lib/metadataTypes/definitions/Query.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Query.definition.d.ts rename to @types/lib/metadataTypes/definitions/Query.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Query.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Query.definition.d.ts.map new file mode 100644 index 000000000..87130d0a3 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Query.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Query.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Query.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts b/@types/lib/metadataTypes/definitions/Role.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Role.definition.d.ts rename to @types/lib/metadataTypes/definitions/Role.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Role.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Role.definition.d.ts.map new file mode 100644 index 000000000..d8d9b3e4e --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Role.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Role.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Role.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts b/@types/lib/metadataTypes/definitions/Script.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Script.definition.d.ts rename to @types/lib/metadataTypes/definitions/Script.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Script.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Script.definition.d.ts.map new file mode 100644 index 000000000..49943a227 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Script.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Script.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Script.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts b/@types/lib/metadataTypes/definitions/SendClassification.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts rename to @types/lib/metadataTypes/definitions/SendClassification.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map b/@types/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map new file mode 100644 index 000000000..41098cc77 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SendClassification.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/SendClassification.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts b/@types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts rename to @types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map b/@types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map new file mode 100644 index 000000000..56a95021e --- /dev/null +++ b/@types/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"SenderProfile.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/SenderProfile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts b/@types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts rename to @types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map b/@types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map new file mode 100644 index 000000000..375a490ac --- /dev/null +++ b/@types/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalEmail.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/TransactionalEmail.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts b/@types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts rename to @types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map b/@types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map new file mode 100644 index 000000000..b5152e71b --- /dev/null +++ b/@types/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalMessage.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/TransactionalMessage.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts b/@types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts rename to @types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map b/@types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map new file mode 100644 index 000000000..e3b3bee6e --- /dev/null +++ b/@types/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalPush.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/TransactionalPush.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts b/@types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts rename to @types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map b/@types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map new file mode 100644 index 000000000..c5da627ba --- /dev/null +++ b/@types/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TransactionalSMS.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/TransactionalSMS.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts b/@types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts rename to @types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map b/@types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map new file mode 100644 index 000000000..d95c59801 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"TriggeredSend.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/TriggeredSend.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/User.definition.d.ts b/@types/lib/metadataTypes/definitions/User.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/User.definition.d.ts rename to @types/lib/metadataTypes/definitions/User.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/User.definition.d.ts.map b/@types/lib/metadataTypes/definitions/User.definition.d.ts.map new file mode 100644 index 000000000..3e9c3e5d8 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/User.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"User.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/User.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts b/@types/lib/metadataTypes/definitions/Verification.definition.d.ts similarity index 100% rename from types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts rename to @types/lib/metadataTypes/definitions/Verification.definition.d.ts diff --git a/@types/lib/metadataTypes/definitions/Verification.definition.d.ts.map b/@types/lib/metadataTypes/definitions/Verification.definition.d.ts.map new file mode 100644 index 000000000..8d750fb90 --- /dev/null +++ b/@types/lib/metadataTypes/definitions/Verification.definition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Verification.definition.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/definitions/Verification.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/retrieveChangelog.d.ts b/@types/lib/retrieveChangelog.d.ts similarity index 100% rename from types/ts/lib/retrieveChangelog.d.ts rename to @types/lib/retrieveChangelog.d.ts diff --git a/@types/lib/retrieveChangelog.d.ts.map b/@types/lib/retrieveChangelog.d.ts.map new file mode 100644 index 000000000..ddb2b83b1 --- /dev/null +++ b/@types/lib/retrieveChangelog.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"retrieveChangelog.d.ts","sourceRoot":"","sources":["../../lib/retrieveChangelog.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/util/auth.d.ts b/@types/lib/util/auth.d.ts similarity index 100% rename from types/ts/lib/util/auth.d.ts rename to @types/lib/util/auth.d.ts diff --git a/@types/lib/util/auth.d.ts.map b/@types/lib/util/auth.d.ts.map new file mode 100644 index 000000000..ff10bbd26 --- /dev/null +++ b/@types/lib/util/auth.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../lib/util/auth.js"],"names":[],"mappings":";yBAMa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAYtD;;;;;;OAMG;IACH,oHA8BC;IACD;;;;;OAKG;IACH,0EAkBC;IACD;;;;OAIG;IACH,+BAGC"} \ No newline at end of file diff --git a/types/ts/lib/util/businessUnit.d.ts b/@types/lib/util/businessUnit.d.ts similarity index 100% rename from types/ts/lib/util/businessUnit.d.ts rename to @types/lib/util/businessUnit.d.ts diff --git a/@types/lib/util/businessUnit.d.ts.map b/@types/lib/util/businessUnit.d.ts.map new file mode 100644 index 000000000..2a1a47b63 --- /dev/null +++ b/@types/lib/util/businessUnit.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"businessUnit.d.ts","sourceRoot":"","sources":["../../../lib/util/businessUnit.js"],"names":[],"mappings":";yBAOa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAcjC,8HAqFpB"} \ No newline at end of file diff --git a/types/ts/lib/util/cache.d.ts b/@types/lib/util/cache.d.ts similarity index 100% rename from types/ts/lib/util/cache.d.ts rename to @types/lib/util/cache.d.ts diff --git a/@types/lib/util/cache.d.ts.map b/@types/lib/util/cache.d.ts.map new file mode 100644 index 000000000..e606d6810 --- /dev/null +++ b/@types/lib/util/cache.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../lib/util/cache.js"],"names":[],"mappings":";IAkCe,8EAWV;IAMS;;;;MAA2B;IASzB,wCAG4D;IAU9D,kDAAmD;IAQhD;;aAEZ;IASc;;mCAUd;IACD;;;;;;;;;OASG;IACH,8JAgCC;IACD;;;;;;;OAOG;IACH,sGA4BC;IACD;;;;;;;OAOG;IACH,oHAyBC;;;yBArNQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY"} \ No newline at end of file diff --git a/types/ts/lib/util/cli.d.ts b/@types/lib/util/cli.d.ts similarity index 100% rename from types/ts/lib/util/cli.d.ts rename to @types/lib/util/cli.d.ts diff --git a/@types/lib/util/cli.d.ts.map b/@types/lib/util/cli.d.ts.map new file mode 100644 index 000000000..afad3e49e --- /dev/null +++ b/@types/lib/util/cli.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../lib/util/cli.js"],"names":[],"mappings":";yBAca,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;;IAQrD;;;;;OAKG;IACH,sDAQC;IACD;;;;;OAKG;IACH,6GAgBC;IAED;;;;OAIG;IACH,2EAgCC;IACD;;;;;OAKG;IACH,4FAOC;IACD;;;;;;;;OAQG;IACH,mJAQC;IACD;;;;;;;;OAQG;IACH,gNAqEC;IACD;;;;;;;;OAQG;IACH;;;OAsEC;IACD;;;;;;;OAOG;IACH,kJA4DC;IAED;;;;;;OAMG;IACH,gHAmFC;IACD;;;;;;OAMG;IACH,kHAmGC;IACD;;;;;;;;OAQG;IACH;;2BAsBC;IAED;;;;OAIG;IACH,wEAoGC"} \ No newline at end of file diff --git a/types/ts/lib/util/config.d.ts b/@types/lib/util/config.d.ts similarity index 100% rename from types/ts/lib/util/config.d.ts rename to @types/lib/util/config.d.ts diff --git a/@types/lib/util/config.d.ts.map b/@types/lib/util/config.d.ts.map new file mode 100644 index 000000000..ed63a9eda --- /dev/null +++ b/@types/lib/util/config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../lib/util/config.js"],"names":[],"mappings":";yBASa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;;IAStD;;;;;;OAMG;IACH,8GAyDC;IACD;;;;;;OAMG;IACH,8HAmMC;IACD;;;;;OAKG;IACH,mFAcC"} \ No newline at end of file diff --git a/types/ts/lib/util/devops.d.ts b/@types/lib/util/devops.d.ts similarity index 100% rename from types/ts/lib/util/devops.d.ts rename to @types/lib/util/devops.d.ts diff --git a/@types/lib/util/devops.d.ts.map b/@types/lib/util/devops.d.ts.map new file mode 100644 index 000000000..2a04c0836 --- /dev/null +++ b/@types/lib/util/devops.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"devops.d.ts","sourceRoot":"","sources":["../../../lib/util/devops.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAOtD;;;;;;;;;;OAUG;IACH,kOAqTC;IACD;;;;;;;;OAQG;IACH,iPA+KC;IAED;;;;;;OAMG;IACH,4DA2BC;IACD;;;;;;;;;OASG;IACH,gMAIC"} \ No newline at end of file diff --git a/types/ts/lib/util/file.d.ts b/@types/lib/util/file.d.ts similarity index 100% rename from types/ts/lib/util/file.d.ts rename to @types/lib/util/file.d.ts diff --git a/@types/lib/util/file.d.ts.map b/@types/lib/util/file.d.ts.map new file mode 100644 index 000000000..5b09f3274 --- /dev/null +++ b/@types/lib/util/file.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../lib/util/file.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;AAsiB1D,0BAAkC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.config.d.ts b/@types/lib/util/init.config.d.ts similarity index 100% rename from types/ts/lib/util/init.config.d.ts rename to @types/lib/util/init.config.d.ts diff --git a/@types/lib/util/init.config.d.ts.map b/@types/lib/util/init.config.d.ts.map new file mode 100644 index 000000000..56ffad974 --- /dev/null +++ b/@types/lib/util/init.config.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.config.d.ts","sourceRoot":"","sources":["../../../lib/util/init.config.js"],"names":[],"mappings":";yBAaa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAQtD;;;;;OAKG;IACH,gGA0LC;IAED;;;;;OAKG;IACH,8EA+DC;IACD;;;;;;;OAOG;IACH,yFAgBC;IACD;;;;;OAKG;IACH,yEAsBC;IACD;;;;;;;OAOG;IACH,yIAiEC;IACD;;;;OAIG;IACH,6CAuBC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.d.ts b/@types/lib/util/init.d.ts similarity index 100% rename from types/ts/lib/util/init.d.ts rename to @types/lib/util/init.d.ts diff --git a/@types/lib/util/init.d.ts.map b/@types/lib/util/init.d.ts.map new file mode 100644 index 000000000..c965f02c3 --- /dev/null +++ b/@types/lib/util/init.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../lib/util/init.js"],"names":[],"mappings":";yBAaa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAQtD;;;;;;;OAOG;IACH,yIAyKC;IAED;;;;OAIG;IACH,sCAyEC;IACD;;OAEG;IACH,uCAwDC;IACD;;;;;;OAMG;IACH,uEAgCC;IACD;;;;;;;OAOG;IACH,sIAqCC;IACD;;;;;OAKG;IACH,gDAgDC;IAED;;;;;;OAMG;IACH,gGAuBC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.git.d.ts b/@types/lib/util/init.git.d.ts similarity index 100% rename from types/ts/lib/util/init.git.d.ts rename to @types/lib/util/init.git.d.ts diff --git a/@types/lib/util/init.git.d.ts.map b/@types/lib/util/init.git.d.ts.map new file mode 100644 index 000000000..e0cd8dc04 --- /dev/null +++ b/@types/lib/util/init.git.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.git.d.ts","sourceRoot":"","sources":["../../../lib/util/init.git.js"],"names":[],"mappings":";;IAcI;;;;OAIG;IACH;;;OAyDC;IACD;;;;OAIG;IACH,kCAwCC;IACD;;;;OAIG;IACH,0CAgDC;IACD;;;;OAIG;IACH,+CAkEC;IACD;;;;OAIG;IACH;;;OAKC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.npm.d.ts b/@types/lib/util/init.npm.d.ts similarity index 100% rename from types/ts/lib/util/init.npm.d.ts rename to @types/lib/util/init.npm.d.ts diff --git a/@types/lib/util/init.npm.d.ts.map b/@types/lib/util/init.npm.d.ts.map new file mode 100644 index 000000000..5c8f1df41 --- /dev/null +++ b/@types/lib/util/init.npm.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"init.npm.d.ts","sourceRoot":"","sources":["../../../lib/util/init.npm.js"],"names":[],"mappings":";;IAcI;;;;;;;OAOG;IACH,kEAsGC;IACD;;;;;OAKG;IACH;;;;OAwBC"} \ No newline at end of file diff --git a/types/ts/lib/util/util.d.ts b/@types/lib/util/util.d.ts similarity index 100% rename from types/ts/lib/util/util.d.ts rename to @types/lib/util/util.d.ts diff --git a/@types/lib/util/util.d.ts.map b/@types/lib/util/util.d.ts.map new file mode 100644 index 000000000..e20b0c5fa --- /dev/null +++ b/@types/lib/util/util.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG;IACH,sGAqCC;IACD;;;;OAIG;IACH,kCAGC;IACD;;;;;;OAMG;IACH,yCAEC;IACD;;;;;;OAMG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,8EAkBC;IAED;;;;;OAKG;IACH;;;MASC;IAED;;;;OAIG;IACH,4CAyBC;IAO0B,6DAmE1B;;gBAMS,MAAM;IAUH,mEA8EZ;IAWe,0GAef;IASgB;;YAyBhB;IASW,6DAOX;IAED;;;;;OAKG;IACH,2DAiBC;IAED;;;;;OAKG;IACH;;MAqFC;IAED;;;;;;OAMG;IACH,qDAEC;IACD;;;;;;;OAOG;IACH,qFAqBC;IACD;;;;;;;OAOG;IACH,6FAYC;IACD;;;;;;;;OAQG;IACH;;;;aAyBC;IACD;;;;OAIG;IACH,qCAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BD;;;;;OAKG;IACH,yCAEC;IACD;;;;;OAKG;IACH,iDAQC;IACD;;;;;;OAMG;IACH,0EAcC;IACD;;;;;OAKG;IACH,0CAIC;IACD;;;;;;;;;;;;;;;;;OAiBG;IACH,uCA0BC;IACD;;;;;;OAMG;IACH,iEAaC;IACD;;;;;;OAMG;IACH,2DA6BC;IACD;;;;;OAKG;IACH,oDAEC;IACD;;;;;;;OAOG;IACH,6FAaC;;yBA16BQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file diff --git a/types/ts/types/mcdev.d.d.ts b/@types/types/mcdev.d.d.ts similarity index 100% rename from types/ts/types/mcdev.d.d.ts rename to @types/types/mcdev.d.d.ts diff --git a/@types/types/mcdev.d.d.ts.map b/@types/types/mcdev.d.d.ts.map new file mode 100644 index 000000000..0bb345e3c --- /dev/null +++ b/@types/types/mcdev.d.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"mcdev.d.d.ts","sourceRoot":"","sources":["../../types/mcdev.d.js"],"names":[],"mappings":";;;;;;eAEc,MAAM;;;;mBACN,MAAM;;;;aACN,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;mBACN,MAAM;;;;iBACN,MAAM;;;QAGC,MAAM,GAAE,MAAM;;qCACtB,OAAO,GAAC,eAAe,GAAC,aAAa,GAAC,aAAa,GAAC,aAAa,GAAC,YAAY,GAAC,gBAAgB,GAAC,aAAa,GAAC,eAAe,GAAC,aAAa,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,aAAa,GAAC,gBAAgB,GAAC,cAAc,GAAC,YAAY,GAAC,UAAU,GAAC,aAAa,GAAC,eAAe,GAAC,oBAAoB,GAAC,uBAAuB,GAAC,aAAa,GAAC,iBAAiB,GAAC,WAAW,GAAC,iBAAiB,GAAC,OAAO,GAAC,WAAW,GAAC,OAAO,GAAC,cAAc,GAAC,cAAc,GAAC,QAAQ,GAAC,QAAQ,GAAC,YAAY,GAAC,SAAS,GAAC,MAAM,GAAC,YAAY,GAAC,eAAe,GAAC,eAAe,GAAC,OAAO,GAAC,MAAM,GAAC,QAAQ,GAAC,oBAAoB,GAAC,eAAe,GAAC,oBAAoB,GAAC,mBAAmB,GAAC,kBAAkB,GAAC,eAAe,GAAC,MAAM,GAAC,cAAc;;;;;;;;;;;;;QAM3rB,MAAM,GAAE,gBAAgB;;;;;;QACxB,MAAM,GAAE,eAAe;;;;;;QACvB,MAAM,GAAE,gBAAgB,EAAE;;iCAClC;IAAC,QAAQ,EAAE,eAAe,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC;kCACzC;IAAC,QAAQ,EAAE,gBAAgB,CAA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iBACN,MAAM;;;;uBACN,OAAO,GAAG,MAAM,EAAE;;;;;QAEA,QAAQ,EAA1B,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,SAAS,EAA3B,OAAO;QACW,aAAa,EAA/B,OAAO;QACW,kBAAkB,EAApC,OAAO"} \ No newline at end of file diff --git a/package.json b/package.json index d218e3393..b1fceb749 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,10 @@ "rest" ], "main": "./lib/index.js", - "types": "./types/lib/index.d.ts", + "types": "./@types/lib/index.d.ts", "exports": { ".": { + "types": "./@types/lib/index.d.ts", "default": "./lib/index.js" }, "./*": "./*.js" diff --git a/tsconfig.json b/tsconfig.json index 9019b17f7..427a15e78 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,7 +13,7 @@ // Types should go into this directory. // Removing this would place the .d.ts files // next to the .js files - "outDir": "types/ts", + "outDir": "@types", // go to js file when using IDE functions like // "Go to Definition" in VSCode "declarationMap": true diff --git a/types/ts/lib/Builder.d.ts.map b/types/ts/lib/Builder.d.ts.map deleted file mode 100644 index 815755e4a..000000000 --- a/types/ts/lib/Builder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Builder.d.ts","sourceRoot":"","sources":["../../../lib/Builder.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;AAZtD;;;;;;;;;;;;;GAaG;AAEH;;GAEG;AACH;IAsEI;;;;;;;;OAQG;IACH,mCANW,MAAM,gBACN,MAAM,UACN,MAAM,EAAE,UACR,MAAM,GACJ,QAAS,qBAAqB,CAAC,CAuB3C;IAoCD;;;;;;;;OAQG;IACH,qCANW,MAAM,gBACN,MAAM,WACN,MAAM,EAAE,UACR,MAAM,GACJ,QAAS,qBAAqB,CAAC,CAuB3C;IACD;;;;;;;OAOG;IACH,qCALW,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CAoD5B;IAhOD;;;;;;OAMG;IACH,wBAJW,OAAO,YAEP,QAAQ,EAyBlB;IAtBG,kDAA4B;IAC5B,oBAAkD;IAClD,iBAIE;IACF,iDAAwB;IAMxB,oBAGC;IAED;;OAEG;IACH,UAFU,qBAAqB,CAEb;IAGtB;;;;;;;OAOG;IACH,+BALW,MAAM,WACN,MAAM,EAAE,qBACR,WAAW,GACT,QAAS,qBAAqB,CAAC,CA8B3C;IAgCD;;;;;;;OAOG;IACH,6BALW,MAAM,UACN,MAAM,EAAE,qBACR,WAAW,GACT,QAAS,qBAAqB,CAAC,CA4B3C;CA2FJ"} \ No newline at end of file diff --git a/types/ts/lib/Deployer.d.ts.map b/types/ts/lib/Deployer.d.ts.map deleted file mode 100644 index 6d3e3cdab..000000000 --- a/types/ts/lib/Deployer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Deployer.d.ts","sourceRoot":"","sources":["../../../lib/Deployer.js"],"names":[],"mappings":";uBAYa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;mCACzC,OAAO,qBAAqB,EAAE,oBAAoB;2BAClD,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH;IAwBI;;;;;;;OAOG;IACH,4BALW,MAAM,qBACN,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,oBAAoB;MAAE,CA2J3D;IACD;;;;;;;;;OASG;IACH,uBAPW,MAAM,MACN,MAAM,cACN,OAAO,YACP,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAmB1C;IAiHD;;;;;;;OAOG;IACH,iCALW,MAAM,YACN,MAAM,EAAE,gBACR,OAAO,GACL,oBAAoB,CA4BhC;IAED;;;;;;;OAOG;IACH,0CALW,MAAM,YACN,oBAAoB,mBACpB,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA6G5B;IA5dD;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAkBlB;IAfG,iDAAwB;IACxB,kDAA4B;IAC5B,eAIE;IACF,iBAIE;IAoMN;;;;;;OAMG;IACH,gBAJW,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAwG1C;IAhGO,mCAAmC;IACnC,UADW,oBAAoB,CACiC;CAyP3E"} \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeDefinitions.d.ts.map b/types/ts/lib/MetadataTypeDefinitions.d.ts.map deleted file mode 100644 index 97ca45310..000000000 --- a/types/ts/lib/MetadataTypeDefinitions.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MetadataTypeDefinitions.d.ts","sourceRoot":"","sources":["../../../lib/MetadataTypeDefinitions.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEkB,iDAAiD;2BACxC,0DAA0D;yBAC5D,wDAAwD;uBAC1D,sDAAsD;qBACxD,oDAAoD;wBACjD,uDAAuD;0BACrD,yDAAyD;+BACpD,8DAA8D;kCAC3D,iEAAiE;wBAC3E,uDAAuD;4BACnD,2DAA2D;4BAC3D,2DAA2D;sBACjE,qDAAqD;kBACzD,iDAAiD;sBAC7C,qDAAqD;kBACzD,iDAAiD;yBAC1C,wDAAwD;yBACxD,wDAAwD;mBAC9D,kDAAkD;mBAClD,kDAAkD;uBAC9C,sDAAsD;oBACzD,mDAAmD;iBACtD,gDAAgD;uBAC1C,sDAAsD;0BACnD,yDAAyD;0BACzD,yDAAyD;kBACjE,iDAAiD;iBAClD,gDAAgD;mBAC9C,kDAAkD;+BACtC,8DAA8D;0BACnE,yDAAyD;iCAClD,gEAAgE;+BAClE,8DAA8D;8BAC/D,6DAA6D;6BAC9D,4DAA4D;0BAC/D,yDAAyD;iBAClE,gDAAgD;yBACxC,wDAAwD"} \ No newline at end of file diff --git a/types/ts/lib/MetadataTypeInfo.d.ts.map b/types/ts/lib/MetadataTypeInfo.d.ts.map deleted file mode 100644 index 1cc2633be..000000000 --- a/types/ts/lib/MetadataTypeInfo.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MetadataTypeInfo.d.ts","sourceRoot":"","sources":["../../../lib/MetadataTypeInfo.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEkB,0BAA0B;2BACjB,mCAAmC;yBACrC,iCAAiC;uBACnC,+BAA+B;qBACjC,6BAA6B;wBAC1B,gCAAgC;0BAC9B,kCAAkC;+BAC7B,uCAAuC;kCACpC,0CAA0C;wBACpD,gCAAgC;4BAC5B,oCAAoC;4BACpC,oCAAoC;sBAC1C,8BAA8B;kBAClC,0BAA0B;sBACtB,8BAA8B;kBAClC,0BAA0B;yBACnB,iCAAiC;yBACjC,iCAAiC;mBACvC,2BAA2B;mBAC3B,2BAA2B;uBACvB,+BAA+B;oBAClC,4BAA4B;iBAC/B,yBAAyB;uBACnB,+BAA+B;0BAC5B,kCAAkC;0BAClC,kCAAkC;kBAC1C,0BAA0B;iBAC3B,yBAAyB;mBACvB,2BAA2B;+BACf,uCAAuC;0BAC5C,kCAAkC;+BAC7B,uCAAuC;8BACxC,sCAAsC;6BACvC,qCAAqC;0BACxC,kCAAkC;iBAC3C,yBAAyB;yBACjB,iCAAiC"} \ No newline at end of file diff --git a/types/ts/lib/Retriever.d.ts.map b/types/ts/lib/Retriever.d.ts.map deleted file mode 100644 index ed7621f9d..000000000 --- a/types/ts/lib/Retriever.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Retriever.d.ts","sourceRoot":"","sources":["../../../lib/Retriever.js"],"names":[],"mappings":";uBAUa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;gCAClD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;GAEG;AACH;IACI;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAYlB;IATG,iDAAwB;IACxB,kDAA4B;IAC5B,oBAAkD;IAClD,oBAAkD;IAClD,cAIE;IAGN;;;;;;;;OAQG;IACH,wBANW,MAAM,EAAE,gBACR,MAAM,EAAE,GAAG,YAAY,sBACvB,WAAW,kBACX,OAAO,GACL,QAAS,qBAAqB,CAAC,CA4I3C;IAED;;;;;OAKG;IACH,oCAHW,MAAM,EAAE,GACN,MAAM,EAAE,CAepB;CACJ"} \ No newline at end of file diff --git a/types/ts/lib/cli.d.ts.map b/types/ts/lib/cli.d.ts.map deleted file mode 100644 index 876ccb2b4..000000000 --- a/types/ts/lib/cli.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../lib/cli.js"],"names":[],"mappings":";2BAaa,OAAO,qBAAqB,EAAE,YAAY"} \ No newline at end of file diff --git a/types/ts/lib/index.d.ts.map b/types/ts/lib/index.d.ts.map deleted file mode 100644 index bd66acf77..000000000 --- a/types/ts/lib/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/index.js"],"names":[],"mappings":";uBAmBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC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,EAAE,CAAC,CAsB9B;IACD;;;;;;;OAOG;IACH,8BALW,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAK/C;IACD;;;;;;;OAOG;IACH,6BALW,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;OAOG;IACH,2BALW,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CA6D7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,gBAC3B,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CA4J/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,QAC3B,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAgD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Asset.d.ts.map b/types/ts/lib/metadataTypes/Asset.d.ts.map deleted file mode 100644 index acb2d12ca..000000000 --- a/types/ts/lib/metadataTypes/Asset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M,GACJ,MAAM,CAyBlB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;gBAr/DD;;;;mBAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAyCC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA+BH;;;;;;mBAMG;;;;;;;;;;;;;;;gBAKH;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAiDH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;uCAiBH;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4RH;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApfkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeGroup.d.ts.map b/types/ts/lib/metadataTypes/AttributeGroup.d.ts.map deleted file mode 100644 index 7d607189e..000000000 --- a/types/ts/lib/metadataTypes/AttributeGroup.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AttributeGroup.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/AttributeGroup.js"],"names":[],"mappings":";+BAOa,OAAO,wBAAwB,EAAE,gBAAgB;iCACjD,OAAO,wBAAwB,EAAE,kBAAkB;AAFhE;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA6D5B;CAOJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eANG;;;;;eAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhHkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/AttributeSet.d.ts.map b/types/ts/lib/metadataTypes/AttributeSet.d.ts.map deleted file mode 100644 index 5c2abf9b3..000000000 --- a/types/ts/lib/metadataTypes/AttributeSet.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AttributeSet.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/AttributeSet.js"],"names":[],"mappings":";+BAQa,OAAO,wBAAwB,EAAE,gBAAgB;8BACjD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;AAHhE;;;;GAIG;AAEH;;;;GAIG;AACH;IACI,mCAA8B;IAC9B;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9KkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Automation.d.ts.map b/types/ts/lib/metadataTypes/Automation.d.ts.map deleted file mode 100644 index ea9c3c7e6..000000000 --- a/types/ts/lib/metadataTypes/Automation.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Automation.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;uBACnD,OAAO,wBAAwB,EAAE,QAAQ;gCACzC,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;6BAG5C,OAAO,wBAAwB,EAAE,cAAc;gCAC/C,OAAO,wBAAwB,EAAE,iBAAiB;4BAClD,OAAO,wBAAwB,EAAE,aAAa;+BAC9C,OAAO,wBAAwB,EAAE,gBAAgB;iCACjD,OAAO,wBAAwB,EAAE,kBAAkB;qCACnD,OAAO,wBAAwB,EAAE,sBAAsB;AAnBpE;;;;;;;;;;;;GAYG;AACH;;;;;;;GAOG;AAEH;;;;GAIG;AACH;IACI,+BAAgC;IAChC,0BAAqB;IACrB,0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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyNpC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8BhC;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAzTkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Campaign.d.ts.map b/types/ts/lib/metadataTypes/Campaign.d.ts.map deleted file mode 100644 index 79d9b3ba1..000000000 --- a/types/ts/lib/metadataTypes/Campaign.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Campaign.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Campaign.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAqBxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,iCALW,MAAM,cACN,MAAM,QACN,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAaxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCApBG;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApEkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/ContentArea.d.ts.map b/types/ts/lib/metadataTypes/ContentArea.d.ts.map deleted file mode 100644 index fcab071aa..000000000 --- a/types/ts/lib/metadataTypes/ContentArea.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ContentArea.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/ContentArea.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAmBxC;IA2BD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;CACJ;;;;;;;yBA/FD;;;;;;;;;;;WAWG;;;;;;;;;;;;;;;;;;;;;;;;;uCAQC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/BkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtension.d.ts.map b/types/ts/lib/metadataTypes/DataExtension.d.ts.map deleted file mode 100644 index 489a1c53d..000000000 --- a/types/ts/lib/metadataTypes/DataExtension.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtension.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtension.js"],"names":[],"mappings":";uBAea,OAAO,wBAAwB,EAAE,QAAQ;+BACzC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;qCAG5C,OAAO,wBAAwB,EAAE,sBAAsB;oCACvD,OAAO,wBAAwB,EAAE,qBAAqB;gCACtD,OAAO,wBAAwB,EAAE,iBAAiB;+BAClD,OAAO,wBAAwB,EAAE,gBAAgB;AAZ9D;;;;;;;GAOG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI,oCAAoC;IACpC,kBADW,qBAAqB,CACf;IACjB;;;;;;OAMG;IACH,2BAHW,gBAAgB,gBAoG1B;IAyED;;;;;OAKG;IACH,wCAHW,MAAM,GACJ,OAAO,CA0BnB;IAED;;;;;OAKG;IACH,wBAHW,iBAAiB,gBAK3B;IAED;;;;;;;OAOG;IACH,sDAHW,iBAAi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;;;;;;;;;;;uCAh8CG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArJkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionField.d.ts.map b/types/ts/lib/metadataTypes/DataExtensionField.d.ts.map deleted file mode 100644 index a257b8ab5..000000000 --- a/types/ts/lib/metadataTypes/DataExtensionField.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtensionField.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtensionField.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;oCAG5C,OAAO,wBAAwB,EAAE,qBAAqB;qCACtD,OAAO,wBAAwB,EAAE,sBAAsB;AAdpE;;;;;;;;;;;GAWG;AACH;;;GAGG;AACH;;;;GAIG;AACH;IACI,6BAAwB;IACxB;;;;;;OAMG;IACH,6BAJW,MAAM,qBACN,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrE;IACD;;;;;;OAMG;IACH,0CAJW,iBAAiB,qBACjB,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,qBAAqB,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIrE;IACD;;;;;OAKG;IACH,uCAHW,qBAAqB,GACnB,sBAAsB,EAAE,CASpC;IAED;;;;;;OAMG;IACH,uBAJW,sBAAsB,KACtB,sBAAsB,GACpB,MAAM,CAIlB;IACD;;;;;OAKG;IACH,qCAHW,sBAAsB,GACpB,sBAAsB,CAelC;IACD;;;;;;;OAOG;IACH,mDAJW,sBAAsB,EAAE,SACxB,MAAM,GACJ;YAAiB,MAAM,GAAE,sBAAsB;MAAE,CAoK7D;IAYD;;;;;;OAMG;IACH,oCAJW,MAAM,YACN,MAAM,GACJ,QAAS,OAAO,CAAC,CAuD7B;IACD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAO1B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA5SG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map b/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map deleted file mode 100644 index fbac61c35..000000000 --- a/types/ts/lib/metadataTypes/DataExtensionTemplate.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtensionTemplate.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtensionTemplate.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAbO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/Bf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtract.d.ts.map b/types/ts/lib/metadataTypes/DataExtract.d.ts.map deleted file mode 100644 index 378beed17..000000000 --- a/types/ts/lib/metadataTypes/DataExtract.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtract.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtract.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CA4CzC;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,2BAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,gBAAgB,CAW5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiB5B;IACD;;;;;;OAMG;IACH,6CASC;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAxKG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAaH;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DataExtractType.d.ts.map b/types/ts/lib/metadataTypes/DataExtractType.d.ts.map deleted file mode 100644 index 4c028dbdf..000000000 --- a/types/ts/lib/metadataTypes/DataExtractType.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtractType.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DataExtractType.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;GAMG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3CwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map b/types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map deleted file mode 100644 index f0271dc43..000000000 --- a/types/ts/lib/metadataTypes/DeliveryProfile.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DeliveryProfile.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/DeliveryProfile.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtCwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Discovery.d.ts.map b/types/ts/lib/metadataTypes/Discovery.d.ts.map deleted file mode 100644 index 654eebc3c..000000000 --- a/types/ts/lib/metadataTypes/Discovery.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Discovery.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Discovery.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AACH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA0BxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAxDwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Email.d.ts.map b/types/ts/lib/metadataTypes/Email.d.ts.map deleted file mode 100644 index 946e7bf01..000000000 --- a/types/ts/lib/metadataTypes/Email.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Email.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Email.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAgBxC;IAmBD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAvED;;;;mBAIG;;;qCAEC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;qCAEC,gCAAgC;;;;;;;;;;;;;;;;;;;eAcpC;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/EmailSend.d.ts.map b/types/ts/lib/metadataTypes/EmailSend.d.ts.map deleted file mode 100644 index 7981f1ab5..000000000 --- a/types/ts/lib/metadataTypes/EmailSend.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EmailSend.d.ts","sourceRoot":"","sources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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAzZwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Event.d.ts.map b/types/ts/lib/metadataTypes/Event.d.ts.map deleted file mode 100644 index b541f168e..000000000 --- a/types/ts/lib/metadataTypes/Event.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Event.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Event.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;OAUG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAwBxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CAqDzC;IA6BD;;;;;OAK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;;;;;;;;;;;;;;;;;;;;;;yBAtBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileLocation.d.ts.map b/types/ts/lib/metadataTypes/FileLocation.d.ts.map deleted file mode 100644 index 2cda24d59..000000000 --- a/types/ts/lib/metadataTypes/FileLocation.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FileLocation.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/FileLocation.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3CwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/FileTransfer.d.ts.map b/types/ts/lib/metadataTypes/FileTransfer.d.ts.map deleted file mode 100644 index 300e769c4..000000000 --- a/types/ts/lib/metadataTypes/FileTransfer.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FileTransfer.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/FileTransfer.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CA4CzC;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,gBAkB1B;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkB5B;IAED;;;;;;OAMG;IACH,6CASC;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAxJG;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArDkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Filter.d.ts.map b/types/ts/lib/metadataTypes/Filter.d.ts.map deleted file mode 100644 index d09517631..000000000 --- a/types/ts/lib/metadataTypes/Filter.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Filter.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Filter.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;;OAWG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApCwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Folder.d.ts.map b/types/ts/lib/metadataTypes/Folder.d.ts.map deleted file mode 100644 index bf56ce39f..000000000 --- a/types/ts/lib/metadataTypes/Folder.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Folder.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Folder.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAA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.map b/types/ts/lib/metadataTypes/ImportFile.d.ts.map deleted file mode 100644 index dfb252c69..000000000 --- a/types/ts/lib/metadataTypes/ImportFile.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ImportFile.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/ImportFile.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;;OAUG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiDxC;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS,mBAAmB,CAAC,CAuCzC;IACD;;;;;;OAMG;IACH,6CAeC;IAED;;;;;OAKG;IACH,0BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,0BAHW,gBAAgB,gBAQ1B;IAgCD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAuHtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAkH5B;CAiBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WA7cD;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAtBsB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Journey.d.ts.map b/types/ts/lib/metadataTypes/Journey.d.ts.map deleted file mode 100644 index f80e177fc..000000000 --- a/types/ts/lib/metadataTypes/Journey.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiIxC;IA6ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAkBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA2J5B;IACD;;;;;OAKG;IACH,6CAiVC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAiHtC;IAED;;;;;OAKG;IACH,0CAkLC;CAoDJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAh5BG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArQkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/List.d.ts.map b/types/ts/lib/metadataTypes/List.d.ts.map deleted file mode 100644 index 00ea9aed6..000000000 --- a/types/ts/lib/metadataTypes/List.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/List.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAyBxC;IACD;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;;OAMG;IACH,sCAqEC;IAYD;;;;;OAKG;IACH,+BAHW,gBAAgB,GACd,gBAAgB,CAI5B;IACD;;;;;;OAMG;IACH,+BAJW,gBAAgB,kBAChB,OAAO,GACL,gBAAgB,CAsB5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCApLO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnCf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MetadataType.d.ts.map b/types/ts/lib/metadataTypes/MetadataType.d.ts.map deleted file mode 100644 index 3f3fc7f7d..000000000 --- a/types/ts/lib/metadataTypes/MetadataType.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB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IACH,oCALW,MAAM,qBACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CA6B7B;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,OACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CAoB7B;IACD;;;;;;;OAOG;IACH,sCALW,MAAM,gBACN,OAAO,eACP,MAAM,GACJ,MAAM,CAgBlB;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileCode.d.ts.map b/types/ts/lib/metadataTypes/MobileCode.d.ts.map deleted file mode 100644 index 59df25740..000000000 --- a/types/ts/lib/metadataTypes/MobileCode.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MobileCode.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MobileCode.js"],"names":[],"mappings":";uBAKa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CASxC;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA3BG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9BkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileKeyword.d.ts.map b/types/ts/lib/metadataTypes/MobileKeyword.d.ts.map deleted file mode 100644 index 7a2db8bdb..000000000 --- a/types/ts/lib/metadataTypes/MobileKeyword.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MobileKeyword.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MobileKeyword.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAwBxC;IAoDD;;;;OAIG;IACH,8CAFW,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAljBwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/MobileMessage.d.ts.map b/types/ts/lib/metadataTypes/MobileMessage.d.ts.map deleted file mode 100644 index bfa776324..000000000 --- a/types/ts/lib/metadataTypes/MobileMessage.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MobileMessage.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/MobileMessage.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,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;;;;;;;;;eA+NH;;;;;;;;;;eAUG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAxWkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Query.d.ts.map b/types/ts/lib/metadataTypes/Query.d.ts.map deleted file mode 100644 index efabb10a5..000000000 --- a/types/ts/lib/metadataTypes/Query.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Query.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Query.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;wBAI5C,OAAO,wBAAwB,EAAE,SAAS;uBAC1C,OAAO,wBAAwB,EAAE,QAAQ;AAftD;;;;;;;;;;;GAWG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAA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;;;;;;;;;;;;;;;;;;yBA3dwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Role.d.ts.map b/types/ts/lib/metadataTypes/Role.d.ts.map deleted file mode 100644 index 3d50e867b..000000000 --- a/types/ts/lib/metadataTypes/Role.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Role.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Role.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;kCAClD,OAAO,wBAAwB,EAAE,mBAAmB;0BACpD,OAAO,wBAAwB,EAAE,WAAW;AAXzD;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,QACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAsFxC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,gBAAgB,CAS5B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,2BAHW,eAAe,GACb,QAAS,IAAI,CAAC,CA0G1B;IAED;;;;;;;;;;OAUG;IACH,4BAPW,MAAM,WACN,MAAM,eACN,MAAM,cACN,MAAM,GAEJ,IAAI,CAyDhB;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7UwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Script.d.ts.map b/types/ts/lib/metadataTypes/Script.d.ts.map deleted file mode 100644 index 4e30a5c88..000000000 --- a/types/ts/lib/metadataTypes/Script.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;yBAI5C,OAAO,wBAAwB,EAAE,UAAU;wBAC3C,OAAO,wBAAwB,EAAE,SAAS;AAfvD;;;;;;;;;;;GAWG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAKzD;IACD;;;;OAIG;IACH,2BAFa,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIzD;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS;QAAC,QAAQ,EAAE,UAAU,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAS1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lib/metadataTypes/SendClassification.d.ts.map deleted file mode 100644 index 49e770bfc..000000000 --- a/types/ts/lib/metadataTypes/SendClassification.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SendClassification.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/SendClassification.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAWD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CA4BtC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiC5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnJwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/SenderProfile.d.ts.map b/types/ts/lib/metadataTypes/SenderProfile.d.ts.map deleted file mode 100644 index 9d39ebb8b..000000000 --- a/types/ts/lib/metadataTypes/SenderProfile.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SenderProfile.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/SenderProfile.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyBtC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAzEO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiCpC;;;;;mBAKG;;;;;;;;;;mCAKH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhFkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map b/types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map deleted file mode 100644 index 336b20780..000000000 --- a/types/ts/lib/metadataTypes/TransactionalEmail.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalEmail.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalEmail.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAyB;IACzB,oBAAoB;IACpB,kCAA2B;IAqB3B;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyCtC;IACD;;;;;;OAMG;IACH,0BAJW,gBAAgB,eAChB,MAAM,GACJ,QAAS,IAAI,CAAC,CAe1B;IACD;;;;OAIG;IACH,0BAFa,IAAI,CAWhB;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAmF5B;CA2BJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCApPgC,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map b/types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map deleted file mode 100644 index e24781171..000000000 --- a/types/ts/lib/metadataTypes/TransactionalMessage.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalMessage.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalMessage.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IAEI,oBAAe;IACf;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2CxC;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAOxC;IACD;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;CAcJ;;;;;;QA1HD;;;;;;;;;;;WAWG;QAEH;;;;WAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAIC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhCkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalPush.d.ts.map b/types/ts/lib/metadataTypes/TransactionalPush.d.ts.map deleted file mode 100644 index 402a10f0f..000000000 --- a/types/ts/lib/metadataTypes/TransactionalPush.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalPush.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalPush.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAwB;IAExB;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqBtC;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA4B5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAnED;;;;eAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA8BC;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAxD0B,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map b/types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map deleted file mode 100644 index 0df29737e..000000000 --- a/types/ts/lib/metadataTypes/TransactionalSMS.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalSMS.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TransactionalSMS.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI,uBAAuB;IACvB;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAM1B;IAqDD;;;;;;;OAOG;IACH,4BALW,gBAAgB,aAChB,MAAM,iBACN,MAAM,GACJ,QAAS,MAAM,CAAC,CAmB5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,QAAS,eAAe,CAAC,CAqErC;IACD;;;;;OAKG;IACH,yCAHW,MAAM,GACJ,QAAS;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC,CAOlD;IAyDD;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,gBAAgB,qBAChB,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAqDhC;IACD;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,OAAO,CAInB;CAsBJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAzTG;;;;;;eAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA3C0B,2BAA2B"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/TriggeredSend.d.ts.map b/types/ts/lib/metadataTypes/TriggeredSend.d.ts.map deleted file mode 100644 index e00ac2fec..000000000 --- a/types/ts/lib/metadataTypes/TriggeredSend.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAO1B;IAYD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAwGnC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqFtC;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,aACR,OAAO,GACL,QAAS,IAAI,CAAC,CAkB1B;IAED;;;;;OAKG;IACH,qCAHW,eAAe,GACb,QAAS,MAAM,EAAE,CAAC,CAS9B;IACD;;;;;OAKG;IACH,0CAHW,OAAO,GACL,QAAS,kBAAkB,CAAC,CAqDxC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,YACN,OAAO,GACL,QAAS,OAAO,CAAC,CA8F7B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA7YG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAyOH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2CC,gCAAgC;;;eAAhC,gCAAgC;;;;;;;;;;;;;yBA5Xf,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/User.d.ts.map b/types/ts/lib/metadataTypes/User.d.ts.map deleted file mode 100644 index 6691d9d53..000000000 --- a/types/ts/lib/metadataTypes/User.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"User.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/User.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,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D;;;;;;;OAOG;IACH,yBA+BC;IAED;;;;;;;;OAQG;IACH,iCANW,MAAM,kBACN,iBAAiB,mBACjB,MAAM,qBACN,MAAM,EAAE,GACN,QAAS,kBAAkB,CAAC,CA4IxC;IAED;;;;;;;;;OASG;IACH,8CAqEC;IAED;;;;;OAKG;IACH,sCAJW,MAAM,aACN,MAAM,GACJ,MAAM,CAqDlB;IACD;;;;;;OAMG;IACH,0BAGC;IAED;;;;OAIG;IACH,2BAOC;IACD;;;;;;;OAOG;IACH,iCAmBC;IACD;;;;;OAKG;IACH,2BAHW,eAAe,GACb,QAAS,IAAI,CAAC,CAsI1B;IACD;;;;;;;OAOG;IACH,8BAeC;IAED;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAoEnC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAzoCG;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAiBH;;;;;mBAKG;;;;;;;;;;;;;;;;uCASH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA7EkB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/Verification.d.ts.map b/types/ts/lib/metadataTypes/Verification.d.ts.map deleted file mode 100644 index 3af0d9f5a..000000000 --- a/types/ts/lib/metadataTypes/Verification.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Verification.d.ts","sourceRoot":"","sources":["../../../../lib/metadataTypes/Verification.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;wBAC5C,OAAO,wBAAwB,EAAE,SAAS;+BAI1C,OAAO,wBAAwB,EAAE,gBAAgB;AAf9D;;;;;;;;;;;;GAYG;AAEH;;GAEG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAsExC;IACD;;;;;;OAMG;IACH,qCAHW,MAAM,GACJ,IAAI,CAehB;IAED;;;;OAIG;IACH,2BAFa,QAAS,kBAAkB,CAAC,CAIxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;;;OAOG;IACH,sCALW,gBAAgB,eAChB,MAAM,8BACN,gBAAgB,GACd,QAAS,IAAI,CAAC,CAuB1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAQ1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAWtC;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAiB5B;CAUJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9OwB,mBAAmB"} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map deleted file mode 100644 index 12733d84b..000000000 --- a/types/ts/lib/metadataTypes/definitions/Asset.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Asset.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Asset.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map deleted file mode 100644 index ac45b8e77..000000000 --- a/types/ts/lib/metadataTypes/definitions/AttributeGroup.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AttributeGroup.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/AttributeGroup.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map deleted file mode 100644 index e50e1081c..000000000 --- a/types/ts/lib/metadataTypes/definitions/AttributeSet.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"AttributeSet.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/AttributeSet.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map deleted file mode 100644 index 4a2dbc6b8..000000000 --- a/types/ts/lib/metadataTypes/definitions/Automation.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Automation.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Automation.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map deleted file mode 100644 index b011a54cd..000000000 --- a/types/ts/lib/metadataTypes/definitions/Campaign.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Campaign.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Campaign.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map deleted file mode 100644 index 774052e56..000000000 --- a/types/ts/lib/metadataTypes/definitions/ContentArea.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ContentArea.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/ContentArea.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map deleted file mode 100644 index 290e73d6f..000000000 --- a/types/ts/lib/metadataTypes/definitions/DataExtension.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtension.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtension.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map deleted file mode 100644 index 68ca65388..000000000 --- a/types/ts/lib/metadataTypes/definitions/DataExtensionField.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtensionField.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtensionField.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map deleted file mode 100644 index 30f5eb839..000000000 --- a/types/ts/lib/metadataTypes/definitions/DataExtensionTemplate.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtensionTemplate.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtensionTemplate.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map deleted file mode 100644 index ee27b0599..000000000 --- a/types/ts/lib/metadataTypes/definitions/DataExtract.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtract.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtract.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map deleted file mode 100644 index 7ee37fb41..000000000 --- a/types/ts/lib/metadataTypes/definitions/DataExtractType.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DataExtractType.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DataExtractType.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map deleted file mode 100644 index fe52bac3e..000000000 --- a/types/ts/lib/metadataTypes/definitions/DeliveryProfile.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"DeliveryProfile.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/DeliveryProfile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map deleted file mode 100644 index 5d2e545a8..000000000 --- a/types/ts/lib/metadataTypes/definitions/Discovery.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Discovery.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Discovery.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map deleted file mode 100644 index d2e2b699e..000000000 --- a/types/ts/lib/metadataTypes/definitions/Email.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Email.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Email.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map deleted file mode 100644 index 4c41f7b00..000000000 --- a/types/ts/lib/metadataTypes/definitions/EmailSend.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"EmailSend.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/EmailSend.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map deleted file mode 100644 index 0a325c821..000000000 --- a/types/ts/lib/metadataTypes/definitions/Event.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Event.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Event.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map deleted file mode 100644 index cd784f34a..000000000 --- a/types/ts/lib/metadataTypes/definitions/FileLocation.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FileLocation.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/FileLocation.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map deleted file mode 100644 index 53b447267..000000000 --- a/types/ts/lib/metadataTypes/definitions/FileTransfer.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"FileTransfer.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/FileTransfer.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map deleted file mode 100644 index 5db22cb9b..000000000 --- a/types/ts/lib/metadataTypes/definitions/Filter.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Filter.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Filter.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map deleted file mode 100644 index 67ea36ba5..000000000 --- a/types/ts/lib/metadataTypes/definitions/Folder.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Folder.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Folder.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map deleted file mode 100644 index 327808834..000000000 --- a/types/ts/lib/metadataTypes/definitions/ImportFile.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"ImportFile.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/ImportFile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map deleted file mode 100644 index c243959a7..000000000 --- a/types/ts/lib/metadataTypes/definitions/Journey.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Journey.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Journey.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map deleted file mode 100644 index df1aa5d03..000000000 --- a/types/ts/lib/metadataTypes/definitions/List.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"List.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/List.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map deleted file mode 100644 index 0f02645fa..000000000 --- a/types/ts/lib/metadataTypes/definitions/MobileCode.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MobileCode.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/MobileCode.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map deleted file mode 100644 index c3fb878e7..000000000 --- a/types/ts/lib/metadataTypes/definitions/MobileKeyword.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MobileKeyword.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/MobileKeyword.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map deleted file mode 100644 index ea6197a18..000000000 --- a/types/ts/lib/metadataTypes/definitions/MobileMessage.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"MobileMessage.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/MobileMessage.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map deleted file mode 100644 index 0e0f8fd27..000000000 --- a/types/ts/lib/metadataTypes/definitions/Query.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Query.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Query.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map deleted file mode 100644 index d0fdd257f..000000000 --- a/types/ts/lib/metadataTypes/definitions/Role.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Role.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Role.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map deleted file mode 100644 index c109b6504..000000000 --- a/types/ts/lib/metadataTypes/definitions/Script.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Script.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Script.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map deleted file mode 100644 index e531e22d1..000000000 --- a/types/ts/lib/metadataTypes/definitions/SendClassification.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SendClassification.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/SendClassification.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map deleted file mode 100644 index 7f723e9ac..000000000 --- a/types/ts/lib/metadataTypes/definitions/SenderProfile.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"SenderProfile.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/SenderProfile.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map deleted file mode 100644 index 66d8a26cf..000000000 --- a/types/ts/lib/metadataTypes/definitions/TransactionalEmail.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalEmail.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalEmail.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map deleted file mode 100644 index 34a85c99f..000000000 --- a/types/ts/lib/metadataTypes/definitions/TransactionalMessage.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalMessage.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalMessage.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map deleted file mode 100644 index 3e87c9cac..000000000 --- a/types/ts/lib/metadataTypes/definitions/TransactionalPush.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalPush.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalPush.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map deleted file mode 100644 index 6059b7b1e..000000000 --- a/types/ts/lib/metadataTypes/definitions/TransactionalSMS.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TransactionalSMS.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TransactionalSMS.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map deleted file mode 100644 index 265fff45c..000000000 --- a/types/ts/lib/metadataTypes/definitions/TriggeredSend.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"TriggeredSend.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/TriggeredSend.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map deleted file mode 100644 index 92f4c2e9c..000000000 --- a/types/ts/lib/metadataTypes/definitions/User.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"User.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/User.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map b/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map deleted file mode 100644 index a8230bbaf..000000000 --- a/types/ts/lib/metadataTypes/definitions/Verification.definition.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Verification.definition.d.ts","sourceRoot":"","sources":["../../../../../lib/metadataTypes/definitions/Verification.definition.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/retrieveChangelog.d.ts.map b/types/ts/lib/retrieveChangelog.d.ts.map deleted file mode 100644 index a45ee5547..000000000 --- a/types/ts/lib/retrieveChangelog.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"retrieveChangelog.d.ts","sourceRoot":"","sources":["../../../lib/retrieveChangelog.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/types/ts/lib/util/auth.d.ts.map b/types/ts/lib/util/auth.d.ts.map deleted file mode 100644 index e3a845ee7..000000000 --- a/types/ts/lib/util/auth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../lib/util/auth.js"],"names":[],"mappings":";yBAMa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAYtD;;;;;;OAMG;IACH,oHA8BC;IACD;;;;;OAKG;IACH,0EAkBC;IACD;;;;OAIG;IACH,+BAGC"} \ No newline at end of file diff --git a/types/ts/lib/util/businessUnit.d.ts.map b/types/ts/lib/util/businessUnit.d.ts.map deleted file mode 100644 index 00234a1f2..000000000 --- a/types/ts/lib/util/businessUnit.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"businessUnit.d.ts","sourceRoot":"","sources":["../../../../lib/util/businessUnit.js"],"names":[],"mappings":";yBAOa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAcjC,8HAqFpB"} \ No newline at end of file diff --git a/types/ts/lib/util/cache.d.ts.map b/types/ts/lib/util/cache.d.ts.map deleted file mode 100644 index 0ae3124ad..000000000 --- a/types/ts/lib/util/cache.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../../../lib/util/cache.js"],"names":[],"mappings":";IAkCe,8EAWV;IAMS;;;;MAA2B;IASzB,wCAG4D;IAU9D,kDAAmD;IAQhD;;aAEZ;IASc;;mCAUd;IACD;;;;;;;;;OASG;IACH,8JAgCC;IACD;;;;;;;OAOG;IACH,sGA4BC;IACD;;;;;;;OAOG;IACH,oHAyBC;;;yBArNQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY"} \ No newline at end of file diff --git a/types/ts/lib/util/cli.d.ts.map b/types/ts/lib/util/cli.d.ts.map deleted file mode 100644 index a33ba8d11..000000000 --- a/types/ts/lib/util/cli.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../../lib/util/cli.js"],"names":[],"mappings":";yBAca,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;;IAQrD;;;;;OAKG;IACH,sDAQC;IACD;;;;;OAKG;IACH,6GAgBC;IAED;;;;OAIG;IACH,2EAgCC;IACD;;;;;OAKG;IACH,4FAOC;IACD;;;;;;;;OAQG;IACH,mJAQC;IACD;;;;;;;;OAQG;IACH,gNAqEC;IACD;;;;;;;;OAQG;IACH;;;OAsEC;IACD;;;;;;;OAOG;IACH,kJA4DC;IAED;;;;;;OAMG;IACH,gHAmFC;IACD;;;;;;OAMG;IACH,kHAmGC;IACD;;;;;;;;OAQG;IACH;;2BAsBC;IAED;;;;OAIG;IACH,wEAoGC"} \ No newline at end of file diff --git a/types/ts/lib/util/config.d.ts.map b/types/ts/lib/util/config.d.ts.map deleted file mode 100644 index 217cd3bf5..000000000 --- a/types/ts/lib/util/config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../lib/util/config.js"],"names":[],"mappings":";yBASa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;;IAStD;;;;;;OAMG;IACH,8GAyDC;IACD;;;;;;OAMG;IACH,8HAmMC;IACD;;;;;OAKG;IACH,mFAcC"} \ No newline at end of file diff --git a/types/ts/lib/util/devops.d.ts.map b/types/ts/lib/util/devops.d.ts.map deleted file mode 100644 index 8e0a743df..000000000 --- a/types/ts/lib/util/devops.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"devops.d.ts","sourceRoot":"","sources":["../../../../lib/util/devops.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAOtD;;;;;;;;;;OAUG;IACH,kOAqTC;IACD;;;;;;;;OAQG;IACH,iPA+KC;IAED;;;;;;OAMG;IACH,4DA2BC;IACD;;;;;;;;;OASG;IACH,gMAIC"} \ No newline at end of file diff --git a/types/ts/lib/util/file.d.ts.map b/types/ts/lib/util/file.d.ts.map deleted file mode 100644 index c27deb34b..000000000 --- a/types/ts/lib/util/file.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../../lib/util/file.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;AAsiB1D,0BAAkC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.config.d.ts.map b/types/ts/lib/util/init.config.d.ts.map deleted file mode 100644 index 7e0b38cbb..000000000 --- a/types/ts/lib/util/init.config.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"init.config.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.config.js"],"names":[],"mappings":";yBAaa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAQtD;;;;;OAKG;IACH,gGA0LC;IAED;;;;;OAKG;IACH,8EA+DC;IACD;;;;;;;OAOG;IACH,yFAgBC;IACD;;;;;OAKG;IACH,yEAsBC;IACD;;;;;;;OAOG;IACH,yIAiEC;IACD;;;;OAIG;IACH,6CAuBC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.d.ts.map b/types/ts/lib/util/init.d.ts.map deleted file mode 100644 index 11b633749..000000000 --- a/types/ts/lib/util/init.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.js"],"names":[],"mappings":";yBAaa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;IAQtD;;;;;;;OAOG;IACH,yIAyKC;IAED;;;;OAIG;IACH,sCAyEC;IACD;;OAEG;IACH,uCAwDC;IACD;;;;;;OAMG;IACH,uEAgCC;IACD;;;;;;;OAOG;IACH,sIAqCC;IACD;;;;;OAKG;IACH,gDAgDC;IAED;;;;;;OAMG;IACH,gGAuBC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.git.d.ts.map b/types/ts/lib/util/init.git.d.ts.map deleted file mode 100644 index 7f119f07c..000000000 --- a/types/ts/lib/util/init.git.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"init.git.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.git.js"],"names":[],"mappings":";;IAcI;;;;OAIG;IACH;;;OAyDC;IACD;;;;OAIG;IACH,kCAwCC;IACD;;;;OAIG;IACH,0CAgDC;IACD;;;;OAIG;IACH,+CAkEC;IACD;;;;OAIG;IACH;;;OAKC"} \ No newline at end of file diff --git a/types/ts/lib/util/init.npm.d.ts.map b/types/ts/lib/util/init.npm.d.ts.map deleted file mode 100644 index 7b02de068..000000000 --- a/types/ts/lib/util/init.npm.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"init.npm.d.ts","sourceRoot":"","sources":["../../../../lib/util/init.npm.js"],"names":[],"mappings":";;IAcI;;;;;;;OAOG;IACH,kEAsGC;IACD;;;;;OAKG;IACH;;;;OAwBC"} \ No newline at end of file diff --git a/types/ts/lib/util/util.d.ts.map b/types/ts/lib/util/util.d.ts.map deleted file mode 100644 index 309f9679e..000000000 --- a/types/ts/lib/util/util.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG;IACH,sGAqCC;IACD;;;;OAIG;IACH,kCAGC;IACD;;;;;;OAMG;IACH,yCAEC;IACD;;;;;;OAMG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,8EAkBC;IAED;;;;;OAKG;IACH;;;MASC;IAED;;;;OAIG;IACH,4CAyBC;IAO0B,6DAmE1B;;gBAMS,MAAM;IAUH,mEA8EZ;IAWe,0GAef;IASgB;;YAyBhB;IASW,6DAOX;IAED;;;;;OAKG;IACH,2DAiBC;IAED;;;;;OAKG;IACH;;MAqFC;IAED;;;;;;OAMG;IACH,qDAEC;IACD;;;;;;;OAOG;IACH,qFAqBC;IACD;;;;;;;OAOG;IACH,6FAYC;IACD;;;;;;;;OAQG;IACH;;;;aAyBC;IACD;;;;OAIG;IACH,qCAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BD;;;;;OAKG;IACH,yCAEC;IACD;;;;;OAKG;IACH,iDAQC;IACD;;;;;;OAMG;IACH,0EAcC;IACD;;;;;OAKG;IACH,0CAIC;IACD;;;;;;;;;;;;;;;;;OAiBG;IACH,uCA0BC;IACD;;;;;;OAMG;IACH,iEAaC;IACD;;;;;;OAMG;IACH,2DA6BC;IACD;;;;;OAKG;IACH,oDAEC;IACD;;;;;;;OAOG;IACH,6FAaC;;yBA16BQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file diff --git a/types/ts/types/mcdev.d.d.ts.map b/types/ts/types/mcdev.d.d.ts.map deleted file mode 100644 index 9393413d6..000000000 --- a/types/ts/types/mcdev.d.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mcdev.d.d.ts","sourceRoot":"","sources":["../../mcdev.d.js"],"names":[],"mappings":";;;;;;eAEc,MAAM;;;;mBACN,MAAM;;;;aACN,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;mBACN,MAAM;;;;iBACN,MAAM;;;QAGC,MAAM,GAAE,MAAM;;qCACtB,OAAO,GAAC,eAAe,GAAC,aAAa,GAAC,aAAa,GAAC,aAAa,GAAC,YAAY,GAAC,gBAAgB,GAAC,aAAa,GAAC,eAAe,GAAC,aAAa,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,aAAa,GAAC,gBAAgB,GAAC,cAAc,GAAC,YAAY,GAAC,UAAU,GAAC,aAAa,GAAC,eAAe,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AU,GAAC,oBAAoB,GAAC,iBAAiB,GAAC,SAAS,GAAC,IAAI,GAAC,IAAI,GAAC,MAAM;;;;WACnI,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ;;;;;;iBAKjC,MAAM;;;;aACN,MAAM;;;;;QAEc,aAAa,EAAjC,MAAM;QACc,MAAM,EAA1B,MAAM;QACc,IAAI,EAAxB,MAAM;QACc,QAAQ,EAA5B,MAAM;QACc,QAAQ,EAA5B,MAAM;QACc,cAAc,EAAlC,MAAM;;;;;;YACE,MAAM,GAAE,MAAM;;;;;gBACtB,MAAM;;;;;QAEkB,QAAQ,EAAhC,MAAM,EAAE;QACgB,kBAAkB,EAA1C,MAAM,EAAE;;;;;aACR,MAAM;;0BAIP,OAAO,GAAC,SAAS,GAAC,MAAM,GAAC,OAAO;;;;;YAE/B,WAAW;;;;;;;;;;qBAGZ,OAAO,SAAS,EAAE,MAAM,GAAG,WAAW;;;;;UAIrC,MAAM;;;;aACN,MAAM;;;;iBACN,MAAM;;;;uBACN,OAAO,GAAG,MAAM,EAAE;;;;;QAEA,QAAQ,EAA1B,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,SAAS,EAA3B,OAAO;QACW,aAAa,EAA/B,OAAO;QACW,kBAAkB,EAApC,OAAO"} \ No newline at end of file From 740d7a7be7a2338ad9268159b21b831bd16fac83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 15:23:08 +0200 Subject: [PATCH 294/359] #1110: seems to be not relevant for typescript --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index b1fceb749..6cbad94c9 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,6 @@ "rest" ], "main": "./lib/index.js", - "types": "./@types/lib/index.d.ts", "exports": { ".": { "types": "./@types/lib/index.d.ts", From f09203cc714b2581cd50c5ddc1f772b9479d54b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 15:49:34 +0200 Subject: [PATCH 295/359] #1334: ensure that event is not a permitted type in fixKeys --- lib/index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/index.js b/lib/index.js index e87500ab6..12284c28a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1045,6 +1045,17 @@ class Mcdev { for (const selectedType of Array.isArray(selectedTypesArr) ? selectedTypesArr : Object.keys(selectedTypesArr)) { + if (selectedType === 'event') { + Util.logger.warn( + `Type 'event' is not supported for fixKeys for compatibility reasons. Draft Journeys would otherwise be broken after the key change. If you do need to update an event key, use deploy --changeKeyValue or --changeKeyField instead.` + ); + if (Array.isArray(selectedTypesArr)) { + selectedTypesArr = selectedTypesArr.filter((type) => type !== 'event'); + } else { + delete selectedTypesArr.event; + } + continue; + } const temp = await this.#runMethod( 'fixKeys', businessUnit, From 6c7dce204265ef854b7b97535143e8e3c588d005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 15:51:07 +0200 Subject: [PATCH 296/359] #1334: add test for event and fixKeys --- test/type.event.test.js | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 test/type.event.test.js diff --git a/test/type.event.test.js b/test/type.event.test.js new file mode 100644 index 000000000..11731911d --- /dev/null +++ b/test/type.event.test.js @@ -0,0 +1,62 @@ +import * as chai from 'chai'; +const assert = chai.assert; +// const expect = chai.expect; + +import chaiFiles from 'chai-files'; +// import cache from '../lib/util/cache.js'; +import * as testUtils from './utils.js'; +import handler from '../lib/index.js'; +chai.use(chaiFiles); +// const file = chaiFiles.file; + +describe('type: event', () => { + beforeEach(() => { + testUtils.mockSetup(); + }); + + afterEach(() => { + testUtils.mockReset(); + }); + + describe('Retrieve ================', () => {}); + + describe('Deploy ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + }); + + describe('FixKeys ================', () => { + beforeEach(() => { + testUtils.mockSetup(true); + }); + + it('Should exit fixKeys because event is not supported intentionally', async () => { + // WHEN + handler.setOptions({ skipInteraction: { fixKeysReretrieve: false } }); + const resultFixKeys = await handler.fixKeys('testInstance/testBU', ['event']); + // THEN + assert.equal(process.exitCode, 0, 'fixKeys should not have thrown an error'); + // check which keys were fixed + assert.equal( + resultFixKeys['testInstance/testBU'], + undefined, + 'expected to find no keys to be fixed' + ); + + // check number of API calls + assert.equal( + testUtils.getAPIHistoryLength(), + 0, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + + describe('Templating ================', () => {}); + + describe('Delete ================', () => {}); + + describe('CI/CD ================', () => {}); +}); From 1987f5a2f8547ca6efe20dd5e91deb7ed3f514f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 23 May 2024 16:34:08 +0200 Subject: [PATCH 297/359] #1270: extract preheader code into html file to make parsing easier --- lib/metadataTypes/Asset.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 7964023f0..d25b73bc6 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1061,6 +1061,33 @@ class Asset extends MetadataType { }); } } + // metadata.views.html.content (optional) + // the main content can be empty (=not set up yet) hence check if we did extract sth or else readFile() will print error msgs + const fileName2 = 'views.preheader.content' + subtypeExtension; + if ( + (await File.pathExists( + File.normalizePath([...readDirArr, `${fileName2}.html`]) + )) && + metadata.views.preheader + ) { + if (!fileListOnly) { + metadata.views.preheader.content = await File.readFilteredFilename( + readDirArr, + fileName2, + 'html' + ); + } + + if (templateName) { + // to use this method in templating, store a copy of the info in fileList + fileList.push({ + subFolder: [...subDirArr, templateFileName], + fileName: fileName2, + fileExt: 'html', + content: metadata.views.preheader.content, + }); + } + } // metadata.views.html.slots.<>.blocks.<>.content (optional) if (metadata?.views?.html?.slots) { @@ -1401,6 +1428,16 @@ class Asset extends MetadataType { }); delete metadata.views.html.content; } + // metadata.views.html.content (optional) + if (metadata.views?.preheader?.content?.length) { + codeArr.push({ + subFolder: null, + fileName: 'views.preheader.content', + fileExt: 'html', + content: metadata.views.preheader.content, + }); + delete metadata.views.preheader.content; + } // metadata.views.html.slots.<>.blocks.<>.content (optional) if (metadata.views?.html?.slots) { From 390266d730616fc9a48c99303aa379effce15985 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 24 May 2024 16:31:36 +0200 Subject: [PATCH 298/359] #1270: ensure typing is offered for deeper classes as well --- @types/lib/index.d.ts.map | 2 +- package.json | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 46fcd878c..4fea58da2 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAmBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BAC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AM,EAAE,CAAC,CAsB9B;IACD;;;;;;;OAOG;IACH,8BALW,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAK/C;IACD;;;;;;;OAOG;IACH,6BALW,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;OAOG;IACH,2BALW,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CA6D7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,gBAC3B,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CA4J/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,QAC3B,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAgD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAmBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,E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E,GACN,QAAS,MAAM,EAAE,CAAC,CAgD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/package.json b/package.json index 6cbad94c9..6c046020f 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,10 @@ "types": "./@types/lib/index.d.ts", "default": "./lib/index.js" }, - "./*": "./*.js" + "./*": { + "types": "./@types/lib/*.d.ts", + "default": "./lib/*.js" + } }, "bin": { "mcdev": "./lib/cli.js" From c3f400c876dc8832a9df9456a65d8513fdce292b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 May 2024 20:04:42 +0000 Subject: [PATCH 299/359] Bump eslint-plugin-jsdoc from 48.2.5 to 48.2.6 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.2.5 to 48.2.6. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.2.5...v48.2.6) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 9 ++++----- package.json | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index b947b63a3..ebf62a9e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.5", + "eslint-plugin-jsdoc": "48.2.6", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", @@ -2290,9 +2290,9 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.2.5", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.5.tgz", - "integrity": "sha512-ZeTfKV474W1N9niWfawpwsXGu+ZoMXu4417eBROX31d7ZuOk8zyG66SO77DpJ2+A9Wa2scw/jRqBPnnQo7VbcQ==", + "version": "48.2.6", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.6.tgz", + "integrity": "sha512-GNk9jtpYmoEVeD/U6yYYmd6T8vSOoPs7CL8ZeX85iD8P3qifDdLQGze6+cw9boobDthmYnnxvIoHrhuSffj09g==", "dev": true, "dependencies": { "@es-joy/jsdoccomment": "~0.43.0", @@ -2301,7 +2301,6 @@ "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "esquery": "^1.5.0", - "is-builtin-module": "^3.2.1", "semver": "^7.6.1", "spdx-expression-parse": "^4.0.0" }, diff --git a/package.json b/package.json index 6c046020f..a735d45aa 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.5", + "eslint-plugin-jsdoc": "48.2.6", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "52.0.0", From e3d46f36d63c9628961ae0c15f3db4efe5381a78 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 04:07:14 +0000 Subject: [PATCH 300/359] Bump lint-staged from 15.2.2 to 15.2.5 Bumps [lint-staged](https://github.com/okonet/lint-staged) from 15.2.2 to 15.2.5. - [Release notes](https://github.com/okonet/lint-staged/releases) - [Changelog](https://github.com/lint-staged/lint-staged/blob/master/CHANGELOG.md) - [Commits](https://github.com/okonet/lint-staged/compare/v15.2.2...v15.2.5) --- updated-dependencies: - dependency-name: lint-staged dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 109 +++++++++++++++++++++------------------------- package.json | 2 +- 2 files changed, 51 insertions(+), 60 deletions(-) diff --git a/package-lock.json b/package-lock.json index ebf62a9e5..aaf1beb0e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "eslint-plugin-unicorn": "52.0.0", "fast-xml-parser": "4.4.0", "husky": "9.0.11", - "lint-staged": "15.2.2", + "lint-staged": "15.2.5", "mocha": "10.4.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", @@ -1182,12 +1182,12 @@ } }, "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dev": true, "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -1687,12 +1687,12 @@ "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==" }, "node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "version": "12.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.1.0.tgz", + "integrity": "sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==", "dev": true, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/comment-parser": { @@ -2754,9 +2754,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dev": true, "dependencies": { "to-regex-range": "^5.0.1" @@ -4424,12 +4424,15 @@ } }, "node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.1.tgz", + "integrity": "sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==", "dev": true, "engines": { "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lines-and-columns": { @@ -4439,21 +4442,21 @@ "dev": true }, "node_modules/lint-staged": { - "version": "15.2.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", - "integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==", - "dev": true, - "dependencies": { - "chalk": "5.3.0", - "commander": "11.1.0", - "debug": "4.3.4", - "execa": "8.0.1", - "lilconfig": "3.0.0", - "listr2": "8.0.1", - "micromatch": "4.0.5", - "pidtree": "0.6.0", - "string-argv": "0.3.2", - "yaml": "2.3.4" + "version": "15.2.5", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.5.tgz", + "integrity": "sha512-j+DfX7W9YUvdzEZl3Rk47FhDF6xwDBV5wwsCPw6BwWZVPYJemusQmvb9bRsW23Sqsaa+vRloAWogbK4BUuU2zA==", + "dev": true, + "dependencies": { + "chalk": "~5.3.0", + "commander": "~12.1.0", + "debug": "~4.3.4", + "execa": "~8.0.1", + "lilconfig": "~3.1.1", + "listr2": "~8.2.1", + "micromatch": "~4.0.7", + "pidtree": "~0.6.0", + "string-argv": "~0.3.2", + "yaml": "~2.4.2" }, "bin": { "lint-staged": "bin/lint-staged.js" @@ -4478,16 +4481,16 @@ } }, "node_modules/listr2": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", - "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", + "version": "8.2.1", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.2.1.tgz", + "integrity": "sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g==", "dev": true, "dependencies": { "cli-truncate": "^4.0.0", "colorette": "^2.0.20", "eventemitter3": "^5.0.1", "log-update": "^6.0.0", - "rfdc": "^1.3.0", + "rfdc": "^1.3.1", "wrap-ansi": "^9.0.0" }, "engines": { @@ -4643,13 +4646,10 @@ } }, "node_modules/log-update/node_modules/ansi-escapes": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", - "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.1.tgz", + "integrity": "sha512-4nJ3yixlEthEJ9Rk4vPcdBRkZvQZlYyu8j4/Mqz5sgIkddmEnH2Yj2ZrnP9S3tQOvSNRUIgVNF/1yPpRAGNRig==", "dev": true, - "dependencies": { - "type-fest": "^3.0.0" - }, "engines": { "node": ">=14.16" }, @@ -4769,18 +4769,6 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, - "node_modules/log-update/node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/log-update/node_modules/wrap-ansi": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", @@ -4961,12 +4949,12 @@ } }, "node_modules/micromatch": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", - "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.7.tgz", + "integrity": "sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==", "dev": true, "dependencies": { - "braces": "^3.0.2", + "braces": "^3.0.3", "picomatch": "^2.3.1" }, "engines": { @@ -7368,10 +7356,13 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" }, "node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.2.tgz", + "integrity": "sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==", "dev": true, + "bin": { + "yaml": "bin.mjs" + }, "engines": { "node": ">= 14" } diff --git a/package.json b/package.json index a735d45aa..5ae0f772d 100644 --- a/package.json +++ b/package.json @@ -105,7 +105,7 @@ "eslint-plugin-unicorn": "52.0.0", "fast-xml-parser": "4.4.0", "husky": "9.0.11", - "lint-staged": "15.2.2", + "lint-staged": "15.2.5", "mocha": "10.4.0", "mock-fs": "5.2.0", "npm-run-all": "4.1.5", From 544d03c9baf3a6c1ec23d73a1364bcc1f2b91a42 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 May 2024 11:43:08 +0000 Subject: [PATCH 301/359] --- updated-dependencies: - dependency-name: eslint-plugin-unicorn dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 180 +++++++++++++++++++++++++++++++++++----------- package.json | 2 +- 2 files changed, 140 insertions(+), 42 deletions(-) diff --git a/package-lock.json b/package-lock.json index aaf1beb0e..c3a896d2c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -47,7 +47,7 @@ "eslint-plugin-jsdoc": "48.2.6", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", - "eslint-plugin-unicorn": "52.0.0", + "eslint-plugin-unicorn": "53.0.0", "fast-xml-parser": "4.4.0", "husky": "9.0.11", "lint-staged": "15.2.5", @@ -162,9 +162,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.20", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", - "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", + "version": "7.24.6", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.6.tgz", + "integrity": "sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==", "dev": true, "engines": { "node": ">=6.9.0" @@ -757,9 +757,9 @@ "dev": true }, "node_modules/acorn": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", - "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", + "version": "8.11.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz", + "integrity": "sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -1200,9 +1200,9 @@ "dev": true }, "node_modules/browserslist": { - "version": "4.22.2", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz", - "integrity": "sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, "funding": [ { @@ -1219,8 +1219,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001565", - "electron-to-chromium": "^1.4.601", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -1334,9 +1334,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001576", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001576.tgz", - "integrity": "sha512-ff5BdakGe2P3SQsMsiqmt1Lc8221NR1VzHj5jXN5vBny9A6fpze94HiVV/n7XRosOlsShJcvMv5mdnpjOGCEgg==", + "version": "1.0.30001624", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001624.tgz", + "integrity": "sha512-0dWnQG87UevOCPYaOR49CBcLBwoZLpws+k6W37nLjWUhumP1Isusj0p2u+3KhjNloRWK9OKMgjBBzPujQHw4nA==", "dev": true, "funding": [ { @@ -1800,12 +1800,12 @@ "dev": true }, "node_modules/core-js-compat": { - "version": "3.35.0", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.35.0.tgz", - "integrity": "sha512-5blwFAddknKeNgsjBzilkdQ0+YK8L1PfqPYq40NOYMYFSS38qj+hpTcLLWwpIwA2A5bje/x5jmVn2tzUMg9IVw==", + "version": "3.37.1", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.37.1.tgz", + "integrity": "sha512-9TNiImhKvQqSUkOvk/mMRZzOANTiEVC7WaBNhHcKM7x+/5E1l5NvsysR19zuDQScE8k+kfQXWRN3AtS/eOSHpg==", "dev": true, "dependencies": { - "browserslist": "^4.22.2" + "browserslist": "^4.23.0" }, "funding": { "type": "opencollective", @@ -2071,9 +2071,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.4.626", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.626.tgz", - "integrity": "sha512-f7/be56VjRRQk+Ric6PmIrEtPcIqsn3tElyAu9Sh6egha2VLJ82qwkcOdcnT06W+Pb6RUulV1ckzrGbKzVcTHg==", + "version": "1.4.783", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.783.tgz", + "integrity": "sha512-bT0jEz/Xz1fahQpbZ1D7LgmPYZ3iHVY39NcWWro1+hA2IvjiPeaXtfSqrQ+nXjApMvQRE2ASt1itSLRrebHMRQ==", "dev": true }, "node_modules/emoji-regex": { @@ -2177,9 +2177,9 @@ } }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "engines": { "node": ">=6" } @@ -2381,17 +2381,17 @@ } }, "node_modules/eslint-plugin-unicorn": { - "version": "52.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-52.0.0.tgz", - "integrity": "sha512-1Yzm7/m+0R4djH0tjDjfVei/ju2w3AzUGjG6q8JnuNIL5xIwsflyCooW5sfBvQp2pMYQFSWWCFONsjCax1EHng==", + "version": "53.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-53.0.0.tgz", + "integrity": "sha512-kuTcNo9IwwUCfyHGwQFOK/HjJAYzbODHN3wP0PgqbW+jbXqpNWxNVpVhj2tO9SixBwuAdmal8rVcWKBxwFnGuw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.22.20", + "@babel/helper-validator-identifier": "^7.24.5", "@eslint-community/eslint-utils": "^4.4.0", - "@eslint/eslintrc": "^2.1.4", + "@eslint/eslintrc": "^3.0.2", "ci-info": "^4.0.0", "clean-regexp": "^1.0.0", - "core-js-compat": "^3.34.0", + "core-js-compat": "^3.37.0", "esquery": "^1.5.0", "indent-string": "^4.0.0", "is-builtin-module": "^3.2.1", @@ -2400,11 +2400,11 @@ "read-pkg-up": "^7.0.1", "regexp-tree": "^0.1.27", "regjsparser": "^0.10.0", - "semver": "^7.5.4", + "semver": "^7.6.1", "strip-indent": "^3.0.0" }, "engines": { - "node": ">=16" + "node": ">=18.18" }, "funding": { "url": "https://github.com/sindresorhus/eslint-plugin-unicorn?sponsor=1" @@ -2413,6 +2413,86 @@ "eslint": ">=8.56.0" } }, + "node_modules/eslint-plugin-unicorn/node_modules/@eslint/eslintrc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.1.0.tgz", + "integrity": "sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/eslint-visitor-keys": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.0.0.tgz", + "integrity": "sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==", + "dev": true, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/espree": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.0.1.tgz", + "integrity": "sha512-MWkrWZbJsL2UwnjxTX3gG8FneachS/Mwg7tdGXce011sJd5b0JG54vat5KHnfSBODZ3Wvzd2WnjxyzsRoVv+ww==", + "dev": true, + "dependencies": { + "acorn": "^8.11.3", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-unicorn/node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-unicorn/node_modules/jsesc": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz", @@ -2425,6 +2505,24 @@ "node": ">=6" } }, + "node_modules/eslint-plugin-unicorn/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/eslint-plugin-unicorn/node_modules/semver": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.2.tgz", + "integrity": "sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -5727,9 +5825,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", "dev": true }, "node_modules/picomatch": { @@ -6981,9 +7079,9 @@ } }, "node_modules/update-browserslist-db": { - "version": "1.0.13", - "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", - "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.16.tgz", + "integrity": "sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==", "dev": true, "funding": [ { @@ -7000,8 +7098,8 @@ } ], "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "escalade": "^3.1.2", + "picocolors": "^1.0.1" }, "bin": { "update-browserslist-db": "cli.js" diff --git a/package.json b/package.json index 5ae0f772d..4f3151c7f 100644 --- a/package.json +++ b/package.json @@ -102,7 +102,7 @@ "eslint-plugin-jsdoc": "48.2.6", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", - "eslint-plugin-unicorn": "52.0.0", + "eslint-plugin-unicorn": "53.0.0", "fast-xml-parser": "4.4.0", "husky": "9.0.11", "lint-staged": "15.2.5", From 66bac4f239e0d96bfc2672122b0c284f27d66cfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 28 May 2024 13:53:56 +0200 Subject: [PATCH 302/359] #0: eslint --fix for unicorn:prefer-string-raw --- lib/index.js | 2 +- lib/util/util.js | 6 +++--- test/utils.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/index.js b/lib/index.js index 12284c28a..a620e4da3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -699,7 +699,7 @@ class Mcdev { File.removeSync(filename); } - const regex = new RegExp('(\\w+-){4}\\w+'); + const regex = new RegExp(String.raw`(\w+-){4}\w+`); await File.ensureDir(retrieveDir); const metadata = Deployer.readBUMetadata(retrieveDir, null, true); let output = '# List of Metadata with Name-Key mismatches\n'; diff --git a/lib/util/util.js b/lib/util/util.js index 71b891306..b56e0d955 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -480,7 +480,7 @@ export const Util = { sortable.sort((a, b) => b[1].length - a[1].length); for (const pair of sortable) { - const escVal = pair[1].toString().replaceAll(/[-/\\^$*+?.()|[\]{}]/g, '\\$&'); + const escVal = pair[1].toString().replaceAll(/[-/\\^$*+?.()|[\]{}]/g, String.raw`\$&`); const regString = new RegExp(escVal, 'g'); str = str.replace(regString, '{{{' + pair[0] + '}}}'); } @@ -875,8 +875,8 @@ export const Util = { } // Remove special chars search = search.replaceAll( - new RegExp('([\\.\\\\\\+\\*\\?\\[\\^\\]\\$\\(\\)\\{\\}\\=\\!\\<\\>\\|\\:\\-])', 'g'), - '\\$1' + new RegExp(String.raw`([\.\\\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:\-])`, 'g'), + String.raw`\$1` ); // Replace % and _ with equivalent regex search = search.replaceAll('%', '.*').replaceAll('_', '.'); diff --git a/test/utils.js b/test/utils.js index cdbe0529c..4050ac479 100644 --- a/test/utils.js +++ b/test/utils.js @@ -294,5 +294,5 @@ export function logAPIHistoryDebug() { * @returns {string} escaped string */ function escapeRegExp(str) { - return str.replaceAll(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string + return str.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`); // $& means the whole matched string } From 995316d32aa03a36bdf598d22c84f095de7edbe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 28 May 2024 15:42:34 +0200 Subject: [PATCH 303/359] #0: streamline and make more reliable lint & lint:fix before, if we saw errors for one folder we wouldnt get the errors (or fixes) for the next --- package.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 4f3151c7f..712587a07 100644 --- a/package.json +++ b/package.json @@ -52,12 +52,9 @@ "mcdev": "node lib/cli.js", "build": "run-s lint:fix docs test", "debug": "node --nolazy --inspect-brk=9229 lib/cli.js", - "lint:fix": "eslint --fix lib/**/*.js && eslint --fix types/*.js && eslint --fix test/**/*.js", - "lint": "run-p -c lint-type lint-lib lint-test", + "lint:fix": "eslint --fix lib/**/*.js types/*.js test/**/*.js", + "lint": "eslint lib/**/*.js types/*.js test/**/*.js", "lint-ts": "tsc -p jsconfig.json --maxNodeModuleJsDepth 1 --noEmit", - "lint-lib": "eslint lib/**/*.js", - "lint-type": "eslint types/*.js", - "lint-test": "eslint test/**/*.js", "prepare": "husky || true", "lint-and-test": "run-s lint test", "test": "mocha --reporter-option maxDiffSize=25000", From bb9de89c77bac15b166cdcaf452bef0ae791d8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 28 May 2024 15:56:32 +0200 Subject: [PATCH 304/359] #0: manual eslint fixes for unicorn/prefer-structured-clone --- @types/lib/metadataTypes/Automation.d.ts | 6 ++++++ @types/lib/metadataTypes/Automation.d.ts.map | 2 +- lib/metadataTypes/Asset.js | 2 +- lib/metadataTypes/Automation.js | 4 ++-- lib/metadataTypes/DataExtensionField.js | 4 ++-- lib/metadataTypes/DataExtract.js | 2 +- lib/metadataTypes/Folder.js | 6 +++--- lib/metadataTypes/MetadataType.js | 10 +++++----- lib/util/auth.js | 2 +- 9 files changed, 22 insertions(+), 16 deletions(-) diff --git a/@types/lib/metadataTypes/Automation.d.ts b/@types/lib/metadataTypes/Automation.d.ts index 99faab377..2d473376b 100644 --- a/@types/lib/metadataTypes/Automation.d.ts +++ b/@types/lib/metadataTypes/Automation.d.ts @@ -864,6 +864,12 @@ declare namespace Automation { template: boolean; }; 'steps[].annotation': { + /** + * manages post retrieve steps + * + * @param {AutomationItem} metadata a single automation + * @returns {AutomationItem | void} parsed item + */ isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; diff --git a/@types/lib/metadataTypes/Automation.d.ts.map b/@types/lib/metadataTypes/Automation.d.ts.map index 3c94b44b3..93691bce5 100644 --- a/@types/lib/metadataTypes/Automation.d.ts.map +++ b/@types/lib/metadataTypes/Automation.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Automation.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;uBACnD,OAAO,wBAAwB,EAAE,QAAQ;gCACzC,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;6BAG5C,OAAO,wBAAwB,EAAE,cAAc;gCAC/C,OAAO,wBAAwB,EAAE,iBAAiB;4BAClD,OAAO,wBAAwB,EAAE,aAAa;+BAC9C,OAAO,wBAAwB,EAAE,gBAAgB;iCACjD,OAAO,wBAAwB,EAAE,kBAAkB;qCACnD,OAAO,wBAAwB,EAAE,sBAAsB;AAnBpE;;;;;;;;;;;;GAYG;AACH;;;;;;;GAOG;AAEH;;;;GAIG;AACH;IACI,+BAAgC;IAChC,0BAAqB;IACrB,0CAAyC;IACzC,4BAA4B;IAC5B,2BADW,aAAa,CACE;IAC1B;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyNpC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8BhC;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAzTkB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Automation.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Automation.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;uBACnD,OAAO,wBAAwB,EAAE,QAAQ;gCACzC,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;6BAG5C,OAAO,wBAAwB,EAAE,cAAc;gCAC/C,OAAO,wBAAwB,EAAE,iBAAiB;4BAClD,OAAO,wBAAwB,EAAE,aAAa;+BAC9C,OAAO,wBAAwB,EAAE,gBAAgB;iCACjD,OAAO,wBAAwB,EAAE,kBAAkB;qCACnD,OAAO,wBAAwB,EAAE,sBAAsB;AAnBpE;;;;;;;;;;;;GAYG;AACH;;;;;;;GAOG;AAEH;;;;GAIG;AACH;IACI,+BAAgC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyNpC,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBA8BhC;;;;;;;mBAOG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAqFH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnZkB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 7964023f0..c9c73a453 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -889,7 +889,7 @@ class Asset extends MetadataType { mode ) { // * because asset's _mergeCode() is overwriting 'metadata', clone it to ensure the main file is not modified by what we do in here - metadata = JSON.parse(JSON.stringify(metadata)); + metadata = structuredClone(metadata); // #1 text extracts // define asset's subtype diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index 403787040..bbfdef44a 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -351,7 +351,7 @@ class Automation extends MetadataType { ); } } catch { - val = JSON.parse(JSON.stringify(details)); + val = structuredClone(details); } if (val === null) { throw new Error( @@ -508,7 +508,7 @@ class Automation extends MetadataType { } } } - return JSON.parse(JSON.stringify(metadata)); + return structuredClone(metadata); } catch (ex) { Util.logger.warn( ` - ${this.definition.typeName} '${metadata[this.definition.nameField]}': ${ diff --git a/lib/metadataTypes/DataExtensionField.js b/lib/metadataTypes/DataExtensionField.js index b5ca637b7..efef3e5b5 100644 --- a/lib/metadataTypes/DataExtensionField.js +++ b/lib/metadataTypes/DataExtensionField.js @@ -190,7 +190,7 @@ class DataExtensionField extends MetadataType { } } // share fields with fixShared logic - this.fixShared_fields[deKey][item.Name] = JSON.parse(JSON.stringify(item)); + this.fixShared_fields[deKey][item.Name] = structuredClone(item); this.fixShared_fields[deKey][item.Name].FieldType = itemOld.FieldType; if (!changeFound) { @@ -227,7 +227,7 @@ class DataExtensionField extends MetadataType { // Field doesn't exist in target, therefore Remove ObjectID if present delete item.ObjectID; - this.fixShared_fields[deKey][item.Name] = JSON.parse(JSON.stringify(item)); + this.fixShared_fields[deKey][item.Name] = structuredClone(item); } if (Util.isTrue(item.IsPrimaryKey) && Util.isFalse(item.IsRequired)) { // applicable: with or without data diff --git a/lib/metadataTypes/DataExtract.js b/lib/metadataTypes/DataExtract.js index 9dba7db36..6284d7cec 100644 --- a/lib/metadataTypes/DataExtract.js +++ b/lib/metadataTypes/DataExtract.js @@ -157,7 +157,7 @@ class DataExtract extends MetadataType { ` - ${this.definition.type} ${metadata[this.definition.keyField]}: ${ex.message}` ); } - return JSON.parse(JSON.stringify(metadata)); + return structuredClone(metadata); } /** * helper to allow us to select single metadata entries via REST diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index 0a81a6993..aa9e2d889 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -179,7 +179,7 @@ class Folder extends MetadataType { * @returns {Promise.} Promise of saved metadata */ static async upsert(metadata) { - const orignalMetadata = JSON.parse(JSON.stringify(metadata)); + const orignalMetadata = structuredClone(metadata); let updateCount = 0; let updateFailedCount = 0; let createCount = 0; @@ -265,7 +265,7 @@ class Folder extends MetadataType { let result; // since deployableMetadata will be modified for deploy, make a copy for reference - const beforeMetadata = JSON.parse(JSON.stringify(deployableMetadata)); + const beforeMetadata = structuredClone(deployableMetadata); if (existingId) { // if an existing folder exists with the same name/path then use that deployableMetadata.ID = existingId; @@ -590,7 +590,7 @@ class Folder extends MetadataType { * @returns {MetadataTypeItem} cloned metadata */ static postRetrieveTasks(metadata) { - return JSON.parse(JSON.stringify(metadata)); + return structuredClone(metadata); } /** * Helper for writing Metadata to disk, used for Retrieve and deploy diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index c7e41916e..2913b7c15 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -209,7 +209,7 @@ class MetadataType { * @returns {MetadataTypeItem} cloned metadata */ static postRetrieveTasks(metadata, targetDir, isTemplating) { - return JSON.parse(JSON.stringify(metadata)); + return structuredClone(metadata); } /** * generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve @@ -529,7 +529,7 @@ class MetadataType { return true; } // we do need the full set in other places and hence need to work with a clone here - const clonedMetada = JSON.parse(JSON.stringify(metadata)); + const clonedMetada = structuredClone(metadata); this.removeNotUpdateableFields(clonedMetada); // iterate over what we want to upload rather than what we cached to avoid false positives for (const prop in clonedMetada) { @@ -577,7 +577,7 @@ class MetadataType { * @returns {Promise.} keyField => metadata map */ static async upsert(metadataMap, deployDir) { - const orignalMetadataMap = JSON.parse(JSON.stringify(metadataMap)); + const orignalMetadataMap = structuredClone(metadataMap); const metadataToUpdate = []; const metadataToCreate = []; let filteredByPreDeploy = 0; @@ -893,7 +893,7 @@ class MetadataType { * @returns {Promise. | null} Promise of API response or null in case of an error */ static async createREST(metadataEntry, uri, handleOutside) { - const metadataClone = JSON.parse(JSON.stringify(metadataEntry)); + const metadataClone = structuredClone(metadataEntry); this.removeNotCreateableFields(metadataEntry); try { // set to empty object in case API returned nothing to be able to update it in helper classes @@ -1787,7 +1787,7 @@ class MetadataType { // we dont store Id on local disk, but we need it for caching logic, // so its in retrieve but not in save. Here we put into the clone so that the original // object used for caching doesnt have the Id removed. - const saveClone = JSON.parse(JSON.stringify(results[originalKey])); + const saveClone = structuredClone(results[originalKey]); if ( !this.definition.keepId && this.definition.idField !== this.definition.keyField diff --git a/lib/util/auth.js b/lib/util/auth.js index 8931d3c9c..d05cb9f5f 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -140,7 +140,7 @@ function setupSDK(sessionKey, authObject) { Util.logger.errorStack(ex); }, logRequest: (req) => { - const msg = JSON.parse(JSON.stringify(req)); + const msg = structuredClone(req); if (msg.url === '/Service.asmx') { msg.data = msg.data.replaceAll( //gim, From 0b20427c910825eb40e054f7d3dff993881e4538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Tue, 28 May 2024 16:06:13 +0200 Subject: [PATCH 305/359] #0: manual eslint fixes for unicorn/prefer-structured-clone --- lib/metadataTypes/DataExtension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index 98d81e1cc..de4098494 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -1486,8 +1486,8 @@ class DataExtension extends MetadataType { metadata[key].Fields.sort((a, b) => a.Ordinal - b.Ordinal); const originalKey = key; - const metadataCleaned = JSON.parse( - JSON.stringify(await this.postRetrieveTasks(metadata[key])) + const metadataCleaned = structuredClone( + await this.postRetrieveTasks(metadata[key]) ); this.keepTemplateFields(metadataCleaned); From 50e48d885d3ffb34be26df49bb254433a641efd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 29 May 2024 10:20:24 +0200 Subject: [PATCH 306/359] #1350: switch from fixed node-version to whatever is set in package.json engines.node --- .github/workflows/code-test.yml | 2 +- .github/workflows/coverage-develop-branch.yml | 2 +- .github/workflows/coverage-main-branch.yml | 2 +- .github/workflows/coverage.yml | 2 +- .github/workflows/npm-publish.yml | 5 +++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/code-test.yml b/.github/workflows/code-test.yml index 2021742ac..78071f92e 100644 --- a/.github/workflows/code-test.yml +++ b/.github/workflows/code-test.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18.16 + node-version-file: ./package.json registry-url: https://registry.npmjs.org/ - run: npm ci --ignore-scripts diff --git a/.github/workflows/coverage-develop-branch.yml b/.github/workflows/coverage-develop-branch.yml index daa1bd57c..4700e1a37 100644 --- a/.github/workflows/coverage-develop-branch.yml +++ b/.github/workflows/coverage-develop-branch.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18.16 + node-version-file: ./package.json - run: npm ci --ignore-scripts diff --git a/.github/workflows/coverage-main-branch.yml b/.github/workflows/coverage-main-branch.yml index bd8aa2cdb..3c80b297f 100644 --- a/.github/workflows/coverage-main-branch.yml +++ b/.github/workflows/coverage-main-branch.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18.16 + node-version-file: ./package.json - run: npm ci --ignore-scripts diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 8ee186b82..be85e4d40 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -19,7 +19,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18.16 + node-version-file: ./package.json - run: npm ci --ignore-scripts diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index 7c43db805..21fdc1ad1 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -14,7 +14,8 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18.16 + node-version-file: ./package.json + - run: npm ci - run: npm test @@ -25,7 +26,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 18.16 + node-version-file: ./package.json registry-url: https://registry.npmjs.org/ - run: npm ci - run: npm publish From cce7d51f4b2d65df1b9445b26d0a0006c4442faf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 29 May 2024 10:40:46 +0200 Subject: [PATCH 307/359] #1350: make sure we test with minimal node version (18.18.2 at the moment) AND with node20 --- .github/workflows/code-test.yml | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-test.yml b/.github/workflows/code-test.yml index 78071f92e..182af701a 100644 --- a/.github/workflows/code-test.yml +++ b/.github/workflows/code-test.yml @@ -10,8 +10,8 @@ on: branches: [main, develop, hotfix] jobs: - testAndCoverage: - name: lint & test + lintandTest18: + name: lint & test w/ node v18 runs-on: ubuntu-latest permissions: actions: read @@ -24,7 +24,31 @@ jobs: - uses: actions/setup-node@v4 with: - node-version-file: ./package.json + node-version: 18.18.2 + registry-url: https://registry.npmjs.org/ + + - run: npm ci --ignore-scripts + + - run: npm run lint + + # Assuming code passes, run tests + - name: Run mcdev-tests + run: npm run test + lintandTest20: + name: lint & test w/ node v20 + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 registry-url: https://registry.npmjs.org/ - run: npm ci --ignore-scripts From bb41725687d6aa20266b2f5ef5856b3fec3d1988 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 29 May 2024 10:47:59 +0200 Subject: [PATCH 308/359] #1350: also add a test run in node v19 --- .github/workflows/code-test.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/code-test.yml b/.github/workflows/code-test.yml index 182af701a..6d3f12a62 100644 --- a/.github/workflows/code-test.yml +++ b/.github/workflows/code-test.yml @@ -31,6 +31,30 @@ jobs: - run: npm run lint + # Assuming code passes, run tests + - name: Run mcdev-tests + run: npm run test + lintandTest19: + name: lint & test w/ node v19 + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 19 + registry-url: https://registry.npmjs.org/ + + - run: npm ci --ignore-scripts + + - run: npm run lint + # Assuming code passes, run tests - name: Run mcdev-tests run: npm run test From db9fe27466cb1ce346f864a1429ce5387d86caa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 29 May 2024 15:43:58 +0200 Subject: [PATCH 309/359] #1350: replace chai-files > file with await fs.fileRead() to workaround tschaub/mock-fs#377 --- test/general.test.js | 133 +++++++++++++---------------- test/type.asset.test.js | 26 +++--- test/type.automation.test.js | 110 +++++++++++------------- test/type.dataExtension.test.js | 17 ++-- test/type.mobileKeyword.test.js | 57 ++++++------- test/type.mobileMessage.test.js | 21 +++-- test/type.query.test.js | 83 +++++++++--------- test/type.script.test.js | 77 +++++++++-------- test/type.transactionalSMS.test.js | 25 +++--- test/type.user.test.js | 8 +- test/utils.js | 37 +++++--- 11 files changed, 279 insertions(+), 315 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index 686e7c5a5..dd29dfb2b 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -6,7 +6,6 @@ import chaiFiles from 'chai-files'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('GENERAL', () => { beforeEach(() => { @@ -343,8 +342,8 @@ describe('GENERAL', () => { 'returned template JSON of retrieveAsTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + await testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'template', 'sql')); // *** buildDefinition *** const definitionResult = await handler.buildDefinition( @@ -385,8 +384,8 @@ describe('GENERAL', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql')); assert.equal( testUtils.getAPIHistoryLength() - expectedApiCallsRetrieve, @@ -445,8 +444,8 @@ describe('GENERAL', () => { 'returned template JSON of retrieveAsTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + await testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'template', 'sql')); // *** buildDefinition *** @@ -476,8 +475,8 @@ describe('GENERAL', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql')); assert.equal( testUtils.getAPIHistoryLength() - expectedApiCallsRetrieve, @@ -537,8 +536,8 @@ describe('GENERAL', () => { 'returned template JSON of retrieveAsTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + await testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'template', 'sql')); // *** buildDefinitionBulk *** @@ -580,23 +579,19 @@ describe('GENERAL', () => { // check if files were also created for other BU-market combos // testBU: testSourceMarket expect( - file( - testUtils.getActualDeployFile( - 'testExisting_automation', - 'automation', - 'json' - ) + await testUtils.getActualDeployFile( + 'testExisting_automation', + 'automation', + 'json' ) ).to.exist; // _ParentBU_: testTargetMarket expect( - file( - testUtils.getActualDeployFile( - 'testTemplated_automation', - 'automation', - 'json', - '_ParentBU_' - ) + await testUtils.getActualDeployFile( + 'testTemplated_automation', + 'automation', + 'json', + '_ParentBU_' ) ).to.exist; @@ -634,34 +629,30 @@ describe('GENERAL', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql')); // check if files were also created for other BU-market combos // testBU: testSourceMarket - expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'json'))) + expect(await testUtils.getActualDeployFile('testExisting_query', 'query', 'json')) .to.exist; - expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'sql'))).to + expect(await testUtils.getActualDeployFile('testExisting_query', 'query', 'sql')).to .exist; // _ParentBU_: testTargetMarket expect( - file( - testUtils.getActualDeployFile( - 'testTemplated_query', - 'query', - 'json', - '_ParentBU_' - ) + await testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'json', + '_ParentBU_' ) ).to.exist; expect( - file( - testUtils.getActualDeployFile( - 'testTemplated_query', - 'query', - 'sql', - '_ParentBU_' - ) + await testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'sql', + '_ParentBU_' ) ).to.exist; @@ -728,8 +719,8 @@ describe('GENERAL', () => { 'returned template JSON of retrieveAsTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + await testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'template', 'sql')); // *** buildDefinitionBulk chained *** const definitionResult = await handler.buildDefinitionBulk( @@ -780,23 +771,19 @@ describe('GENERAL', () => { // check if files were also created for other BU-market combos // testBU: testSourceMarket expect( - file( - testUtils.getActualDeployFile( - 'testExisting_automation', - 'automation', - 'json' - ) + await testUtils.getActualDeployFile( + 'testExisting_automation', + 'automation', + 'json' ) ).to.exist; // _ParentBU_: testTargetMarket expect( - file( - testUtils.getActualDeployFile( - 'testTemplated_automation', - 'automation', - 'json', - '_ParentBU_' - ) + await testUtils.getActualDeployFile( + 'testTemplated_automation', + 'automation', + 'json', + '_ParentBU_' ) ).to.exist; @@ -834,34 +821,30 @@ describe('GENERAL', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql')); // check if files were also created for other BU-market combos // testBU: testSourceMarket - expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'json'))) + expect(await testUtils.getActualDeployFile('testExisting_query', 'query', 'json')) .to.exist; - expect(file(testUtils.getActualDeployFile('testExisting_query', 'query', 'sql'))).to + expect(await testUtils.getActualDeployFile('testExisting_query', 'query', 'sql')).to .exist; // _ParentBU_: testTargetMarket expect( - file( - testUtils.getActualDeployFile( - 'testTemplated_query', - 'query', - 'json', - '_ParentBU_' - ) + await testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'json', + '_ParentBU_' ) ).to.exist; expect( - file( - testUtils.getActualDeployFile( - 'testTemplated_query', - 'query', - 'sql', - '_ParentBU_' - ) + await testUtils.getActualDeployFile( + 'testTemplated_query', + 'query', + 'sql', + '_ParentBU_' ) ).to.exist; diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 1ddad5030..5d9f4a13d 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -158,7 +158,7 @@ describe('type: asset', () => { 'returned metadata was not equal expected' ); expect(file(getActualFile('mcdev-issue-1157', 'asset', 'block', 'html'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'asset', 'block-1157-retrieve', 'html')) + await testUtils.getExpectedFile('9999999', 'asset', 'block-1157-retrieve', 'html') ); assert.deepEqual( @@ -335,13 +335,11 @@ describe('type: asset', () => { 'views.html.content' ) ).to.equal( - file( - testUtils.getExpectedFile( - '9999999', - 'asset', - 'template-templatebasedemail', - 'html' - ) + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'template-templatebasedemail', + 'html' ) ); // THEN @@ -371,13 +369,11 @@ describe('type: asset', () => { 'views.html.content' ) ).to.equal( - file( - testUtils.getExpectedFile( - '9999999', - 'asset', - 'build-templatebasedemail', - 'html' - ) + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'build-templatebasedemail', + 'html' ) ); diff --git a/test/type.automation.test.js b/test/type.automation.test.js index 96cc86460..ce76ca652 100644 --- a/test/type.automation.test.js +++ b/test/type.automation.test.js @@ -7,7 +7,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('type: automation', () => { beforeEach(() => { @@ -38,14 +37,12 @@ describe('type: automation', () => { 'returned metadata was not equal expected' ); // check if MD file was created and equals expectations - expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal( - file( - testUtils.getExpectedFile( - '9999999', - 'automation', - 'retrieve-testExisting_automation', - 'md' - ) + expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'automation', + 'retrieve-testExisting_automation', + 'md' ) ); assert.equal( @@ -101,26 +98,22 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update' ); // check if MD file was created and equals expectations - expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal( - file( - testUtils.getExpectedFile( - '9999999', - 'automation', - 'update-testExisting_automation', - 'md' - ) + expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'automation', + 'update-testExisting_automation', + 'md' ) ); // check if MD file was created and equals expectations - expect(file(testUtils.getActualDoc('testNew_automation', 'automation'))).to.equal( - file( - testUtils.getExpectedFile( - '9999999', - 'automation', - 'create-testNew_automation', - 'md' - ) + expect(await testUtils.getActualDoc('testNew_automation', 'automation')).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'automation', + 'create-testNew_automation', + 'md' ) ); @@ -183,14 +176,12 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update' ); // check if MD file was created and equals expectations - expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal( - file( - testUtils.getExpectedFile( - '9999999', - 'automation', - 'update-testExisting_automation', - 'md' - ) + expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'automation', + 'update-testExisting_automation', + 'md' ) ); @@ -252,14 +243,12 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update' ); // check if MD file was created and equals expectations - expect(file(testUtils.getActualDoc('testExisting_automation', 'automation'))).to.equal( - file( - testUtils.getExpectedFile( - '9999999', - 'automation', - 'update-testExisting_automation', - 'md' - ) + expect(await testUtils.getActualDoc('testExisting_automation', 'automation')).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'automation', + 'update-testExisting_automation', + 'md' ) ); @@ -340,11 +329,9 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update automation' ); expect( - file( - testUtils.getActualDoc( - 'testExisting_automation_fixedKey_scheduled', - 'automation' - ) + await testUtils.getActualDoc( + 'testExisting_automation_fixedKey_scheduled', + 'automation' ) ).to.exist; // check number of API calls @@ -386,11 +373,9 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update automation' ); expect( - file( - testUtils.getActualDoc( - 'testExisting_automation_fixedKey_scheduled', - 'automation' - ) + await testUtils.getActualDoc( + 'testExisting_automation_fixedKey_scheduled', + 'automation' ) ).to.exist; // check number of API calls @@ -432,11 +417,9 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update automation' ); expect( - file( - testUtils.getActualDoc( - 'testExisting_automation_fixedKey_scheduled', - 'automation' - ) + await testUtils.getActualDoc( + 'testExisting_automation_fixedKey_scheduled', + 'automation' ) ).to.exist; // check number of API calls @@ -478,8 +461,9 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update automation' ); expect( - file( - testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation') + await testUtils.getActualDoc( + 'testExisting_automation_fixedKey_paused', + 'automation' ) ).to.exist; // check number of API calls @@ -521,8 +505,9 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update automation' ); expect( - file( - testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation') + await testUtils.getActualDoc( + 'testExisting_automation_fixedKey_paused', + 'automation' ) ).to.exist; // check number of API calls @@ -564,8 +549,9 @@ describe('type: automation', () => { 'returned metadata was not equal expected for update automation' ); expect( - file( - testUtils.getActualDoc('testExisting_automation_fixedKey_paused', 'automation') + await testUtils.getActualDoc( + 'testExisting_automation_fixedKey_paused', + 'automation' ) ).to.exist; // check number of API calls diff --git a/test/type.dataExtension.test.js b/test/type.dataExtension.test.js index d53101ed8..805c9a83a 100644 --- a/test/type.dataExtension.test.js +++ b/test/type.dataExtension.test.js @@ -7,7 +7,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('type: dataExtension', () => { beforeEach(() => { @@ -39,9 +38,9 @@ describe('type: dataExtension', () => { ); // check if MD file was created and equals expectations expect( - file(testUtils.getActualDoc('testExisting_dataExtension', 'dataExtension')) + await testUtils.getActualDoc('testExisting_dataExtension', 'dataExtension') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'dataExtension', 'retrieve', 'md')) + await testUtils.getExpectedFile('9999999', 'dataExtension', 'retrieve', 'md') ); assert.equal( @@ -76,15 +75,13 @@ describe('type: dataExtension', () => { ); // check if MD file was created and equals expectations expect( - file( - testUtils.getActualDoc( - 'testExisting_dataExtensionShared', - 'dataExtension', - '_ParentBU_' - ) + await testUtils.getActualDoc( + 'testExisting_dataExtensionShared', + 'dataExtension', + '_ParentBU_' ) ).to.equal( - file(testUtils.getExpectedFile('1111111', 'dataExtension', 'retrieve', 'md')) + await testUtils.getExpectedFile('1111111', 'dataExtension', 'retrieve', 'md') ); assert.equal( diff --git a/test/type.mobileKeyword.test.js b/test/type.mobileKeyword.test.js index 0f10856df..b179a6338 100644 --- a/test/type.mobileKeyword.test.js +++ b/test/type.mobileKeyword.test.js @@ -7,7 +7,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('type: mobileKeyword', () => { beforeEach(() => { @@ -40,14 +39,12 @@ describe('type: mobileKeyword', () => { 'saved JSON was not equal expected' ); expect( - file( - testUtils.getActualFile( - '4912312345678.TESTEXISTING_KEYWORD', - 'mobileKeyword', - 'amp' - ) + await testUtils.getActualFile( + '4912312345678.TESTEXISTING_KEYWORD', + 'mobileKeyword', + 'amp' ) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'get', 'amp'))); + ).to.equal(await testUtils.getExpectedFile('9999999', 'mobileKeyword', 'get', 'amp')); assert.equal( testUtils.getAPIHistoryLength(), 2, @@ -85,11 +82,13 @@ describe('type: mobileKeyword', () => { 'returned JSON was not equal expected for insert mobileKeyword' ); expect( - file( - testUtils.getActualFile('4912312345678.TESTNEW_KEYWORD', 'mobileKeyword', 'amp') + await testUtils.getActualFile( + '4912312345678.TESTNEW_KEYWORD', + 'mobileKeyword', + 'amp' ) ).to.equal( - file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'post-create', 'amp')) + await testUtils.getExpectedFile('9999999', 'mobileKeyword', 'post-create', 'amp') ); // confirm updated item @@ -152,15 +151,13 @@ describe('type: mobileKeyword', () => { 'returned template JSON was not equal expected' ); expect( - file( - testUtils.getActualTemplateFile( - '4912312345678.TESTEXISTING_KEYWORD', - 'mobileKeyword', - 'amp' - ) + await testUtils.getActualTemplateFile( + '4912312345678.TESTEXISTING_KEYWORD', + 'mobileKeyword', + 'amp' ) ).to.equal( - file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'template', 'amp')) + await testUtils.getExpectedFile('9999999', 'mobileKeyword', 'template', 'amp') ); assert.equal( testUtils.getAPIHistoryLength(), @@ -196,15 +193,13 @@ describe('type: mobileKeyword', () => { 'returned template JSON was not equal expected' ); expect( - file( - testUtils.getActualTemplateFile( - '4912312345678.TESTEXISTING_KEYWORD', - 'mobileKeyword', - 'amp' - ) + await testUtils.getActualTemplateFile( + '4912312345678.TESTEXISTING_KEYWORD', + 'mobileKeyword', + 'amp' ) ).to.equal( - file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'template', 'amp')) + await testUtils.getExpectedFile('9999999', 'mobileKeyword', 'template', 'amp') ); // buildDefinition @@ -224,14 +219,12 @@ describe('type: mobileKeyword', () => { 'returned deployment JSON was not equal expected' ); expect( - file( - testUtils.getActualDeployFile( - '4912312345678.TESTTEMPLATED_KEYWORD', - 'mobileKeyword', - 'amp' - ) + await testUtils.getActualDeployFile( + '4912312345678.TESTTEMPLATED_KEYWORD', + 'mobileKeyword', + 'amp' ) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'mobileKeyword', 'build', 'amp'))); + ).to.equal(await testUtils.getExpectedFile('9999999', 'mobileKeyword', 'build', 'amp')); assert.equal( testUtils.getAPIHistoryLength(), diff --git a/test/type.mobileMessage.test.js b/test/type.mobileMessage.test.js index 8823496d9..37ff4b040 100644 --- a/test/type.mobileMessage.test.js +++ b/test/type.mobileMessage.test.js @@ -7,7 +7,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('type: mobileMessage', () => { beforeEach(() => { @@ -36,8 +35,8 @@ describe('type: mobileMessage', () => { await testUtils.getExpectedJson('9999999', 'mobileMessage', 'get'), 'saved JSON was not equal expected' ); - expect(file(testUtils.getActualFile('NTIzOjc4OjA', 'mobileMessage', 'amp'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'mobileMessage', 'get', 'amp')) + expect(await testUtils.getActualFile('NTIzOjc4OjA', 'mobileMessage', 'amp')).to.equal( + await testUtils.getExpectedFile('9999999', 'mobileMessage', 'get', 'amp') ); assert.equal( testUtils.getAPIHistoryLength(), @@ -71,8 +70,8 @@ describe('type: mobileMessage', () => { await testUtils.getExpectedJson('9999999', 'mobileMessage', 'post-create'), 'returned JSON was not equal expected for insert mobileMessage' ); - expect(file(testUtils.getActualFile('NTQ3Ojc4OjA', 'mobileMessage', 'amp'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'mobileMessage', 'post-create', 'amp')) + expect(await testUtils.getActualFile('NTQ3Ojc4OjA', 'mobileMessage', 'amp')).to.equal( + await testUtils.getExpectedFile('9999999', 'mobileMessage', 'post-create', 'amp') ); // confirm updated item @@ -81,8 +80,8 @@ describe('type: mobileMessage', () => { await testUtils.getExpectedJson('9999999', 'mobileMessage', 'post-update'), // watch out - mobileMessage api wants put instead of patch for updates 'returned JSON was not equal expected for update mobileMessage' ); - expect(file(testUtils.getActualFile('NTIzOjc4OjA', 'mobileMessage', 'amp'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'mobileMessage', 'post-update', 'amp')) + expect(await testUtils.getActualFile('NTIzOjc4OjA', 'mobileMessage', 'amp')).to.equal( + await testUtils.getExpectedFile('9999999', 'mobileMessage', 'post-update', 'amp') ); // check number of API calls @@ -132,9 +131,9 @@ describe('type: mobileMessage', () => { 'returned template JSON was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('NTIzOjc4OjA', 'mobileMessage', 'amp')) + await testUtils.getActualTemplateFile('NTIzOjc4OjA', 'mobileMessage', 'amp') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'mobileMessage', 'template', 'amp')) + await testUtils.getExpectedFile('9999999', 'mobileMessage', 'template', 'amp') ); // buildDefinition @@ -151,8 +150,8 @@ describe('type: mobileMessage', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('NTIzOjc4OjA', 'mobileMessage', 'amp')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'mobileMessage', 'build', 'amp'))); + await testUtils.getActualDeployFile('NTIzOjc4OjA', 'mobileMessage', 'amp') + ).to.equal(await testUtils.getExpectedFile('9999999', 'mobileMessage', 'build', 'amp')); assert.equal( testUtils.getAPIHistoryLength(), diff --git a/test/type.query.test.js b/test/type.query.test.js index 5ef5e0900..ff2dce40a 100644 --- a/test/type.query.test.js +++ b/test/type.query.test.js @@ -7,7 +7,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('type: query', () => { beforeEach(() => { @@ -37,8 +36,8 @@ describe('type: query', () => { await testUtils.getExpectedJson('9999999', 'query', 'get'), 'returned metadata with correct key was not equal expected' ); - expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'get', 'sql')) + expect(await testUtils.getActualFile('testExisting_query', 'query', 'sql')).to.equal( + await testUtils.getExpectedFile('9999999', 'query', 'get', 'sql') ); // check if r__dataExtension_key was overwritten assert.deepEqual( @@ -72,8 +71,8 @@ describe('type: query', () => { await testUtils.getExpectedJson('9999999', 'query', 'get'), 'returned metadata was not equal expected' ); - expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'get', 'sql')) + expect(await testUtils.getActualFile('testExisting_query', 'query', 'sql')).to.equal( + await testUtils.getExpectedFile('9999999', 'query', 'get', 'sql') ); assert.equal( testUtils.getAPIHistoryLength(), @@ -101,10 +100,10 @@ describe('type: query', () => { await testUtils.getExpectedJson('9999999', 'query', 'get'), 'returned metadata was not equal expected' ); - expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'get', 'sql')) + expect(await testUtils.getActualFile('testExisting_query', 'query', 'sql')).to.equal( + await testUtils.getExpectedFile('9999999', 'query', 'get', 'sql') ); - expect(file(testUtils.getActualFile('testExisting_query2', 'query', 'sql'))).to.not + expect(await testUtils.getActualFile('testExisting_query2', 'query', 'sql')).to.not .exist; assert.equal( testUtils.getAPIHistoryLength(), @@ -128,9 +127,9 @@ describe('type: query', () => { '4 queries in cache expected' ); - expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.not + expect(await testUtils.getActualFile('testExisting_query', 'query', 'sql')).to.not .exist; - expect(file(testUtils.getActualFile('testExisting_query2', 'query', 'sql'))).to.not + expect(await testUtils.getActualFile('testExisting_query2', 'query', 'sql')).to.not .exist; assert.equal( testUtils.getAPIHistoryLength(), @@ -175,8 +174,8 @@ describe('type: query', () => { await testUtils.getExpectedJson('9999999', 'query', 'post'), 'returned metadata was not equal expected for insert query' ); - expect(file(testUtils.getActualFile('testNew_query', 'query', 'sql'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'post', 'sql')) + expect(await testUtils.getActualFile('testNew_query', 'query', 'sql')).to.equal( + await testUtils.getExpectedFile('9999999', 'query', 'post', 'sql') ); // confirm updated item assert.deepEqual( @@ -184,8 +183,8 @@ describe('type: query', () => { await testUtils.getExpectedJson('9999999', 'query', 'patch'), 'returned metadata was not equal expected for insert query' ); - expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'patch', 'sql')) + expect(await testUtils.getActualFile('testExisting_query', 'query', 'sql')).to.equal( + await testUtils.getExpectedFile('9999999', 'query', 'patch', 'sql') ); // check number of API calls assert.equal( @@ -216,8 +215,8 @@ describe('type: query', () => { await testUtils.getExpectedJson('9999999', 'query', 'patch'), 'returned metadata was not equal expected for insert query' ); - expect(file(testUtils.getActualFile('testExisting_query', 'query', 'sql'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'patch', 'sql')) + expect(await testUtils.getActualFile('testExisting_query', 'query', 'sql')).to.equal( + await testUtils.getExpectedFile('9999999', 'query', 'patch', 'sql') ); // check number of API calls assert.equal( @@ -281,8 +280,8 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql'))); + await testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql')); // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -335,8 +334,8 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql'))); + await testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql')); // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -389,9 +388,9 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys_DEV', 'query', 'sql')) + await testUtils.getActualFile('testExisting_query_fixedKeys_DEV', 'query', 'sql') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeysSuffix', 'sql')) + await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeysSuffix', 'sql') ); // check number of API calls assert.equal( @@ -505,8 +504,8 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql'))); + await testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql')); // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -554,9 +553,9 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys_DEV', 'query', 'sql')) + await testUtils.getActualFile('testExisting_query_fixedKeys_DEV', 'query', 'sql') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeysSuffix', 'sql')) + await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeysSuffix', 'sql') ); // check number of API calls assert.equal( @@ -598,8 +597,8 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql'))); + await testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql')); // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -636,8 +635,8 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql'))); + await testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql')); // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -678,8 +677,8 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql'))); + await testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql')); // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -715,8 +714,8 @@ describe('type: query', () => { 'returned metadata was not equal expected for update query' ); expect( - file(testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql'))); + await testUtils.getActualFile('testExisting_query_fixedKeys', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'patch_fixKeys', 'sql')); // check number of API calls assert.equal( testUtils.getAPIHistoryLength(), @@ -749,8 +748,8 @@ describe('type: query', () => { 'returned template JSON of retrieveAsTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + await testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'template', 'sql')); // THEN await handler.buildDefinition( 'testInstance/testBU', @@ -766,8 +765,8 @@ describe('type: query', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql')); assert.equal( testUtils.getAPIHistoryLength(), @@ -801,8 +800,8 @@ describe('type: query', () => { 'returned template JSON of buildTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'template', 'sql'))); + await testUtils.getActualTemplateFile('testExisting_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'template', 'sql')); // THEN await handler.buildDefinition( 'testInstance/testBU', @@ -818,8 +817,8 @@ describe('type: query', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'query', 'build', 'sql'))); + await testUtils.getActualDeployFile('testTemplated_query', 'query', 'sql') + ).to.equal(await testUtils.getExpectedFile('9999999', 'query', 'build', 'sql')); assert.equal( testUtils.getAPIHistoryLength(), diff --git a/test/type.script.test.js b/test/type.script.test.js index c40cdcfb9..25745f0f5 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -7,7 +7,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('type: script', () => { beforeEach(() => { @@ -46,10 +45,10 @@ describe('type: script', () => { await testUtils.getExpectedJson('9999999', 'script', 'get'), 'returned metadata with correct key was not equal expected' ); - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'html'))).to.not + expect(await testUtils.getActualFile('testExisting_script', 'script', 'html')).to.not .exist; - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'ssjs'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'script', 'get', 'ssjs')) + expect(await testUtils.getActualFile('testExisting_script', 'script', 'ssjs')).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'get', 'ssjs') ); // test with no script tag @@ -59,12 +58,12 @@ describe('type: script', () => { 'returned metadata was not equal expected' ); expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'html')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'html') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'script', 'get_noScriptTag', 'html')) + await testUtils.getExpectedFile('9999999', 'script', 'get_noScriptTag', 'html') ); expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'ssjs')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'ssjs') ).to.not.exist; // test with ampscript @@ -74,11 +73,11 @@ describe('type: script', () => { 'returned metadata was not equal expected' ); expect( - file(testUtils.getActualFile('testExisting_script_ampscript', 'script', 'html')) + await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'html') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'script', 'get_ampscript', 'html')) + await testUtils.getExpectedFile('9999999', 'script', 'get_ampscript', 'html') ); - expect(file(testUtils.getActualFile('testExisting_script_ampscript', 'script', 'ssjs'))) + expect(await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'ssjs')) .to.not.exist; // test with mixed code (ampscript inside of ssjs) @@ -88,12 +87,12 @@ describe('type: script', () => { 'returned metadata was not equal expected' ); expect( - file(testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'html')) + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'html') ).to.not.exist; expect( - file(testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'ssjs')) + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'ssjs') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'script', 'get_ampincluded', 'ssjs')) + await testUtils.getExpectedFile('9999999', 'script', 'get_ampincluded', 'ssjs') ); // test with mixed code (ssjs and ampscript side-by-side) @@ -103,9 +102,9 @@ describe('type: script', () => { 'returned metadata was not equal expected' ); expect( - file(testUtils.getActualFile('testExisting_script_mixed', 'script', 'html')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'script', 'get_mixed', 'html'))); - expect(file(testUtils.getActualFile('testExisting_script_mixed', 'script', 'ssjs'))).to + await testUtils.getActualFile('testExisting_script_mixed', 'script', 'html') + ).to.equal(await testUtils.getExpectedFile('9999999', 'script', 'get_mixed', 'html')); + expect(await testUtils.getActualFile('testExisting_script_mixed', 'script', 'ssjs')).to .not.exist; assert.equal( @@ -133,20 +132,20 @@ describe('type: script', () => { await testUtils.getExpectedJson('9999999', 'script', 'get'), 'returned metadata was not equal expected' ); - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'html'))).to.not + expect(await testUtils.getActualFile('testExisting_script', 'script', 'html')).to.not .exist; - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'ssjs'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'script', 'get', 'ssjs')) + expect(await testUtils.getActualFile('testExisting_script', 'script', 'ssjs')).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'get', 'ssjs') ); expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'json')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'json') ).to.not.exist; expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'ssjs')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'ssjs') ).to.not.exist; expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'html')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'html') ).to.not.exist; assert.equal( @@ -177,18 +176,18 @@ describe('type: script', () => { await testUtils.getExpectedJson('9999999', 'script', 'get'), 'returned metadata was not equal expected' ); - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'ssjs'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'script', 'get', 'ssjs')) + expect(await testUtils.getActualFile('testExisting_script', 'script', 'ssjs')).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'get', 'ssjs') ); expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'json')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'json') ).to.not.exist; expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'ssjs')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'ssjs') ).to.not.exist; expect( - file(testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'html')) + await testUtils.getActualFile('testExisting_script_noScriptTag', 'script', 'html') ).to.not.exist; assert.equal( @@ -214,7 +213,7 @@ describe('type: script', () => { '5 scripts in cache expected' ); - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'ssjs'))).to.not + expect(await testUtils.getActualFile('testExisting_script', 'script', 'ssjs')).to.not .exist; assert.equal( testUtils.getAPIHistoryLength(), @@ -254,10 +253,10 @@ describe('type: script', () => { await testUtils.getExpectedJson('9999999', 'script', 'patch'), 'returned metadata was not equal expected for insert script' ); - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'html'))).to.not + expect(await testUtils.getActualFile('testExisting_script', 'script', 'html')).to.not .exist; - expect(file(testUtils.getActualFile('testExisting_script', 'script', 'ssjs'))).to.equal( - file(testUtils.getExpectedFile('9999999', 'script', 'patch', 'ssjs')) + expect(await testUtils.getActualFile('testExisting_script', 'script', 'ssjs')).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'patch', 'ssjs') ); // check number of API calls assert.equal( @@ -291,8 +290,8 @@ describe('type: script', () => { 'returned template JSON of retrieveAsTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_script', 'script', 'ssjs')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'script', 'template', 'ssjs'))); + await testUtils.getActualTemplateFile('testExisting_script', 'script', 'ssjs') + ).to.equal(await testUtils.getExpectedFile('9999999', 'script', 'template', 'ssjs')); // THEN await handler.buildDefinition( 'testInstance/testBU', @@ -308,8 +307,8 @@ describe('type: script', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_script', 'script', 'ssjs')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'script', 'build', 'ssjs'))); + await testUtils.getActualDeployFile('testTemplated_script', 'script', 'ssjs') + ).to.equal(await testUtils.getExpectedFile('9999999', 'script', 'build', 'ssjs')); assert.equal( testUtils.getAPIHistoryLength(), @@ -343,8 +342,8 @@ describe('type: script', () => { 'returned template JSON of buildTemplate was not equal expected' ); expect( - file(testUtils.getActualTemplateFile('testExisting_script', 'script', 'ssjs')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'script', 'template', 'ssjs'))); + await testUtils.getActualTemplateFile('testExisting_script', 'script', 'ssjs') + ).to.equal(await testUtils.getExpectedFile('9999999', 'script', 'template', 'ssjs')); // THEN await handler.buildDefinition( 'testInstance/testBU', @@ -360,8 +359,8 @@ describe('type: script', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_script', 'script', 'ssjs')) - ).to.equal(file(testUtils.getExpectedFile('9999999', 'script', 'build', 'ssjs'))); + await testUtils.getActualDeployFile('testTemplated_script', 'script', 'ssjs') + ).to.equal(await testUtils.getExpectedFile('9999999', 'script', 'build', 'ssjs')); assert.equal( testUtils.getAPIHistoryLength(), diff --git a/test/type.transactionalSMS.test.js b/test/type.transactionalSMS.test.js index 8915390a5..4c531d275 100644 --- a/test/type.transactionalSMS.test.js +++ b/test/type.transactionalSMS.test.js @@ -7,7 +7,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; describe('type: transactionalSMS', () => { beforeEach(() => { @@ -37,9 +36,9 @@ describe('type: transactionalSMS', () => { 'returned JSON was not equal expected' ); expect( - file(testUtils.getActualFile('testExisting_tsms', 'transactionalSMS', 'amp')) + await testUtils.getActualFile('testExisting_tsms', 'transactionalSMS', 'amp') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'transactionalSMS', 'get', 'amp')) + await testUtils.getExpectedFile('9999999', 'transactionalSMS', 'get', 'amp') ); assert.equal( testUtils.getAPIHistoryLength(), @@ -74,9 +73,9 @@ describe('type: transactionalSMS', () => { 'returned JSON was not equal expected for insert transactionalSMS' ); expect( - file(testUtils.getActualFile('testNew_tsms', 'transactionalSMS', 'amp')) + await testUtils.getActualFile('testNew_tsms', 'transactionalSMS', 'amp') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'transactionalSMS', 'post', 'amp')) + await testUtils.getExpectedFile('9999999', 'transactionalSMS', 'post', 'amp') ); // confirm updated item assert.deepEqual( @@ -85,9 +84,9 @@ describe('type: transactionalSMS', () => { 'returned JSON was not equal expected for update transactionalSMS' ); expect( - file(testUtils.getActualFile('testExisting_tsms', 'transactionalSMS', 'amp')) + await testUtils.getActualFile('testExisting_tsms', 'transactionalSMS', 'amp') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'transactionalSMS', 'patch', 'amp')) + await testUtils.getExpectedFile('9999999', 'transactionalSMS', 'patch', 'amp') ); // check number of API calls assert.equal( @@ -141,11 +140,13 @@ describe('type: transactionalSMS', () => { 'returned template JSON was not equal expected' ); expect( - file( - testUtils.getActualTemplateFile('testExisting_tsms', 'transactionalSMS', 'amp') + await testUtils.getActualTemplateFile( + 'testExisting_tsms', + 'transactionalSMS', + 'amp' ) ).to.equal( - file(testUtils.getExpectedFile('9999999', 'transactionalSMS', 'template', 'amp')) + await testUtils.getExpectedFile('9999999', 'transactionalSMS', 'template', 'amp') ); // buildDefinition await handler.buildDefinition( @@ -162,9 +163,9 @@ describe('type: transactionalSMS', () => { 'returned deployment JSON was not equal expected' ); expect( - file(testUtils.getActualDeployFile('testTemplated_tsms', 'transactionalSMS', 'amp')) + await testUtils.getActualDeployFile('testTemplated_tsms', 'transactionalSMS', 'amp') ).to.equal( - file(testUtils.getExpectedFile('9999999', 'transactionalSMS', 'build', 'amp')) + await testUtils.getExpectedFile('9999999', 'transactionalSMS', 'build', 'amp') ); assert.equal( testUtils.getAPIHistoryLength(), diff --git a/test/type.user.test.js b/test/type.user.test.js index 16100fe2f..784a58dad 100644 --- a/test/type.user.test.js +++ b/test/type.user.test.js @@ -40,9 +40,11 @@ describe('type: user', () => { ); // check if MD file was created and equals expectations // ! this test needs to update the lastLoginDate counter because it changes with every passing day - const expectedFile = await File.readFile( - testUtils.getExpectedFile('1111111', 'user', 'retrieve', 'md'), - { encoding: 'utf8' } + const expectedFile = await testUtils.getExpectedFile( + '1111111', + 'user', + 'retrieve', + 'md' ); const regexFindDaysSinceLogin = /\| (\d*) (seconds|minutes|days|weeks|months|years){1} \|/g; diff --git a/test/utils.js b/test/utils.js index 4050ac479..33bf1ab60 100644 --- a/test/utils.js +++ b/test/utils.js @@ -36,10 +36,13 @@ export function getActualJson(customerKey, type, buName = 'testBU') { * @param {string} customerKey of metadata * @param {string} type of metadata * @param {string} [buName] used when we need to test on ParentBU - * @returns {string} file path + * @returns {Promise.} file path */ export function getActualDoc(customerKey, type, buName = 'testBU') { - return `./retrieve/testInstance/${buName}/${type}/${customerKey}.${type}-doc.md`; + return File.readFile( + `./retrieve/testInstance/${buName}/${type}/${customerKey}.${type}-doc.md`, + 'utf8' + ); } /** * gets file from Retrieve folder @@ -48,10 +51,13 @@ export function getActualDoc(customerKey, type, buName = 'testBU') { * @param {string} type of metadata * @param {string} ext file extension * @param {string} [buName] used when we need to test on ParentBU - * @returns {string} file path + * @returns {Promise.} file in string form */ export function getActualFile(customerKey, type, ext, buName = 'testBU') { - return `./retrieve/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`; + return File.readFile( + `./retrieve/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`, + 'utf8' + ); } /** * gets file from Deploy folder @@ -59,7 +65,7 @@ export function getActualFile(customerKey, type, ext, buName = 'testBU') { * @param {string} customerKey of metadata * @param {string} type of metadata * @param {string} [buName] used when we need to test on ParentBU - * @returns {Promise.} file in string form + * @returns {Promise.} file in JSON form */ export function getActualDeployJson(customerKey, type, buName = 'testBU') { return File.readJSON( @@ -73,17 +79,20 @@ export function getActualDeployJson(customerKey, type, buName = 'testBU') { * @param {string} type of metadata * @param {string} ext file extension * @param {string} [buName] used when we need to test on ParentBU - * @returns {string} file path + * @returns {Promise.} file in string form */ export function getActualDeployFile(customerKey, type, ext, buName = 'testBU') { - return `./deploy/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`; + return File.readFile( + `./deploy/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`, + 'utf8' + ); } /** * gets file from Template folder * * @param {string} customerKey of metadata * @param {string} type of metadata - * @returns {Promise.} file in string form + * @returns {Promise.} file in JSON form */ export function getActualTemplateJson(customerKey, type) { return File.readJSON(`./template/${type}/${customerKey}.${type}-meta.json`); @@ -94,10 +103,10 @@ export function getActualTemplateJson(customerKey, type) { * @param {string} customerKey of metadata * @param {string} type of metadata * @param {string} ext file extension - * @returns {string} file path + * @returns {Promise.} file in string form */ export function getActualTemplateFile(customerKey, type, ext) { - return `./template/${type}/${customerKey}.${type}-meta.${ext}`; + return File.readFile(`./template/${type}/${customerKey}.${type}-meta.${ext}`, 'utf8'); } /** * gets file from resources folder which should be used for comparison @@ -105,10 +114,10 @@ export function getActualTemplateFile(customerKey, type, ext) { * @param {string} mid of Business Unit * @param {string} type of metadata * @param {string} action of SOAP request - * @returns {Promise.} file in string form + * @returns {Promise.} file in JSON form */ export function getExpectedJson(mid, type, action) { - return File.readJSON(path.join('test', 'resources', mid, type, action + '-expected.json')); + return File.readJSON(`./test/resources/${mid}/${type}/${action}-expected.json`); } /** * gets file from resources folder which should be used for comparison @@ -117,10 +126,10 @@ export function getExpectedJson(mid, type, action) { * @param {string} type of metadata * @param {string} action of SOAP request * @param {string} ext file extension - * @returns {string} file path + * @returns {Promise.} file in string form */ export function getExpectedFile(mid, type, action, ext) { - return path.join('test', 'resources', mid, type, action + '-expected.' + ext); + return File.readFile(`./test/resources/${mid}/${type}/${action}-expected.${ext}`, 'utf8'); } /** * setup mocks for API and FS From ec7dffa1424c344acd254c28553c3252898f0883 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 29 May 2024 16:18:21 +0200 Subject: [PATCH 310/359] #1350: fix ...to.not.exit tests --- test/utils.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/test/utils.js b/test/utils.js index 33bf1ab60..0f84a6fd6 100644 --- a/test/utils.js +++ b/test/utils.js @@ -51,13 +51,16 @@ export function getActualDoc(customerKey, type, buName = 'testBU') { * @param {string} type of metadata * @param {string} ext file extension * @param {string} [buName] used when we need to test on ParentBU - * @returns {Promise.} file in string form + * @returns {Promise.} file in string form, null if not found */ -export function getActualFile(customerKey, type, ext, buName = 'testBU') { - return File.readFile( - `./retrieve/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`, - 'utf8' - ); +export async function getActualFile(customerKey, type, ext, buName = 'testBU') { + const path = `./retrieve/testInstance/${buName}/${type}/${customerKey}.${type}-meta.${ext}`; + try { + return await File.readFile(path, 'utf8'); + } catch { + console.log(`File not found: ${path}`); // eslint-disable-line no-console + return null; + } } /** * gets file from Deploy folder From c8f40d02217cc83e4db3ee4b9baee0f52e044841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 31 May 2024 12:07:27 +0200 Subject: [PATCH 311/359] #1350: replace fs....Sync() methods with async versions to workaround tschaub/mock-fs#377 --- @types/lib/Deployer.d.ts | 4 +- @types/lib/Deployer.d.ts.map | 2 +- @types/lib/metadataTypes/Asset.d.ts | 8 ++-- @types/lib/metadataTypes/Asset.d.ts.map | 2 +- @types/lib/metadataTypes/Folder.d.ts | 4 +- @types/lib/metadataTypes/Folder.d.ts.map | 2 +- @types/lib/metadataTypes/MetadataType.d.ts | 8 ++-- .../lib/metadataTypes/MetadataType.d.ts.map | 2 +- @types/lib/util/config.d.ts.map | 2 +- @types/lib/util/file.d.ts.map | 2 +- @types/lib/util/util.d.ts | 9 ++++ @types/lib/util/util.d.ts.map | 2 +- lib/Deployer.js | 14 +++--- lib/index.js | 6 +-- lib/metadataTypes/Asset.js | 35 +++++++------- lib/metadataTypes/Automation.js | 2 +- lib/metadataTypes/DataExtension.js | 2 +- lib/metadataTypes/Folder.js | 8 ++-- lib/metadataTypes/MetadataType.js | 22 +++++---- lib/metadataTypes/Role.js | 2 +- lib/metadataTypes/User.js | 2 +- lib/util/auth.js | 2 +- lib/util/config.js | 7 ++- lib/util/devops.js | 6 +-- lib/util/file.js | 18 ++++--- lib/util/init.config.js | 2 +- lib/util/init.npm.js | 4 +- lib/util/util.js | 15 ++++++ test/type.asset.test.js | 47 ++++++++++++------- 29 files changed, 139 insertions(+), 102 deletions(-) diff --git a/@types/lib/Deployer.d.ts b/@types/lib/Deployer.d.ts index a390d3a30..666919799 100644 --- a/@types/lib/Deployer.d.ts +++ b/@types/lib/Deployer.d.ts @@ -62,9 +62,9 @@ declare class Deployer { * @param {string} deployDir root directory of metadata. * @param {string[]} [typeArr] limit deployment to given metadata type * @param {boolean} [listBadKeys] do not print errors, used for badKeys() - * @returns {MultiMetadataTypeMap} Metadata of BU in local directory + * @returns {Promise.} Metadata of BU in local directory */ - static readBUMetadata(deployDir: string, typeArr?: string[], listBadKeys?: boolean): MultiMetadataTypeMap; + static readBUMetadata(deployDir: string, typeArr?: string[], listBadKeys?: boolean): Promise; /** * parses asset metadata to auto-create folders in target folder * diff --git a/@types/lib/Deployer.d.ts.map b/@types/lib/Deployer.d.ts.map index af0de6f5b..72306bcfb 100644 --- a/@types/lib/Deployer.d.ts.map +++ b/@types/lib/Deployer.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Deployer.d.ts","sourceRoot":"","sources":["../../lib/Deployer.js"],"names":[],"mappings":";uBAYa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;mCACzC,OAAO,qBAAqB,EAAE,oBAAoB;2BAClD,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH;IAwBI;;;;;;;OAOG;IACH,4BALW,MAAM,qBACN,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,oBAAoB;MAAE,CA2J3D;IACD;;;;;;;;;OASG;IACH,uBAPW,MAAM,MACN,MAAM,cACN,OAAO,YACP,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAmB1C;IAiHD;;;;;;;OAOG;IACH,iCALW,MAAM,YACN,MAAM,EAAE,gBACR,OAAO,GACL,oBAAoB,CA4BhC;IAED;;;;;;;OAOG;IACH,0CALW,MAAM,YACN,oBAAoB,mBACpB,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA6G5B;IA5dD;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAkBlB;IAfG,iDAAwB;IACxB,kDAA4B;IAC5B,eAIE;IACF,iBAIE;IAoMN;;;;;;OAMG;IACH,gBAJW,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAwG1C;IAhGO,mCAAmC;IACnC,UADW,oBAAoB,CACiC;CAyP3E"} \ No newline at end of file +{"version":3,"file":"Deployer.d.ts","sourceRoot":"","sources":["../../lib/Deployer.js"],"names":[],"mappings":";uBAYa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;sBAC7C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;gCACnD,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;mCACzC,OAAO,qBAAqB,EAAE,oBAAoB;2BAClD,OAAO,qBAAqB,EAAE,YAAY;AAdvD;;;;;;;;;;;;;;;GAeG;AAEH;;;GAGG;AACH;IAwBI;;;;;;;OAOG;IACH,4BALW,MAAM,qBACN,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,oBAAoB;MAAE,CA2J3D;IACD;;;;;;;;;OASG;IACH,uBAPW,MAAM,MACN,MAAM,cACN,OAAO,YACP,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAmB1C;IAiHD;;;;;;;OAOG;IACH,iCALW,MAAM,YACN,MAAM,EAAE,gBACR,OAAO,GACL,QAAS,oBAAoB,CAAC,CA4B1C;IAED;;;;;;;OAOG;IACH,0CALW,MAAM,YACN,oBAAoB,mBACpB,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA6G5B;IA5dD;;;;;OAKG;IACH,wBAHW,OAAO,YACP,QAAQ,EAkBlB;IAfG,iDAAwB;IACxB,kDAA4B;IAC5B,eAIE;IACF,iBAIE;IAoMN;;;;;;OAMG;IACH,gBAJW,MAAM,EAAE,GAAG,YAAY,WACvB,MAAM,EAAE,GACN,QAAS,oBAAoB,CAAC,CAwG1C;IAhGO,mCAAmC;IACnC,UADW,oBAAoB,CACuC;CAyPjF"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Asset.d.ts b/@types/lib/metadataTypes/Asset.d.ts index 9d05b7bc7..f90ebbf85 100644 --- a/@types/lib/metadataTypes/Asset.d.ts +++ b/@types/lib/metadataTypes/Asset.d.ts @@ -293,9 +293,9 @@ declare class Asset extends MetadataType { * @param {string} dir directory that contains '.json' files to be read * @param {boolean} _ unused parameter * @param {string[]} selectedSubType asset, message, ... - * @returns {MetadataTypeMap} fileName => fileContent map + * @returns {Promise.} fileName => fileContent map */ - static getJsonFromFS(dir: string, _: boolean, selectedSubType: string[]): MetadataTypeMap; + static getJsonFromFS(dir: string, _: boolean, selectedSubType: string[]): Promise; /** * optional method used for some types to try a different folder structure * @@ -359,9 +359,9 @@ declare class Asset extends MetadataType { * * @param {string} subType asset subtype * @param {object} item api response for metadata - * @returns {object} JS object of the asset we loaded from disk + * @returns {Promise.} JS object of the asset we loaded from disk */ - static "__#1@#getJson"(subType: string, item: object): object; + static "__#1@#getJson"(subType: string, item: object): Promise; } declare namespace Asset { let definition: { diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map index 5a7cf338b..109103236 100644 --- a/@types/lib/metadataTypes/Asset.d.ts.map +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAYa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;iCAC1C,OAAO,wBAAwB,EAAE,kBAAkB;AAdhE;;;;;;;;;GASG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,QACR,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CA+BxD;IAiBD;;;;OAIG;IACH,2CAFW,eAAe,iBAkBzB;IAED;;;;;;OAMG;IACH,4BAJW,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApfkB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAYa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;iCAC1C,OAAO,wBAAwB,EAAE,kBAAkB;AAdhE;;;;;;;;;GASG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,QACR,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CA+BxD;IAiBD;;;;OAIG;IACH,2CAFW,eAAe,iBAkBzB;IAED;;;;;;OAMG;IACH,4BAJW,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,GACN,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIxD;IAED;;;;;;;;OAQG;IACH,uCANW,MAAM,QACN,MAAM,qBACN,WAAW,oBACX,YAAY,GACV,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CA0BzD;IACD;;;;;OAKG;IACH,4BAeC;IAED;;;;;OAKG;IACH,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B;IACD;;;;;;OAMG;IACH,gCAJW,MAAM,QACN,MAAM,GACJ,QAAS,MAAM,CAAC,CAyB5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;gBAp/DD;;;;mBAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAyCC;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA+BH;;;;;;mBAMG;;;;;;;;;;;;;;;gBAKH;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAiDH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;uCAiBH;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA4RH;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApfkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Folder.d.ts b/@types/lib/metadataTypes/Folder.d.ts index 3cd1da051..a0ed8cad7 100644 --- a/@types/lib/metadataTypes/Folder.d.ts +++ b/@types/lib/metadataTypes/Folder.d.ts @@ -80,9 +80,9 @@ declare class Folder extends MetadataType { * * @param {string} dir directory that contains '.json' files to be read * @param {boolean} [listBadKeys] do not print errors, used for badKeys() - * @returns {MetadataTypeMap} fileName => fileContent map + * @returns {Promise.} fileName => fileContent map */ - static getJsonFromFS(dir: string, listBadKeys?: boolean): MetadataTypeMap; + static getJsonFromFS(dir: string, listBadKeys?: boolean): Promise; /** * Helper to retrieve the folders as promise * diff --git a/@types/lib/metadataTypes/Folder.d.ts.map b/@types/lib/metadataTypes/Folder.d.ts.map index d505b90f0..d64e5f04c 100644 --- a/@types/lib/metadataTypes/Folder.d.ts.map +++ b/@types/lib/metadataTypes/Folder.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Folder.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Folder.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,qBACN,MAAM,EAAE,eACR,MAAM,EAAE,QACR,MAAM,gBA8HhB;IAED;;;;;;OAMG;IACH,4BAJW,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,gBAKlB;IAED;;;;;;;OAOG;IACH,wBAHW,eAAe,GACb,QAAS,MAAM,CAAC,CA8J5B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBA+C1B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBAyB1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAgDtC;IAED;;;;;;OAMG;IACH,0BAJW,MAAM,gBACN,OAAO,GACL,eAAe,CAkE3B;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,EAAE,qBACR,OAAO,oBACP,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA+B5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAI5B;IACD;;;;;;;OAOG;IACH,4BALW,eAAe,eACf,MAAM,OACN,MAAM,GAAG,MAAM,GACb,QAAS,MAAM,CAAC,CAuD5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9oBwB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Folder.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Folder.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,qBACN,MAAM,EAAE,eACR,MAAM,EAAE,QACR,MAAM,gBA8HhB;IAED;;;;;;OAMG;IACH,4BAJW,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,gBAKlB;IAED;;;;;;;OAOG;IACH,wBAHW,eAAe,GACb,QAAS,MAAM,CAAC,CA8J5B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBA+C1B;IAED;;;;;OAKG;IACH,6BAHW,gBAAgB,gBAyB1B;IAED;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAgDtC;IAED;;;;;;OAMG;IACH,0BAJW,MAAM,gBACN,OAAO,GACL,QAAS,eAAe,CAAC,CAkErC;IAED;;;;;;;OAOG;IACH,yCALW,MAAM,EAAE,qBACR,OAAO,oBACP,MAAM,EAAE,GACN,QAAS,MAAM,CAAC,CA+B5B;IACD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CAI5B;IACD;;;;;;;OAOG;IACH,4BALW,eAAe,eACf,MAAM,OACN,MAAM,GAAG,MAAM,GACb,QAAS,MAAM,CAAC,CAuD5B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA9oBwB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/MetadataType.d.ts b/@types/lib/metadataTypes/MetadataType.d.ts index 7887122ba..e42921427 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts +++ b/@types/lib/metadataTypes/MetadataType.d.ts @@ -26,9 +26,9 @@ declare class MetadataType { * @param {string} dir directory that contains '.json' files to be read * @param {boolean} [listBadKeys] do not print errors, used for badKeys() * @param {string[]} [selectedSubType] asset, message, ... - * @returns {MetadataTypeMap} fileName => fileContent map + * @returns {Promise.} fileName => fileContent map */ - static getJsonFromFS(dir: string, listBadKeys?: boolean, selectedSubType?: string[]): MetadataTypeMap; + static getJsonFromFS(dir: string, listBadKeys?: boolean, selectedSubType?: string[]): Promise; /** * Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set in child classes. * @@ -608,9 +608,9 @@ declare class MetadataType { * @param {string} readDir root directory of metadata. * @param {boolean} [listBadKeys] do not print errors, used for badKeys() * @param {object} [buMetadata] Metadata of BU in local directory - * @returns {object} Metadata of BU in local directory + * @returns {Promise.} Metadata of BU in local directory */ - static readBUMetadataForType(readDir: string, listBadKeys?: boolean, buMetadata?: object): object; + static readBUMetadataForType(readDir: string, listBadKeys?: boolean, buMetadata?: object): Promise; /** * should return only the json for all but asset, query and script that are saved as multiple files * additionally, the documentation for dataExtension and automation should be returned diff --git a/@types/lib/metadataTypes/MetadataType.d.ts.map b/@types/lib/metadataTypes/MetadataType.d.ts.map index c6604e669..126ff68c7 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts.map +++ b/@types/lib/metadataTypes/MetadataType.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;kBAC5C,OAAO,wBAAwB,EAAE,GAAG;uBACpC,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;wBAC1C,OAAO,wBAAwB,EAAE,SAAS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G;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file +{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;kBAC5C,OAAO,wBAAwB,EAAE,GAAG;uBACpC,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;wBAC1C,OAAO,wBAAwB,EAAE,SAAS;AAavD;;;;GAIG;AACH;IACI;;;;;;;OAOG;IACH,0BALW,MAAM,gBACN,OAAO,oBACP,MAAM,EAAE,GACN,QAAS,eAAe,CAAC,CAuCrC;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,EAAE,cACR,OAAO,GACL,MAAM,EAAE,CAkBpB;IAED;;;;;;;OAOG;IACH,wBALW,eAAe,aACf,MAAM,eACN,MAAM,GACJ,QAAS,eAAe,CAAC,CAcrC;IAED;;;;;;;OAOG;IACH,sCALW,eAAe,oBACf,eAAe,kBACf;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,GAChC,IAAI,C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ACN,MAAM,GAAG,MAAM,EAAE,gBACjB,MAAM,aACN,WAAW,GACT,QAAS,kBAAkB,CAAC,CA4FxC;IACD;;;;;OAKG;IACH,yBAHW,MAAM,GACJ,MAAM,EAAE,CAkCpB;IAED;;;;;;OAMG;IACH,2BAJW,eAAe,aACf,OAAO,GACL,IAAI,CAMhB;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,QAAS;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC,CAK/C;IAED;;;;;OAKG;IACH,gCAHW,MAAM,GACJ,QAAS,OAAO,CAAC,CAK7B;IACD;;;;;;OAMG;IACH,oCAJW,MAAM,yBACN,MAAM,EAAE,GACN,QAAS,IAAI,CAAC,CAe1B;IAED;;;;;;;OAOG;IACH,oCALW,MAAM,qBACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CA6B7B;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,OACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CAoB7B;IACD;;;;;;;OAOG;IACH,sCALW,MAAM,gBACN,OAAO,eACP,MAAM,GACJ,QAAS,MAAM,CAAC,CAgB5B;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/@types/lib/util/config.d.ts.map b/@types/lib/util/config.d.ts.map index ed63a9eda..a0fdc2465 100644 --- a/@types/lib/util/config.d.ts.map +++ b/@types/lib/util/config.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../lib/util/config.js"],"names":[],"mappings":";yBASa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;;IAStD;;;;;;OAMG;IACH,8GAyDC;IACD;;;;;;OAMG;IACH,8HAmMC;IACD;;;;;OAKG;IACH,mFAcC"} \ No newline at end of file +{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../lib/util/config.js"],"names":[],"mappings":";yBASa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;;;IAStD;;;;;;OAMG;IACH,8GAyDC;IACD;;;;;;OAMG;IACH,8HAmMC;IACD;;;;;OAKG;IACH,mFAaC"} \ No newline at end of file diff --git a/@types/lib/util/file.d.ts.map b/@types/lib/util/file.d.ts.map index 5b09f3274..ba210cfc4 100644 --- a/@types/lib/util/file.d.ts.map +++ b/@types/lib/util/file.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../lib/util/file.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;AAsiB1D,0BAAkC"} \ No newline at end of file +{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../lib/util/file.js"],"names":[],"mappings":";yBAYa,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;sBAC7C,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;gCACrD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;AAoiB1D,0BAAkC"} \ No newline at end of file diff --git a/@types/lib/util/util.d.ts b/@types/lib/util/util.d.ts index 6b972a563..133c303b1 100644 --- a/@types/lib/util/util.d.ts +++ b/@types/lib/util/util.d.ts @@ -277,6 +277,15 @@ export namespace Util { * @returns {TypeKeyCombo} - */ function createTypeKeyCombo(typeArr: string[], keyArr: string[], returnEmpty?: boolean): any; + /** + * async version of Array.find() + * returns the first element in the provided array that satisfies the provided testin function + * + * @param {Array} arr your test array + * @param {Function} asyncCallback callback + * @returns {Promise.} first element that passed the test + */ + function findAsync(arr: any[], asyncCallback: Function): Promise; } export type AuthObject = import('../../types/mcdev.d.js').AuthObject; export type BuObject = import('../../types/mcdev.d.js').BuObject; diff --git a/@types/lib/util/util.d.ts.map b/@types/lib/util/util.d.ts.map index e20b0c5fa..0608ac2cd 100644 --- a/@types/lib/util/util.d.ts.map +++ b/@types/lib/util/util.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OA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OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG;IACH,sGAqCC;IACD;;;;OAIG;IACH,kCAGC;IACD;;;;;;OAMG;IACH,yCAEC;IACD;;;;;;OAMG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,8EAkBC;IAED;;;;;OAKG;IACH;;;MASC;IAED;;;;OAIG;IACH,4CAyBC;IAO0B,6DAmE1B;;gBAMS,MAAM;IAUH,mEA8EZ;IAWe,0GAef;IASgB;;YAyBhB;IASW,6DAOX;IAED;;;;;OAKG;IACH,2DAiBC;IAED;;;;;OAKG;IACH;;MAqFC;IAED;;;;;;OAMG;IACH,qDAEC;IACD;;;;;;;OAOG;IACH,qFAqBC;IACD;;;;;;;OAOG;IACH,6FAYC;IACD;;;;;;;;OAQG;IACH;;;;aAyBC;IACD;;;;OAIG;IACH,qCAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BD;;;;;OAKG;IACH,yCAEC;IACD;;;;;OAKG;IACH,iDAQC;IACD;;;;;;OAMG;IACH,0EAcC;IACD;;;;;OAKG;IACH,0CAIC;IACD;;;;;;;;;;;;;;;;;OAiBG;IACH,uCA0BC;IACD;;;;;;OAMG;IACH,iEAaC;IACD;;;;;;OAMG;IACH,2DA6BC;IACD;;;;;OAKG;IACH,oDAEC;IACD;;;;;;;OAOG;IACH,6FAaC;IACD;;;;;;;OAOG;IACH,sEAMC;;yBAz7BQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file diff --git a/lib/Deployer.js b/lib/Deployer.js index 19ec41a2a..db5d27de0 100644 --- a/lib/Deployer.js +++ b/lib/Deployer.js @@ -259,7 +259,7 @@ class Deployer { : types; if (await File.pathExists(this.deployDir)) { /** @type {MultiMetadataTypeMap} */ - this.metadata = Deployer.readBUMetadata(this.deployDir, typeArr); + this.metadata = await Deployer.readBUMetadata(this.deployDir, typeArr); // filter found metadata by key if given if (typeArr && Array.isArray(typeArr)) { for (const selectedType of typeArr) { @@ -362,21 +362,21 @@ class Deployer { * @param {string} deployDir root directory of metadata. * @param {string[]} [typeArr] limit deployment to given metadata type * @param {boolean} [listBadKeys] do not print errors, used for badKeys() - * @returns {MultiMetadataTypeMap} Metadata of BU in local directory + * @returns {Promise.} Metadata of BU in local directory */ - static readBUMetadata(deployDir, typeArr, listBadKeys) { + static async readBUMetadata(deployDir, typeArr, listBadKeys) { /** @type {MultiMetadataTypeMap} */ const buMetadata = {}; try { - File.ensureDirSync(deployDir); - const metadataTypes = File.readdirSync(deployDir); + await File.ensureDir(deployDir); + const metadataTypes = await File.readdir(deployDir); for (const metadataType of metadataTypes) { if ( MetadataTypeInfo[metadataType] && (!typeArr || Util.includesStartsWith(typeArr, metadataType)) ) { // check if folder name is a valid metadataType, then check if the user limited to a certain type in the command params - buMetadata[metadataType] = MetadataTypeInfo[metadataType].getJsonFromFS( + buMetadata[metadataType] = await MetadataTypeInfo[metadataType].getJsonFromFS( File.normalizePath([deployDir, metadataType]), listBadKeys, typeArr @@ -502,7 +502,7 @@ class Deployer { Util.logger.info(`Created folders in deploy dir: ${i}`); // reload from file system to ensure we use the same logic for building the temporary JSON - metadata.folder = MetadataTypeInfo.folder.getJsonFromFS( + metadata.folder = await MetadataTypeInfo.folder.getJsonFromFS( File.normalizePath([deployDir, 'folder']) ); } diff --git a/lib/index.js b/lib/index.js index a620e4da3..1cc07e55e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -695,13 +695,13 @@ class Mcdev { File.filterIllegalFilenames(buObject.businessUnit) + '.badKeys.md', ]); await File.ensureDir(docPath); - if (await File.pathExistsSync(filename)) { - File.removeSync(filename); + if (await File.pathExists(filename)) { + await File.remove(filename); } const regex = new RegExp(String.raw`(\w+-){4}\w+`); await File.ensureDir(retrieveDir); - const metadata = Deployer.readBUMetadata(retrieveDir, null, true); + const metadata = await Deployer.readBUMetadata(retrieveDir, null, true); let output = '# List of Metadata with Name-Key mismatches\n'; for (const metadataType in metadata) { let listEntries = ''; diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index c9c73a453..5d8ce53ec 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1577,9 +1577,9 @@ class Asset extends MetadataType { * @param {string} dir directory that contains '.json' files to be read * @param {boolean} _ unused parameter * @param {string[]} selectedSubType asset, message, ... - * @returns {MetadataTypeMap} fileName => fileContent map + * @returns {Promise.} fileName => fileContent map */ - static getJsonFromFS(dir, _, selectedSubType) { + static async getJsonFromFS(dir, _, selectedSubType) { const fileName2FileContent = {}; try { for (const subtype of this.definition.subTypes) { @@ -1591,8 +1591,8 @@ class Asset extends MetadataType { continue; } const currentdir = File.normalizePath([dir, subtype]); - if (File.pathExistsSync(currentdir)) { - const files = File.readdirSync(currentdir, { withFileTypes: true }); + if (await File.pathExists(currentdir)) { + const files = await File.readdir(currentdir, { withFileTypes: true }); for (const dirent of files) { try { @@ -1602,7 +1602,7 @@ class Asset extends MetadataType { // complex types with more than one extracted piece of code are saved in their // own subfolder (with folder name = CustomerKey) // this section aims to find that json in the subfolder - const subfolderFiles = File.readdirSync( + const subfolderFiles = await File.readdir( File.normalizePath([currentdir, dirent.name]) ); for (const subFileName of subfolderFiles) { @@ -1613,10 +1613,9 @@ class Asset extends MetadataType { } } if (fileName.endsWith('-meta.json')) { - const fileContent = File.readJSONFile( + const fileContent = await File.readJSONFile( thisDir, fileName, - true, false ); // subtype will change the metadata suffix length @@ -1634,7 +1633,7 @@ class Asset extends MetadataType { } } } catch (ex) { - // this will catch issues with readdirSync + // this will catch issues with readdir Util.metadataLogger('debug', this.definition.type, 'getJsonFromFS', ex); throw new Error(ex); } @@ -1732,7 +1731,7 @@ class Asset extends MetadataType { (await File.pathExists(File.normalizePath([...filePath, fileName]))) ) { // #1 load json to be able to find extracted text files & binary files - const metadata = File.readJSONFile(filePath, fileName, true, false); + const metadata = await File.readJSONFile(filePath, fileName, false); // #2 find all extracted text files const fileListNested = ( await this._mergeCode(metadata, basePath, subType, metadata.customerKey) @@ -1898,7 +1897,7 @@ class Asset extends MetadataType { : this.buObject.businessUnit; // find path for code of content block, fall back to json if not found; undefined if not even the json exists - let path = this.#getPath(subType, item, ownerBUName); + let path = await this.#getPath(subType, item, ownerBUName); if (!json.sharedWith) { delete json.sharedWith; @@ -1928,7 +1927,7 @@ class Asset extends MetadataType { json.key ); // try again - path = this.#getPath(subType, item, this.buObject.businessUnit); + path = await this.#getPath(subType, item, this.buObject.businessUnit); } if (path) { @@ -1938,7 +1937,7 @@ class Asset extends MetadataType { json.error = 'file not found on local disk'; delete json.path; } - const fileContent = this.#getJson(subType, item); + const fileContent = await this.#getJson(subType, item); if (fileContent?.r__folder_Path) { json.folder = fileContent.r__folder_Path; } @@ -2022,14 +2021,14 @@ class Asset extends MetadataType { * @param {string} buName owner business unit name * @returns {string} path to the asset's code */ - static #getPath(subType, item, buName) { + static async #getPath(subType, item, buName) { const pathBase1 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; const pathBase2 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; const paths = []; for (const ext of ['html', 'ssjs', 'amp', 'json']) { paths.push(pathBase1 + ext, pathBase2 + ext); } - const path = paths.find((p) => File.pathExistsSync(p)); + const path = await Util.findAsync(paths, async (p) => await File.pathExists(p)); return path; } /** @@ -2037,9 +2036,9 @@ class Asset extends MetadataType { * * @param {string} subType asset subtype * @param {object} item api response for metadata - * @returns {object} JS object of the asset we loaded from disk + * @returns {Promise.} JS object of the asset we loaded from disk */ - static #getJson(subType, item) { + static async #getJson(subType, item) { const mid = item.memberId; const buName = mid === this.buObject.mid @@ -2056,11 +2055,11 @@ class Asset extends MetadataType { const pathBase2 = `./retrieve/${this.buObject.credential}/${buName}/${this.definition.type}/${subType}/${item[this.definition.keyField]}/${item[this.definition.keyField]}.${this.definition.type}-${subType}-meta.`; const paths = []; paths.push(pathBase1 + 'json', pathBase2 + 'json'); - const path = paths.find((p) => File.pathExistsSync(p)); + const path = await Util.findAsync(paths, async (p) => await File.pathExists(p)); const pathArr = path.split('/'); const fileName = pathArr.pop().slice(0, -5); - const fileContent = File.readJSONFile(pathArr.join('/'), fileName, true, false); + const fileContent = await File.readJSONFile(pathArr.join('/'), fileName, false); return fileContent; } } diff --git a/lib/metadataTypes/Automation.js b/lib/metadataTypes/Automation.js index bbfdef44a..eadc264e4 100644 --- a/lib/metadataTypes/Automation.js +++ b/lib/metadataTypes/Automation.js @@ -1543,7 +1543,7 @@ class Automation extends MetadataType { static async document(metadata) { if (['md', 'both'].includes(this.properties.options.documentType)) { if (!metadata) { - metadata = this.readBUMetadataForType( + metadata = await this.readBUMetadataForType( File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/DataExtension.js b/lib/metadataTypes/DataExtension.js index de4098494..74c39c8d1 100644 --- a/lib/metadataTypes/DataExtension.js +++ b/lib/metadataTypes/DataExtension.js @@ -1353,7 +1353,7 @@ class DataExtension extends MetadataType { static async document(metadataMap) { try { if (!metadataMap) { - metadataMap = this.readBUMetadataForType( + metadataMap = await this.readBUMetadataForType( File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/Folder.js b/lib/metadataTypes/Folder.js index aa9e2d889..7efc029c4 100644 --- a/lib/metadataTypes/Folder.js +++ b/lib/metadataTypes/Folder.js @@ -477,9 +477,9 @@ class Folder extends MetadataType { * * @param {string} dir directory that contains '.json' files to be read * @param {boolean} [listBadKeys] do not print errors, used for badKeys() - * @returns {MetadataTypeMap} fileName => fileContent map + * @returns {Promise.} fileName => fileContent map */ - static getJsonFromFS(dir, listBadKeys) { + static async getJsonFromFS(dir, listBadKeys) { try { /** @type {MetadataTypeMap} */ const fileName2FileContent = {}; @@ -495,10 +495,10 @@ class Folder extends MetadataType { const standardSubDir = File.reverseFilterIllegalFilenames( subdir.replaceAll('\\', '/').split(/folder\//)[1] || '' ); - for (const fileName of File.readdirSync(subdir)) { + for (const fileName of await File.readdir(subdir)) { try { if (fileName.endsWith('meta.json')) { - const fileContent = File.readJSONFile(subdir, fileName, true, false); + const fileContent = await File.readJSONFile(subdir, fileName, false); const fileNameWithoutEnding = File.reverseFilterIllegalFilenames( fileName.split(/\.(\w|-)+-meta.json/)[0] diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 2913b7c15..61a673f25 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -54,16 +54,16 @@ class MetadataType { * @param {string} dir directory that contains '.json' files to be read * @param {boolean} [listBadKeys] do not print errors, used for badKeys() * @param {string[]} [selectedSubType] asset, message, ... - * @returns {MetadataTypeMap} fileName => fileContent map + * @returns {Promise.} fileName => fileContent map */ - static getJsonFromFS(dir, listBadKeys, selectedSubType) { + static async getJsonFromFS(dir, listBadKeys, selectedSubType) { const fileName2FileContent = {}; try { - const files = File.readdirSync(dir); + const files = await File.readdir(dir); for (const fileName of files) { try { if (fileName.endsWith('.json')) { - const fileContent = File.readJSONFile(dir, fileName, true, false); + const fileContent = await File.readJSONFile(dir, fileName, false); const fileNameWithoutEnding = File.reverseFilterIllegalFilenames( fileName.split(/\.(\w|-)+-meta.json/)[0] ); @@ -349,6 +349,9 @@ class MetadataType { fileName, 'json' ); + if (!metadataStr) { + throw new Error('File not found'); + } } catch (ex) { try { metadataStr = await this.readSecondaryFolder( @@ -1948,6 +1951,9 @@ class MetadataType { fileName, 'json' ); + if (!metadataStr) { + throw new Error('File not found'); + } } catch (ex) { try { metadataStr = await this.readSecondaryFolder( @@ -2183,15 +2189,15 @@ class MetadataType { * @param {string} readDir root directory of metadata. * @param {boolean} [listBadKeys] do not print errors, used for badKeys() * @param {object} [buMetadata] Metadata of BU in local directory - * @returns {object} Metadata of BU in local directory + * @returns {Promise.} Metadata of BU in local directory */ - static readBUMetadataForType(readDir, listBadKeys, buMetadata) { + static async readBUMetadataForType(readDir, listBadKeys, buMetadata) { buMetadata ||= {}; readDir = File.normalizePath([readDir, this.definition.type]); try { - if (File.pathExistsSync(readDir)) { + if (await File.pathExists(readDir)) { // check if folder name is a valid metadataType, then check if the user limited to a certain type in the command params - buMetadata[this.definition.type] = this.getJsonFromFS(readDir, listBadKeys); + buMetadata[this.definition.type] = await this.getJsonFromFS(readDir, listBadKeys); return buMetadata; } else { throw new Error(`Directory '${readDir}' does not exist.`); diff --git a/lib/metadataTypes/Role.js b/lib/metadataTypes/Role.js index 12c65de47..ec13757ad 100644 --- a/lib/metadataTypes/Role.js +++ b/lib/metadataTypes/Role.js @@ -169,7 +169,7 @@ class Role extends MetadataType { } if (!metadata) { try { - metadata = this.readBUMetadataForType( + metadata = await this.readBUMetadataForType( File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/metadataTypes/User.js b/lib/metadataTypes/User.js index 57b66a586..4cbd47d3e 100644 --- a/lib/metadataTypes/User.js +++ b/lib/metadataTypes/User.js @@ -974,7 +974,7 @@ class User extends MetadataType { if (!metadata) { // load users from disk if document was called directly and not part of a retrieve try { - metadata = this.readBUMetadataForType( + metadata = await this.readBUMetadataForType( File.normalizePath([ this.properties.directories.retrieve, this.buObject.credential, diff --git a/lib/util/auth.js b/lib/util/auth.js index d05cb9f5f..347a1d6c8 100644 --- a/lib/util/auth.js +++ b/lib/util/auth.js @@ -59,7 +59,7 @@ const Auth = { Util.logger.warn('Missing scope: ' + missingAccess.join(', ')); } const existingAuth = (await File.pathExists(Util.authFileName)) - ? await File.readJson(Util.authFileName) + ? await File.readJSON(Util.authFileName) : {}; existingAuth[credential] = authObject; await File.writeJSONToFile('./', Util.authFileName.split('.json')[0], existingAuth); diff --git a/lib/util/config.js b/lib/util/config.js index b00acaa7e..929f696c1 100644 --- a/lib/util/config.js +++ b/lib/util/config.js @@ -45,7 +45,7 @@ const config = { } if (await File.pathExists(Util.configFileName)) { try { - config.properties = await File.readJson(Util.configFileName); + config.properties = await File.readJSON(Util.configFileName); } catch (ex) { Util.logger.error(`${ex.code}: ${ex.message}`); return; @@ -53,7 +53,7 @@ const config = { if (await File.pathExists(Util.authFileName)) { let auth; try { - auth = await File.readJson(Util.authFileName); + auth = await File.readJSON(Util.authFileName); } catch (ex) { Util.logger.error(`${ex.code}: ${ex.message}`); return; @@ -312,8 +312,7 @@ const config = { Util.logger.debug(`Default config file not found in ${configFileName}`); return; } - // const defaultProperties = File.readJsonSync(configFileName); - const defaultProperties = await File.readJson(configFileName); + const defaultProperties = await File.readJSON(configFileName); // set default name for parent BU defaultProperties.credentials.default.businessUnits[Util.parentBuName] = 0; // set default retrieve values diff --git a/lib/util/devops.js b/lib/util/devops.js index 46b8f53b2..8d47450e3 100644 --- a/lib/util/devops.js +++ b/lib/util/devops.js @@ -147,7 +147,7 @@ const DevOps = { return false; } }) - .map((/** @type {DeltaPkgItem} */ file) => { + .map(async (/** @type {DeltaPkgItem} */ file) => { // Gets external key based on file name und the assumption that filename = externalKey if (file.type === 'folder') { file.externalKey = null; @@ -166,7 +166,7 @@ const DevOps = { // Check if file doesn't exist in reported path, that means it was a git deletion // TODO: improve git action detection by switching from diffSummary to diff with --summary result parsing - if (!File.pathExistsSync(file.file)) { + if (!(await File.pathExists(file.file))) { file.gitAction = 'delete'; } else if (file.moved) { file.gitAction = 'move'; @@ -189,7 +189,7 @@ const DevOps = { } if (!metadata[file._credential][file._businessUnit][file.type]) { try { - MetadataType[file.type].readBUMetadataForType( + await MetadataType[file.type].readBUMetadataForType( buPath, false, metadata[file._credential][file._businessUnit] diff --git a/lib/util/file.js b/lib/util/file.js index ff0b8ff20..a16e54326 100644 --- a/lib/util/file.js +++ b/lib/util/file.js @@ -370,11 +370,10 @@ const File = { * * @param {string | string[]} directory directory where the file is stored * @param {string} filename name of the file without '.json' ending - * @param {boolean} sync should execute sync (default is async) * @param {boolean} cleanPath filters illegal chars if true * @returns {Promise. | object | void} Promise or JSON object depending on if async or not; void on error */ - readJSONFile: function (directory, filename, sync, cleanPath) { + readJSONFile: async function (directory, filename, cleanPath) { try { if (cleanPath == null || cleanPath == true) { directory = this.filterIllegalPathChars(this.normalizePath(directory)); @@ -388,13 +387,9 @@ const File = { } let json; try { - json = sync - ? fs.readJsonSync(path.join(directory, filename + '.json')) - : fs.readJson(path.join(directory, filename + '.json')); + json = await fs.readJSON(path.join(directory, filename + '.json')); } catch (ex) { - // Note: this only works for sync, not async Util.logger.debug(ex.stack); - throw new Error(`${ex.code}: ${ex.message}`); } return json; } catch (ex) { @@ -410,14 +405,17 @@ const File = { * @param {string} [encoding] read file with encoding (defaults to utf-8) * @returns {Promise.} file contents; void on error */ - readFilteredFilename: function (directory, filename, filetype, encoding) { + readFilteredFilename: async function (directory, filename, filetype, encoding) { try { directory = this.filterIllegalPathChars(this.normalizePath(directory)); filename = this.filterIllegalFilenames(filename); // @ts-expect-error - somehow, the declared type does not allow for encoding to be passed in as a string, despite that working and being stated in the docs. - return fs.readFile(path.join(directory, filename + '.' + filetype), encoding || 'utf8'); + return await fs.readFile( + path.join(directory, filename + '.' + filetype), + encoding || 'utf8' + ); } catch (ex) { - Util.logger.error('File.readFilteredFilename:: error | ' + ex.message); + Util.logger.debug('File.readFilteredFilename:: error | ' + ex.message); } return; }, diff --git a/lib/util/init.config.js b/lib/util/init.config.js index ae5e938f4..dbf9502c3 100644 --- a/lib/util/init.config.js +++ b/lib/util/init.config.js @@ -335,7 +335,7 @@ const Init = { let forceIdeConfigUpdate; const relevantForcedUpdates = []; if (await File.pathExists(Util.configFileName)) { - forceIdeConfigUpdate = File.readJsonSync( + forceIdeConfigUpdate = await File.readJSON( path.resolve(__dirname, Util.boilerplateDirectory, 'forcedUpdates.json') ); // return all if no project version was found or only changes from "newer" versions otherwise diff --git a/lib/util/init.npm.js b/lib/util/init.npm.js index b75afd61b..e7a2a8733 100644 --- a/lib/util/init.npm.js +++ b/lib/util/init.npm.js @@ -53,7 +53,7 @@ const Init = { // execute "no questions asked" npm init Util.execSync('npm', ['init', '--yes'], true); try { - fileContent = File.readFileSync('package.json', 'utf8'); + fileContent = await File.readFile('package.json', 'utf8'); if (fileContent) { projectPackageJson = JSON.parse(fileContent); } @@ -74,7 +74,7 @@ const Init = { Util.logger.debug(`Dependency file not found in ${dependencyFile}`); return false; } - const defaultDependencies = await File.readJson(dependencyFile); + const defaultDependencies = await File.readJSON(dependencyFile); const versionsDefault = {}; for (const name of defaultDependencies) { // check mcdev.devDependencies first diff --git a/lib/util/util.js b/lib/util/util.js index b56e0d955..eaef67bc3 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -951,6 +951,21 @@ export const Util = { } return typeKeyMap; }, + /** + * async version of Array.find() + * returns the first element in the provided array that satisfies the provided testin function + * + * @param {Array} arr your test array + * @param {Function} asyncCallback callback + * @returns {Promise.} first element that passed the test + */ + async findAsync(arr, asyncCallback) { + for (const element of arr) { + if (await asyncCallback(element)) { + return element; + } + } + }, }; Util.startLogger(false, true); diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 5d9f4a13d..05fef71e3 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -9,7 +9,6 @@ import cache from '../lib/util/cache.js'; import * as testUtils from './utils.js'; import handler from '../lib/index.js'; chai.use(chaiFiles); -const file = chaiFiles.file; /** * gets file from Retrieve folder @@ -39,10 +38,16 @@ async function getActualJson(customerKey, type, subtype, buName = 'testBU') { * @param {string} subtype of metadata * @param {string} ext file extension * @param {string} [buName] used when we need to test on ParentBU - * @returns {string} file path + * @returns {Promise.} file path */ -function getActualFile(customerKey, type, subtype, ext, buName = 'testBU') { - return `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; +async function getActualFile(customerKey, type, subtype, ext, buName = 'testBU') { + const path = `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; + try { + return await File.readFile(path, 'utf8'); + } catch { + console.log(`File not found: ${path}`); // eslint-disable-line no-console + return null; + } } /** * gets file from Template folder @@ -71,14 +76,18 @@ async function getActualTemplateJson(customerKey, type, subtype) { * @param {string} subtype of metadata * @param {string} ext file extension * @param {string} [filename] optional fileprefix that differs from customerKey - * @returns {any} file + * @returns {Promise.} file */ -function getActualTemplateFile(customerKey, type, subtype, ext, filename) { +async function getActualTemplateFile(customerKey, type, subtype, ext, filename) { return filename - ? file( - `./template/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}` + ? File.readFile( + `./template/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}`, + 'utf8' ) - : file(`./template/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`); + : File.readFile( + `./template/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`, + 'utf8' + ); } /** * gets file from Deploy folder @@ -109,15 +118,17 @@ async function getActualDeployJson(customerKey, type, subtype, buName = 'testBU' * @param {string} ext file extension * @param {string} [filename] optional fileprefix that differs from customerKey * @param {string} [buName] used when we need to test on ParentBU - * @returns {any} file content + * @returns {Promise.} file content */ -function getActualDeployFile(customerKey, type, subtype, ext, filename, buName = 'testBU') { +async function getActualDeployFile(customerKey, type, subtype, ext, filename, buName = 'testBU') { return filename - ? file( - `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}` + ? File.readFile( + `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}`, + 'utf8' ) - : file( - `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}` + : File.readFile( + `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`, + 'utf8' ); } @@ -157,7 +168,7 @@ describe('type: asset', () => { await testUtils.getExpectedJson('9999999', 'asset', 'block-1157-retrieve'), 'returned metadata was not equal expected' ); - expect(file(getActualFile('mcdev-issue-1157', 'asset', 'block', 'html'))).to.equal( + expect(await getActualFile('mcdev-issue-1157', 'asset', 'block', 'html')).to.equal( await testUtils.getExpectedFile('9999999', 'asset', 'block-1157-retrieve', 'html') ); @@ -327,7 +338,7 @@ describe('type: asset', () => { ); expect( - getActualTemplateFile( + await getActualTemplateFile( 'testExisting_asset_templatebasedemail', 'asset', 'message', @@ -361,7 +372,7 @@ describe('type: asset', () => { 'returned deployment JSON was not equal expected' ); expect( - getActualDeployFile( + await getActualDeployFile( 'testTemplated_asset_templatebasedemail', 'asset', 'message', From 8d20e89e1a79496275cbe2a78f5f1a9f9be3a69f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 11:54:25 +0200 Subject: [PATCH 312/359] #1270: refactoring to allow saving without additional processing --- @types/lib/index.d.ts | 40 +++- @types/lib/index.d.ts.map | 2 +- @types/lib/metadataTypes/Asset.d.ts.map | 2 +- @types/lib/metadataTypes/MetadataType.d.ts | 17 ++ .../lib/metadataTypes/MetadataType.d.ts.map | 2 +- @types/lib/metadataTypes/Script.d.ts | 33 ++- @types/lib/metadataTypes/Script.d.ts.map | 2 +- @types/lib/metadataTypes/User.d.ts | 2 +- .../util/replaceContentBlockReference.d.ts | 105 ++++++++++ .../replaceContentBlockReference.d.ts.map | 1 + @types/types/mcdev.d.d.ts | 12 ++ @types/types/mcdev.d.d.ts.map | 2 +- lib/metadataTypes/MetadataType.js | 192 ++++++++++-------- 13 files changed, 306 insertions(+), 106 deletions(-) create mode 100644 @types/lib/util/replaceContentBlockReference.d.ts create mode 100644 @types/lib/util/replaceContentBlockReference.d.ts.map diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts index 22585125c..efdfcbe96 100644 --- a/@types/lib/index.d.ts +++ b/@types/lib/index.d.ts @@ -16,6 +16,7 @@ export type SoapRequestParams = import('../types/mcdev.d.js').SoapRequestParams; export type TemplateMap = import('../types/mcdev.d.js').TemplateMap; export type TypeKeyCombo = import('../types/mcdev.d.js').TypeKeyCombo; export type ExplainType = import('../types/mcdev.d.js').ExplainType; +export type ContentBlockConversionTypes = import('../types/mcdev.d.js').ContentBlockConversionTypes; /** * @typedef {import('../types/mcdev.d.js').BuObject} BuObject * @typedef {import('../types/mcdev.d.js').CodeExtract} CodeExtract @@ -34,6 +35,7 @@ export type ExplainType = import('../types/mcdev.d.js').ExplainType; * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo * @typedef {import('../types/mcdev.d.js').ExplainType} ExplainType + * @typedef {import('../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** * main class @@ -103,7 +105,7 @@ declare class Mcdev { /** * helper to show an off-the-logs message to users */ - static "__#6@#welcomeMessage"(): void; + static "__#7@#welcomeMessage"(): void; /** * Retrieve all metadata from the specified business unit into the local file system. * @@ -124,7 +126,7 @@ declare class Mcdev { * @param {boolean} [changelogOnly] skip saving, only create json in memory * @returns {Promise.} ensure that BUs are worked on sequentially */ - static "__#6@#retrieveBU"(cred: string, bu: string, selectedTypesArr?: string[] | TypeKeyCombo, keys?: string[], changelogOnly?: boolean): Promise; + static "__#7@#retrieveBU"(cred: string, bu: string, selectedTypesArr?: string[] | TypeKeyCombo, keys?: string[], changelogOnly?: boolean): Promise; /** * Deploys all metadata located in the 'deploy' directory to the specified business unit * @@ -294,6 +296,18 @@ declare class Mcdev { static pause(businessUnit: string, selectedType?: string, keys?: string[]): Promise<{ [x: string]: string[]; }>; + /** + * Updates the key to match the name field + * + * @param {string} businessUnit name of BU + * @param {TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type + * @param {string} to what to replace with + * @param {string[]} [fromList] what to replace + * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys + */ + static replaceCbReference(businessUnit: string, selectedTypesArr: TypeKeyCombo, to: string, fromList?: string[]): Promise<{ + [x: string]: object; + }>; /** * Updates the key to match the name field * @@ -308,26 +322,26 @@ declare class Mcdev { /** * run a method across BUs * - * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {'execute'|'pause'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} businessUnit name of BU * @param {string} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata * @returns {Promise.>} key: business unit name, value: list of affected item keys */ - static "__#6@#runMethod"(methodName: 'execute' | 'pause' | 'fixKeys', businessUnit: string, selectedType?: string, keys?: string[]): Promise<{ + static "__#7@#runMethod"(methodName: 'execute' | 'pause' | 'fixKeys' | 'replaceCbReference', businessUnit: string, selectedType?: string, keys?: string[]): Promise<{ [x: string]: string[]; }>; /** * helper for Mcdev.#runMethod * - * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {'execute'|'pause'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} cred name of Credential * @param {string} bu name of BU * @param {string} [type] limit execution to given metadata type * @param {string[]} [keyArr] customerkey of the metadata * @returns {Promise.} list of keys that were affected */ - static "__#6@#runOnBU"(methodName: 'execute' | 'pause' | 'fixKeys', cred: string, bu: string, type?: string, keyArr?: string[]): Promise; + static "__#7@#runOnBU"(methodName: 'execute' | 'pause' | 'fixKeys' | 'replaceCbReference', cred: string, bu: string, type?: string, keyArr?: string[]): Promise; /** * helper for Mcdev.#runOnBU * @@ -335,7 +349,17 @@ declare class Mcdev { * @param {BuObject} buObject properties for auth * @returns {Promise.} keyArr */ - static "__#6@#retrieveKeysWithLike"(selectedType: string, buObject: BuObject): Promise; + static "__#7@#retrieveKeysWithLike"(selectedType: string, buObject: BuObject): Promise; + /** + * Updates the key to match the name field + * + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {string} type limit execution to given metadata type + * @param {string[]} [keyArr] customerkey of the metadata + * @returns {Promise.} list of keys that were affected + */ + static "__#7@#fixKeys"(cred: string, bu: string, type: string, keyArr?: string[]): Promise; /** * Updates the key to match the name field * @@ -345,7 +369,7 @@ declare class Mcdev { * @param {string[]} [keyArr] customerkey of the metadata * @returns {Promise.} list of keys that were affected */ - static "__#6@#fixKeys"(cred: string, bu: string, type: string, keyArr?: string[]): Promise; + static "__#7@#replaceCbReference"(cred: string, bu: string, type: string, keyArr?: string[]): Promise; /** * helper to convert CSVs into an array. if only one value was given, it's also returned as an array * diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 4fea58da2..a4cb2b2a4 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAmBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;AAjBtD;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL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AE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,gBAC3B,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CA4J/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,QAC3B,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAgD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qB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IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAkE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map index 109103236..69e44b6db 100644 --- a/@types/lib/metadataTypes/Asset.d.ts.map +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAYa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;iCAC1C,OAAO,wBAAwB,EAAE,kBAAkB;AAdhE;;;;;;;;;GASG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,QACR,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;K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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApfkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/MetadataType.d.ts b/@types/lib/metadataTypes/MetadataType.d.ts index e42921427..d7566c3bc 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts +++ b/@types/lib/metadataTypes/MetadataType.d.ts @@ -194,6 +194,13 @@ declare class MetadataType { * @returns {void} */ static refresh(): void; + /** + * Abstract execute method that needs to be implemented in child metadata type + * + * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) + * @returns {Promise.} Returns list of keys for which references were replaced + */ + static replaceCbReference(metadataMap: MetadataTypeMap): Promise; /** * Abstract execute method that needs to be implemented in child metadata type * @@ -471,6 +478,16 @@ declare class MetadataType { * @returns {Promise.} Promise of saved metadata */ static saveResults(results: MetadataTypeMap, retrieveDir: string, overrideType?: string, templateVariables?: TemplateMap): Promise; + /** + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} originalKey key of metadata + * @param {string[]} baseDir [retrieveDir, ...overrideType.split('-')] + * @param {string} [subtypeExtension] e.g. ".asset-meta" or ".query-meta" + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {MetadataTypeItem} saved metadata + */ + static saveToDisk(results: MetadataTypeMap, originalKey: string, baseDir: string[], subtypeExtension?: string, templateVariables?: TemplateMap): MetadataTypeItem; /** * helper for {@link MetadataType.buildDefinitionForNested} * searches extracted file for template variable names and applies the market values diff --git a/@types/lib/metadataTypes/MetadataType.d.ts.map b/@types/lib/metadataTypes/MetadataType.d.ts.map index 126ff68c7..91d00eea3 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts.map +++ b/@types/lib/metadataTypes/MetadataType.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;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K/C;IAED;;;;;OAKG;IACH,gCAHW,MAAM,GACJ,QAAS,OAAO,CAAC,CAK7B;IACD;;;;;;OAMG;IACH,oCAJW,MAAM,yBACN,MAAM,EAAE,GACN,QAAS,IAAI,CAAC,CAe1B;IAED;;;;;;;OAOG;IACH,oCALW,MAAM,qBACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CA6B7B;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,OACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CAoB7B;IACD;;;;;;;OAOG;IACH,sCALW,MAAM,gBACN,OAAO,eACP,MAAM,GACJ,QAAS,MAAM,CAAC,CAgB5B;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file +{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;kBAC5C,OAAO,wBAAwB,EAAE,GAAG;uBACpC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GACL,QAAS,OAAO,CAAC,CA6B7B;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,OACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CAoB7B;IACD;;;;;;;OAOG;IACH,sCALW,MAAM,gBACN,OAAO,eACP,MAAM,GACJ,QAAS,MAAM,CAAC,CAgB5B;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Script.d.ts b/@types/lib/metadataTypes/Script.d.ts index f0094adc8..b00fac349 100644 --- a/@types/lib/metadataTypes/Script.d.ts +++ b/@types/lib/metadataTypes/Script.d.ts @@ -9,6 +9,7 @@ export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type ContentBlockConversionTypes = import('../../types/mcdev.d.js').ContentBlockConversionTypes; export type ScriptItem = import('../../types/mcdev.d.js').ScriptItem; export type ScriptMap = import('../../types/mcdev.d.js').ScriptMap; /** @@ -22,6 +23,7 @@ export type ScriptMap = import('../../types/mcdev.d.js').ScriptMap; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** * @typedef {import('../../types/mcdev.d.js').ScriptItem} ScriptItem @@ -144,6 +146,13 @@ declare class Script extends MetadataType { * @returns {CodeExtractItem} a single item with code parts extracted */ static postRetrieveTasks(metadata: ScriptItem): CodeExtractItem; + /** + * manages post retrieve steps + * + * @param {ScriptItem} metadata a single item + * @returns {CodeExtractItem} a single item with code parts extracted + */ + static getCodeExtractItem(metadata: ScriptItem): CodeExtractItem; /** * helper for {@link Script.postRetrieveTasks} and {@link Script._buildForNested} * @@ -170,6 +179,14 @@ declare class Script extends MetadataType { * @returns {Promise.} - */ static postDeleteTasks(customerKey: string): Promise; + /** + * Abstract execute method that needs to be implemented in child metadata type + * + * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) + * @param {string} retrieveDir retrieve dir including cred and bu + * @returns {Promise.} Returns list of keys for which references were replaced + */ + static replaceCbReference(metadataMap: MetadataTypeMap, retrieveDir: string): Promise; } declare namespace Script { let definition: { @@ -202,10 +219,7 @@ declare namespace Script { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; - template: boolean; /** - * @typedef {import('../../types/mcdev.d.js').ScriptItem} ScriptItem - * @typedef {import('../../types/mcdev.d.js').ScriptMap} ScriptMap - */ + template: boolean; }; createdDate: { isCreateable: boolean; @@ -221,7 +235,16 @@ declare namespace Script { }; folderLocationText: { isCreateable: boolean; - isUpdateable: boolean; + isUpdateable: boolean; /** + * Retrieves Metadata of Script + * Endpoint /automation/v1/scripts/ return all Scripts with all details. + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.<{metadata: ScriptMap, type: string}>} Promise + */ retrieving: boolean; template: boolean; }; diff --git a/@types/lib/metadataTypes/Script.d.ts.map b/@types/lib/metadataTypes/Script.d.ts.map index 5c92bab2f..9c7c7d92d 100644 --- a/@types/lib/metadataTypes/Script.d.ts.map +++ b/@types/lib/metadataTypes/Script.d.ts.map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CAJW,UAAU,OACV,MAAM,GACJ,QAAS,UAAU,CAAC,CAUhC;IACD;;;;;;;;;;OAUG;IACH,6CAPW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,GACJ,QAAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IACD;;;;;;;;;;;OAWG;IACH,2CAPW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,GACJ,QAAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IAED;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAsDhC;IAED;;;;;OAKG;IACH,mCAHW,UAAU,GACR,eAAe,CAmB3B;IAED;;;;;;OAMG;IACH,yCAJW,MAAM,gBACN,MAAM,GACJ;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAiBxC;IAwBD;;;;;;OAMG;IACH,6CAWC;IAiBD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAU1B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCA7WD;;;mBAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBApBsB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kC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H,2CAPW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,GACJ,QAAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IAED;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAsDhC;IAED;;;;;OAKG;IACH,mCAHW,UAAU,GACR,eAAe,CAO3B;IACD;;;;;OAKG;IACH,oCAHW,UAAU,GACR,eAAe,CAgB3B;IAED;;;;;;OAMG;IACH,yCAJW,MAAM,gBACN,MAAM,GACJ;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAiBxC;IAwBD;;;;;;OAMG;IACH,6CAWC;IAiBD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAU1B;IAED;;;;;;OAMG;IACH,uCAJW,eAAe,eACf,MAAM,GACJ,QAAS,MAAM,EAAE,CAAC,CAsE9B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAxbG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAvCkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/User.d.ts b/@types/lib/metadataTypes/User.d.ts index eae766f77..dccb76fc7 100644 --- a/@types/lib/metadataTypes/User.d.ts +++ b/@types/lib/metadataTypes/User.d.ts @@ -182,7 +182,7 @@ declare class User extends MetadataType { * @param {string} interval defaults to 'days' * @returns {string} time difference */ - static "__#5@#timeSinceDate"(dateStr: string, interval?: string): string; + static "__#6@#timeSinceDate"(dateStr: string, interval?: string): string; /** * helper to print bu names * diff --git a/@types/lib/util/replaceContentBlockReference.d.ts b/@types/lib/util/replaceContentBlockReference.d.ts new file mode 100644 index 000000000..9e30ba18d --- /dev/null +++ b/@types/lib/util/replaceContentBlockReference.d.ts @@ -0,0 +1,105 @@ +/** + * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject + * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject + * @typedef {import('../../types/mcdev.d.js').Cache} Cache + * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract + * @typedef {import('../../types/mcdev.d.js').CodeExtractItem} CodeExtractItem + * @typedef {import('../../types/mcdev.d.js').DeltaPkgItem} DeltaPkgItem + * @typedef {import('../../types/mcdev.d.js').McdevLogger} McdevLogger + * @typedef {import('../../types/mcdev.d.js').Logger} Logger + * @typedef {import('../../types/mcdev.d.js').Mcdevrc} Mcdevrc + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItem} MetadataTypeItem + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemDiff} MetadataTypeItemDiff + * @typedef {import('../../types/mcdev.d.js').MetadataTypeItemObj} MetadataTypeItemObj + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMap} MetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeList} MultiMetadataTypeList + * @typedef {import('../../types/mcdev.d.js').MultiMetadataTypeMap} MultiMetadataTypeMap + * @typedef {import('../../types/mcdev.d.js').SkipInteraction} SkipInteraction + * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams + * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo + * @typedef {import('../../types/mcdev.d.js').SDKError} SDKError + * @typedef {import('../../types/mcdev.d.js').AssetItemSimple} AssetItemSimple + * @typedef {import('../../types/mcdev.d.js').AssetItemSimpleMap} AssetItemSimpleMap + * @typedef {import('../../types/mcdev.d.js').AssetItemIdSimpleMap} AssetItemIdSimpleMap + * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes + */ +/** + * Util that contains logger and simple util methods + */ +export default class ReplaceContentBlockReference { + /** @type {{id: AssetItemIdSimpleMap, key: AssetItemSimpleMap, name: AssetItemSimpleMap}} */ + static assetCacheMap: { + id: AssetItemIdSimpleMap; + key: AssetItemSimpleMap; + name: AssetItemSimpleMap; + }; + /** @type {{id: RegExp[], key: RegExp[], name: RegExp[]}} */ + static "__#5@#regexBy": { + id: RegExp[]; + key: RegExp[]; + name: RegExp[]; + }; + /** + * used to equalize the reference in the code to whatever is set in the "to" field + * + * @param {string} str full code string + * @param {ContentBlockConversionTypes[]} fromList what to replace + * @param {ContentBlockConversionTypes} to what to replace with + * @param {string} parentName name of the object that was passed in; used in error message only + * @returns {string} replaced string + */ + static replaceReference(str: string, fromList: ContentBlockConversionTypes[], to: ContentBlockConversionTypes, parentName: string): string; + /** + * + * @private + * @param {ContentBlockConversionTypes} from replace with + * @param {string|number} identifier id, key or name of asset + * @param {string} parentName name of the object that was passed in; used in error message only + * @param {boolean} [isSsjs] replaces backslashes with double backslashes in name if true + * @returns {AssetItemSimple} asset object + */ + private static "__#5@#getAssetBy"; + /** + * + * @param {AssetItemSimple} asset asset object + * @param {ContentBlockConversionTypes} to replace with + * @param {boolean} [isSsjs] replaces backslashes with double backslashes in name if true + * @returns {string} replaced string + */ + static "__#5@#replaceWith"(asset: AssetItemSimple, to: ContentBlockConversionTypes, isSsjs?: boolean): string; + /** + * + * @param {Mcdevrc} properties properties for auth +saved + * @param {BuObject} buObject properties for auth + */ + static createCacheMap(properties: Mcdevrc, buObject: BuObject): Promise; +} +export type AuthObject = import('../../types/mcdev.d.js').AuthObject; +export type BuObject = import('../../types/mcdev.d.js').BuObject; +export type Cache = import('../../types/mcdev.d.js').Cache; +export type CodeExtract = import('../../types/mcdev.d.js').CodeExtract; +export type CodeExtractItem = import('../../types/mcdev.d.js').CodeExtractItem; +export type DeltaPkgItem = import('../../types/mcdev.d.js').DeltaPkgItem; +export type McdevLogger = import('../../types/mcdev.d.js').McdevLogger; +export type Logger = import('../../types/mcdev.d.js').Logger; +export type Mcdevrc = import('../../types/mcdev.d.js').Mcdevrc; +export type MetadataTypeItem = import('../../types/mcdev.d.js').MetadataTypeItem; +export type MetadataTypeItemDiff = import('../../types/mcdev.d.js').MetadataTypeItemDiff; +export type MetadataTypeItemObj = import('../../types/mcdev.d.js').MetadataTypeItemObj; +export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; +export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; +export type MultiMetadataTypeList = import('../../types/mcdev.d.js').MultiMetadataTypeList; +export type MultiMetadataTypeMap = import('../../types/mcdev.d.js').MultiMetadataTypeMap; +export type SkipInteraction = import('../../types/mcdev.d.js').SkipInteraction; +export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; +export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type TypeKeyCombo = import('../../types/mcdev.d.js').TypeKeyCombo; +export type SDKError = import('../../types/mcdev.d.js').SDKError; +export type AssetItemSimple = import('../../types/mcdev.d.js').AssetItemSimple; +export type AssetItemSimpleMap = import('../../types/mcdev.d.js').AssetItemSimpleMap; +export type AssetItemIdSimpleMap = import('../../types/mcdev.d.js').AssetItemIdSimpleMap; +export type ContentBlockConversionTypes = import('../../types/mcdev.d.js').ContentBlockConversionTypes; +//# sourceMappingURL=replaceContentBlockReference.d.ts.map \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map new file mode 100644 index 000000000..dea62cb99 --- /dev/null +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG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;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/@types/types/mcdev.d.d.ts b/@types/types/mcdev.d.d.ts index 81b0f03d8..4ee501d8b 100644 --- a/@types/types/mcdev.d.d.ts +++ b/@types/types/mcdev.d.d.ts @@ -1235,6 +1235,18 @@ export type McdevLogger = { errorStack: Function; }; export type Logger = import('winston').Logger & McdevLogger; +export type AssetItemSimple = { + id: number; + key: string; + name: string; +}; +export type AssetItemSimpleMap = { + [x: string]: AssetItemSimple; +}; +export type AssetItemIdSimpleMap = { + [x: number]: AssetItemSimple; +}; +export type ContentBlockConversionTypes = 'id' | 'key' | 'name'; export type ExplainType = { /** * readable name of type diff --git a/@types/types/mcdev.d.d.ts.map b/@types/types/mcdev.d.d.ts.map index 0bb345e3c..8f74adbc1 100644 --- a/@types/types/mcdev.d.d.ts.map +++ b/@types/types/mcdev.d.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mcdev.d.d.ts","sourceRoot":"","sources":["../../types/mcdev.d.js"],"names":[],"mappings":";;;;;;eAEc,MAAM;;;;mBACN,MAAM;;;;aACN,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;mBACN,MAAM;;;;iBACN,MAAM;;;QAGC,MAAM,GAAE,MAAM;;qCACtB,OAAO,GAAC,eAAe,GAAC,aAAa,GAAC,aAAa,GAAC,aAAa,GAAC,YAAY,GAAC,gBAAgB,GAAC,aAAa,GAAC,eAAe,GAAC,aAAa,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,aAAa,GAAC,gBAAgB,GAAC,cAAc,GAAC,YAAY,GAAC,UAAU,GAAC,aAAa,GAAC,eAAe,GAAC,oBAAoB,GAAC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AAC,WAAW,GAAC,QAAQ,GAAC,WAAW,GAAC,aAAa,GAAC,UAAU,GAAC,oBAAoB,GAAC,iBAAiB,GAAC,SAAS,GAAC,IAAI,GAAC,IAAI,GAAC,MAAM;;;;WACnI,MAAM,GAAG,MAAM,GAAG,OAAO,QAAQ;;;;;;iBAKjC,MAAM;;;;aACN,MAAM;;;;;QAEc,aAAa,EAAjC,MAAM;QACc,MAAM,EAA1B,MAAM;QACc,IAAI,EAAxB,MAAM;QACc,QAAQ,EAA5B,MAAM;QACc,QAAQ,EAA5B,MAAM;QACc,cAAc,EAAlC,MAAM;;;;;;YACE,MAAM,GAAE,MAAM;;;;;gBACtB,MAAM;;;;;QAEkB,QAAQ,EAAhC,MAAM,EAAE;QACgB,kBAAkB,EAA1C,MAAM,EAAE;;;;;aACR,MAAM;;0BAIP,OAAO,GAAC,SAAS,GAAC,MAAM,GAAC,OAAO;;;;;YAE/B,WAAW;;;;;;;;;;qBAGZ,OAAO,SAAS,EAAE,MAAM,GAAG,WAAW;8BAGtC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC;;QAC/B,MAAM,GAAE,eAAe;;;QACvB,MAAM,GAAE,eAAe;;0CAC/B,IAAI,GAAC,KAAK,GAAC,MAAM;;;;;UAIhB,MAAM;;;;aACN,MAAM;;;;iBACN,MAAM;;;;uBACN,OAAO,GAAG,MAAM,EAAE;;;;;QAEA,QAAQ,EAA1B,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,MAAM,EAAxB,OAAO;QACW,SAAS,EAA3B,OAAO;QACW,aAAa,EAA/B,OAAO;QACW,kBAAkB,EAApC,OAAO"} \ No newline at end of file diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 61a673f25..98045b575 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -1728,95 +1728,13 @@ class MetadataType { continue; } - // for complex types like asset, script, query we need to save the scripts that were extracted from the JSON - if (results[originalKey].json && results[originalKey].codeArr) { - // replace market values with template variable placeholders (do not do it on .codeArr) - if (templateVariables) { - results[originalKey].json = Util.replaceByObject( - results[originalKey].json, - templateVariables - ); - results[originalKey].subFolder = Util.replaceByObject( - results[originalKey].subFolder, - templateVariables - ); - } - - const postRetrieveData = results[originalKey]; - // normalize results[metadataEntry] - results[originalKey] = postRetrieveData.json; - - if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey])) { - Util.logger.debug(`Filtered ${originalKey} because of --like option`); - continue; - } - - if (postRetrieveData.subFolder) { - // very complex types have their own subfolder - baseDir.push(...postRetrieveData.subFolder); - } - // save extracted scripts - await Promise.all( - postRetrieveData.codeArr.map(async (script) => { - const dir = [...baseDir]; - if (script.subFolder) { - // some files shall be saved in yet a deeper subfolder - dir.push(...script.subFolder); - } - return File.writePrettyToFile( - dir, - script.fileName + subtypeExtension, - script.fileExt, - script.content, - templateVariables - ); - }) - ); - } else { - // not a complex type, run the the entire JSON through templating - // replace market values with template variable placeholders - if (templateVariables) { - results[originalKey] = Util.replaceByObject( - results[originalKey], - templateVariables - ); - } - if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey])) { - Util.logger.debug(`Filtered ${originalKey} because of --like option`); - continue; - } - } - - // we dont store Id on local disk, but we need it for caching logic, - // so its in retrieve but not in save. Here we put into the clone so that the original - // object used for caching doesnt have the Id removed. - const saveClone = structuredClone(results[originalKey]); - if ( - !this.definition.keepId && - this.definition.idField !== this.definition.keyField - ) { - delete saveClone[this.definition.idField]; - } - - if (templateVariables) { - this.keepTemplateFields(saveClone); - } else { - this.keepRetrieveFields(saveClone); - } - savedResults[originalKey] = saveClone; - await File.writeJSONToFile( - // manage subtypes + savedResults[originalKey] = await this.saveToDisk( + results, + originalKey, baseDir, - originalKey + subtypeExtension, - saveClone + subtypeExtension, + templateVariables ); - if (templateVariables) { - Util.logger.info( - `- templated ${this.definition.type}: ${ - saveClone[this.definition.nameField] - }` - ); - } } catch (ex) { Util.logger.errorStack( ex, @@ -1832,6 +1750,106 @@ class MetadataType { } return savedResults; } + + /** + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} originalKey key of metadata + * @param {string[]} baseDir [retrieveDir, ...overrideType.split('-')] + * @param {string} [subtypeExtension] e.g. ".asset-meta" or ".query-meta" + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {MetadataTypeItem} saved metadata + */ + static async saveToDisk(results, originalKey, baseDir, subtypeExtension, templateVariables) { + subtypeExtension ||= '.' + this.definition.type + '-meta'; + // for complex types like asset, script, query we need to save the scripts that were extracted from the JSON + if (results[originalKey].json && results[originalKey].codeArr) { + // replace market values with template variable placeholders (do not do it on .codeArr) + if (templateVariables) { + results[originalKey].json = Util.replaceByObject( + results[originalKey].json, + templateVariables + ); + results[originalKey].subFolder = Util.replaceByObject( + results[originalKey].subFolder, + templateVariables + ); + } + + const postRetrieveData = results[originalKey]; + // normalize results[metadataEntry] + results[originalKey] = postRetrieveData.json; + + if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey])) { + Util.logger.debug(`Filtered ${originalKey} because of --like option`); + return; + } + + if (postRetrieveData.subFolder) { + // very complex types have their own subfolder + baseDir.push(...postRetrieveData.subFolder); + } + // save extracted scripts + await Promise.all( + postRetrieveData.codeArr.map(async (script) => { + const dir = [...baseDir]; + if (script.subFolder) { + // some files shall be saved in yet a deeper subfolder + dir.push(...script.subFolder); + } + return File.writePrettyToFile( + dir, + script.fileName + subtypeExtension, + script.fileExt, + script.content, + templateVariables + ); + }) + ); + } else { + // not a complex type, run the the entire JSON through templating + // replace market values with template variable placeholders + if (templateVariables) { + results[originalKey] = Util.replaceByObject( + results[originalKey], + templateVariables + ); + } + if (Util.OPTIONS.like && !Util.fieldsLike(results[originalKey])) { + Util.logger.debug(`Filtered ${originalKey} because of --like option`); + return; + } + } + + // we dont store Id on local disk, but we need it for caching logic, + // so its in retrieve but not in save. Here we put into the clone so that the original + // object used for caching doesnt have the Id removed. + + const saveClone = structuredClone(results[originalKey]); + if (!this.definition.keepId && this.definition.idField !== this.definition.keyField) { + delete saveClone[this.definition.idField]; + } + + if (templateVariables) { + this.keepTemplateFields(saveClone); + } else { + this.keepRetrieveFields(saveClone); + } + + await File.writeJSONToFile( + // manage subtypes + baseDir, + originalKey + subtypeExtension, + saveClone + ); + if (templateVariables) { + Util.logger.info( + `- templated ${this.definition.type}: ${saveClone[this.definition.nameField]}` + ); + } + + return saveClone; + } /** * helper for {@link MetadataType.buildDefinitionForNested} * searches extracted file for template variable names and applies the market values From 5699437aebdf639c58c9a41b356df30ba1235a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 12:14:11 +0200 Subject: [PATCH 313/359] #1270: baseline solution code for replacing content block references --- lib/cli.js | 64 ++++++- lib/index.js | 166 +++++++++++++++- lib/metadataTypes/MetadataType.js | 13 ++ lib/util/replaceContentBlockReference.js | 229 ++++++++++++++++------- types/mcdev.d.js | 4 +- 5 files changed, 403 insertions(+), 73 deletions(-) diff --git a/lib/cli.js b/lib/cli.js index a6b999b2b..4648c7a83 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -356,7 +356,8 @@ yargs(hideBin(process.argv)) type: 'string', alias: 'bf', group: 'Required parameters for build:', - describe: 'market used for reverse building template', + describe: + 'the business unit to create the templates from (in format "credential name/BU name")', demandOption: true, }) .option('buTo', { @@ -412,7 +413,7 @@ yargs(hideBin(process.argv)) .positional('BU', { type: 'string', describe: - 'the business unit to deploy to (in format "credential name/BU name")', + 'the business unit to create the templates from (in format "credential name/BU name")', }) .positional('TYPE', { type: 'string', @@ -817,6 +818,65 @@ yargs(hideBin(process.argv)) }, }) // @ts-expect-error + .command({ + command: 'replaceContentBlock', + aliases: ['rcb'], + desc: 'Replaces ContentBlockById, ContentBlockByKey or ContentBlockByName functions with each other in AMPscript', + builder: (yargs) => { + yargs + .option('bu', { + type: 'string', + group: 'Required parameters for replaceContentBlock:', + describe: + 'the business unit on which to perform the operation (in format "credential name/BU name")', + demandOption: true, + }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Required parameters for replaceContentBlock:', + describe: 'type or type:key or type:i:id or type:n:name to fix', + demandOption: true, + }) + .option('to', { + type: 'string', + alias: 't', + choices: ['key', 'name', 'id'], + group: 'Required parameters for replaceContentBlock:', + describe: 'what ampscript function to replace it with (key, name, id)', + demandOption: true, + }) + .option('from', { + type: 'string', + alias: 'f', + choices: ['key', 'name', 'id'], + array: true, + group: 'Optional parameters for replaceContentBlock:', + describe: + 'what ampscript function to search for (key, name, id); automatically set to values not used by --to if not provided', + }) + .check((argv) => { + if (argv.from) { + for (const from of argv.from) { + if (from == argv.to) { + throw new Error('Error: --from and --to cannot be the same'); + } + } + } + return true; + }); + }, + handler: (argv) => { + Mcdev.setOptions(argv); + const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); + if ('undefined' === typeof typeKeyCombo) { + console.log('Error: --metadata value invalid'); // eslint-disable-line no-console + } else { + Mcdev.replaceCbReference(argv.bu, typeKeyCombo, argv.to, argv.from); + } + }, + }) + // @ts-expect-error .command({ command: 'upgrade', aliases: ['up'], diff --git a/lib/index.js b/lib/index.js index 1cc07e55e..f6c078ea5 100644 --- a/lib/index.js +++ b/lib/index.js @@ -15,6 +15,7 @@ import MetadataTypeInfo from './MetadataTypeInfo.js'; import MetadataTypeDefinitions from './MetadataTypeDefinitions.js'; import Retriever from './Retriever.js'; import cache from './util/cache.js'; +import ReplaceContentBlockReference from './util/replaceContentBlockReference.js'; /** * @typedef {import('../types/mcdev.d.js').BuObject} BuObject @@ -34,6 +35,7 @@ import cache from './util/cache.js'; * @typedef {import('../types/mcdev.d.js').TemplateMap} TemplateMap * @typedef {import('../types/mcdev.d.js').TypeKeyCombo} TypeKeyCombo * @typedef {import('../types/mcdev.d.js').ExplainType} ExplainType + * @typedef {import('../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** @@ -91,6 +93,8 @@ class Mcdev { 'noLogColors', 'noLogFile', 'noMidSuffix', + 'referenceFrom', + 'referenceTo', 'refresh', '_runningTest', 'schedule', @@ -997,6 +1001,99 @@ class Mcdev { static async pause(businessUnit, selectedType, keys) { return this.#runMethod('pause', businessUnit, selectedType, keys); } + /** + * Updates the key to match the name field + * + * @param {string} businessUnit name of BU + * @param {TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type + * @param {string} to what to replace with + * @param {string[]} [fromList] what to replace + * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys + */ + static async replaceCbReference(businessUnit, selectedTypesArr, to, fromList) { + /** @type {ContentBlockConversionTypes[]} */ + const allowedFromTo = ['key', 'name', 'id']; + if (!allowedFromTo.includes(to)) { + Util.logger.error( + `Invalid value for argument: --to, Given: "${to}", Choices: "${allowedFromTo.join('", "')}"` + ); + return; + } + + if (fromList) { + if (!Array.isArray(fromList)) { + // equalize to array + fromList = [fromList]; + } + for (const from of fromList) { + if (!allowedFromTo.includes(from)) { + Util.logger.error( + `Invalid value for argument: --from, Given: "${from}", Choices: "${allowedFromTo.join('", "')}"` + ); + } + if (from == to) { + Util.logger.error('--from and --to cannot be the same'); + } + } + } + + // define final from/to values + const referenceFrom = fromList || allowedFromTo.filter((item) => item !== to); + const referenceTo = to; + + // if called via CLI, saving the from/to values in OPTIONS was done already, but we need to cover package includes as well + this.setOptions({ referenceFrom, referenceTo }); + + const properties = await config.getProperties(); + if (selectedTypesArr) { + // check if types are valid + for (const selectedType of Object.keys(selectedTypesArr)) { + if (!Util._isValidType(selectedType)) { + return; + } + } + } else { + // do it for all types that have a replaceCbReference method + selectedTypesArr = []; + selectedTypesArr.push( + ...new Set( + properties.metaDataTypes.retrieve + .map((type) => type.split('-')[0]) + .filter((type) => + Object.prototype.hasOwnProperty.call( + MetadataTypeInfo[type], + 'replaceCbReference' + ) + ) + ) + ); + } + Util.logger.info( + `:: Replacing ${referenceFrom.map((from) => 'ContentBlockBy' + Util.capitalizeFirstLetter(from)).join(' and ')} with ContentBlockBy${Util.capitalizeFirstLetter(to)} for ${(Array.isArray( + selectedTypesArr + ) + ? selectedTypesArr + : Object.keys(selectedTypesArr) + ).join(', ')}` + ); + + const response = {}; + for (const selectedType of Array.isArray(selectedTypesArr) + ? selectedTypesArr + : Object.keys(selectedTypesArr)) { + const temp = await this.#runMethod( + 'replaceCbReference', + businessUnit, + selectedType, + Array.isArray(selectedTypesArr) ? null : selectedTypesArr[selectedType] + ); + response[businessUnit] ||= {}; + response[businessUnit][selectedType] = temp[businessUnit]; + } + + return response; + } + /** * Updates the key to match the name field * @@ -1079,7 +1176,7 @@ class Mcdev { /** * run a method across BUs * - * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {'execute'|'pause'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} businessUnit name of BU * @param {string} [selectedType] limit to given metadata types * @param {string[]} [keys] customerkey of the metadata @@ -1116,6 +1213,13 @@ class Mcdev { checkMetadataSupport = false; break; } + case 'replaceCbReference': { + lang_past = 'replaced references'; + lang_present = 'replacing references'; + requireKeyOrLike = false; + checkMetadataSupport = true; + break; + } } Util.logger.info(`mcdev:: ${methodName} ${selectedType}`); @@ -1243,7 +1347,7 @@ class Mcdev { /** * helper for Mcdev.#runMethod * - * @param {'execute'|'pause'|'fixKeys'} methodName what to run + * @param {'execute'|'pause'|'fixKeys'|'replaceCbReference'} methodName what to run * @param {string} cred name of Credential * @param {string} bu name of BU * @param {string} [type] limit execution to given metadata type @@ -1281,6 +1385,13 @@ class Mcdev { break; } } + case 'replaceCbReference': { + { + resultArr.push(...(await this.#replaceCbReference(cred, bu, type, keyArr))); + + break; + } + } default: { if (Util.OPTIONS.like && Object.keys(Util.OPTIONS.like).length) { keyArr = await this.#retrieveKeysWithLike(type, buObject); @@ -1445,6 +1556,57 @@ class Mcdev { Util.logger.info(`:: Done\n`); return resultArr; } + /** + * Updates the key to match the name field + * + * @param {string} cred name of Credential + * @param {string} bu name of BU + * @param {string} type limit execution to given metadata type + * @param {string[]} [keyArr] customerkey of the metadata + * @returns {Promise.} list of keys that were affected + */ + static async #replaceCbReference(cred, bu, type, keyArr) { + const properties = await config.getProperties(); + let updatedKeys = []; + const resultArr = []; + + const buObject = await Cli.getCredentialObject( + properties, + cred === null ? null : cred + '/' + bu, + null, + true + ); + + await ReplaceContentBlockReference.createCacheMap(properties, buObject); + + try { + Util.logger.info(`Retrieving latest versions of ${type} from server`); + const deployer = new Deployer(properties, buObject); + const metadataMap = await MetadataTypeInfo[type].getJsonFromFS( + File.normalizePath([deployer.retrieveDir, type]) + ); + const savePath = File.normalizePath([ + properties.directories.retrieve, + buObject.credential, + buObject.businessUnit, + ]); + const keysForDeploy = await MetadataTypeInfo[type].replaceCbReference( + metadataMap, + savePath + ); + + if (keysForDeploy.length < 1) { + Util.logger.warn( + `No items found with a key-name mismatch that match your criteria.\n` + ); + return resultArr; + } + } catch (ex) { + Util.logger.errorStack(ex, 'mcdev.replaceCbReference failed'); + } + Util.logger.info(`:: Done\n`); + return resultArr; + } /** * helper to convert CSVs into an array. if only one value was given, it's also returned as an array * diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 98045b575..616b73d40 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -481,6 +481,19 @@ class MetadataType { return; } + /** + * Abstract execute method that needs to be implemented in child metadata type + * + * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) + * @returns {Promise.} Returns list of keys for which references were replaced + */ + static async replaceCbReference(metadataMap) { + Util.logger.error( + ` ☇ skipping ${this.definition.type}: replaceCbReference is not supported yet for ${this.definition.type}` + ); + return []; + } + /** * Abstract execute method that needs to be implemented in child metadata type * diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 372f05404..3906d642b 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -1,5 +1,12 @@ 'use strict'; +import auth from './auth.js'; +import cache from './cache.js'; +import { Util } from '../util/util.js'; + +import Folder from '../metadataTypes/Folder.js'; +import Asset from '../metadataTypes/Asset.js'; + /** * @typedef {import('../../types/mcdev.d.js').AuthObject} AuthObject * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -32,100 +39,188 @@ * Util that contains logger and simple util methods */ export default class ReplaceContentBlockReference { - /** @type {{id: AssetItemIdSimpleMap, key: AssetItemSimpleMap, pathName: AssetItemSimpleMap}} */ + /** @type {{id: AssetItemIdSimpleMap, key: AssetItemSimpleMap, name: AssetItemSimpleMap}} */ static assetCacheMap = { - id: null, - key: null, - pathName: null, + id: {}, + key: {}, + name: {}, }; - /** @type {{id: RegExp[], key: RegExp[], pathName: RegExp[]}} */ + /** @type {{id: RegExp[], key: RegExp[], name: RegExp[]}} */ static #regexBy = { - id: [/ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim], - key: [ - /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, - /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim, - ], - pathName: [ - /ContentBlockByName\(\s*"([ a-z0-9-\\._]+)"\s*\)/gim, - /ContentBlockByName\(\s*'([ a-z0-9-\\._]+)'\s*\)/gim, - ], + amp: { + id: [ + /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, + /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim, + ], + key: [ + /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, + /ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim, + ], + name: [ + /ContentBlockByName\(\s*"([ a-z0-9-\\._)(]+)"\s*\)/gim, + /ContentBlockByName\(\s*'([ a-z0-9-\\._)(]+)'\s*\)/gim, + ], + }, + ssjs: { + id: [ + /Platform.Function.ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, + /Platform.Function.ContentBlockById\(\s*'([0-9]+)'\s*\)/gim, + ], + key: [ + /Platform.Function.ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, + /Platform.Function.ContentBlockByKey\(\s*'([a-z0-9-/._]+)'\s*\)/gim, + ], + name: [ + /Platform.Function.ContentBlockByName\(\s*"([ a-z0-9-\\._)(]+)"\s*\)/gim, + /Platform.Function.ContentBlockByName\(\s*'([ a-z0-9-\\._)(]+)'\s*\)/gim, + ], + }, }; /** + * used to equalize the reference in the code to whatever is set in the "to" field * * @param {string} str full code string - * @param {ContentBlockConversionTypes} from what to replace + * @param {ContentBlockConversionTypes[]} fromList what to replace * @param {ContentBlockConversionTypes} to what to replace with + * @param {string} parentName name of the object that was passed in; used in error message only * @returns {string} replaced string */ - static replaceContentBlockReference(str, from, to) { + static replaceReference(str, fromList, to, parentName) { let result = str; - for (const regex of this.#regexBy[from]) { - result = result.replaceAll(regex, (match, identifier) => { - const asset = this.#getAssetBy[from](identifier); - return this.#replaceWith(asset, to); - }); + let changes = 0; + const languages = [ + { name: 'ssjs', isSsjs: true }, + { name: 'amp', isSsjs: false }, + ]; + for (const from of fromList) { + for (const lang of languages) { + for (const regex of this.#regexBy[lang.name][from]) { + result = result.replaceAll(regex, (match, identifier) => { + const referencedAsset = this.#getAssetBy( + from, + identifier, + parentName, + lang.isSsjs + ); + if (referencedAsset) { + changes++; + return this.#replaceWith(referencedAsset, to, lang.isSsjs); + } else { + return match; + } + }); + } + } + } + if (!changes) { + const ex = new Error('No changes made to the code.'); + ex.code = 200; + throw ex; } return result; } - /** @type {{id: Function, key: Function, pathName: Function}} */ - static #getAssetBy = { - /** - * - * @private - * @param {string} pathName r__folder_Path +'/'+ name - * @returns {AssetItemSimple} asset object - */ - pathName(pathName) { - // TODO - return { id: 9999, key: 'my-key', pathName: pathName }; - }, - /** - * - * @private - * @param {number} id id of asset - * @returns {AssetItemSimple} asset object - */ - id(id) { - // TODO - return { - id: id, - key: 'my-key', - pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, - }; - }, - /** - * - * @private - * @param {string} key customerKey field of asset - * @returns {AssetItemSimple} asset object - */ - key(key) { - // TODO - return { - id: 9999, - key: key, - pathName: `Content Builder\\Release 2 - BUILD\\Content Blocks Library\\NEW\\03. Header and banner\\Referred contentblock\\RS_Dev_Header_blue`, - }; - }, - }; + /** + * + * @private + * @param {ContentBlockConversionTypes} from replace with + * @param {string|number} identifier id, key or name of asset + * @param {string} parentName name of the object that was passed in; used in error message only + * @param {boolean} [isSsjs] replaces backslashes with double backslashes in name if true + * @returns {AssetItemSimple} asset object + */ + static #getAssetBy(from, identifier, parentName, isSsjs = false) { + let reference; + switch (from) { + case 'id': { + reference = ReplaceContentBlockReference.assetCacheMap.id[identifier]; + break; + } + case 'key': { + reference = ReplaceContentBlockReference.assetCacheMap.key[identifier]; + break; + } + case 'name': { + if (isSsjs) { + identifier = identifier.replaceAll('\\\\', '\\'); + } + reference = ReplaceContentBlockReference.assetCacheMap.name[identifier]; + break; + } + } + if (!reference) { + Util.logger.error(` - ${parentName}: Asset not found for ${from} ${identifier}`); + } + return reference; + } + /** * * @param {AssetItemSimple} asset asset object * @param {ContentBlockConversionTypes} to replace with + * @param {boolean} [isSsjs] replaces backslashes with double backslashes in name if true * @returns {string} replaced string */ - static #replaceWith(asset, to) { + static #replaceWith(asset, to, isSsjs = false) { switch (to) { case 'id': { - return `ContentBlockById("${asset.id}")`; + return `${isSsjs ? 'Platform.Function.' : ''}ContentBlockById("${asset.id}")`; } case 'key': { - return `ContentBlockByKey("${asset.key}")`; + return `${isSsjs ? 'Platform.Function.' : ''}ContentBlockByKey("${asset.key}")`; } - case 'pathName': { - return `ContentBlockByName("${asset.pathName}")`; + case 'name': { + return `${isSsjs ? 'Platform.Function.' : ''}ContentBlockByName("${isSsjs ? asset.name.replaceAll('\\', '\\\\') : asset.name}")`; } } } + + /** + * + * @param {Mcdevrc} properties properties for auth +saved + * @param {BuObject} buObject properties for auth + */ + static async createCacheMap(properties, buObject) { + const client = auth.getSDK(buObject); + + if (!cache.getCache()) { + cache.initCache(buObject); + } + Util.logger.info(' - Caching folders'); + Folder.buObject = buObject; + Folder.properties = properties; + Folder.client = client; + const resultFolder = await Folder.retrieveForCache(null, ['asset', 'asset-shared']); + cache.setMetadata('folder', resultFolder.metadata); + + Util.logger.info(' - Caching assets'); + Asset.buObject = buObject; + Asset.properties = properties; + Asset.client = client; + const resultAsset = await Asset.retrieveForCache(undefined, [ + 'asset', + 'code', + 'textfile', + 'block', + 'other', + ]); + for (const element of Object.values(resultAsset.metadata)) { + // ensure we got the folder-path in our cache + Asset.setFolderPath(element); + + // create actual cache map + const simpleAsset = { + id: element.id, + key: element.customerKey, + name: element.r__folder_Path.replaceAll('/', '\\') + '\\' + element.name, + }; + // ! note that ContentBlockByName expects backslashes between folders and file name, not forward slashes + ReplaceContentBlockReference.assetCacheMap.id[simpleAsset.id] = simpleAsset; + ReplaceContentBlockReference.assetCacheMap.key[simpleAsset.key] = simpleAsset; + ReplaceContentBlockReference.assetCacheMap.name[simpleAsset.name] = simpleAsset; + } + + cache.setMetadata('asset', resultAsset.metadata); + } } diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 04f545f49..864500ebb 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -450,10 +450,10 @@ complex * @typedef {import('winston').Logger & McdevLogger} Logger */ /** - * @typedef {{id: number, key: string, pathName: string}} AssetItemSimple + * @typedef {{id: number, key: string, name: string}} AssetItemSimple * @typedef {Object.} AssetItemSimpleMap * @typedef {Object.} AssetItemIdSimpleMap - * @typedef {'id'|'key'|'pathName'} ContentBlockConversionTypes + * @typedef {'id'|'key'|'name'} ContentBlockConversionTypes */ /** * @typedef {object} ExplainType From b06cb02559c705e65c99918460b495473975742d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 12:16:06 +0200 Subject: [PATCH 314/359] #1270: rcb for script --- @types/lib/metadataTypes/Script.d.ts.map | 2 +- .../replaceContentBlockReference.d.ts.map | 2 +- lib/metadataTypes/Script.js | 87 ++++++++++++++++++- 3 files changed, 88 insertions(+), 3 deletions(-) diff --git a/@types/lib/metadataTypes/Script.d.ts.map b/@types/lib/metadataTypes/Script.d.ts.map index 9c7c7d92d..15ae963cc 100644 --- a/@types/lib/metadataTypes/Script.d.ts.map +++ b/@types/lib/metadataTypes/Script.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;0CAC5C,OAAO,wBAAwB,EAAE,2BAA2B;yBAI5D,OAAO,wBAAwB,EAAE,UAAU;wBAC3C,OAAO,wBAAwB,EAAE,SAAS;AAhBvD;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAKzD;IACD;;;;OAIG;IACH,2BAFa,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC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H,uCAJW,eAAe,eACf,MAAM,GACJ,QAAS,MAAM,EAAE,CAAC,CAsE9B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCAxbG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAvCkB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;0CAC5C,OAAO,wBAAwB,EAAE,2BAA2B;yBAI5D,OAAO,wBAAwB,EAAE,UAAU;wBAC3C,OAAO,wBAAwB,EAAE,SAAS;AAhBvD;;;;;;;;;;;;GAYG;AAEH;;;GAGG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAKzD;IACD;;;;OAIG;IACH,2BAFa,QAAS;QAAC,QAAQ,EAAE,SAAS,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAIzD;IAED;;;;;;;OAOG;IACH,uCALW,MAAM,QACN,MAAM,qBACN,WAAW,GACT,QAAS;QAAC,Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCArbG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAvCkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index dea62cb99..e2a8d4985 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CA8BtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,YACN,2BAA2B,EAAE,MAC7B,2BAA2B,cAC3B,MAAM,GACJ,MAAM,CA0ClB;IACD;;;;;;;;OAQG;IACH,kCAwBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAelB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA+ClB;CACJ;yBApOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CA8BtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,YACN,2BAA2B,EAAE,MAC7B,2BAA2B,cAC3B,MAAM,GACJ,MAAM,CAwClB;IACD;;;;;;;;OAQG;IACH,kCAwBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAelB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA+ClB;CACJ;yBAlOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index d3968d439..e22545276 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -3,6 +3,7 @@ import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; import File from '../util/file.js'; +import ReplaceCbReference from '../util/replaceContentBlockReference.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -15,6 +16,7 @@ import File from '../util/file.js'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** @@ -111,7 +113,7 @@ class Script extends MetadataType { templateName + '.' + this.definition.type + '-meta', 'ssjs' ); - code = ``; + code = ``; } else if (await File.pathExists(codePath + '.html')) { code = await File.readFilteredFilename( [deployDir, this.definition.type], @@ -271,6 +273,15 @@ class Script extends MetadataType { // folder super.setFolderPath(metadata); + return this.getCodeExtractItem(metadata); + } + /** + * manages post retrieve steps + * + * @param {ScriptItem} metadata a single item + * @returns {CodeExtractItem} a single item with code parts extracted + */ + static getCodeExtractItem(metadata) { // extract SSJS const codeArr = []; // keep between tags @@ -382,6 +393,80 @@ class Script extends MetadataType { `${this.definition.type}-meta.html`, ]); } + + /** + * Abstract execute method that needs to be implemented in child metadata type + * + * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) + * @param {string} retrieveDir retrieve dir including cred and bu + * @returns {Promise.} Returns list of keys for which references were replaced + */ + static async replaceCbReference(metadataMap, retrieveDir) { + const keysForDeploy = []; + if (!metadataMap) { + // if a type was skipped e.g. because it shall only be looked at on the parent then we would expect metadataMap to be undefined + return keysForDeploy; + } + const deployMap = {}; + /** @type {ContentBlockConversionTypes[]} */ + const referenceFrom = Util.OPTIONS.referenceFrom; + /** @type {ContentBlockConversionTypes} */ + const referenceTo = Util.OPTIONS.referenceTo; + + const fromDescription = referenceFrom + .map((from) => 'ContentBlockBy' + Util.capitalizeFirstLetter(from)) + .join(' and '); + + if (Object.keys(metadataMap).length) { + Util.logger.info(`Searching ${this.definition.type} for ${fromDescription}:`); + const baseDir = [retrieveDir, ...this.definition.type.split('-')]; + + for (const key in metadataMap) { + const item = metadataMap[key]; + if (this.isFiltered(item, true) || this.isFiltered(item, false)) { + // we would not have saved these items to disk but they exist in the cache and hence need to be skipped here + + continue; + } + const code = await this._mergeCode(item, retrieveDir); + + try { + item.script = ReplaceCbReference.replaceReference( + code, + referenceFrom, + referenceTo, + `${this.definition.type} ${item[this.definition.keyField]}` + ); + deployMap[key] = this.getCodeExtractItem(item); + // add key but make sure to turn it into string or else numeric keys will be filtered later + keysForDeploy.push(item[this.definition.keyField] + ''); + Util.logger.info( + ` - added ${this.definition.type} to update queue: ${ + item[this.definition.keyField] + }` + ); + this.saveToDisk(deployMap, key, baseDir); + } catch (ex) { + if (ex.code !== 200) { + // dont print error if we simply did not find relevant content blocks + Util.logger.errorStack(ex, ex.message); + } + Util.logger.info( + Util.getGrayMsg( + ` ☇ skipping ${this.definition.type} ${ + item[this.definition.keyField] + }: no ${fromDescription} found` + ) + ); + } + } + + Util.logger.info( + `Found ${keysForDeploy.length} ${this.definition.type}${keysForDeploy.length > 1 ? 's' : ''} to update` + ); + } + return keysForDeploy; + } } // Assign definition & cache to static attributes From 29a6be347a2d7701d58fb676acd8598414cfeb05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 13:36:47 +0200 Subject: [PATCH 315/359] #1270: save-guard development version of rcb base code --- @types/lib/index.d.ts.map | 2 +- lib/index.js | 48 +++++++++++++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index a4cb2b2a4..0b460e168 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO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MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAkE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,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wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index f6c078ea5..b642320e8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1576,20 +1576,29 @@ class Mcdev { null, true ); + const savePath = File.normalizePath([ + properties.directories.retrieve, + buObject.credential, + buObject.businessUnit, + ]); await ReplaceContentBlockReference.createCacheMap(properties, buObject); try { Util.logger.info(`Retrieving latest versions of ${type} from server`); - const deployer = new Deployer(properties, buObject); - const metadataMap = await MetadataTypeInfo[type].getJsonFromFS( - File.normalizePath([deployer.retrieveDir, type]) - ); - const savePath = File.normalizePath([ - properties.directories.retrieve, - buObject.credential, - buObject.businessUnit, - ]); + let metadataMap; + const IN_DEVELOPMENT = true; // TODO: remove when development is done + if (IN_DEVELOPMENT) { + // TODO: remove when development is done + metadataMap = await MetadataTypeInfo[type].getJsonFromFS( + File.normalizePath([savePath, type]) + ); + } else { + // TODO: enable when development is done + const retriever = new Retriever(properties, buObject); + const retrieved = await retriever.retrieve([type], keyArr); + metadataMap = Object.values(retrieved)[0][0]; + } const keysForDeploy = await MetadataTypeInfo[type].replaceCbReference( metadataMap, savePath @@ -1601,6 +1610,27 @@ class Mcdev { ); return resultArr; } + if (IN_DEVELOPMENT) { + // TODO: remove when development is done + resultArr.push(...keysForDeploy); + } else { + // TODO: enable when development is done + this.setOptions({ + fromRetrieve: true, + }); + const deployed = await Deployer.deploy(cred + '/' + bu, [type], keysForDeploy); + updatedKeys = Object.keys(Object.values(Object.values(deployed)[0])[0]); + resultArr.push(...updatedKeys); + if (updatedKeys && updatedKeys.length) { + Util.logger.info( + `Successfully updated ${updatedKeys.length} item${ + updatedKeys.length === 1 ? '' : 's' + } of type ${type}` + ); + } else { + Util.logger.warn(`Nothing updated for type ${type}`); + } + } } catch (ex) { Util.logger.errorStack(ex, 'mcdev.replaceCbReference failed'); } From da71779e4591f16d4bdf6996d611ba8d41d0b897 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 14:40:19 +0200 Subject: [PATCH 316/359] #1270: refactoring to have less code in type specific method --- @types/lib/index.d.ts.map | 2 +- @types/lib/metadataTypes/Asset.d.ts | 6 +- @types/lib/metadataTypes/Automation.d.ts | 18 ++--- @types/lib/metadataTypes/DataExtension.d.ts | 20 ++--- @types/lib/metadataTypes/MetadataType.d.ts | 13 +++- .../lib/metadataTypes/MetadataType.d.ts.map | 2 +- @types/lib/metadataTypes/MobileKeyword.d.ts | 6 +- @types/lib/metadataTypes/Script.d.ts | 9 +-- @types/lib/metadataTypes/Script.d.ts.map | 2 +- @types/lib/metadataTypes/TriggeredSend.d.ts | 47 +++++++---- .../lib/metadataTypes/TriggeredSend.d.ts.map | 2 +- .../util/replaceContentBlockReference.d.ts | 12 +-- .../replaceContentBlockReference.d.ts.map | 2 +- lib/index.js | 2 +- lib/metadataTypes/MetadataType.js | 64 ++++++++++++++- lib/metadataTypes/Script.js | 77 +++---------------- lib/util/replaceContentBlockReference.js | 8 +- 17 files changed, 161 insertions(+), 131 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 0b460e168..124937c9f 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;m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ACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;G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,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Asset.d.ts b/@types/lib/metadataTypes/Asset.d.ts index f90ebbf85..d007587b9 100644 --- a/@types/lib/metadataTypes/Asset.d.ts +++ b/@types/lib/metadataTypes/Asset.d.ts @@ -188,7 +188,7 @@ declare class Asset extends MetadataType { * @param {string} extendedSubType webpage, htmlblock, etc * @returns {string} subType: block, message, other, etc */ - static "__#1@#getMainSubtype"(extendedSubType: string): string; + static "__#2@#getMainSubtype"(extendedSubType: string): string; /** * helper to find a new unique name during asset creation * @@ -353,7 +353,7 @@ declare class Asset extends MetadataType { * @param {string} buName owner business unit name * @returns {string} path to the asset's code */ - static "__#1@#getPath"(subType: string, item: object, buName: string): string; + static "__#2@#getPath"(subType: string, item: object, buName: string): string; /** * helper for {@link Asset.resolveId} that loads the JSON file for the asset * @@ -361,7 +361,7 @@ declare class Asset extends MetadataType { * @param {object} item api response for metadata * @returns {Promise.} JS object of the asset we loaded from disk */ - static "__#1@#getJson"(subType: string, item: object): Promise; + static "__#2@#getJson"(subType: string, item: object): Promise; } declare namespace Asset { let definition: { diff --git a/@types/lib/metadataTypes/Automation.d.ts b/@types/lib/metadataTypes/Automation.d.ts index 2d473376b..560dc9272 100644 --- a/@types/lib/metadataTypes/Automation.d.ts +++ b/@types/lib/metadataTypes/Automation.d.ts @@ -64,7 +64,7 @@ declare class Automation extends MetadataType { * @param {MetadataTypeMap} metadataMap keyField => metadata map * @returns {Promise.} Promise of automation legacy api response */ - static "__#2@#getAutomationNotificationsREST"(metadataMap: MetadataTypeMap): Promise; + static "__#3@#getAutomationNotificationsREST"(metadataMap: MetadataTypeMap): Promise; /** * Retrieves Metadata of Automation * @@ -92,7 +92,7 @@ declare class Automation extends MetadataType { * @param {AutomationItem} metadata a single automation * @returns {boolean} true if the automation schedule is valid */ - static "__#2@#isValidSchedule"(metadata: AutomationItem): boolean; + static "__#3@#isValidSchedule"(metadata: AutomationItem): boolean; /** * manages post retrieve steps * @@ -107,7 +107,7 @@ declare class Automation extends MetadataType { * @param {string} key key of the metadata * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ - static "__#2@#executeItem"(metadataMap: AutomationMap, key: string): Promise<{ + static "__#3@#executeItem"(metadataMap: AutomationMap, key: string): Promise<{ key: string; response: object; }>; @@ -117,7 +117,7 @@ declare class Automation extends MetadataType { * @param {AutomationItem} metadataEntry metadata object * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ - static "__#2@#runOnce"(metadataEntry: AutomationItem): Promise<{ + static "__#3@#runOnce"(metadataEntry: AutomationItem): Promise<{ key: string; response: object; }>; @@ -127,7 +127,7 @@ declare class Automation extends MetadataType { * @param {AutomationItem} metadata automation metadata * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ - static "__#2@#pauseItem"(metadata: AutomationItem): Promise<{ + static "__#3@#pauseItem"(metadata: AutomationItem): Promise<{ key: string; response: object; }>; @@ -160,7 +160,7 @@ declare class Automation extends MetadataType { * * @param {AutomationItem} metadata metadata mapped by their keyField */ - static "__#2@#preDeploySchedule"(metadata: AutomationItem): void; + static "__#3@#preDeploySchedule"(metadata: AutomationItem): void; /** * Gets executed before deploying metadata * @@ -198,7 +198,7 @@ declare class Automation extends MetadataType { * @param {string} key current customer key * @returns {Promise.} - */ - static "__#2@#updateNotificationInfoREST"(metadataMap: AutomationMap, key: string): Promise; + static "__#3@#updateNotificationInfoREST"(metadataMap: AutomationMap, key: string): Promise; /** * helper for {@link Automation.postDeployTasks} * @@ -208,7 +208,7 @@ declare class Automation extends MetadataType { * @param {string} [oldKey] old customer key before fixKey / changeKeyValue / changeKeyField * @returns {Promise.<{key:string, response:object}>} metadata key and API response */ - static "__#2@#scheduleAutomation"(metadataMap: AutomationMap, originalMetadataMap: AutomationMap, key: string, oldKey?: string): Promise<{ + static "__#3@#scheduleAutomation"(metadataMap: AutomationMap, originalMetadataMap: AutomationMap, key: string, oldKey?: string): Promise<{ key: string; response: object; }>; @@ -265,7 +265,7 @@ declare class Automation extends MetadataType { * @param {string} key customer key * @returns {Promise.} objectId or enpty string */ - static "__#2@#getObjectIdForSingleRetrieve"(key: string): Promise; + static "__#3@#getObjectIdForSingleRetrieve"(key: string): Promise; /** * clean up after deleting a metadata item * diff --git a/@types/lib/metadataTypes/DataExtension.d.ts b/@types/lib/metadataTypes/DataExtension.d.ts index 9c95f329f..8a4f82716 100644 --- a/@types/lib/metadataTypes/DataExtension.d.ts +++ b/@types/lib/metadataTypes/DataExtension.d.ts @@ -45,7 +45,7 @@ declare class DataExtension extends MetadataType { * @param {object} res - * @returns {boolean} true: keep, false: discard */ - static "__#3@#filterUpsertResults"(res: object): boolean; + static "__#4@#filterUpsertResults"(res: object): boolean; /** * Create a single dataExtension. Also creates their columns in 'dataExtension.columns' * @@ -61,7 +61,7 @@ declare class DataExtension extends MetadataType { * @param {DataExtensionItem} metadata single metadata entry * @returns {void} */ - static "__#3@#cleanupRetentionPolicyFields"(metadata: DataExtensionItem): void; + static "__#4@#cleanupRetentionPolicyFields"(metadata: DataExtensionItem): void; /** * Updates a single dataExtension. Also updates their columns in 'dataExtension.columns' * @@ -91,7 +91,7 @@ declare class DataExtension extends MetadataType { * @param {{created: number, updated: number}} createdUpdated counter representing successful creates/updates * @returns {Promise.} - */ - static "__#3@#fixShared"(upsertedMetadata: DataExtensionMap, originalMetadata: DataExtensionMap, createdUpdated: { + static "__#4@#fixShared"(upsertedMetadata: DataExtensionMap, originalMetadata: DataExtensionMap, createdUpdated: { created: number; updated: number; }): Promise; @@ -100,7 +100,7 @@ declare class DataExtension extends MetadataType { * * @returns {Promise.} list of selected BU names */ - static "__#3@#fixShared_getBUs"(): Promise; + static "__#4@#fixShared_getBUs"(): Promise; /** * helper for {@link DataExtension.#fixShared} * @@ -110,7 +110,7 @@ declare class DataExtension extends MetadataType { * @param {Object.} sharedDataExtensionMap ID-Key relationship of shared data extensions * @returns {Promise.} updated shared DE keys on BU */ - static "__#3@#fixShared_onBU"(childBuName: string, buObjectParent: BuObject, clientParent: object, sharedDataExtensionMap: { + static "__#4@#fixShared_onBU"(childBuName: string, buObjectParent: BuObject, clientParent: object, sharedDataExtensionMap: { [x: string]: string; }): Promise; /** @@ -125,7 +125,7 @@ declare class DataExtension extends MetadataType { * @param {object} clientParent SDK for parent BU * @returns {Promise.} flag that signals if the fix was successful */ - static "__#3@#fixShared_item"(deId: string, deKey: string, buObjectChildBu: BuObject, clientChildBu: object, buObjectParent: BuObject, clientParent: object): Promise; + static "__#4@#fixShared_item"(deId: string, deKey: string, buObjectChildBu: BuObject, clientChildBu: object, buObjectParent: BuObject, clientParent: object): Promise; /** * add a new field to the shared DE to trigger an update to the data model * helper for {@link DataExtension.#fixShared_item} @@ -136,7 +136,7 @@ declare class DataExtension extends MetadataType { * @param {string} deId dataExtension ObjectID * @returns {Promise.} randomSuffix */ - static "__#3@#fixShared_item_addField"(buObjectChildBu: BuObject, clientChildBu: object, deKey: string, deId: string): Promise; + static "__#4@#fixShared_item_addField"(buObjectChildBu: BuObject, clientChildBu: object, deKey: string, deId: string): Promise; /** * get ID of the field added by {@link DataExtension.#fixShared_item_addField} on the shared DE via parent BU * helper for {@link DataExtension.#fixShared_item} @@ -147,7 +147,7 @@ declare class DataExtension extends MetadataType { * @param {string} deKey dataExtension key * @returns {Promise.} fieldObjectID */ - static "__#3@#fixShared_item_getFieldId"(randomSuffix: string, buObjectParent: BuObject, clientParent: object, deKey: string): Promise; + static "__#4@#fixShared_item_getFieldId"(randomSuffix: string, buObjectParent: BuObject, clientParent: object, deKey: string): Promise; /** * delete the field added by {@link DataExtension.#fixShared_item_addField} * helper for {@link DataExtension.#fixShared_item} @@ -159,7 +159,7 @@ declare class DataExtension extends MetadataType { * @param {string} fieldObjectID field ObjectID * @returns {Promise} - */ - static "__#3@#fixShared_item_deleteField"(randomSuffix: string, buObjectChildBu: BuObject, clientChildBu: object, deKey: string, fieldObjectID: string): Promise; + static "__#4@#fixShared_item_deleteField"(randomSuffix: string, buObjectChildBu: BuObject, clientChildBu: object, deKey: string, fieldObjectID: string): Promise; /** * Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval * @@ -189,7 +189,7 @@ declare class DataExtension extends MetadataType { * @param {string[]} [additionalFields] Returns specified fields even if their retrieve definition is not set to true * @returns {Promise.} - */ - static "__#3@#attachFields"(metadata: DataExtensionMap, fieldOptions?: SoapRequestParams, additionalFields?: string[]): Promise; + static "__#4@#attachFields"(metadata: DataExtensionMap, fieldOptions?: SoapRequestParams, additionalFields?: string[]): Promise; /** * Retrieves dataExtension metadata. Afterwards starts retrieval of dataExtensionColumn metadata retrieval * diff --git a/@types/lib/metadataTypes/MetadataType.d.ts b/@types/lib/metadataTypes/MetadataType.d.ts index d7566c3bc..72ac534bc 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts +++ b/@types/lib/metadataTypes/MetadataType.d.ts @@ -195,12 +195,21 @@ declare class MetadataType { */ static refresh(): void; /** - * Abstract execute method that needs to be implemented in child metadata type + * this iterates over all items found in the retrieve folder and executes the type-specific method for replacing references * * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) + * @param {string} retrieveDir retrieve dir including cred and bu * @returns {Promise.} Returns list of keys for which references were replaced */ - static replaceCbReference(metadataMap: MetadataTypeMap): Promise; + static replaceCbReferenceLoop(metadataMap: MetadataTypeMap, retrieveDir: string): Promise; + /** + * Abstract execute method that needs to be implemented in child metadata type + * + * @param {MetadataTypeItem} item single metadata item + * @param {string} [retrieveDir] directory where metadata is saved + * @returns {Promise.} key of the item that was updated + */ + static replaceCbReference(item: MetadataTypeItem, retrieveDir?: string): Promise; /** * Abstract execute method that needs to be implemented in child metadata type * diff --git a/@types/lib/metadataTypes/MetadataType.d.ts.map b/@types/lib/metadataTypes/MetadataType.d.ts.map index 91d00eea3..89cae4c90 100644 --- a/@types/lib/metadataTypes/MetadataType.d.ts.map +++ b/@types/lib/metadataTypes/MetadataType.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"MetadataType.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ACT,QAAS,kBAAkB,CAAC,CA4FxC;IACD;;;;;OAKG;IACH,yBAHW,MAAM,GACJ,MAAM,EAAE,CAkCpB;IAED;;;;;;OAMG;IACH,2BAJW,eAAe,aACf,OAAO,GACL,IAAI,CAMhB;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,QAAS;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC,CAK/C;IAED;;;;;OAKG;IACH,gCAHW,MAAM,GACJ,QAAS,OAAO,CAAC,CAK7B;IACD;;;;;;OAMG;IACH,oCAJW,MAAM,yBACN,MAAM,EAAE,GACN,QAAS,IAAI,CAAC,CAe1B;IAED;;;;;;;OAOG;IACH,oCALW,MAAM,qBACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CA6B7B;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,OACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CAoB7B;IACD;;;;;;;OAOG;IACH,sCALW,MAAM,gBACN,OAAO,eACP,MAAM,GACJ,QAAS,MAAM,CAAC,CAgB5B;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file +{"version":3,"file":"MetadataType.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/MetadataType.js"],"names":[],"mappings":";uBAiBa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;sBAChD,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO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;;OAMG;IACH,2BAJW,eAAe,aACf,OAAO,GACL,IAAI,CAMhB;IAED;;;;;OAKG;IACH,qBAHW,MAAM,GACJ,QAAS;QAAC,GAAG,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,CAAA;KAAC,CAAC,CAK/C;IAED;;;;;OAKG;IACH,gCAHW,MAAM,GACJ,QAAS,OAAO,CAAC,CAK7B;IACD;;;;;;OAMG;IACH,oCAJW,MAAM,yBACN,MAAM,EAAE,GACN,QAAS,IAAI,CAAC,CAe1B;IAED;;;;;;;OAOG;IACH,oCALW,MAAM,qBACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CA6B7B;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,OACN,MAAM,kBACN,OAAO,GACL,QAAS,OAAO,CAAC,CAoB7B;IACD;;;;;;;OAOG;IACH,sCALW,MAAM,gBACN,OAAO,eACP,MAAM,GACJ,QAAS,MAAM,CAAC,CAgB5B;IACD;;;;;;OAMG;IACH,gCAHW,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAa9B;IAED;;;;OAIG;IACH,qCAHW,eAAe,GACb,MAAM,EAAE,CAwDpB;IACD;;;;;;;OAOG;IACH,4BALW,MAAM,gBACN,gBAAgB,gBAChB,MAAM,GACJ,MAAM,CAelB;CACJ;;;;;;;;;;;;gBAaS,GAAG;oBAIH,OAAO;iBAIP,MAAM;kBAIN,QAAQ"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/MobileKeyword.d.ts b/@types/lib/metadataTypes/MobileKeyword.d.ts index 2bef62d76..247c80407 100644 --- a/@types/lib/metadataTypes/MobileKeyword.d.ts +++ b/@types/lib/metadataTypes/MobileKeyword.d.ts @@ -43,13 +43,13 @@ declare class MobileKeyword extends MetadataType { * * @param {MetadataTypeItem} metadata single item */ - static "__#4@#createCustomKeyField"(metadata: MetadataTypeItem): void; + static "__#5@#createCustomKeyField"(metadata: MetadataTypeItem): void; /** * helper for {@link MobileKeyword.preDeployTasks} and {@link MobileKeyword.createOrUpdate} to ensure we have code & keyword properly set * * @param {MetadataTypeItem} metadata single item */ - static "__#4@#setCodeAndKeyword"(metadata: MetadataTypeItem): void; + static "__#5@#setCodeAndKeyword"(metadata: MetadataTypeItem): void; /** * Retrieves event definition metadata for caching * @@ -74,7 +74,7 @@ declare class MobileKeyword extends MetadataType { * @param {string} key customer key of single item to retrieve / name of the metadata file * @returns {Array} key, queryParams */ - static "__#4@#getRetrieveKeyAndUrl"(key: string): any[]; + static "__#5@#getRetrieveKeyAndUrl"(key: string): any[]; /** * Creates a single item * diff --git a/@types/lib/metadataTypes/Script.d.ts b/@types/lib/metadataTypes/Script.d.ts index b00fac349..0134ba379 100644 --- a/@types/lib/metadataTypes/Script.d.ts +++ b/@types/lib/metadataTypes/Script.d.ts @@ -180,13 +180,12 @@ declare class Script extends MetadataType { */ static postDeleteTasks(customerKey: string): Promise; /** - * Abstract execute method that needs to be implemented in child metadata type * - * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) - * @param {string} retrieveDir retrieve dir including cred and bu - * @returns {Promise.} Returns list of keys for which references were replaced + * @param {MetadataTypeItem} item single metadata item + * @param {string} retrieveDir directory where metadata is saved + * @returns {Promise.} key of the item that was updated */ - static replaceCbReference(metadataMap: MetadataTypeMap, retrieveDir: string): Promise; + static replaceCbReference(item: MetadataTypeItem, retrieveDir: string): Promise; } declare namespace Script { let definition: { diff --git a/@types/lib/metadataTypes/Script.d.ts.map b/@types/lib/metadataTypes/Script.d.ts.map index 15ae963cc..3aff47cf8 100644 --- a/@types/lib/metadataTypes/Script.d.ts.map +++ b/@types/lib/metadataTypes/Script.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO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AAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IACD;;;;;;;;;;;OAWG;IACH,2CAPW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,GACJ,QAAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IAED;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAsDhC;IAED;;;;;OAKG;IACH,mCAHW,UAAU,GACR,eAAe,CAO3B;IACD;;;;;OAKG;IACH,oCAHW,UAAU,GACR,eAAe,CAgB3B;IAED;;;;;;OAMG;IACH,yCAJW,MAAM,gBACN,MAAM,GACJ;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAiBxC;IAwBD;;;;;;OAMG;IACH,6CAWC;IAiBD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAU1B;IAED;;;;;;OAMG;IACH,uCAJW,eAAe,eACf,MAAM,GACJ,QAAS,MAAM,EAAE,CAAC,CAmE9B;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCArbG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAvCkB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Script.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Script.js"],"names":[],"mappings":";uBAQa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAA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AM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,GACJ,QAAS,MAAM,EAAE,EAAE,CAAC,CAiBhC;IAED;;;;;;;;;;;OAWG;IACH,oCARW,MAAM,aACN,MAAM,GAAC,MAAM,EAAE,YACf,UAAU,qBACV,WAAW,gBACX,MAAM,QACN,YAAY,GAAC,UAAU,GACrB,QAAS,MAAM,EAAE,EAAE,CAAC,CAsDhC;IAED;;;;;OAKG;IACH,mCAHW,UAAU,GACR,eAAe,CAO3B;IACD;;;;;OAKG;IACH,oCAHW,UAAU,GACR,eAAe,CAgB3B;IAED;;;;;;OAMG;IACH,yCAJW,MAAM,gBACN,MAAM,GACJ;QAAC,OAAO,EAAC,MAAM,CAAC;QAAA,IAAI,EAAC,MAAM,CAAA;KAAC,CAiBxC;IAwBD;;;;;;OAMG;IACH,6CAWC;IAiBD;;;;;OAKG;IACH,oCAHW,MAAM,GACJ,QAAS,IAAI,CAAC,CAU1B;IAED;;;;;OAKG;IACH,gCAJW,gBAAgB,eAChB,MAAM,GACJ,QAAS,eAAe,CAAC,CAarC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCA9XG;;;;;;;;;mBASG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAvCkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts b/@types/lib/metadataTypes/TriggeredSend.d.ts index 9aa435e4b..18a4fd4b8 100644 --- a/@types/lib/metadataTypes/TriggeredSend.d.ts +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts @@ -9,6 +9,7 @@ export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; +export type ContentBlockConversionTypes = import('../../types/mcdev.d.js').ContentBlockConversionTypes; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract @@ -20,6 +21,7 @@ export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** * MessageSendActivity MetadataType @@ -95,6 +97,12 @@ declare class TriggeredSend extends MetadataType { * @returns {Promise.} true if refresh was successful */ static _refreshItem(key: string, checkKey: boolean): Promise; + /** + * + * @param {MetadataTypeItem} item single metadata item + * @returns {Promise.} key of the item that was updated + */ + static replaceCbReference(item: MetadataTypeItem): Promise; } declare namespace TriggeredSend { let definition: { @@ -135,7 +143,15 @@ declare namespace TriggeredSend { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; - templating: boolean; + templating: boolean; /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ }; AutoUpdateSubscribers: { isCreateable: boolean; @@ -212,10 +228,21 @@ declare namespace TriggeredSend { 'DeliveryProfile.ObjectID': { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; + retrieving: boolean; /** + * Delete a metadata item from the specified business unit + * + * @param {string} customerKey Identifier of data extension + * @returns {Promise.} deletion success status + */ templating: boolean; }; Description: { + isCreateable: boolean; + isUpdateable: boolean; + retrieving: boolean; + templating: boolean; + }; + DisableOnEmailBuildError: { isCreateable: boolean; isUpdateable: boolean; /** * parses retrieved Metadata before saving @@ -226,12 +253,6 @@ declare namespace TriggeredSend { retrieving: boolean; templating: boolean; }; - DisableOnEmailBuildError: { - isCreateable: boolean; - isUpdateable: boolean; - retrieving: boolean; - templating: boolean; - }; DomainType: { isCreateable: boolean; isUpdateable: boolean; @@ -565,12 +586,7 @@ declare namespace TriggeredSend { SendSourceDataExtension: { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; /** - * helper for {@link TriggeredSend.refresh} that finds active TSDs on the server and filters it by the same rules that {@link TriggeredSend.retrieve} is using to avoid refreshing TSDs with broken dependencies - * - * @param {boolean} [assetLoaded] if run after Asset.deploy via --refresh option this will skip caching assets - * @returns {Promise.} Promise of TSD item map - */ + retrieving: boolean; templating: boolean; }; SendWindowClose: { @@ -651,10 +667,9 @@ declare namespace TriggeredSend { r__folder_Path: { skipValidation: boolean; }; - /** @type {SoapRequestParams} */ r__list_PathName: { skipValidation: boolean; - }; /** @type {SoapRequestParams} */ + }; c__priority: { skipValidation: boolean; }; diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts.map b/@types/lib/metadataTypes/TriggeredSend.d.ts.map index a30298c50..fd1f135ee 100644 --- a/@types/lib/metadataTypes/TriggeredSend.d.ts.map +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAyOH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA2CC,gCAAgC;;;eAAhC,gCAAgC;;;;;;;;;;;;;yBA5Xf,mBAAmB"} \ No newline at end of file +{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAWa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;0CAC5C,OAAO,wBAAwB,EAAE,2BAA2B;AAXzE;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAO1B;IAYD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAwGnC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqFtC;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,aACR,OAAO,GACL,QAAS,IAAI,CAAC,CAkB1B;IAED;;;;;OAKG;IACH,qCAHW,eAAe,GACb,QAAS,MAAM,EAAE,CAAC,CAS9B;IACD;;;;;OAKG;IACH,0CAHW,OAAO,GACL,QAAS,kBAAkB,CAAC,CAqDxC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,YACN,OAAO,GACL,QAAS,OAAO,CAAC,CA8F7B;IACD;;;;OAIG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CA2CtC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAhgBG;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAkDH;;;;;mBAKG;;;;;;;;;;;uCAKH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArGkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts b/@types/lib/util/replaceContentBlockReference.d.ts index 9e30ba18d..019c63482 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts +++ b/@types/lib/util/replaceContentBlockReference.d.ts @@ -36,7 +36,7 @@ export default class ReplaceContentBlockReference { name: AssetItemSimpleMap; }; /** @type {{id: RegExp[], key: RegExp[], name: RegExp[]}} */ - static "__#5@#regexBy": { + static "__#1@#regexBy": { id: RegExp[]; key: RegExp[]; name: RegExp[]; @@ -45,12 +45,12 @@ export default class ReplaceContentBlockReference { * used to equalize the reference in the code to whatever is set in the "to" field * * @param {string} str full code string - * @param {ContentBlockConversionTypes[]} fromList what to replace - * @param {ContentBlockConversionTypes} to what to replace with * @param {string} parentName name of the object that was passed in; used in error message only + * @param {ContentBlockConversionTypes[]} [fromList] what to replace + * @param {ContentBlockConversionTypes} [to] what to replace with * @returns {string} replaced string */ - static replaceReference(str: string, fromList: ContentBlockConversionTypes[], to: ContentBlockConversionTypes, parentName: string): string; + static replaceReference(str: string, parentName: string, fromList?: ContentBlockConversionTypes[], to?: ContentBlockConversionTypes): string; /** * * @private @@ -60,7 +60,7 @@ export default class ReplaceContentBlockReference { * @param {boolean} [isSsjs] replaces backslashes with double backslashes in name if true * @returns {AssetItemSimple} asset object */ - private static "__#5@#getAssetBy"; + private static "__#1@#getAssetBy"; /** * * @param {AssetItemSimple} asset asset object @@ -68,7 +68,7 @@ export default class ReplaceContentBlockReference { * @param {boolean} [isSsjs] replaces backslashes with double backslashes in name if true * @returns {string} replaced string */ - static "__#5@#replaceWith"(asset: AssetItemSimple, to: ContentBlockConversionTypes, isSsjs?: boolean): string; + static "__#1@#replaceWith"(asset: AssetItemSimple, to: ContentBlockConversionTypes, isSsjs?: boolean): string; /** * * @param {Mcdevrc} properties properties for auth diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index e2a8d4985..07a6d5b70 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;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OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAgCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA2ClB;IACD;;;;;;;;OAQG;IACH,kCAwBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAelB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA+ClB;CACJ;yBAvOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index b642320e8..cb6486131 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1599,7 +1599,7 @@ class Mcdev { const retrieved = await retriever.retrieve([type], keyArr); metadataMap = Object.values(retrieved)[0][0]; } - const keysForDeploy = await MetadataTypeInfo[type].replaceCbReference( + const keysForDeploy = await MetadataTypeInfo[type].replaceCbReferenceLoop( metadataMap, savePath ); diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index 616b73d40..eae339c33 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -482,12 +482,72 @@ class MetadataType { } /** - * Abstract execute method that needs to be implemented in child metadata type + * this iterates over all items found in the retrieve folder and executes the type-specific method for replacing references * * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) + * @param {string} retrieveDir retrieve dir including cred and bu * @returns {Promise.} Returns list of keys for which references were replaced */ - static async replaceCbReference(metadataMap) { + static async replaceCbReferenceLoop(metadataMap, retrieveDir) { + const keysForDeploy = []; + if (!metadataMap) { + // if a type was skipped e.g. because it shall only be looked at on the parent then we would expect metadataMap to be undefined + return keysForDeploy; + } + + const fromDescription = Util.OPTIONS.referenceFrom + .map((from) => 'ContentBlockBy' + Util.capitalizeFirstLetter(from)) + .join(' and '); + + if (Object.keys(metadataMap).length) { + Util.logger.info(`Searching ${this.definition.type} for ${fromDescription}:`); + const baseDir = [retrieveDir, ...this.definition.type.split('-')]; + const deployMap = {}; + + for (const key in metadataMap) { + const item = metadataMap[key]; + if (this.isFiltered(item, true) || this.isFiltered(item, false)) { + // we would not have saved these items to disk but they exist in the cache and hence need to be skipped here + + continue; + } + + try { + // add key but make sure to turn it into string or else numeric keys will be filtered later + deployMap[key] = await this.replaceCbReference(item, retrieveDir); + this.saveToDisk(deployMap, key, baseDir); + + keysForDeploy.push(key + ''); + Util.logger.info(` - added ${this.definition.type} to update queue: ${key}`); + } catch (ex) { + if (ex.code !== 200) { + // dont print error if we simply did not find relevant content blocks + Util.logger.errorStack(ex, ex.message); + } + Util.logger.info( + Util.getGrayMsg( + ` ☇ skipping ${this.definition.type} ${ + item[this.definition.keyField] + }: no ${fromDescription} found` + ) + ); + } + } + + Util.logger.info( + `Found ${keysForDeploy.length} ${this.definition.type}${keysForDeploy.length === 1 ? '' : 's'} to update` + ); + } + return keysForDeploy; + } + /** + * Abstract execute method that needs to be implemented in child metadata type + * + * @param {MetadataTypeItem} item single metadata item + * @param {string} [retrieveDir] directory where metadata is saved + * @returns {Promise.} key of the item that was updated + */ + static async replaceCbReference(item, retrieveDir) { Util.logger.error( ` ☇ skipping ${this.definition.type}: replaceCbReference is not supported yet for ${this.definition.type}` ); diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index e22545276..096761f85 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -395,77 +395,22 @@ class Script extends MetadataType { } /** - * Abstract execute method that needs to be implemented in child metadata type * - * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) - * @param {string} retrieveDir retrieve dir including cred and bu - * @returns {Promise.} Returns list of keys for which references were replaced + * @param {MetadataTypeItem} item single metadata item + * @param {string} retrieveDir directory where metadata is saved + * @returns {Promise.} key of the item that was updated */ - static async replaceCbReference(metadataMap, retrieveDir) { - const keysForDeploy = []; - if (!metadataMap) { - // if a type was skipped e.g. because it shall only be looked at on the parent then we would expect metadataMap to be undefined - return keysForDeploy; - } - const deployMap = {}; - /** @type {ContentBlockConversionTypes[]} */ - const referenceFrom = Util.OPTIONS.referenceFrom; - /** @type {ContentBlockConversionTypes} */ - const referenceTo = Util.OPTIONS.referenceTo; - - const fromDescription = referenceFrom - .map((from) => 'ContentBlockBy' + Util.capitalizeFirstLetter(from)) - .join(' and '); + static async replaceCbReference(item, retrieveDir) { + const parentName = `${this.definition.type} ${item[this.definition.keyField]}`; - if (Object.keys(metadataMap).length) { - Util.logger.info(`Searching ${this.definition.type} for ${fromDescription}:`); - const baseDir = [retrieveDir, ...this.definition.type.split('-')]; + const code = await this._mergeCode(item, retrieveDir); - for (const key in metadataMap) { - const item = metadataMap[key]; - if (this.isFiltered(item, true) || this.isFiltered(item, false)) { - // we would not have saved these items to disk but they exist in the cache and hence need to be skipped here + item.script = ReplaceCbReference.replaceReference(code, parentName); - continue; - } - const code = await this._mergeCode(item, retrieveDir); - - try { - item.script = ReplaceCbReference.replaceReference( - code, - referenceFrom, - referenceTo, - `${this.definition.type} ${item[this.definition.keyField]}` - ); - deployMap[key] = this.getCodeExtractItem(item); - // add key but make sure to turn it into string or else numeric keys will be filtered later - keysForDeploy.push(item[this.definition.keyField] + ''); - Util.logger.info( - ` - added ${this.definition.type} to update queue: ${ - item[this.definition.keyField] - }` - ); - this.saveToDisk(deployMap, key, baseDir); - } catch (ex) { - if (ex.code !== 200) { - // dont print error if we simply did not find relevant content blocks - Util.logger.errorStack(ex, ex.message); - } - Util.logger.info( - Util.getGrayMsg( - ` ☇ skipping ${this.definition.type} ${ - item[this.definition.keyField] - }: no ${fromDescription} found` - ) - ); - } - } - - Util.logger.info( - `Found ${keysForDeploy.length} ${this.definition.type}${keysForDeploy.length > 1 ? 's' : ''} to update` - ); - } - return keysForDeploy; + // *** finish *** + // replaceReference will throw an error if nothing was updated which will end execution here + // no error means we have a new item to deploy and need to update the item in our retrieve folder + return this.getCodeExtractItem(item); } } diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 3906d642b..d116c8503 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -81,12 +81,14 @@ export default class ReplaceContentBlockReference { * used to equalize the reference in the code to whatever is set in the "to" field * * @param {string} str full code string - * @param {ContentBlockConversionTypes[]} fromList what to replace - * @param {ContentBlockConversionTypes} to what to replace with * @param {string} parentName name of the object that was passed in; used in error message only + * @param {ContentBlockConversionTypes[]} [fromList] what to replace + * @param {ContentBlockConversionTypes} [to] what to replace with * @returns {string} replaced string */ - static replaceReference(str, fromList, to, parentName) { + static replaceReference(str, parentName, fromList, to) { + fromList ||= Util.OPTIONS.referenceFrom; + to ||= Util.OPTIONS.referenceTo; let result = str; let changes = 0; const languages = [ From 07bf392fde424d39fb384fc26fc9ec1a1abe967c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 14:42:39 +0200 Subject: [PATCH 317/359] #1270: rcb for triggeredSend --- lib/metadataTypes/TriggeredSend.js | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 5720edc1a..4bceba6f7 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -6,6 +6,7 @@ import cache from '../util/cache.js'; import asset from './Asset.js'; import folder from './Folder.js'; import list from './List.js'; +import ReplaceCbReference from '../util/replaceContentBlockReference.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -18,6 +19,7 @@ import list from './List.js'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap + * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** @@ -491,6 +493,53 @@ class TriggeredSend extends MetadataType { } return true; } + /** + * + * @param {MetadataTypeItem} item single metadata item + * @returns {Promise.} key of the item that was updated + */ + static async replaceCbReference(item) { + // *** type specific logic *** + const parentName = `${this.definition.type} ${item[this.definition.keyField]}`; + let changes = false; + try { + item.FromName = ReplaceCbReference.replaceReference(item.FromName, parentName); + changes = true; + } catch { + // handled via final check on "changes" + } + try { + item.FromAddress = ReplaceCbReference.replaceReference(item.FromAddress, parentName); + changes = true; + } catch { + // handled via final check on "changes" + } + try { + item.EmailSubject = ReplaceCbReference.replaceReference(item.EmailSubject, parentName); + changes = true; + } catch { + // handled via final check on "changes" + } + try { + item.DynamicEmailSubject = ReplaceCbReference.replaceReference( + item.DynamicEmailSubject, + parentName + ); + changes = true; + } catch { + // handled via final check on "changes" + } + if (!changes) { + const ex = new Error('No changes made to the code.'); + ex.code = 200; + throw ex; + } + + // *** finish *** + // replaceReference will throw an error if nothing was updated which will end execution here + // no error means we have a new item to deploy and need to update the item in our retrieve folder + return item; + } } // Assign definition to static attributes From b3cd1ca6da8a740088566c621801bdf4369339d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 14:48:45 +0200 Subject: [PATCH 318/359] #1270: find/replace contentBlockById(...) with id passed in without quotes/doublequotes --- @types/lib/util/replaceContentBlockReference.d.ts.map | 2 +- lib/util/replaceContentBlockReference.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index 07a6d5b70..00c6c0615 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAgCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA2ClB;IACD;;;;;;;;OAQG;IACH,kCAwBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAelB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA+ClB;CACJ;yBAvOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAgCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA2ClB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAjOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index d116c8503..908c647a6 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -51,6 +51,7 @@ export default class ReplaceContentBlockReference { id: [ /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, /ContentBlockById\(\s*'([0-9]+)'\s*\)/gim, + /ContentBlockById\(\s*([0-9]+)\s*\)/gim, ], key: [ /ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, @@ -65,6 +66,7 @@ export default class ReplaceContentBlockReference { id: [ /Platform.Function.ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, /Platform.Function.ContentBlockById\(\s*'([0-9]+)'\s*\)/gim, + /Platform.Function.ContentBlockById\(\s*([0-9]+)\s*\)/gim, ], key: [ /Platform.Function.ContentBlockByKey\(\s*"([a-z0-9-/._]+)"\s*\)/gim, @@ -166,7 +168,7 @@ export default class ReplaceContentBlockReference { static #replaceWith(asset, to, isSsjs = false) { switch (to) { case 'id': { - return `${isSsjs ? 'Platform.Function.' : ''}ContentBlockById("${asset.id}")`; + return `${isSsjs ? 'Platform.Function.' : ''}ContentBlockById(${asset.id})`; } case 'key': { return `${isSsjs ? 'Platform.Function.' : ''}ContentBlockByKey("${asset.key}")`; From 733eaa2bdaf3adf28f98191d8dd37f2a2f29aa9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 14:57:04 +0200 Subject: [PATCH 319/359] #1270: refactoring & improved error handling --- @types/lib/metadataTypes/SenderProfile.d.ts | 31 ++++++++-------- .../lib/metadataTypes/SenderProfile.d.ts.map | 2 +- @types/lib/metadataTypes/TriggeredSend.d.ts | 36 ++++++------------- .../lib/metadataTypes/TriggeredSend.d.ts.map | 2 +- .../replaceContentBlockReference.d.ts.map | 2 +- lib/index.js | 4 +-- lib/metadataTypes/TriggeredSend.js | 33 +++++++++++------ 7 files changed, 55 insertions(+), 55 deletions(-) diff --git a/@types/lib/metadataTypes/SenderProfile.d.ts b/@types/lib/metadataTypes/SenderProfile.d.ts index 27ae024ea..f8d075f0c 100644 --- a/@types/lib/metadataTypes/SenderProfile.d.ts +++ b/@types/lib/metadataTypes/SenderProfile.d.ts @@ -58,6 +58,12 @@ declare class SenderProfile extends MetadataType { * @returns {Promise.} Promise */ static preDeployTasks(metadata: MetadataTypeItem): Promise; + /** + * + * @param {MetadataTypeItem} item single metadata item + * @returns {Promise.} key of the item that was updated + */ + static replaceCbReference(item: MetadataTypeItem): Promise; } declare namespace SenderProfile { let definition: { @@ -97,7 +103,15 @@ declare namespace SenderProfile { isUpdateable: boolean; retrieving: boolean; template: boolean; - }; + }; /** + * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata + * + * @param {string} [retrieveDir] Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise of metadata + */ CustomerKey: { isCreateable: boolean; isUpdateable: boolean; @@ -115,7 +129,7 @@ declare namespace SenderProfile { isUpdateable: boolean; retrieving: boolean; template: boolean; - }; /** @type {SoapRequestParams} */ + }; Description: { isCreateable: boolean; isUpdateable: boolean; @@ -147,12 +161,6 @@ declare namespace SenderProfile { template: boolean; }; AutoForwardTriggeredSend: { - /** - * Delete a metadata item from the specified business unit - * - * @param {string} customerKey Identifier of data extension - * @returns {Promise.} deletion success status - */ isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; @@ -162,12 +170,7 @@ declare namespace SenderProfile { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; - template: boolean; /** - * prepares a single item for deployment - * - * @param {MetadataTypeItem} metadata a single query activity - * @returns {Promise.} Promise - */ + template: boolean; }; AutoReplyTriggeredSend: { isCreateable: boolean; diff --git a/@types/lib/metadataTypes/SenderProfile.d.ts.map b/@types/lib/metadataTypes/SenderProfile.d.ts.map index b4ef21b66..af881d057 100644 --- a/@types/lib/metadataTypes/SenderProfile.d.ts.map +++ b/@types/lib/metadataTypes/SenderProfile.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"SenderProfile.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/SenderProfile.js"],"names":[],"mappings":";uBAMa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyBtC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAzEO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAiCpC;;;;;mBAKG;;;;;;;;;;mCAKH;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAhFkB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"SenderProfile.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/SenderProfile.js"],"names":[],"mappings":";uBAOa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,8BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAexC;IACD;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,4BAHW,gBAAgB,gBAK1B;IAYD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyBtC;IACD;;;;OAIG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CA4DtC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAnJG;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA/BkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts b/@types/lib/metadataTypes/TriggeredSend.d.ts index 18a4fd4b8..f554192f8 100644 --- a/@types/lib/metadataTypes/TriggeredSend.d.ts +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts @@ -9,7 +9,6 @@ export type MetadataTypeMap = import('../../types/mcdev.d.js').MetadataTypeMap; export type MetadataTypeMapObj = import('../../types/mcdev.d.js').MetadataTypeMapObj; export type SoapRequestParams = import('../../types/mcdev.d.js').SoapRequestParams; export type TemplateMap = import('../../types/mcdev.d.js').TemplateMap; -export type ContentBlockConversionTypes = import('../../types/mcdev.d.js').ContentBlockConversionTypes; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject * @typedef {import('../../types/mcdev.d.js').CodeExtract} CodeExtract @@ -21,7 +20,6 @@ export type ContentBlockConversionTypes = import('../../types/mcdev.d.js').Conte * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap - * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** * MessageSendActivity MetadataType @@ -143,15 +141,7 @@ declare namespace TriggeredSend { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; - templating: boolean; /** - * Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata - * - * @param {string} retrieveDir Directory where retrieved metadata directory will be saved - * @param {void | string[]} [_] unused parameter - * @param {void | string[]} [__] unused parameter - * @param {string} [key] customer key of single item to retrieve - * @returns {Promise.} Promise of metadata - */ + templating: boolean; }; AutoUpdateSubscribers: { isCreateable: boolean; @@ -167,7 +157,7 @@ declare namespace TriggeredSend { }; BccEmail: { isCreateable: boolean; - isUpdateable: boolean; + isUpdateable: boolean; /** @type {SoapRequestParams} */ retrieving: boolean; templating: boolean; }; @@ -228,12 +218,7 @@ declare namespace TriggeredSend { 'DeliveryProfile.ObjectID': { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; /** - * Delete a metadata item from the specified business unit - * - * @param {string} customerKey Identifier of data extension - * @returns {Promise.} deletion success status - */ + retrieving: boolean; templating: boolean; }; Description: { @@ -241,15 +226,15 @@ declare namespace TriggeredSend { isUpdateable: boolean; retrieving: boolean; templating: boolean; - }; + }; /** + * parses retrieved Metadata before saving + * + * @param {MetadataTypeItem} metadata a single item + * @returns {MetadataTypeItem | void} Array with one metadata object and one sql string + */ DisableOnEmailBuildError: { isCreateable: boolean; - isUpdateable: boolean; /** - * parses retrieved Metadata before saving - * - * @param {MetadataTypeItem} metadata a single item - * @returns {MetadataTypeItem | void} Array with one metadata object and one sql string - */ + isUpdateable: boolean; retrieving: boolean; templating: boolean; }; @@ -671,6 +656,7 @@ declare namespace TriggeredSend { skipValidation: boolean; }; c__priority: { + /** @type {SoapRequestParams} */ skipValidation: boolean; }; r__sendClassification_key: { diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts.map b/@types/lib/metadataTypes/TriggeredSend.d.ts.map index fd1f135ee..23ad5e45d 100644 --- a/@types/lib/metadataTypes/TriggeredSend.d.ts.map +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAWa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;0CAC5C,OAAO,wBAAwB,EAAE,2BAA2B;AAXzE;;;;;;;;;;;;GAYG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAO1B;IAYD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAwGnC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqFtC;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,aACR,OAAO,GACL,QAAS,IAAI,CAAC,CAkB1B;IA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAyRC,gCAAgC;;;;;;;;;;;;yBA7Xf,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index 00c6c0615..91d9e1313 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAgCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA2ClB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAjOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;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wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index cb6486131..d970c7082 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1605,9 +1605,7 @@ class Mcdev { ); if (keysForDeploy.length < 1) { - Util.logger.warn( - `No items found with a key-name mismatch that match your criteria.\n` - ); + Util.logger.warn(`No items found that can be updated.\n`); return resultArr; } if (IN_DEVELOPMENT) { diff --git a/lib/metadataTypes/TriggeredSend.js b/lib/metadataTypes/TriggeredSend.js index 4bceba6f7..e09cc6816 100644 --- a/lib/metadataTypes/TriggeredSend.js +++ b/lib/metadataTypes/TriggeredSend.js @@ -19,7 +19,6 @@ import ReplaceCbReference from '../util/replaceContentBlockReference.js'; * @typedef {import('../../types/mcdev.d.js').MetadataTypeMapObj} MetadataTypeMapObj * @typedef {import('../../types/mcdev.d.js').SoapRequestParams} SoapRequestParams * @typedef {import('../../types/mcdev.d.js').TemplateMap} TemplateMap - * @typedef {import('../../types/mcdev.d.js').ContentBlockConversionTypes} ContentBlockConversionTypes */ /** @@ -499,26 +498,34 @@ class TriggeredSend extends MetadataType { * @returns {Promise.} key of the item that was updated */ static async replaceCbReference(item) { - // *** type specific logic *** const parentName = `${this.definition.type} ${item[this.definition.keyField]}`; let changes = false; + let error; + + // *** type specific logic *** try { item.FromName = ReplaceCbReference.replaceReference(item.FromName, parentName); changes = true; - } catch { - // handled via final check on "changes" + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } } try { item.FromAddress = ReplaceCbReference.replaceReference(item.FromAddress, parentName); changes = true; - } catch { - // handled via final check on "changes" + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } } try { item.EmailSubject = ReplaceCbReference.replaceReference(item.EmailSubject, parentName); changes = true; - } catch { - // handled via final check on "changes" + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } } try { item.DynamicEmailSubject = ReplaceCbReference.replaceReference( @@ -526,9 +533,15 @@ class TriggeredSend extends MetadataType { parentName ); changes = true; - } catch { - // handled via final check on "changes" + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } } + if (error) { + throw error; + } + if (!changes) { const ex = new Error('No changes made to the code.'); ex.code = 200; From 798606223daf02fe309283a1a1dd1ce08f183415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 15:03:06 +0200 Subject: [PATCH 320/359] #1270: rcb for senderProfile --- lib/metadataTypes/SenderProfile.js | 65 ++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/lib/metadataTypes/SenderProfile.js b/lib/metadataTypes/SenderProfile.js index 91d331e54..477d67174 100644 --- a/lib/metadataTypes/SenderProfile.js +++ b/lib/metadataTypes/SenderProfile.js @@ -2,6 +2,7 @@ import MetadataType from './MetadataType.js'; import { Util } from '../util/util.js'; +import ReplaceCbReference from '../util/replaceContentBlockReference.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -105,6 +106,70 @@ class SenderProfile extends MetadataType { } return metadata; } + /** + * + * @param {MetadataTypeItem} item single metadata item + * @returns {Promise.} key of the item that was updated + */ + static async replaceCbReference(item) { + const parentName = `${this.definition.type} ${item[this.definition.keyField]}`; + let changes = false; + let error; + + // *** type specific logic *** + try { + item.FromName = ReplaceCbReference.replaceReference(item.FromName, parentName); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + item.FromAddress = ReplaceCbReference.replaceReference(item.FromAddress, parentName); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + item.AutoForwardToEmailAddress = ReplaceCbReference.replaceReference( + item.AutoForwardToEmailAddress, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + item.AutoForwardToName = ReplaceCbReference.replaceReference( + item.AutoForwardToName, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + if (error) { + throw error; + } + + if (!changes) { + const ex = new Error('No changes made to the code.'); + ex.code = 200; + throw ex; + } + + // *** finish *** + // replaceReference will throw an error if nothing was updated which will end execution here + // no error means we have a new item to deploy and need to update the item in our retrieve folder + return item; + } } // Assign definition & cache to static attributes From fe12c3d457811780bbb44cff30676116e3ec6e7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 15:23:20 +0200 Subject: [PATCH 321/359] #1270: improve error handling --- @types/lib/metadataTypes/Journey.d.ts | 30 ++++++++++++++----- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- @types/lib/metadataTypes/TriggeredSend.d.ts | 3 +- .../lib/metadataTypes/TriggeredSend.d.ts.map | 2 +- .../replaceContentBlockReference.d.ts.map | 2 +- lib/util/replaceContentBlockReference.js | 5 ++++ 6 files changed, 31 insertions(+), 13 deletions(-) diff --git a/@types/lib/metadataTypes/Journey.d.ts b/@types/lib/metadataTypes/Journey.d.ts index c320cf370..e93038a18 100644 --- a/@types/lib/metadataTypes/Journey.d.ts +++ b/@types/lib/metadataTypes/Journey.d.ts @@ -91,6 +91,12 @@ declare class Journey extends MetadataType { * @param {MetadataTypeItem} metadata a single item */ private static _preDeployTasks_activities; + /** + * + * @param {MetadataTypeItem} item single metadata item + * @returns {Promise.} key of the item that was updated + */ + static replaceCbReference(item: MetadataTypeItem): Promise; } declare namespace Journey { let definition: { @@ -109,7 +115,15 @@ declare namespace Journey { lastmodNameField: any; restPagination: boolean; restPageSize: number; - type: string; + type: string; /** + * Retrieves Metadata of Journey + * + * @param {string} retrieveDir Directory where retrieved metadata directory will be saved + * @param {void | string[]} [_] unused parameter + * @param {void | string[]} [__] unused parameter + * @param {string} [key] customer key of single item to retrieve + * @returns {Promise.} Promise + */ typeDescription: string; typeRetrieveByDefault: boolean; typeName: string; @@ -349,7 +363,12 @@ declare namespace Journey { isUpdateable: boolean; retrieving: boolean; template: boolean; - }; + }; /** + * Delete a metadata item from the specified business unit + * + * @param {string} key Identifier of item + * @returns {Promise.} deletion success status + */ 'triggers[].configurationArguments.relatedObjectFilterCriteria': { isCreateable: boolean; isUpdateable: boolean; @@ -474,12 +493,7 @@ declare namespace Journey { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; - template: boolean; /** - * Creates a single item - * - * @param {MetadataTypeItem} metadata a single item - * @returns {Promise} Promise - */ + template: boolean; }; 'triggers[].metaData.iconUrl': { isCreateable: boolean; diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map index 3bb13b4f9..ed46aa996 100644 --- a/@types/lib/metadataTypes/Journey.d.ts.map +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBASa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiIxC;IA6ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAkBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA2J5B;IACD;;;;;OAKG;IACH,6CAiVC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAiHtC;IAED;;;;;OAKG;IACH,0CAkLC;CAoDJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAh5BG;;;;;mBAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArQkB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,w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;;yBA5KkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts b/@types/lib/metadataTypes/TriggeredSend.d.ts index f554192f8..cc4d10f36 100644 --- a/@types/lib/metadataTypes/TriggeredSend.d.ts +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts @@ -656,8 +656,7 @@ declare namespace TriggeredSend { skipValidation: boolean; }; c__priority: { - /** @type {SoapRequestParams} */ - skipValidation: boolean; + skipValidation: boolean; /** @type {SoapRequestParams} */ }; r__sendClassification_key: { skipValidation: boolean; diff --git a/@types/lib/metadataTypes/TriggeredSend.d.ts.map b/@types/lib/metadataTypes/TriggeredSend.d.ts.map index 23ad5e45d..dd77f9dce 100644 --- a/@types/lib/metadataTypes/TriggeredSend.d.ts.map +++ b/@types/lib/metadataTypes/TriggeredSend.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAWa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,g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CAAgC;;;;;;;;;;;;yBA7Xf,mBAAmB"} \ No newline at end of file +{"version":3,"file":"TriggeredSend.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/TriggeredSend.js"],"names":[],"mappings":";uBAWa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CA2BxC;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAO1B;IAYD;;;;;OAKG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,GAAG,IAAI,CAwGnC;IACD;;;;;OAKG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAqFtC;IACD;;;;;;OAMG;IACH,wBAJW,MAAM,EAAE,aACR,OAAO,GACL,QAAS,IAAI,CAAC,CAkB1B;IAED;;;;;OAKG;IACH,qCAHW,eAAe,GACb,QAAS,MAAM,EAAE,CAAC,CAS9B;IACD;;;;;OAKG;IACH,0CAHW,OAAO,GACL,QAAS,kBAAkB,CAAC,CAqDxC;IAED;;;;;;OAMG;IACH,yBAJW,MAAM,YACN,OAAO,GACL,QAAS,OAAO,CAAC,CA8F7B;IACD;;;;OAIG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAyDtC;CACJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uCApgBO,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eA0DpC;;;;;eAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yCAyRC,gCAAgC;;;;;;;;;;;yBA7Xf,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index 91d9e1313..e82bb5eee 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE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AO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAkCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA8ClB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAtOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 908c647a6..2af38da56 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -47,6 +47,8 @@ export default class ReplaceContentBlockReference { }; /** @type {{id: RegExp[], key: RegExp[], name: RegExp[]}} */ static #regexBy = { + // TODO: handle cases in which variables or functions are passed into ContentBlockByX + amp: { id: [ /ContentBlockById\(\s*"([0-9]+)"\s*\)/gim, @@ -89,6 +91,9 @@ export default class ReplaceContentBlockReference { * @returns {string} replaced string */ static replaceReference(str, parentName, fromList, to) { + if (!str) { + return str; + } fromList ||= Util.OPTIONS.referenceFrom; to ||= Util.OPTIONS.referenceTo; let result = str; From fab55ecd28d28fcc1aded727ce88d277aba7e61b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 15:25:20 +0200 Subject: [PATCH 322/359] #0: chores --- lib/metadataTypes/definitions/TriggeredSend.definition.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/metadataTypes/definitions/TriggeredSend.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js index 59c75a681..d57bad0ad 100644 --- a/lib/metadataTypes/definitions/TriggeredSend.definition.js +++ b/lib/metadataTypes/definitions/TriggeredSend.definition.js @@ -360,6 +360,7 @@ export default { templating: false, }, PreHeader: { + // not supported by API isCreateable: false, isUpdateable: false, retrieving: false, From 25fcca2474bdf5c3539d07b007a52969f8d943a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 15:58:39 +0200 Subject: [PATCH 323/359] #1270: rcb support for journey --- @types/lib/metadataTypes/Journey.d.ts.map | 2 +- .../replaceContentBlockReference.d.ts.map | 2 +- lib/metadataTypes/Journey.js | 122 ++++++++++++++++++ 3 files changed, 124 insertions(+), 2 deletions(-) diff --git a/@types/lib/metadataTypes/Journey.d.ts.map b/@types/lib/metadataTypes/Journey.d.ts.map index ed46aa996..ab961a9d3 100644 --- a/@types/lib/metadataTypes/Journey.d.ts.map +++ b/@types/lib/metadataTypes/Journey.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;gCACnD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;AAVzD;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,IAAI,GAAG,MAAM,EAAE,OACf,IAAI,GAAG,MAAM,EAAE,QACf,MAAM,GACJ,QAAS,kBAAkB,CAAC,CAiIxC;IA6ED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAS1B;IAED;;;;;OAKG;IACH,wBAHW,gBAAgB,gBAK1B;IAkBD;;;;OAIG;IACH,2CAFW,eAAe,iBAmBzB;IAED;;;;;;OAMG;IACH,mCAHW,gBAAgB,GACd,gBAAgB,CA2J5B;IACD;;;;;OAKG;IACH,6CAiVC;IAED;;;;;;OAMG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CAiHtC;IAED;;;;;OAKG;IACH,0CAkLC;IAoDD;;;;OAIG;IACH,gCAHW,gBAAgB,GACd,QAAS,gBAAgB,CAAC,CA0GtC;CACJ;;;;;;;;;;;;;;;;;;sBAjuCG;;;;;;;;WAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAiIH;;;;;eAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA5KkB,mBAAmB"} \ No newline at end of file +{"version":3,"file":"Journey.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Journey.js"],"names":[],"mappings":";uBAUa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACr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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA5KkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index e82bb5eee..c57e94db7 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAkCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA8ClB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAtOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAkCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CAgDlB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAxOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/lib/metadataTypes/Journey.js b/lib/metadataTypes/Journey.js index a4caf3236..5e318d1c7 100644 --- a/lib/metadataTypes/Journey.js +++ b/lib/metadataTypes/Journey.js @@ -5,6 +5,7 @@ import TransactionalEmail from './TransactionalEmail.js'; import { Util } from '../util/util.js'; import cache from '../util/cache.js'; import File from '../util/file.js'; +import ReplaceCbReference from '../util/replaceContentBlockReference.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -1168,6 +1169,127 @@ class Journey extends MetadataType { } return action; } + /** + * + * @param {MetadataTypeItem} item single metadata item + * @returns {Promise.} key of the item that was updated + */ + static async replaceCbReference(item) { + const parentName = `${this.definition.type} ${item[this.definition.keyField]}`; + let changes = false; + let error; + + // *** type specific logic ** + + // find email activities with triggeredSend configurationArguments + const activities = item.activities.filter((activity) => activity.type === 'EMAILV2'); + if (!activities) { + const ex = new Error('No changes made to the code.'); + ex.code = 200; + throw ex; + } + + for (const activity of activities) { + if (activity.arguments) { + try { + activity.arguments.emailSubjectDataBound = ReplaceCbReference.replaceReference( + activity.arguments.emailSubjectDataBound, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + } + const triggeredSend = activity.configurationArguments?.triggeredSend; + if (triggeredSend) { + // the following is very similar but not equal to the variables in TriggeredSend.js + try { + triggeredSend.bccEmail = ReplaceCbReference.replaceReference( + triggeredSend.bccEmail, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + triggeredSend.ccEmail = ReplaceCbReference.replaceReference( + triggeredSend.ccEmail, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + triggeredSend.dynamicEmailSubject = ReplaceCbReference.replaceReference( + triggeredSend.dynamicEmailSubject, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + triggeredSend.emailSubject = ReplaceCbReference.replaceReference( + triggeredSend.emailSubject, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + triggeredSend.preHeader = ReplaceCbReference.replaceReference( + triggeredSend.preHeader, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + try { + triggeredSend.exclusionFilter = ReplaceCbReference.replaceReference( + triggeredSend.exclusionFilter, + parentName + ); + changes = true; + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + } + } + + if (error) { + throw error; + } + + if (!changes) { + const ex = new Error('No changes made to the code.'); + ex.code = 200; + throw ex; + } + + // *** finish *** + // replaceReference will throw an error if nothing was updated which will end execution here + // no error means we have a new item to deploy and need to update the item in our retrieve folder + return item; + } } // Assign definition to static attributes From 473c97008990d23380b593221aeda6477ac3ba1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 16:01:04 +0200 Subject: [PATCH 324/359] #1270: improve error handling --- lib/util/replaceContentBlockReference.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 2af38da56..53a38942c 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -92,7 +92,9 @@ export default class ReplaceContentBlockReference { */ static replaceReference(str, parentName, fromList, to) { if (!str) { - return str; + const ex = new Error('No string provided'); + ex.code = 200; + throw ex; } fromList ||= Util.OPTIONS.referenceFrom; to ||= Util.OPTIONS.referenceTo; From 88660ea3fd0c60c56cabd9a71b7d5c0309ad9cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 16:32:12 +0200 Subject: [PATCH 325/359] #1270: async fix --- @types/lib/metadataTypes/Asset.d.ts | 78 +++++++++---------------- @types/lib/metadataTypes/Asset.d.ts.map | 2 +- lib/metadataTypes/MetadataType.js | 2 +- 3 files changed, 30 insertions(+), 52 deletions(-) diff --git a/@types/lib/metadataTypes/Asset.d.ts b/@types/lib/metadataTypes/Asset.d.ts index d007587b9..52cec3872 100644 --- a/@types/lib/metadataTypes/Asset.d.ts +++ b/@types/lib/metadataTypes/Asset.d.ts @@ -362,6 +362,19 @@ declare class Asset extends MetadataType { * @returns {Promise.} JS object of the asset we loaded from disk */ static "__#2@#getJson"(subType: string, item: object): Promise; + /** + * + * @param {MetadataTypeItem} item single metadata item + * @param {string} retrieveDir directory where metadata is saved + * @returns {Promise.} key of the item that was updated + */ + static replaceCbReference(item: MetadataTypeItem, retrieveDir: string): Promise; + /** + * empty dummy method as assets are note saved via the central method + * + * @returns {MetadataTypeItem} saved metadata + */ + static saveToDisk(): MetadataTypeItem; } declare namespace Asset { let definition: { @@ -388,11 +401,6 @@ declare namespace Asset { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; - /** - * FileTransfer MetadataType - * - * @augments MetadataType - */ template: boolean; }; allowedBlocks: { @@ -477,15 +485,7 @@ declare namespace Asset { template: boolean; }; content: { - isCreateable: boolean; /** - * Helper for writing Metadata to disk, used for Retrieve and deploy - * - * @param {MetadataTypeMap} results metadata results from deploy - * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve - * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) - * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata - * @returns {Promise.} Promise of saved metadata - */ + isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; template: boolean; @@ -549,16 +549,16 @@ declare namespace Asset { }; 'data.email.legacy': { isCreateable: boolean; - isUpdateable: boolean; /** - * Retrieves asset metadata for caching - * - * @param {void | string[]} [_] parameter not used - * @param {string[]} [subTypeArr] optionally limit to a single subtype - * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise - */ + isUpdateable: boolean; retrieving: boolean; template: boolean; - }; + }; /** + * Retrieves asset metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise + */ 'data.email.options': { skipValidation: boolean; }; @@ -570,15 +570,6 @@ declare namespace Asset { }; description: { isCreateable: boolean; - /** - * Retrieves asset metadata for templating - * - * @param {string} templateDir Directory where retrieved metadata directory will be saved - * @param {string} name name of the metadata file - * @param {TemplateMap} templateVariables variables to be replaced in the metadata - * @param {AssetSubType} [selectedSubType] optionally limit to a single subtype - * @returns {Promise.<{metadata: AssetItem, type: string}>} Promise - */ isUpdateable: boolean; retrieving: boolean; template: boolean; @@ -671,12 +662,7 @@ declare namespace Asset { isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; - template: boolean; /** - * Creates a single asset - * - * @param {AssetItem} metadata a single asset - * @returns {Promise} Promise - */ + template: boolean; }; memberId: { isCreateable: boolean; @@ -700,15 +686,7 @@ declare namespace Asset { template: boolean; }; 'modifiedBy.id': { - isCreateable: boolean; /** - * Retrieves Metadata of a specific asset type - * - * @param {string} subType group of similar assets to put in a folder (ie. images) - * @param {string} [retrieveDir] target directory for saving assets - * @param {string} [key] key/id/name to filter by - * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata - * @returns {Promise.} Promise - */ + isCreateable: boolean; isUpdateable: boolean; retrieving: boolean; template: boolean; @@ -1035,6 +1013,10 @@ declare namespace Asset { jar: number; rar: number; tar: number; + zip: number; + gpg: number; + htm: number; + html: number; /** * Some metadata types store their actual content as a separate file, e.g. images * This method retrieves these and saves them alongside the metadata json @@ -1044,10 +1026,6 @@ declare namespace Asset { * @param {string} retrieveDir target directory for saving assets * @returns {Promise.} - */ - zip: number; - gpg: number; - htm: number; - html: number; xhtml: number; xht: number; css: number; diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map index 69e44b6db..bab07a7f0 100644 --- a/@types/lib/metadataTypes/Asset.d.ts.map +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAYa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAwXH;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArfkB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/MetadataType.js b/lib/metadataTypes/MetadataType.js index eae339c33..3ccbeb148 100644 --- a/lib/metadataTypes/MetadataType.js +++ b/lib/metadataTypes/MetadataType.js @@ -515,7 +515,7 @@ class MetadataType { try { // add key but make sure to turn it into string or else numeric keys will be filtered later deployMap[key] = await this.replaceCbReference(item, retrieveDir); - this.saveToDisk(deployMap, key, baseDir); + await this.saveToDisk(deployMap, key, baseDir); keysForDeploy.push(key + ''); Util.logger.info(` - added ${this.definition.type} to update queue: ${key}`); From 2ce42c90ad17b679164fe9955f70951191dbd884 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 16:35:30 +0200 Subject: [PATCH 326/359] #1270: rcb support for asset --- lib/metadataTypes/Asset.js | 70 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 6334e21fa..a2d0d65ea 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -8,6 +8,7 @@ import cliProgress from 'cli-progress'; import cache from '../util/cache.js'; import TriggeredSend from './TriggeredSend.js'; import Folder from './Folder.js'; +import ReplaceCbReference from '../util/replaceContentBlockReference.js'; /** * @typedef {import('../../types/mcdev.d.js').BuObject} BuObject @@ -2099,6 +2100,75 @@ class Asset extends MetadataType { const fileContent = await File.readJSONFile(pathArr.join('/'), fileName, false); return fileContent; } + /** + * + * @param {MetadataTypeItem} item single metadata item + * @param {string} retrieveDir directory where metadata is saved + * @returns {Promise.} key of the item that was updated + */ + static async replaceCbReference(item, retrieveDir) { + const responseItem = structuredClone(item); + const parentName = `${this.definition.type} ${item[this.definition.keyField]}`; + let changes = false; + let error; + + // *** type specific logic *** + const subType = this.#getMainSubtype(item.assetType.name); + /** @type {CodeExtract[]} */ + const fileList = await this._mergeCode( + item, + retrieveDir, + subType, + item[this.definition.keyField], + false + ); + const fileListChanged = []; + for (const file of fileList) { + try { + file.content = ReplaceCbReference.replaceReference(file.content, parentName); + changes = true; + fileListChanged.push(file); + } catch (ex) { + if (ex.code !== 200) { + error = ex; + } + } + } + + // save what was changed regardless of other errors + for (const extractedFile of fileListChanged) { + File.writeToFile( + [retrieveDir, ...extractedFile.subFolder], + extractedFile.fileName, + extractedFile.fileExt, + extractedFile.content, + extractedFile.encoding || null + ); + } + + if (error) { + throw error; + } + + if (!changes) { + const ex = new Error('No changes made to the code.'); + ex.code = 200; + throw ex; + } + + // *** finish *** + // replaceReference will throw an error if nothing was updated which will end execution here + // no error means we have a new item to deploy and need to update the item in our retrieve folder + return responseItem; + } + /** + * empty dummy method as assets are note saved via the central method + * + * @returns {MetadataTypeItem} saved metadata + */ + static async saveToDisk() { + return; + } } // Assign definition to static attributes From 2488fd6a176686342870241493f530614ddc4c89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 20:20:47 +0200 Subject: [PATCH 327/359] #1270: tests fixed for preheader extraction / 1987f5a2f8547ca6efe20dd5e91deb7ed3f514f8 --- @types/lib/index.d.ts.map | 2 +- @types/lib/metadataTypes/Asset.d.ts | 6 - @types/lib/metadataTypes/Asset.d.ts.map | 2 +- .../replaceContentBlockReference.d.ts.map | 2 +- .../build-templatebasedemail-expected.json | 1 - ...ild-templatebasedemail-html-expected.html} | 0 ...templatebasedemail-preheader-expected.html | 1 + .../retrieve-templatebasedemail-expected.json | 1 - ...eve-templatebasedemail-html-expected.html} | 0 ...templatebasedemail-preheader-expected.html | 1 + .../template-templatebasedemail-expected.json | 1 - ...late-templatebasedemail-html-expected.html | 20 +++ ...templatebasedemail-preheader-expected.html | 1 + test/type.asset.test.js | 114 ++++++++++++++---- 14 files changed, 117 insertions(+), 35 deletions(-) rename test/resources/9999999/asset/{build-templatebasedemail-expected.html => build-templatebasedemail-html-expected.html} (100%) create mode 100644 test/resources/9999999/asset/build-templatebasedemail-preheader-expected.html rename test/resources/9999999/asset/{template-templatebasedemail-expected.html => retrieve-templatebasedemail-html-expected.html} (100%) create mode 100644 test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.html create mode 100644 test/resources/9999999/asset/template-templatebasedemail-html-expected.html create mode 100644 test/resources/9999999/asset/template-templatebasedemail-preheader-expected.html diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 124937c9f..7254847f3 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAm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D9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;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set.d.ts b/@types/lib/metadataTypes/Asset.d.ts index 52cec3872..6fe8b7f57 100644 --- a/@types/lib/metadataTypes/Asset.d.ts +++ b/@types/lib/metadataTypes/Asset.d.ts @@ -369,12 +369,6 @@ declare class Asset extends MetadataType { * @returns {Promise.} key of the item that was updated */ static replaceCbReference(item: MetadataTypeItem, retrieveDir: string): Promise; - /** - * empty dummy method as assets are note saved via the central method - * - * @returns {MetadataTypeItem} saved metadata - */ - static saveToDisk(): MetadataTypeItem; } declare namespace Asset { let definition: { diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map index bab07a7f0..1a3d18b03 100644 --- a/@types/lib/metadataTypes/Asset.d.ts.map +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAaa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;iCAC1C,OAAO,wBAAwB,EAAE,kBAAkB;AAdhE;;;;;;;;;GASG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;OAQG;IACH,6BANW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,QACR,MAAM,GACJ,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CA+Bx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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBArfkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index c57e94db7..8b71cb906 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAkCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CAgDlB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAxOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAkCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA0ClB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAlOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/test/resources/9999999/asset/build-templatebasedemail-expected.json b/test/resources/9999999/asset/build-templatebasedemail-expected.json index 9bcbdc340..8cae6d6b3 100644 --- a/test/resources/9999999/asset/build-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/build-templatebasedemail-expected.json @@ -19,7 +19,6 @@ "preheader": { "contentType": "application/vnd.etmc.email.View; kind=preheader", "thumbnail": {}, - "content": "my custom preheader text", "availableViews": [], "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/asset/build-templatebasedemail-expected.html b/test/resources/9999999/asset/build-templatebasedemail-html-expected.html similarity index 100% rename from test/resources/9999999/asset/build-templatebasedemail-expected.html rename to test/resources/9999999/asset/build-templatebasedemail-html-expected.html diff --git a/test/resources/9999999/asset/build-templatebasedemail-preheader-expected.html b/test/resources/9999999/asset/build-templatebasedemail-preheader-expected.html new file mode 100644 index 000000000..6a942e2ce --- /dev/null +++ b/test/resources/9999999/asset/build-templatebasedemail-preheader-expected.html @@ -0,0 +1 @@ +my custom preheader text diff --git a/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json index e5b47fbc7..a5b0516c6 100644 --- a/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/retrieve-templatebasedemail-expected.json @@ -22,7 +22,6 @@ "preheader": { "contentType": "application/vnd.etmc.email.View; kind=preheader", "thumbnail": {}, - "content": "my custom preheader text", "availableViews": [], "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/asset/template-templatebasedemail-expected.html b/test/resources/9999999/asset/retrieve-templatebasedemail-html-expected.html similarity index 100% rename from test/resources/9999999/asset/template-templatebasedemail-expected.html rename to test/resources/9999999/asset/retrieve-templatebasedemail-html-expected.html diff --git a/test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.html b/test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.html new file mode 100644 index 000000000..6a942e2ce --- /dev/null +++ b/test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.html @@ -0,0 +1 @@ +my custom preheader text diff --git a/test/resources/9999999/asset/template-templatebasedemail-expected.json b/test/resources/9999999/asset/template-templatebasedemail-expected.json index 196b64a83..90e42abbc 100644 --- a/test/resources/9999999/asset/template-templatebasedemail-expected.json +++ b/test/resources/9999999/asset/template-templatebasedemail-expected.json @@ -19,7 +19,6 @@ "preheader": { "contentType": "application/vnd.etmc.email.View; kind=preheader", "thumbnail": {}, - "content": "my custom preheader text", "availableViews": [], "data": { "email": { "options": { "generateFrom": null } } }, "modelVersion": 2 diff --git a/test/resources/9999999/asset/template-templatebasedemail-html-expected.html b/test/resources/9999999/asset/template-templatebasedemail-html-expected.html new file mode 100644 index 000000000..5ae3b84c4 --- /dev/null +++ b/test/resources/9999999/asset/template-templatebasedemail-html-expected.html @@ -0,0 +1,20 @@ +Update Profile + + + + +
+ This email was sent by: %%Member_Busname%%
%%Member_Addr%% + %%Member_City%%, %%Member_State%%, %%Member_PostalCode%%, %%Member_Country%%

+
+Manage Subscriptions diff --git a/test/resources/9999999/asset/template-templatebasedemail-preheader-expected.html b/test/resources/9999999/asset/template-templatebasedemail-preheader-expected.html new file mode 100644 index 000000000..6a942e2ce --- /dev/null +++ b/test/resources/9999999/asset/template-templatebasedemail-preheader-expected.html @@ -0,0 +1 @@ +my custom preheader text diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 05fef71e3..aeaf8f14f 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -37,15 +37,18 @@ async function getActualJson(customerKey, type, subtype, buName = 'testBU') { * @param {string} type of metadata * @param {string} subtype of metadata * @param {string} ext file extension + * @param {string} [filename] optional fileprefix that differs from customerKey * @param {string} [buName] used when we need to test on ParentBU * @returns {Promise.} file path */ -async function getActualFile(customerKey, type, subtype, ext, buName = 'testBU') { +async function getActualFile(customerKey, type, subtype, ext, filename, buName = 'testBU') { const path = `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; + const pathSub = `./retrieve/testInstance/${buName}/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}`; + try { - return await File.readFile(path, 'utf8'); + return await File.readFile(filename ? pathSub : path, 'utf8'); } catch { - console.log(`File not found: ${path}`); // eslint-disable-line no-console + console.log(`File not found: ${filename ? pathSub : path}`); // eslint-disable-line no-console return null; } } @@ -79,16 +82,17 @@ async function getActualTemplateJson(customerKey, type, subtype) { * @returns {Promise.} file */ async function getActualTemplateFile(customerKey, type, subtype, ext, filename) { - return filename - ? File.readFile( - `./template/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}`, - 'utf8' - ) - : File.readFile( - `./template/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`, - 'utf8' - ); + const path = `./template/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; + const pathSub = `./template/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}`; + + try { + return File.readFile(filename ? pathSub : path, 'utf8'); + } catch { + console.log(`File not found: ${filename ? pathSub : path}`); // eslint-disable-line no-console + return null; + } } + /** * gets file from Deploy folder * @@ -121,15 +125,15 @@ async function getActualDeployJson(customerKey, type, subtype, buName = 'testBU' * @returns {Promise.} file content */ async function getActualDeployFile(customerKey, type, subtype, ext, filename, buName = 'testBU') { - return filename - ? File.readFile( - `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}`, - 'utf8' - ) - : File.readFile( - `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`, - 'utf8' - ); + const path = `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; + const pathSub = `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}/${filename}.${type}-${subtype}-meta.${ext}`; + + try { + return File.readFile(filename ? pathSub : path, 'utf8'); + } catch { + console.log(`File not found: ${filename ? pathSub : path}`); // eslint-disable-line no-console + return null; + } } describe('type: asset', () => { @@ -177,6 +181,38 @@ describe('type: asset', () => { await testUtils.getExpectedJson('9999999', 'asset', 'retrieve-templatebasedemail'), 'returned metadata was not equal expected' ); + expect( + await getActualFile( + 'testExisting_asset_templatebasedemail', + 'asset', + 'message', + 'html', + 'views.html.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'retrieve-templatebasedemail-html', + 'html' + ) + ); + expect( + await getActualFile( + 'testExisting_asset_templatebasedemail', + 'asset', + 'message', + 'html', + 'views.preheader.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'retrieve-templatebasedemail-preheader', + 'html' + ) + ); assert.equal( testUtils.getAPIHistoryLength(), @@ -349,7 +385,23 @@ describe('type: asset', () => { await testUtils.getExpectedFile( '9999999', 'asset', - 'template-templatebasedemail', + 'template-templatebasedemail-html', + 'html' + ) + ); + expect( + await getActualTemplateFile( + 'testExisting_asset_templatebasedemail', + 'asset', + 'message', + 'html', + 'views.preheader.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'template-templatebasedemail-preheader', 'html' ) ); @@ -383,7 +435,23 @@ describe('type: asset', () => { await testUtils.getExpectedFile( '9999999', 'asset', - 'build-templatebasedemail', + 'build-templatebasedemail-html', + 'html' + ) + ); + expect( + await getActualDeployFile( + 'testTemplated_asset_templatebasedemail', + 'asset', + 'message', + 'html', + 'views.preheader.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'build-templatebasedemail-preheader', 'html' ) ); From 744b0fc8216903f47d08402085fe9bbc623849a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 20:46:12 +0200 Subject: [PATCH 328/359] #1270: ensure Asset.retrieve() returns the extended json and not just the simplified caching version --- @types/lib/index.d.ts.map | 2 +- @types/lib/metadataTypes/Asset.d.ts | 53 ++++++++++++++----------- @types/lib/metadataTypes/Asset.d.ts.map | 2 +- lib/metadataTypes/Asset.js | 18 +++++---- 4 files changed, 43 insertions(+), 32 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 7254847f3..ba0e8713d 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.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B,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,E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;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAwE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Asset.d.ts b/@types/lib/metadataTypes/Asset.d.ts index 6fe8b7f57..eba2485ee 100644 --- a/@types/lib/metadataTypes/Asset.d.ts +++ b/@types/lib/metadataTypes/Asset.d.ts @@ -114,9 +114,9 @@ declare class Asset extends MetadataType { * @param {string} subType group of similar assets to put in a folder (ie. images) * @param {string} retrieveDir target directory for saving assets * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata - * @returns {Promise} Promise + * @returns {Promise.} Promise */ - static requestAndSaveExtended(items: any[], subType: string, retrieveDir: string, templateVariables?: TemplateMap): Promise; + static requestAndSaveExtended(items: any[], subType: string, retrieveDir: string, templateVariables?: TemplateMap): Promise; /** * helper that reset the log level and prints errors * @@ -546,15 +546,15 @@ declare namespace Asset { isUpdateable: boolean; retrieving: boolean; template: boolean; - }; /** - * Retrieves asset metadata for caching - * - * @param {void | string[]} [_] parameter not used - * @param {string[]} [subTypeArr] optionally limit to a single subtype - * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise - */ + }; 'data.email.options': { - skipValidation: boolean; + skipValidation: boolean; /** + * Retrieves asset metadata for caching + * + * @param {void | string[]} [_] parameter not used + * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise + */ }; 'data.portfolio': { isCreateable: boolean; @@ -570,7 +570,15 @@ declare namespace Asset { }; design: { isCreateable: boolean; - isUpdateable: boolean; + isUpdateable: boolean; /** + * Retrieves asset metadata for templating + * + * @param {string} templateDir Directory where retrieved metadata directory will be saved + * @param {string} name name of the metadata file + * @param {TemplateMap} templateVariables variables to be replaced in the metadata + * @param {AssetSubType} [selectedSubType] optionally limit to a single subtype + * @returns {Promise.<{metadata: AssetItem, type: string}>} Promise + */ retrieving: boolean; template: boolean; }; @@ -712,7 +720,7 @@ declare namespace Asset { objectID: { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; + retrieving: boolean; /** @type {AssetSubType[]} */ template: boolean; }; owner: { @@ -724,7 +732,7 @@ declare namespace Asset { 'owner.email': { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; + retrieving: boolean; /** @type {AssetRequestParams} */ template: boolean; }; 'owner.id': { @@ -1011,15 +1019,6 @@ declare namespace Asset { gpg: number; htm: number; html: number; - /** - * Some metadata types store their actual content as a separate file, e.g. images - * This method retrieves these and saves them alongside the metadata json - * - * @param {AssetItem} metadata a single asset - * @param {string} subType group of similar assets to put in a folder (ie. images) - * @param {string} retrieveDir target directory for saving assets - * @returns {Promise.} - - */ xhtml: number; xht: number; css: number; @@ -1038,7 +1037,15 @@ declare namespace Asset { fla: number; eml: number; text: number; - txt: number; + txt: number; /** + * Some metadata types store their actual content as a separate file, e.g. images + * This method retrieves these and saves them alongside the metadata json + * + * @param {AssetItem} metadata a single asset + * @param {string} subType group of similar assets to put in a folder (ie. images) + * @param {string} retrieveDir target directory for saving assets + * @returns {Promise.} - + */ freeformblock: number; textblock: number; htmlblock: number; diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map index 1a3d18b03..17b248c6c 100644 --- a/@types/lib/metadataTypes/Asset.d.ts.map +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAaa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAA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;;;;;;;;;;;;;;;uCAMH;;;;;;;;mBAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAsFC,6BAA6B;;;;;;;;;;;;qCAM7B,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAmRrC;;;;;;;;eAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA3fkB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index a2d0d65ea..ca5cedb55 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -352,7 +352,7 @@ class Asset extends MetadataType { * @param {string} subType group of similar assets to put in a folder (ie. images) * @param {string} retrieveDir target directory for saving assets * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata - * @returns {Promise} Promise + * @returns {Promise.} Promise */ static async requestAndSaveExtended(items, subType, retrieveDir, templateVariables) { // disable CLI logs other than error while retrieving subtype @@ -372,6 +372,8 @@ class Asset extends MetadataType { const completed = []; const failed = []; + const metadataMap = {}; + // put in do loop to manage issues with connection timeout do { // use promise execution limiting to avoid rate limits on api, but speed up execution @@ -381,9 +383,8 @@ class Asset extends MetadataType { const rateLimit = pLimit(5); const promiseMap = await Promise.all( - items.map((item) => + items.map((item, index) => rateLimit(async () => { - const metadata = {}; // this is a file so extended is at another endpoint if (item?.fileProperties?.extension && !completed.includes(item.id)) { try { @@ -393,7 +394,7 @@ class Asset extends MetadataType { failed.push({ item: item, error: ex }); } // even if the extended file failed, still save the metadata - metadata[item.customerKey] = item; + metadataMap[item.customerKey] = item; } // this is a complex type which stores data in the asset itself else if (!completed.includes(item.id)) { @@ -402,15 +403,17 @@ class Asset extends MetadataType { 'asset/v1/content/assets/' + item.id ); // only save the metadata if we have extended content - metadata[item.customerKey] = extendedItem; + metadataMap[item.customerKey] = extendedItem; + // overwrite the original item with the extended content to ensure retrieve() returns it + items[index] = extendedItem; } catch (ex) { failed.push({ item: item, error: ex }); } } completed.push(item.id); - if (metadata[item.customerKey]) { + if (metadataMap[item.customerKey]) { await this.saveResults( - metadata, + metadataMap, retrieveDir, 'asset-' + subType, templateVariables @@ -435,6 +438,7 @@ class Asset extends MetadataType { } } } while (completed.length === items.length); + return metadataMap; } /** From e67fb49cc73b7e90a99c0fa477162ff293fa0d28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 20:50:29 +0200 Subject: [PATCH 329/359] #1270: prevent saving in loop for type asset as thats done in Asset.replaceCbReference() --- lib/metadataTypes/Asset.js | 61 +++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 4 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index ca5cedb55..1bbf99090 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -2166,12 +2166,65 @@ class Asset extends MetadataType { return responseItem; } /** - * empty dummy method as assets are note saved via the central method + * this iterates over all items found in the retrieve folder and executes the type-specific method for replacing references * - * @returns {MetadataTypeItem} saved metadata + * @param {MetadataTypeMap} metadataMap list of metadata (keyField => metadata) + * @param {string} retrieveDir retrieve dir including cred and bu + * @returns {Promise.} Returns list of keys for which references were replaced */ - static async saveToDisk() { - return; + static async replaceCbReferenceLoop(metadataMap, retrieveDir) { + const keysForDeploy = []; + if (!metadataMap) { + // if a type was skipped e.g. because it shall only be looked at on the parent then we would expect metadataMap to be undefined + return keysForDeploy; + } + + const fromDescription = Util.OPTIONS.referenceFrom + .map((from) => 'ContentBlockBy' + Util.capitalizeFirstLetter(from)) + .join(' and '); + + if (Object.keys(metadataMap).length) { + Util.logger.info(`Searching ${this.definition.type} for ${fromDescription}:`); + // const baseDir = [retrieveDir, ...this.definition.type.split('-')]; + const deployMap = {}; + + for (const key in metadataMap) { + const item = metadataMap[key]; + if (this.isFiltered(item, true) || this.isFiltered(item, false)) { + // we would not have saved these items to disk but they exist in the cache and hence need to be skipped here + + continue; + } + + try { + // add key but make sure to turn it into string or else numeric keys will be filtered later + deployMap[key] = await this.replaceCbReference(item, retrieveDir); + + // ! this method is equal to the super version except that it does not run saveToDisk here + // await this.saveToDisk(deployMap, key, baseDir); + + keysForDeploy.push(key + ''); + Util.logger.info(` - added ${this.definition.type} to update queue: ${key}`); + } catch (ex) { + if (ex.code !== 200) { + // dont print error if we simply did not find relevant content blocks + Util.logger.errorStack(ex, ex.message); + } + Util.logger.info( + Util.getGrayMsg( + ` ☇ skipping ${this.definition.type} ${ + item[this.definition.keyField] + }: no ${fromDescription} found` + ) + ); + } + } + + Util.logger.info( + `Found ${keysForDeploy.length} ${this.definition.type}${keysForDeploy.length === 1 ? '' : 's'} to update` + ); + } + return keysForDeploy; } } From 7e73522fdae76fa736b8b0a6bb571bdb33a2f574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 22:51:40 +0200 Subject: [PATCH 330/359] #1270: include shared assets in assetCacheMap for reference replacements --- @types/lib/index.d.ts.map | 2 +- @types/lib/metadataTypes/Asset.d.ts | 58 +++++++++---------- @types/lib/metadataTypes/Asset.d.ts.map | 2 +- .../replaceContentBlockReference.d.ts.map | 2 +- lib/metadataTypes/Asset.js | 15 +++-- lib/util/replaceContentBlockReference.js | 29 ++++++++++ 6 files changed, 67 insertions(+), 41 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index ba0e8713d..7254847f3 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL,IAAI,CAIhB;IACD;;;;;OAKG;IACH,wBAHW,MAAM,GACJ,IAAI,CA2ChB;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AQG;IACH,wCANW,MAAM,oBACN,YAAY,MACZ,MAAM,aACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAoF7C;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAwE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BAC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SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/@types/lib/metadataTypes/Asset.d.ts b/@types/lib/metadataTypes/Asset.d.ts index eba2485ee..e74c98598 100644 --- a/@types/lib/metadataTypes/Asset.d.ts +++ b/@types/lib/metadataTypes/Asset.d.ts @@ -40,9 +40,10 @@ declare class Asset extends MetadataType { * @param {void | string[]} _ unused parameter * @param {string[]} [subTypeArr] optionally limit to a single AssetSubType * @param {string} [key] customer key + * @param {boolean} [loadShared] optionally retrieve assets from other BUs that were shared with the current * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ - static retrieve(retrieveDir: string, _: void | string[], subTypeArr?: string[], key?: string): Promise<{ + static retrieve(retrieveDir: string, _: void | string[], subTypeArr?: string[], key?: string, loadShared?: boolean): Promise<{ metadata: AssetMap; type: string; }>; @@ -57,9 +58,10 @@ declare class Asset extends MetadataType { * * @param {void | string[]} [_] parameter not used * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @param {boolean} [loadShared] optionally retrieve assets from other BUs that were shared with the current * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ - static retrieveForCache(_?: void | string[], subTypeArr?: string[]): Promise<{ + static retrieveForCache(_?: void | string[], subTypeArr?: string[], loadShared?: boolean): Promise<{ metadata: AssetMap; type: string; }>; @@ -104,9 +106,10 @@ declare class Asset extends MetadataType { * @param {string} [retrieveDir] target directory for saving assets * @param {string} [key] key/id/name to filter by * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @param {boolean} [loadShared] optionally retrieve assets from other BUs that were shared with the current * @returns {Promise.} Promise */ - static requestSubType(subType: string, retrieveDir?: string, key?: string, templateVariables?: TemplateMap): Promise; + static requestSubType(subType: string, retrieveDir?: string, key?: string, templateVariables?: TemplateMap, loadShared?: boolean): Promise; /** * Retrieves extended metadata (files or extended content) of asset * @@ -487,7 +490,15 @@ declare namespace Asset { contentType: { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; + retrieving: boolean; /** + * Helper for writing Metadata to disk, used for Retrieve and deploy + * + * @param {MetadataTypeMap} results metadata results from deploy + * @param {string} retrieveDir directory where metadata should be stored after deploy/retrieve + * @param {string} [overrideType] for use when there is a subtype (such as folder-queries) + * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @returns {Promise.} Promise of saved metadata + */ template: boolean; }; 'createdBy.email': { @@ -548,13 +559,7 @@ declare namespace Asset { template: boolean; }; 'data.email.options': { - skipValidation: boolean; /** - * Retrieves asset metadata for caching - * - * @param {void | string[]} [_] parameter not used - * @param {string[]} [subTypeArr] optionally limit to a single subtype - * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise - */ + skipValidation: boolean; }; 'data.portfolio': { isCreateable: boolean; @@ -570,15 +575,7 @@ declare namespace Asset { }; design: { isCreateable: boolean; - isUpdateable: boolean; /** - * Retrieves asset metadata for templating - * - * @param {string} templateDir Directory where retrieved metadata directory will be saved - * @param {string} name name of the metadata file - * @param {TemplateMap} templateVariables variables to be replaced in the metadata - * @param {AssetSubType} [selectedSubType] optionally limit to a single subtype - * @returns {Promise.<{metadata: AssetItem, type: string}>} Promise - */ + isUpdateable: boolean; retrieving: boolean; template: boolean; }; @@ -647,7 +644,12 @@ declare namespace Asset { isUpdateable: boolean; retrieving: boolean; template: boolean; - }; + }; /** + * helper for {@link Asset.retrieve} + {@link Asset.retrieveAsTemplate} + * + * @private + * @returns {string[]} AssetSubType array + */ legacyData: { isCreateable: boolean; isUpdateable: boolean; @@ -720,7 +722,7 @@ declare namespace Asset { objectID: { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; /** @type {AssetSubType[]} */ + retrieving: boolean; template: boolean; }; owner: { @@ -732,7 +734,7 @@ declare namespace Asset { 'owner.email': { isCreateable: boolean; isUpdateable: boolean; - retrieving: boolean; /** @type {AssetRequestParams} */ + retrieving: boolean; template: boolean; }; 'owner.id': { @@ -1037,15 +1039,7 @@ declare namespace Asset { fla: number; eml: number; text: number; - txt: number; /** - * Some metadata types store their actual content as a separate file, e.g. images - * This method retrieves these and saves them alongside the metadata json - * - * @param {AssetItem} metadata a single asset - * @param {string} subType group of similar assets to put in a folder (ie. images) - * @param {string} retrieveDir target directory for saving assets - * @returns {Promise.} - - */ + txt: number; freeformblock: number; textblock: number; htmlblock: number; diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map index 17b248c6c..eb1a31234 100644 --- a/@types/lib/metadataTypes/Asset.d.ts.map +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAaa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAnKkB,mBAAmB"} \ No newline at end of file diff --git a/@types/lib/util/replaceContentBlockReference.d.ts.map b/@types/lib/util/replaceContentBlockReference.d.ts.map index 8b71cb906..366c94749 100644 --- a/@types/lib/util/replaceContentBlockReference.d.ts.map +++ b/@types/lib/util/replaceContentBlockReference.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,EAAE,EAAE,oBAAoB,CAAC;QAAC,GAAG,EAAE,kBAAkB,CAAC;QAAC,IAAI,EAAE,kBAAkB,CAAA;KAAC,CAKtF;IACF,4DAA4D;IAC5D,wBADW;QAAC,EAAE,EAAE,MAAM,EAAE,CAAC;QAAC,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAC,CAkCtD;IAEF;;;;;;;;OAQG;IACH,6BANW,MAAM,cACN,MAAM,aACN,2BAA2B,EAAE,OAC7B,2BAA2B,GACzB,MAAM,CA0ClB;IACD;;;;;;;;OAQG;IACH,kCAuBC;IAED;;;;;;OAMG;IACH,kCALW,eAAe,MACf,2BAA2B,WAC3B,OAAO,GACL,MAAM,CAclB;IAED;;;;;OAKG;IACH,kCAJW,OAAO,YAEP,QAAQ,iBA2ClB;CACJ;yBAlOY,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file +{"version":3,"file":"replaceContentBlockReference.d.ts","sourceRoot":"","sources":["../../../lib/util/replaceContentBlockReference.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;GAEG;AACH;IACI,4FAA4F;IAC5F,sBADW;QAAC,E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7C,OAAO,wBAAwB,EAAE,QAAQ;8BACzC,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;mCACnD,OAAO,wBAAwB,EAAE,oBAAoB;0CACrD,OAAO,wBAAwB,EAAE,2BAA2B"} \ No newline at end of file diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 1bbf99090..c98c32a09 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -40,9 +40,10 @@ class Asset extends MetadataType { * @param {void | string[]} _ unused parameter * @param {string[]} [subTypeArr] optionally limit to a single AssetSubType * @param {string} [key] customer key + * @param {boolean} [loadShared] optionally retrieve assets from other BUs that were shared with the current * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ - static async retrieve(retrieveDir, _, subTypeArr, key) { + static async retrieve(retrieveDir, _, subTypeArr, key, loadShared = false) { const items = []; if (subTypeArr) { // check if elements in subTypeArr exist in this.definition.subTypes @@ -61,7 +62,7 @@ class Asset extends MetadataType { for (const subType of subTypeArr) { // each subtype contains multiple different specific types (images contains jpg and png for example) // we use await here to limit the risk of too many concurrent api requests at time - items.push(...(await this.requestSubType(subType, retrieveDir, key, null))); + items.push(...(await this.requestSubType(subType, retrieveDir, key, null, loadShared))); } const metadata = this.parseResponseBody({ items: items }); if (retrieveDir) { @@ -116,10 +117,11 @@ class Asset extends MetadataType { * * @param {void | string[]} [_] parameter not used * @param {string[]} [subTypeArr] optionally limit to a single subtype + * @param {boolean} [loadShared] optionally retrieve assets from other BUs that were shared with the current * @returns {Promise.<{metadata: AssetMap, type: string}>} Promise */ - static retrieveForCache(_, subTypeArr) { - return this.retrieve(null, null, subTypeArr); + static retrieveForCache(_, subTypeArr, loadShared = false) { + return this.retrieve(null, null, subTypeArr, undefined, loadShared); } /** @@ -208,9 +210,10 @@ class Asset extends MetadataType { * @param {string} [retrieveDir] target directory for saving assets * @param {string} [key] key/id/name to filter by * @param {TemplateMap} [templateVariables] variables to be replaced in the metadata + * @param {boolean} [loadShared] optionally retrieve assets from other BUs that were shared with the current * @returns {Promise.} Promise */ - static async requestSubType(subType, retrieveDir, key, templateVariables) { + static async requestSubType(subType, retrieveDir, key, templateVariables, loadShared = false) { if (retrieveDir) { Util.logger.info(`- Retrieving Subtype: ${subType}`); } else { @@ -221,7 +224,7 @@ class Asset extends MetadataType { const subtypeIds = extendedSubTypeArr?.map( (subTypeItemName) => Asset.definition.typeMapping[subTypeItemName] ); - const uri = '/asset/v1/content/assets/query'; + const uri = '/asset/v1/content/assets/query' + (loadShared ? '?scope=shared' : ''); /** @type {AssetRequestParams} */ const payload = { page: { diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 53a38942c..1f379b284 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -233,5 +233,34 @@ saved } cache.setMetadata('asset', resultAsset.metadata); + + Util.logger.info(' - Caching shared assets'); + const resultAssetShared = await Asset.retrieveForCache( + undefined, + ['asset', 'code', 'textfile', 'block', 'other'], + true + ); + for (const element of Object.values(resultAssetShared.metadata)) { + // ensure we got the folder-path in our cache + Asset.setFolderPath(element); + + // create actual cache map + const simpleAsset = { + id: element.id, + key: element.customerKey, + name: element.r__folder_Path + ? element.r__folder_Path.replaceAll('/', '\\') + '\\' + element.name + : null, + }; + // ! note that ContentBlockByName expects backslashes between folders and file name, not forward slashes + ReplaceContentBlockReference.assetCacheMap.id[simpleAsset.id] = simpleAsset; + ReplaceContentBlockReference.assetCacheMap.key[simpleAsset.key] = simpleAsset; + if (simpleAsset.name) { + // while asset without path could still be found via search, it would no longer referencable via ContentBlockByName + ReplaceContentBlockReference.assetCacheMap.name[simpleAsset.name] = simpleAsset; + } + } + + // lets not put the shared assets into our cache to avoid confusing the system... } } From 0f86f2ff714cb07ebc9f246086fce3bfa4ae478f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 23:02:17 +0200 Subject: [PATCH 331/359] #1270: handle folder-not-found situation --- lib/util/replaceContentBlockReference.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 1f379b284..4febccf49 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -114,10 +114,17 @@ export default class ReplaceContentBlockReference { parentName, lang.isSsjs ); - if (referencedAsset) { + if (referencedAsset && referencedAsset[to]) { + // make sure we not only found the asset but also have a replacement for it (folder issue could block swap to ContentBlockByName) changes++; return this.#replaceWith(referencedAsset, to, lang.isSsjs); } else { + if (referencedAsset && !referencedAsset[to]) { + // this is expected to only happen if to=="name" + Util.logger.error( + ` - ${parentName}: Asset ${from} ${identifier} has no valid ${to} reference` + ); + } return match; } }); @@ -224,12 +231,17 @@ saved const simpleAsset = { id: element.id, key: element.customerKey, - name: element.r__folder_Path.replaceAll('/', '\\') + '\\' + element.name, + name: element.r__folder_Path + ? element.r__folder_Path.replaceAll('/', '\\') + '\\' + element.name + : null, }; // ! note that ContentBlockByName expects backslashes between folders and file name, not forward slashes ReplaceContentBlockReference.assetCacheMap.id[simpleAsset.id] = simpleAsset; ReplaceContentBlockReference.assetCacheMap.key[simpleAsset.key] = simpleAsset; - ReplaceContentBlockReference.assetCacheMap.name[simpleAsset.name] = simpleAsset; + if (simpleAsset.name) { + // while asset without path could still be found via search, it would no longer referencable via ContentBlockByName + ReplaceContentBlockReference.assetCacheMap.name[simpleAsset.name] = simpleAsset; + } } cache.setMetadata('asset', resultAsset.metadata); From 56f9252d53b95e2619333a9bde4ad37267dbf5b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 23:05:11 +0200 Subject: [PATCH 332/359] #1238: improve readability of resolveId reponse; include ContentBlockByKey-sample --- lib/metadataTypes/Asset.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index c98c32a09..51e259bed 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1994,15 +1994,16 @@ class Asset extends MetadataType { // for automated processing by VSCode extension, optionally print the json console.log(JSON.stringify(json, null, 2)); // eslint-disable-line no-console } else { - Util.logger.info( - ` - ${this.definition.type}-${subType} found: ${item[this.definition.keyField]} (${item[this.definition.nameField]})` - ); + Util.logger.info(` - ID: ${id}`); + Util.logger.info(` - Key: ${item[this.definition.keyField]}`); + Util.logger.info(` - Name: ${item[this.definition.nameField]}`); + if (json.isShared) { - Util.logger.warn(' - Shared from ' + ownerBUName + ' (' + json.mid + ')'); + Util.logger.warn(' - Shared from: ' + ownerBUName + ' (' + json.mid + ')'); } if (json.sharedWith && Array.isArray(json.sharedWith)) { Util.logger.warn( - ` - Shared with: ${json.sharedWith + ` with: ${json.sharedWith .map( (mid) => Util.inverseGet( @@ -2018,13 +2019,15 @@ class Asset extends MetadataType { .join(', ')}` ); } - Util.logger.info(` - ID: ${id}`); if (json.legacyId) { Util.logger.info(` - Legacy ID: ${json.legacyId}`); } + Util.logger.info(` - How to use:`); + Util.logger.info(` %%= ContentBlockByKey("${json.key}") =%%`); + if (json.folder) { Util.logger.info( - ` - ContentBlockByName("${json.folder.split('/').join('\\') + '\\' + json.name}")` + ` %%= ContentBlockByName("${json.folder.split('/').join('\\') + '\\' + json.name}") =%%` ); if (json.folder.includes('&') || json.name.includes('&')) { Util.logger.warn( From db51b07d96fab428e002f75c8547d73d17f9825e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 23:11:36 +0200 Subject: [PATCH 333/359] #1270: fix end-of-file line break regression --- lib/metadataTypes/Script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/metadataTypes/Script.js b/lib/metadataTypes/Script.js index 096761f85..576b22d78 100644 --- a/lib/metadataTypes/Script.js +++ b/lib/metadataTypes/Script.js @@ -113,7 +113,7 @@ class Script extends MetadataType { templateName + '.' + this.definition.type + '-meta', 'ssjs' ); - code = ``; + code = ``; } else if (await File.pathExists(codePath + '.html')) { code = await File.readFilteredFilename( [deployDir, this.definition.type], From 50f7dffb02f9579152fdf359c491511305851517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 23:26:16 +0200 Subject: [PATCH 334/359] #0: disable error code debugging message --- @types/lib/index.d.ts.map | 2 +- lib/util/util.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 7254847f3..9c4455d82 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAA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M,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL,IAAI,CAIhB;IACD;;;;;OAKG;IACH,wBAHW,MAAM,GACJ,IAAI,CA6ChB;IACD;;;;;;;;;;OAUG;IACH;QAPyB,KAAK,GAAnB,MAAM;QAEQ,MAAM,GAApB,MAAM;QACQ,aAAa,GAA3B,MAAM;QACgB,OAAO,GAA7B,YAAY,EA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BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/lib/util/util.js b/lib/util/util.js index eaef67bc3..27d9d49c0 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -162,7 +162,7 @@ export const Util = { * @returns {void} */ signalFatalError() { - Util.logger.debug('Util.signalFataError() sets process.exitCode = 1 unless already set'); + // Util.logger.debug('Util.signalFataError() sets process.exitCode = 1 unless already set'); process.exitCode ||= 1; }, /** From b2f368515325cd28f7c920289a4922c259dd3b93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 23:29:05 +0200 Subject: [PATCH 335/359] #1270: add skipRetrieve, skipDeploy and refresh options to replaceContentBlock --- @types/lib/index.d.ts.map | 2 +- lib/cli.js | 19 +++++++++++++++++++ lib/index.js | 19 +++++++++++-------- 3 files changed, 31 insertions(+), 9 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 9c4455d82..ab873e076 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL,IAAI,C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;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAI/C;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,oBACN,YAAY,MACZ,MAAM,aACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAoF7C;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO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K/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAwE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/lib/cli.js b/lib/cli.js index 4648c7a83..80d781d8b 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -855,6 +855,25 @@ yargs(hideBin(process.argv)) describe: 'what ampscript function to search for (key, name, id); automatically set to values not used by --to if not provided', }) + .option('skipRetrieve', { + type: 'boolean', + group: 'Optional parameters for replaceContentBlock:', + describe: + 'if you have already just downloaded the metadata and want to skip the retrieve step', + }) + .option('skipDeploy', { + type: 'boolean', + group: 'Optional parameters for replaceContentBlock:', + describe: + 'if you have want to carefully examine the changed files in your retrieve folder you can run this dry-run mode which skips the deploy step at the end', + }) + .option('refresh', { + type: 'boolean', + alias: 'r', + group: 'Optional parameters for replaceContentBlock:', + describe: + 'for asset-message: runs refresh command for related triggeredSends after deploy', + }) .check((argv) => { if (argv.from) { for (const from of argv.from) { diff --git a/lib/index.js b/lib/index.js index d970c7082..399da542e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -96,9 +96,11 @@ class Mcdev { 'referenceFrom', 'referenceTo', 'refresh', - '_runningTest', + 'skipDeploy', + 'skipRetrieve', 'schedule', 'skipInteraction', + '_runningTest', ]; for (const option of knownOptions) { if (argv[option] !== undefined) { @@ -1587,14 +1589,14 @@ class Mcdev { try { Util.logger.info(`Retrieving latest versions of ${type} from server`); let metadataMap; - const IN_DEVELOPMENT = true; // TODO: remove when development is done - if (IN_DEVELOPMENT) { - // TODO: remove when development is done + if (Util.OPTIONS.skipRetrieve) { + Util.logger.warn( + 'Skipping retrieve due to --skipRetrieve flag. Hope you know what you are doing.' + ); metadataMap = await MetadataTypeInfo[type].getJsonFromFS( File.normalizePath([savePath, type]) ); } else { - // TODO: enable when development is done const retriever = new Retriever(properties, buObject); const retrieved = await retriever.retrieve([type], keyArr); metadataMap = Object.values(retrieved)[0][0]; @@ -1608,11 +1610,12 @@ class Mcdev { Util.logger.warn(`No items found that can be updated.\n`); return resultArr; } - if (IN_DEVELOPMENT) { - // TODO: remove when development is done + if (Util.OPTIONS.skipDeploy) { + Util.logger.warn( + 'DRY-RUN MODE: Skipping deploy due to --skipDeploy flag. Once you are satisfied with the result, re-run without --skipRetrieve nor --skipDeploy to actually deploy the changes.' + ); resultArr.push(...keysForDeploy); } else { - // TODO: enable when development is done this.setOptions({ fromRetrieve: true, }); From c2a4efb921c89e019df920271b9b32f9fc93963a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Sun, 2 Jun 2024 23:45:00 +0200 Subject: [PATCH 336/359] #1270: improve log output --- @types/lib/index.d.ts.map | 2 +- lib/index.js | 12 ++++++------ lib/util/replaceContentBlockReference.js | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index ab873e076..ec24a7164 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,Q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BAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA2E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAwE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE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;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 399da542e..f810b1fea 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1555,7 +1555,6 @@ class Mcdev { } catch (ex) { Util.logger.errorStack(ex, 'mcdev.fixKeys failed'); } - Util.logger.info(`:: Done\n`); return resultArr; } /** @@ -1587,7 +1586,6 @@ class Mcdev { await ReplaceContentBlockReference.createCacheMap(properties, buObject); try { - Util.logger.info(`Retrieving latest versions of ${type} from server`); let metadataMap; if (Util.OPTIONS.skipRetrieve) { Util.logger.warn( @@ -1597,6 +1595,7 @@ class Mcdev { File.normalizePath([savePath, type]) ); } else { + Util.logger.info(`Retrieving latest versions of ${type} from server`); const retriever = new Retriever(properties, buObject); const retrieved = await retriever.retrieve([type], keyArr); metadataMap = Object.values(retrieved)[0][0]; @@ -1611,10 +1610,12 @@ class Mcdev { return resultArr; } if (Util.OPTIONS.skipDeploy) { - Util.logger.warn( - 'DRY-RUN MODE: Skipping deploy due to --skipDeploy flag. Once you are satisfied with the result, re-run without --skipRetrieve nor --skipDeploy to actually deploy the changes.' - ); resultArr.push(...keysForDeploy); + Util.logger.warn('DRY-RUN MODE: Skipping deploy due to --skipDeploy flag.'); + Util.logger.info( + 'Once you are satisfied with the result, re-run without --skipRetrieve nor --skipDeploy to actually deploy the changes or run:' + ); + Util.logger.info(` mcdev d ${cred}/${bu} ${type} "${keysForDeploy.join(',')}"`); } else { this.setOptions({ fromRetrieve: true, @@ -1635,7 +1636,6 @@ class Mcdev { } catch (ex) { Util.logger.errorStack(ex, 'mcdev.replaceCbReference failed'); } - Util.logger.info(`:: Done\n`); return resultArr; } /** diff --git a/lib/util/replaceContentBlockReference.js b/lib/util/replaceContentBlockReference.js index 4febccf49..27d6a9baa 100644 --- a/lib/util/replaceContentBlockReference.js +++ b/lib/util/replaceContentBlockReference.js @@ -205,14 +205,14 @@ saved if (!cache.getCache()) { cache.initCache(buObject); } - Util.logger.info(' - Caching folders'); + Util.logger.info('Caching folders'); Folder.buObject = buObject; Folder.properties = properties; Folder.client = client; const resultFolder = await Folder.retrieveForCache(null, ['asset', 'asset-shared']); cache.setMetadata('folder', resultFolder.metadata); - Util.logger.info(' - Caching assets'); + Util.logger.info('Caching assets'); Asset.buObject = buObject; Asset.properties = properties; Asset.client = client; @@ -246,7 +246,7 @@ saved cache.setMetadata('asset', resultAsset.metadata); - Util.logger.info(' - Caching shared assets'); + Util.logger.info('Caching shared assets'); const resultAssetShared = await Asset.retrieveForCache( undefined, ['asset', 'code', 'textfile', 'block', 'other'], From 3d7747207260b9a22fa9db6ecc699ea96593c6a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jun 2024 20:50:10 +0000 Subject: [PATCH 337/359] Bump eslint-plugin-jsdoc from 48.2.6 to 48.2.7 Bumps [eslint-plugin-jsdoc](https://github.com/gajus/eslint-plugin-jsdoc) from 48.2.6 to 48.2.7. - [Release notes](https://github.com/gajus/eslint-plugin-jsdoc/releases) - [Changelog](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/.releaserc) - [Commits](https://github.com/gajus/eslint-plugin-jsdoc/compare/v48.2.6...v48.2.7) --- updated-dependencies: - dependency-name: eslint-plugin-jsdoc dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 24 ++++++++++++------------ package.json | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index c3a896d2c..d8631d464 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.6", + "eslint-plugin-jsdoc": "48.2.7", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "53.0.0", @@ -280,9 +280,9 @@ } }, "node_modules/@es-joy/jsdoccomment": { - "version": "0.43.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.0.tgz", - "integrity": "sha512-Q1CnsQrytI3TlCB1IVWXWeqUIPGVEKGaE7IbVdt13Nq/3i0JESAkQQERrfiQkmlpijl+++qyqPgaS31Bvc1jRQ==", + "version": "0.43.1", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.43.1.tgz", + "integrity": "sha512-I238eDtOolvCuvtxrnqtlBaw0BwdQuYqK7eA6XIonicMdOOOb75mqdIzkGDUbS04+1Di007rgm9snFRNeVrOog==", "dev": true, "dependencies": { "@types/eslint": "^8.56.5", @@ -297,9 +297,9 @@ } }, "node_modules/@es-joy/jsdoccomment/node_modules/@typescript-eslint/types": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.9.0.tgz", - "integrity": "sha512-oZQD9HEWQanl9UfsbGVcZ2cGaR0YT5476xfWE0oE5kQa2sNK2frxOlkeacLOTh9po4AlUT5rtkGyYM5kew0z5w==", + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.12.0.tgz", + "integrity": "sha512-o+0Te6eWp2ppKY3mLCU+YA9pVJxhUJE15FV7kxuD9jgwIAa+w/ycGJBMrYDTpVGUM/tgpa9SeMOugSabWFq7bg==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -2290,18 +2290,18 @@ } }, "node_modules/eslint-plugin-jsdoc": { - "version": "48.2.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.6.tgz", - "integrity": "sha512-GNk9jtpYmoEVeD/U6yYYmd6T8vSOoPs7CL8ZeX85iD8P3qifDdLQGze6+cw9boobDthmYnnxvIoHrhuSffj09g==", + "version": "48.2.7", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.7.tgz", + "integrity": "sha512-fYj3roTnkFL9OFFTB129rico8lerC5G8Vp2ZW9SjO9RNWG0exVvI+i/Y8Bpm1ufjR0uvT38xtoab/U0Hp8Ybog==", "dev": true, "dependencies": { - "@es-joy/jsdoccomment": "~0.43.0", + "@es-joy/jsdoccomment": "~0.43.1", "are-docs-informative": "^0.0.2", "comment-parser": "1.4.1", "debug": "^4.3.4", "escape-string-regexp": "^4.0.0", "esquery": "^1.5.0", - "semver": "^7.6.1", + "semver": "^7.6.2", "spdx-expression-parse": "^4.0.0" }, "engines": { diff --git a/package.json b/package.json index 712587a07..38154ab39 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,7 @@ "eslint": "8.57.0", "eslint-config-prettier": "9.1.0", "eslint-config-ssjs": "1.1.11", - "eslint-plugin-jsdoc": "48.2.6", + "eslint-plugin-jsdoc": "48.2.7", "eslint-plugin-mocha": "10.4.3", "eslint-plugin-prettier": "5.1.2", "eslint-plugin-unicorn": "53.0.0", From 6ab55039f6bd438b4b69122277dedb475af5e54d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Jun 2024 05:44:19 +0000 Subject: [PATCH 338/359] Bump prettier from 3.2.5 to 3.3.0 Bumps [prettier](https://github.com/prettier/prettier) from 3.2.5 to 3.3.0. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/3.2.5...3.3.0) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d8631d464..58730864d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,7 +20,7 @@ "json-to-table": "4.2.1", "mustache": "4.2.0", "p-limit": "5.0.0", - "prettier": "3.2.5", + "prettier": "3.3.0", "prettier-plugin-sql": "0.18.0", "semver": "7.6.0", "sfmc-sdk": "2.0.1", @@ -5873,9 +5873,9 @@ } }, "node_modules/prettier": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.2.5.tgz", - "integrity": "sha512-3/GWa9aOC0YeD7LUfvOG2NiDyhOWRvt1k+rcKhOuYnMY24iiCphgneUfJDyFXd6rZCAnuLBv6UeAULtrhT/F4A==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.0.tgz", + "integrity": "sha512-J9odKxERhCQ10OC2yb93583f6UnYutOeiV5i0zEDS7UGTdUt0u+y8erxl3lBKvwo/JHyyoEdXjwp4dke9oyZ/g==", "bin": { "prettier": "bin/prettier.cjs" }, diff --git a/package.json b/package.json index 38154ab39..05bb68a38 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "json-to-table": "4.2.1", "mustache": "4.2.0", "p-limit": "5.0.0", - "prettier": "3.2.5", + "prettier": "3.3.0", "prettier-plugin-sql": "0.18.0", "semver": "7.6.0", "sfmc-sdk": "2.0.1", From 40899c7806d1b93e0d54219ccdf585247cbf27e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 5 Jun 2024 13:57:07 +0200 Subject: [PATCH 339/359] #1270: extract text-version of html email into external file and change preheader to ampscript file-type: ampscript --- @types/lib/metadataTypes/Asset.d.ts.map | 2 +- lib/metadataTypes/Asset.js | 73 ++++++++++++++++--- ...templatebasedemail-preheader-expected.amp} | 0 ...templatebasedemail-preheader-expected.amp} | 0 ...templatebasedemail-preheader-expected.amp} | 0 test/type.asset.test.js | 12 +-- 6 files changed, 68 insertions(+), 19 deletions(-) rename test/resources/9999999/asset/{build-templatebasedemail-preheader-expected.html => build-templatebasedemail-preheader-expected.amp} (100%) rename test/resources/9999999/asset/{retrieve-templatebasedemail-preheader-expected.html => retrieve-templatebasedemail-preheader-expected.amp} (100%) rename test/resources/9999999/asset/{template-templatebasedemail-preheader-expected.html => template-templatebasedemail-preheader-expected.amp} (100%) diff --git a/@types/lib/metadataTypes/Asset.d.ts.map b/@types/lib/metadataTypes/Asset.d.ts.map index eb1a31234..e0f1489c0 100644 --- a/@types/lib/metadataTypes/Asset.d.ts.map +++ b/@types/lib/metadataTypes/Asset.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"Asset.d.ts","sourceRoot":"","sources":["../../../lib/metadataTypes/Asset.js"],"names":[],"mappings":";uBAaa,OAAO,wBAAwB,EAAE,QAAQ;0BACzC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;+BAChD,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAG5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ;wBACzC,OAAO,wBAAwB,EAAE,SAAS;iCAC1C,OAAO,wBAAwB,EAAE,kBAAkB;AAdhE;;;;;;;;;GASG;AACH;;;;;GAKG;AAEH;;;;GAIG;AACH;IACI;;;;;;;;;OASG;IACH,6BAPW,MAAM,KACN,IAAI,GAAG,MAAM,EAAE,eACf,MAAM,EAAE,QACR,MAAM,eACN,OAAO,GACL,QAAS;QAAC,QAAQ,EAAE,QAAQ,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CA+BxD;IAiBD;;;;OAIG;IACH,2CAFW,eAAe,iBAkBzB;IAED;;;;;;;OAOG;IACH,4BALW,IAAI,G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;;;;;;;;;;;;;;;;;;;yBAnKkB,mBAAmB"} \ No newline at end of file diff --git a/lib/metadataTypes/Asset.js b/lib/metadataTypes/Asset.js index 51e259bed..6c8d907ac 100644 --- a/lib/metadataTypes/Asset.js +++ b/lib/metadataTypes/Asset.js @@ -1071,18 +1071,18 @@ class Asset extends MetadataType { } // metadata.views.html.content (optional) // the main content can be empty (=not set up yet) hence check if we did extract sth or else readFile() will print error msgs - const fileName2 = 'views.preheader.content' + subtypeExtension; + const fileNamePreheader = 'views.preheader.content' + subtypeExtension; if ( (await File.pathExists( - File.normalizePath([...readDirArr, `${fileName2}.html`]) + File.normalizePath([...readDirArr, `${fileNamePreheader}.amp`]) )) && metadata.views.preheader ) { if (!fileListOnly) { metadata.views.preheader.content = await File.readFilteredFilename( readDirArr, - fileName2, - 'html' + fileNamePreheader, + 'amp' ); } @@ -1090,13 +1090,51 @@ class Asset extends MetadataType { // to use this method in templating, store a copy of the info in fileList fileList.push({ subFolder: [...subDirArr, templateFileName], - fileName: fileName2, - fileExt: 'html', + fileName: fileNamePreheader, + fileExt: 'amp', content: metadata.views.preheader.content, }); } } + // metadata.views.text.content (optional) + // the main content can be empty (=not set up yet) hence check if we did extract sth or else readFile() will print error msgs + const fileNameText = 'views.text.content' + subtypeExtension; + if ( + (await File.pathExists( + File.normalizePath([...readDirArr, `${fileNameText}.amp`]) + )) && + metadata.views.text + ) { + if (!fileListOnly) { + metadata.views.text.content = await File.readFilteredFilename( + readDirArr, + fileNameText, + 'amp' + ); + } + + if (templateName) { + // to use this method in templating, store a copy of the info in fileList + fileList.push({ + subFolder: [...subDirArr, templateFileName], + fileName: fileNameText, + fileExt: 'amp', + content: metadata.views.text.content, + }); + } + } else if (metadata.views.text) { + // ensure the text version gets generated from html + metadata.views.text.data = { + email: { + options: { + generateFrom: 'html', + }, + }, + }; + metadata.views.text.generateFrom = 'html'; + } + // metadata.views.html.slots.<>.blocks.<>.content (optional) if (metadata?.views?.html?.slots) { await this._mergeCode_slots( @@ -1175,7 +1213,7 @@ class Asset extends MetadataType { await File.pathExists( File.normalizePath([ ...readDirArr, - `${templateFileName}${subtypeExtension}.html`, + `${templateFileName}${subtypeExtension}.amp`, ]) ) ) { @@ -1184,7 +1222,7 @@ class Asset extends MetadataType { metadata.views.text.content = await File.readFilteredFilename( readDirArr, templateFileName + subtypeExtension, - 'html' + 'amp' ); } if (templateName) { @@ -1192,7 +1230,7 @@ class Asset extends MetadataType { fileList.push({ subFolder: subDirArr, fileName: templateFileName + subtypeExtension, - fileExt: 'html', + fileExt: 'amp', content: metadata.views.text.content, }); } @@ -1436,17 +1474,28 @@ class Asset extends MetadataType { }); delete metadata.views.html.content; } - // metadata.views.html.content (optional) + // metadata.views.preheader.content (optional) if (metadata.views?.preheader?.content?.length) { codeArr.push({ subFolder: null, fileName: 'views.preheader.content', - fileExt: 'html', + fileExt: 'amp', content: metadata.views.preheader.content, }); delete metadata.views.preheader.content; } + // metadata.views.text.content (optional) + if (metadata.views?.text?.content?.length) { + codeArr.push({ + subFolder: null, + fileName: 'views.text.content', + fileExt: 'amp', + content: metadata.views.text.content, + }); + delete metadata.views.text.content; + } + // metadata.views.html.slots.<>.blocks.<>.content (optional) if (metadata.views?.html?.slots) { this._extractCode_slots('views.html.slots', metadata.views.html.slots, codeArr); @@ -1489,7 +1538,7 @@ class Asset extends MetadataType { codeArr.push({ subFolder: null, fileName: customerKey, - fileExt: 'html', + fileExt: 'amp', content: metadata.views.text.content, }); delete metadata.views.text.content; diff --git a/test/resources/9999999/asset/build-templatebasedemail-preheader-expected.html b/test/resources/9999999/asset/build-templatebasedemail-preheader-expected.amp similarity index 100% rename from test/resources/9999999/asset/build-templatebasedemail-preheader-expected.html rename to test/resources/9999999/asset/build-templatebasedemail-preheader-expected.amp diff --git a/test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.html b/test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.amp similarity index 100% rename from test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.html rename to test/resources/9999999/asset/retrieve-templatebasedemail-preheader-expected.amp diff --git a/test/resources/9999999/asset/template-templatebasedemail-preheader-expected.html b/test/resources/9999999/asset/template-templatebasedemail-preheader-expected.amp similarity index 100% rename from test/resources/9999999/asset/template-templatebasedemail-preheader-expected.html rename to test/resources/9999999/asset/template-templatebasedemail-preheader-expected.amp diff --git a/test/type.asset.test.js b/test/type.asset.test.js index aeaf8f14f..b893f0098 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -202,7 +202,7 @@ describe('type: asset', () => { 'testExisting_asset_templatebasedemail', 'asset', 'message', - 'html', + 'amp', 'views.preheader.content' ) ).to.equal( @@ -210,7 +210,7 @@ describe('type: asset', () => { '9999999', 'asset', 'retrieve-templatebasedemail-preheader', - 'html' + 'amp' ) ); @@ -394,7 +394,7 @@ describe('type: asset', () => { 'testExisting_asset_templatebasedemail', 'asset', 'message', - 'html', + 'amp', 'views.preheader.content' ) ).to.equal( @@ -402,7 +402,7 @@ describe('type: asset', () => { '9999999', 'asset', 'template-templatebasedemail-preheader', - 'html' + 'amp' ) ); // THEN @@ -444,7 +444,7 @@ describe('type: asset', () => { 'testTemplated_asset_templatebasedemail', 'asset', 'message', - 'html', + 'amp', 'views.preheader.content' ) ).to.equal( @@ -452,7 +452,7 @@ describe('type: asset', () => { '9999999', 'asset', 'build-templatebasedemail-preheader', - 'html' + 'amp' ) ); From d02f08e06e128bc5afdce9d91c6da24e0d8364cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 12:30:04 +0200 Subject: [PATCH 340/359] #1270: fox Prototype-polluting assignment warning --- @types/lib/index.d.ts.map | 2 +- @types/lib/util/util.d.ts | 9 +++++++++ @types/lib/util/util.d.ts.map | 2 +- lib/index.js | 3 +++ lib/util/util.js | 24 ++++++++++++++++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index ec24a7164..defcfc29e 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL,IAAI,CAIhB;IACD;;;;;OAKG;IACH,wBAHW,MAAM,GACJ,IAAI,CA6ChB;IACD;;;;;;;;;;OAUG;IACH;QAPyB,KAAK,GAAnB,MAAM;QAEQ,MAAM,GAApB,MAAM;QACQ,aAAa,GAA3B,MAAM;QACgB,OAAO,GAA7B,YAAY,EAAE;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,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA0E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,e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W,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA0E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file diff --git a/@types/lib/util/util.d.ts b/@types/lib/util/util.d.ts index 133c303b1..d712b0bbf 100644 --- a/@types/lib/util/util.d.ts +++ b/@types/lib/util/util.d.ts @@ -83,6 +83,15 @@ export namespace Util { * @returns {boolean} type ok or not */ function _isValidType(selectedType: string, handleOutside?: boolean): boolean; + /** + * helper for Mcdev.retrieve, Mcdev.retrieveAsTemplate and Mcdev.deploy + * + * @param {Mcdevrc} properties javascript object in .mcdevrc.json + * @param {string} businessUnit name of BU + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {boolean} bu found or not + */ + function _isValidBU(properties: import("../../types/mcdev.d.js").Mcdevrc, businessUnit: string, handleOutside?: boolean): boolean; /** * helper that deals with extracting type and subtype * diff --git a/@types/lib/util/util.d.ts.map b/@types/lib/util/util.d.ts.map index 0608ac2cd..c7f41ba4b 100644 --- a/@types/lib/util/util.d.ts.map +++ b/@types/lib/util/util.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG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mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG;IACH,sGAqCC;IACD;;;;OAIG;IACH,kCAGC;IACD;;;;;;OAMG;IACH,yCAEC;IACD;;;;;;OAMG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,8EAkBC;IAED;;;;;;;OAOG;IACH,kIAcC;IAED;;;;;OAKG;IACH;;;MASC;IAED;;;;OAIG;IACH,4CAyBC;IAO0B,6DAmE1B;;gBAMS,MAAM;IAUH,mEA8EZ;IAWe,0GAef;IASgB;;YAyBhB;IASW,6DAOX;IAED;;;;;OAKG;IACH,2DAiBC;IAED;;;;;OAKG;IACH;;MAqFC;IAED;;;;;;OAMG;IACH,qDAEC;IACD;;;;;;;OAOG;IACH,qFAqBC;IACD;;;;;;;OAOG;IACH,6FAYC;IACD;;;;;;;;OAQG;IACH;;;;aAyBC;IACD;;;;OAIG;IACH,qCAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BD;;;;;OAKG;IACH,yCAEC;IACD;;;;;OAKG;IACH,iDAQC;IACD;;;;;;OAMG;IACH,0EAcC;IACD;;;;;OAKG;IACH,0CAIC;IACD;;;;;;;;;;;;;;;;;OAiBG;IACH,uCA0BC;IACD;;;;;;OAMG;IACH,iEAaC;IACD;;;;;;OAMG;IACH,2DA6BC;IACD;;;;;OAKG;IACH,oDAEC;IACD;;;;;;;OAOG;IACH,6FAaC;IACD;;;;;;;OAOG;IACH,sEAMC;;yBAj9BQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index f810b1fea..dbcff6768 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1047,6 +1047,9 @@ class Mcdev { this.setOptions({ referenceFrom, referenceTo }); const properties = await config.getProperties(); + if (!Util._isValidBU(properties, businessUnit)) { + return; + } if (selectedTypesArr) { // check if types are valid for (const selectedType of Object.keys(selectedTypesArr)) { diff --git a/lib/util/util.js b/lib/util/util.js index 27d9d49c0..6f586f7d2 100644 --- a/lib/util/util.js +++ b/lib/util/util.js @@ -213,6 +213,30 @@ export const Util = { return true; }, + /** + * helper for Mcdev.retrieve, Mcdev.retrieveAsTemplate and Mcdev.deploy + * + * @param {Mcdevrc} properties javascript object in .mcdevrc.json + * @param {string} businessUnit name of BU + * @param {boolean} [handleOutside] if the API reponse is irregular this allows you to handle it outside of this generic method + * @returns {boolean} bu found or not + */ + _isValidBU(properties, businessUnit, handleOutside) { + const [cred, bu] = businessUnit ? businessUnit.split('/') : [null, null]; + if (!properties.credentials[cred]) { + if (!handleOutside) { + Util.logger.error(`Credential not found`); + } + return false; + } else if (!properties.credentials[cred].businessUnits[bu]) { + if (!handleOutside) { + Util.logger.error(`BU not found in credential`); + } + return false; + } + return true; + }, + /** * helper that deals with extracting type and subtype * From 2cebec1236ede72c04a0d852eadaefb631784d4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 12:31:28 +0200 Subject: [PATCH 341/359] #1270: fix ts warning --- test/type.asset.test.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/type.asset.test.js b/test/type.asset.test.js index b893f0098..68ed05dcf 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -79,7 +79,7 @@ async function getActualTemplateJson(customerKey, type, subtype) { * @param {string} subtype of metadata * @param {string} ext file extension * @param {string} [filename] optional fileprefix that differs from customerKey - * @returns {Promise.} file + * @returns {Promise.} file */ async function getActualTemplateFile(customerKey, type, subtype, ext, filename) { const path = `./template/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; @@ -89,7 +89,7 @@ async function getActualTemplateFile(customerKey, type, subtype, ext, filename) return File.readFile(filename ? pathSub : path, 'utf8'); } catch { console.log(`File not found: ${filename ? pathSub : path}`); // eslint-disable-line no-console - return null; + return; } } @@ -122,7 +122,7 @@ async function getActualDeployJson(customerKey, type, subtype, buName = 'testBU' * @param {string} ext file extension * @param {string} [filename] optional fileprefix that differs from customerKey * @param {string} [buName] used when we need to test on ParentBU - * @returns {Promise.} file content + * @returns {Promise.} file content */ async function getActualDeployFile(customerKey, type, subtype, ext, filename, buName = 'testBU') { const path = `./deploy/testInstance/${buName}/${type}/${subtype}/${customerKey}.${type}-${subtype}-meta.${ext}`; @@ -132,7 +132,7 @@ async function getActualDeployFile(customerKey, type, subtype, ext, filename, bu return File.readFile(filename ? pathSub : path, 'utf8'); } catch { console.log(`File not found: ${filename ? pathSub : path}`); // eslint-disable-line no-console - return null; + return; } } From cc1d88270d2ad7bb635c84dce76ab4e072480056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 12:45:48 +0200 Subject: [PATCH 342/359] #1270: improve typing --- @types/lib/index.d.ts | 6 +++--- @types/lib/index.d.ts.map | 2 +- @types/lib/util/util.d.ts | 4 +++- @types/lib/util/util.d.ts.map | 2 +- @types/types/mcdev.d.d.ts | 6 ++++-- @types/types/mcdev.d.d.ts.map | 2 +- lib/index.js | 5 +++-- types/mcdev.d.js | 2 +- 8 files changed, 17 insertions(+), 12 deletions(-) diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts index efdfcbe96..cb2151cf5 100644 --- a/@types/lib/index.d.ts +++ b/@types/lib/index.d.ts @@ -301,11 +301,11 @@ declare class Mcdev { * * @param {string} businessUnit name of BU * @param {TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type - * @param {string} to what to replace with - * @param {string[]} [fromList] what to replace + * @param {ContentBlockConversionTypes} to what to replace with + * @param {ContentBlockConversionTypes[]} [fromList] what to replace * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys */ - static replaceCbReference(businessUnit: string, selectedTypesArr: TypeKeyCombo, to: string, fromList?: string[]): Promise<{ + static replaceCbReference(businessUnit: string, selectedTypesArr: TypeKeyCombo, to: ContentBlockConversionTypes, fromList?: ContentBlockConversionTypes[]): Promise<{ [x: string]: object; }>; /** diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index defcfc29e..08c9ef6b4 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL,IAAI,CAIhB;IACD;;;;;OAKG;IACH,wBAHW,MAAM,GACJ,IAAI,CA6ChB;IACD;;;;;;;;;;OAUG;IACH;QAPyB,KAAK,GAAnB,MAAM;QAEQ,MAAM,GAApB,MAAM;QACQ,aAAa,GAA3B,MAAM;QACgB,OA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;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA0E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA0ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD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uD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA0E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file diff --git a/@types/lib/util/util.d.ts b/@types/lib/util/util.d.ts index d712b0bbf..7547afe41 100644 --- a/@types/lib/util/util.d.ts +++ b/@types/lib/util/util.d.ts @@ -285,7 +285,9 @@ export namespace Util { * @param {boolean} [returnEmpty] returns array with null element if false/not set; Retriever needs this to be false; Deployer needs it to be true * @returns {TypeKeyCombo} - */ - function createTypeKeyCombo(typeArr: string[], keyArr: string[], returnEmpty?: boolean): any; + function createTypeKeyCombo(typeArr: string[], keyArr: string[], returnEmpty?: boolean): { + [x: string]: string[]; + }; /** * async version of Array.find() * returns the first element in the provided array that satisfies the provided testin function diff --git a/@types/lib/util/util.d.ts.map b/@types/lib/util/util.d.ts.map index c7f41ba4b..6278ed58c 100644 --- a/@types/lib/util/util.d.ts.map +++ b/@types/lib/util/util.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG;IACH,sGAqCC;IACD;;;;OAIG;IACH,kCAGC;IACD;;;;;;OAMG;I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,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file +{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../../lib/util/util.js"],"names":[],"mappings":";;;;;;;;yBAkDe,eAAe;;;;IAK1B;;;;;;OAMG;IACH;;;;MAUC;IACD;;;;;;OAMG;IACH,oEAEC;IACD;;;;;;OAMG;IACH,wEAEC;IACD;;;;;;OAMG;IACH,oGAYC;IAED;;;;;OAKG;IACH,sGAqCC;IACD;;;;OAIG;IACH,kCAGC;IACD;;;;;;OAMG;IACH,yCAEC;IACD;;;;;;OAMG;IACH,0CAEC;IAED;;;;;;OAMG;IACH,8EAkBC;IAED;;;;;;;OAOG;IACH,kIAcC;IAED;;;;;OAKG;IACH;;;MASC;IAED;;;;OAIG;IACH,4CAyBC;IAO0B,6DAmE1B;;gBAMS,MAAM;IAUH,mEA8EZ;IAWe,0GAef;IASgB;;YAyBhB;IASW,6DAOX;IAED;;;;;OAKG;IACH,2DAiBC;IAED;;;;;OAKG;IACH;;MAqFC;IAED;;;;;;OAMG;IACH,qDAEC;IACD;;;;;;;OAOG;IACH,qFAqBC;IACD;;;;;;;OAOG;IACH,6FAYC;IACD;;;;;;;;OAQG;IACH;;;;aAyBC;IACD;;;;OAIG;IACH,qCAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BD;;;;;OAKG;IACH,yCAEC;IACD;;;;;OAKG;IACH,iDAQC;IACD;;;;;;OAMG;IACH,0EAcC;IACD;;;;;OAKG;IACH,0CAIC;IACD;;;;;;;;;;;;;;;;;OAiBG;IACH,uCA0BC;IACD;;;;;;OAMG;IACH,iEAaC;IACD;;;;;;OAMG;IACH,2DA6BC;IACD;;;;;OAKG;IACH,oDAEC;IACD;;;;;;;OAOG;IACH;;MAaC;IACD;;;;;;;OAOG;IACH,sEAMC;;yBAj9BQ,OAAO,wBAAwB,EAAE,UAAU;uBAC3C,OAAO,wBAAwB,EAAE,QAAQ;oBACzC,OAAO,wBAAwB,EAAE,KAAK;0BACtC,OAAO,wBAAwB,EAAE,WAAW;8BAC5C,OAAO,wBAAwB,EAAE,eAAe;2BAChD,OAAO,wBAAwB,EAAE,YAAY;0BAC7C,OAAO,wBAAwB,EAAE,WAAW;qBAC5C,OAAO,wBAAwB,EAAE,MAAM;sBACvC,OAAO,wBAAwB,EAAE,OAAO;+BACxC,OAAO,wBAAwB,EAAE,gBAAgB;mCACjD,OAAO,wBAAwB,EAAE,oBAAoB;kCACrD,OAAO,wBAAwB,EAAE,mBAAmB;8BACpD,OAAO,wBAAwB,EAAE,eAAe;iCAChD,OAAO,wBAAwB,EAAE,kBAAkB;oCACnD,OAAO,wBAAwB,EAAE,qBAAqB;mCACtD,OAAO,wBAAwB,EAAE,oBAAoB;8BACrD,OAAO,wBAAwB,EAAE,eAAe;gCAChD,OAAO,wBAAwB,EAAE,iBAAiB;0BAClD,OAAO,wBAAwB,EAAE,WAAW;2BAC5C,OAAO,wBAAwB,EAAE,YAAY;uBAC7C,OAAO,wBAAwB,EAAE,QAAQ"} \ No newline at end of file diff --git a/@types/types/mcdev.d.d.ts b/@types/types/mcdev.d.d.ts index 4ee501d8b..2953fa67b 100644 --- a/@types/types/mcdev.d.d.ts +++ b/@types/types/mcdev.d.d.ts @@ -35,9 +35,11 @@ export type TemplateMap = { }; export type SupportedMetadataTypes = 'asset' | 'asset-archive' | 'asset-asset' | 'asset-audio' | 'asset-block' | 'asset-code' | 'asset-document' | 'asset-image' | 'asset-message' | 'asset-other' | 'asset-rawimage' | 'asset-template' | 'asset-textfile' | 'asset-video' | 'attributeGroup' | 'attributeSet' | 'automation' | 'campaign' | 'contentArea' | 'dataExtension' | 'dataExtensionField' | 'dataExtensionTemplate' | 'dataExtract' | 'dataExtractType' | 'discovery' | 'deliveryProfile' | 'email' | 'emailSend' | 'event' | 'fileLocation' | 'fileTransfer' | 'filter' | 'folder' | 'importFile' | 'journey' | 'list' | 'mobileCode' | 'mobileKeyword' | 'mobileMessage' | 'query' | 'role' | 'script' | 'sendClassification' | 'senderProfile' | 'transactionalEmail' | 'transactionalPush' | 'transactionalSMS' | 'triggeredSend' | 'user' | 'verification'; /** - * object-key=metadata type, value=array of external keys + * object-key=SupportedMetadataTypes, value=array of external keys */ -export type TypeKeyCombo = any; +export type TypeKeyCombo = { + [x: string]: string[] | null; +}; /** * generic metadata item */ diff --git a/@types/types/mcdev.d.d.ts.map b/@types/types/mcdev.d.d.ts.map index 8f74adbc1..52b39c973 100644 --- a/@types/types/mcdev.d.d.ts.map +++ b/@types/types/mcdev.d.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"mcdev.d.d.ts","sourceRoot":"","sources":["../../types/mcdev.d.js"],"names":[],"mappings":";;;;;;eAEc,MAAM;;;;mBACN,MAAM;;;;aACN,MAAM;;;;UACN,MAAM;;;;UACN,MAAM;;;;mBACN,MAAM;;;;iBACN,MAAM;;;QAGC,MAAM,GAAE,MAAM;;qCACtB,OAAO,GAAC,eAAe,GAAC,aAAa,GAAC,aAAa,GAAC,aAAa,GAAC,YAAY,GAAC,gBAAgB,GAAC,aAAa,GAAC,eAAe,GAAC,aAAa,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,gBAAgB,GAAC,aAAa,GAAC,gBAAgB,GAAC,cAAc,GAAC,YAAY,GAAC,UAAU,GAAC,aAAa,GAAC,eAAe,GAAC,oBAAoB,GAAC,uBAAuB,GAAC,aAAa,GAAC,iBAAiB,GAAC,WAAW,GAAC,iBAAiB,GAAC,OAAO,GAAC,WAAW,GAAC,OAAO,GAAC,cAAc,GAAC,cAAc,GAAC,QAAQ,GAAC,Q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e59a2602 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1008,8 +1008,8 @@ class Mcdev { * * @param {string} businessUnit name of BU * @param {TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type - * @param {string} to what to replace with - * @param {string[]} [fromList] what to replace + * @param {ContentBlockConversionTypes} to what to replace with + * @param {ContentBlockConversionTypes[]} [fromList] what to replace * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys */ static async replaceCbReference(businessUnit, selectedTypesArr, to, fromList) { @@ -1701,6 +1701,7 @@ class Mcdev { } } }); + /** @type {TypeKeyCombo} */ const response = {}; for (const item of metadataOptionMap) { if (item) { diff --git a/types/mcdev.d.js b/types/mcdev.d.js index 864500ebb..2423c69bd 100644 --- a/types/mcdev.d.js +++ b/types/mcdev.d.js @@ -11,7 +11,7 @@ /** * @typedef {Object.} TemplateMap * @typedef {'asset'|'asset-archive'|'asset-asset'|'asset-audio'|'asset-block'|'asset-code'|'asset-document'|'asset-image'|'asset-message'|'asset-other'|'asset-rawimage'|'asset-template'|'asset-textfile'|'asset-video'|'attributeGroup'|'attributeSet'|'automation'|'campaign'|'contentArea'|'dataExtension'|'dataExtensionField'|'dataExtensionTemplate'|'dataExtract'|'dataExtractType'|'discovery'|'deliveryProfile'|'email'|'emailSend'|'event'|'fileLocation'|'fileTransfer'|'filter'|'folder'|'importFile'|'journey'|'list'|'mobileCode'|'mobileKeyword'|'mobileMessage'|'query'|'role'|'script'|'sendClassification'|'senderProfile'|'transactionalEmail'|'transactionalPush'|'transactionalSMS'|'triggeredSend'|'user'|'verification'} SupportedMetadataTypes - * @typedef {Object.} TypeKeyCombo object-key=metadata type, value=array of external keys + * @typedef {Object.} TypeKeyCombo object-key=SupportedMetadataTypes, value=array of external keys */ /** From 0120428e562bf83270814964fc6b23a347d8725c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 13:44:23 +0200 Subject: [PATCH 343/359] #1270: add test case for rcb script --- .../automation/v1/scripts/get-response.json | 6 +- .../get_ampincluded-rcb-id-expected.html | 5 + .../get_ampincluded-rcb-key-expected.html | 5 + .../get_ampincluded-rcb-name-expected.html | 5 + .../script/get_ampscript-rcb-id-expected.html | 8 + .../get_ampscript-rcb-key-expected.html | 8 + .../get_ampscript-rcb-name-expected.html | 10 + .../script/get_mixed-rcb-id-expected.html | 12 + .../script/get_mixed-rcb-key-expected.html | 12 + .../script/get_mixed-rcb-name-expected.html | 14 ++ test/type.script.test.js | 209 ++++++++++++++++++ 11 files changed, 291 insertions(+), 3 deletions(-) create mode 100644 test/resources/9999999/script/get_ampincluded-rcb-id-expected.html create mode 100644 test/resources/9999999/script/get_ampincluded-rcb-key-expected.html create mode 100644 test/resources/9999999/script/get_ampincluded-rcb-name-expected.html create mode 100644 test/resources/9999999/script/get_ampscript-rcb-id-expected.html create mode 100644 test/resources/9999999/script/get_ampscript-rcb-key-expected.html create mode 100644 test/resources/9999999/script/get_ampscript-rcb-name-expected.html create mode 100644 test/resources/9999999/script/get_mixed-rcb-id-expected.html create mode 100644 test/resources/9999999/script/get_mixed-rcb-key-expected.html create mode 100644 test/resources/9999999/script/get_mixed-rcb-name-expected.html diff --git a/test/resources/9999999/automation/v1/scripts/get-response.json b/test/resources/9999999/automation/v1/scripts/get-response.json index b19640196..3fdea2a7e 100644 --- a/test/resources/9999999/automation/v1/scripts/get-response.json +++ b/test/resources/9999999/automation/v1/scripts/get-response.json @@ -28,7 +28,7 @@ "name": "testExisting_script_ampscript", "key": "testExisting_script_ampscript", "description": "", - "script": "line1 %%[ SET @test='bla bla' ]%% line2 %%= v(@test) =%% still line2\nline3", + "script": "line1 %%[ SET @test='bla bla' ]%% line2 %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%% still line2\nline3\n", "categoryId": 304, "createdDate": "2022-10-20T00:41:26.163", "modifiedDate": "2022-10-20T00:41:26.163" @@ -38,7 +38,7 @@ "name": "testExisting_script_ampincluded", "key": "testExisting_script_ampincluded", "description": "", - "script": " ", + "script": " \n", "categoryId": 304, "createdDate": "2022-10-20T00:41:26.163", "modifiedDate": "2022-10-20T00:41:26.163" @@ -48,7 +48,7 @@ "name": "testExisting_script_mixed", "key": "testExisting_script_mixed", "description": "", - "script": " line1 %%[ SET @test='bla bla' ]%% line2 %%= v(@test) =%% still line2;\n collapsed to line2 because it's assumed HTML\n", + "script": " line1 %%[ SET @test='bla bla' ]%% line2 %%= ContentBlockByKey(\"mcdev-issue-1157\") =%% still line2;\n collapsed to line2 because it's assumed HTML\n", "categoryId": 304, "createdDate": "2022-10-20T00:41:26.163", "modifiedDate": "2022-10-20T00:41:26.163" diff --git a/test/resources/9999999/script/get_ampincluded-rcb-id-expected.html b/test/resources/9999999/script/get_ampincluded-rcb-id-expected.html new file mode 100644 index 000000000..cd0777f11 --- /dev/null +++ b/test/resources/9999999/script/get_ampincluded-rcb-id-expected.html @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/test/resources/9999999/script/get_ampincluded-rcb-key-expected.html b/test/resources/9999999/script/get_ampincluded-rcb-key-expected.html new file mode 100644 index 000000000..8c5df930a --- /dev/null +++ b/test/resources/9999999/script/get_ampincluded-rcb-key-expected.html @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/test/resources/9999999/script/get_ampincluded-rcb-name-expected.html b/test/resources/9999999/script/get_ampincluded-rcb-name-expected.html new file mode 100644 index 000000000..79e3ce357 --- /dev/null +++ b/test/resources/9999999/script/get_ampincluded-rcb-name-expected.html @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/test/resources/9999999/script/get_ampscript-rcb-id-expected.html b/test/resources/9999999/script/get_ampscript-rcb-id-expected.html new file mode 100644 index 000000000..a81add93e --- /dev/null +++ b/test/resources/9999999/script/get_ampscript-rcb-id-expected.html @@ -0,0 +1,8 @@ +line1 +%%[ + SET @test = 'bla bla' +]%% +line2 %%= ContentBlockById(1295064) =%% still line2 line3 + diff --git a/test/resources/9999999/script/get_ampscript-rcb-key-expected.html b/test/resources/9999999/script/get_ampscript-rcb-key-expected.html new file mode 100644 index 000000000..c0b0018af --- /dev/null +++ b/test/resources/9999999/script/get_ampscript-rcb-key-expected.html @@ -0,0 +1,8 @@ +line1 +%%[ + SET @test = 'bla bla' +]%% +line2 %%= ContentBlockByKey("mcdev-issue-1157") =%% still line2 line3 + diff --git a/test/resources/9999999/script/get_ampscript-rcb-name-expected.html b/test/resources/9999999/script/get_ampscript-rcb-name-expected.html new file mode 100644 index 000000000..988f0e756 --- /dev/null +++ b/test/resources/9999999/script/get_ampscript-rcb-name-expected.html @@ -0,0 +1,10 @@ +line1 +%%[ + SET @test = 'bla bla' +]%% +line2 %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% still line2 line3 + diff --git a/test/resources/9999999/script/get_mixed-rcb-id-expected.html b/test/resources/9999999/script/get_mixed-rcb-id-expected.html new file mode 100644 index 000000000..bf9e6e0c9 --- /dev/null +++ b/test/resources/9999999/script/get_mixed-rcb-id-expected.html @@ -0,0 +1,12 @@ + +line1 +%%[ + SET @test = 'bla bla' +]%% +line2 %%= ContentBlockById(1295064) =%% still line2; collapsed to line2 because it's assumed +HTML + diff --git a/test/resources/9999999/script/get_mixed-rcb-key-expected.html b/test/resources/9999999/script/get_mixed-rcb-key-expected.html new file mode 100644 index 000000000..4fce50c94 --- /dev/null +++ b/test/resources/9999999/script/get_mixed-rcb-key-expected.html @@ -0,0 +1,12 @@ + +line1 +%%[ + SET @test = 'bla bla' +]%% +line2 %%= ContentBlockByKey("mcdev-issue-1157") =%% still line2; collapsed to line2 because it's assumed +HTML + diff --git a/test/resources/9999999/script/get_mixed-rcb-name-expected.html b/test/resources/9999999/script/get_mixed-rcb-name-expected.html new file mode 100644 index 000000000..3b8fbff2c --- /dev/null +++ b/test/resources/9999999/script/get_mixed-rcb-name-expected.html @@ -0,0 +1,14 @@ + +line1 +%%[ + SET @test = 'bla bla' +]%% +line2 %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% still line2; collapsed to line2 because it's assumed +HTML + diff --git a/test/type.script.test.js b/test/type.script.test.js index 25745f0f5..f5a4770de 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -416,4 +416,213 @@ describe('type: script', () => { }); describe('Execute ================', () => {}); + + describe('ReplaceContentBlockByX ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + script: null, + }, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].script, + ['testExisting_script_ampincluded', 'testExisting_script_mixed'], + 'should have found the right scripts that need updating' + ); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.script ? Object.keys(result.script).length : 0, + 5, + 'only 5 scripts expected' + ); + // check if conversions happened + expect( + await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'script', + 'get_ampscript-rcb-name', + 'html' + ) + ); + expect(await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'ssjs')) + .to.not.exist; + + expect( + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'script', + 'get_ampincluded-rcb-name', + 'html' + ) + ); + expect( + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'ssjs') + ).to.not.exist; + + expect( + await testUtils.getActualFile('testExisting_script_mixed', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'get_mixed-rcb-name', 'html') + ); + expect(await testUtils.getActualFile('testExisting_script_mixed', 'script', 'ssjs')).to + .not.exist; + + assert.equal( + testUtils.getAPIHistoryLength(), + 15, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + script: null, + }, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].script, + ['testExisting_script_ampscript', 'testExisting_script_mixed'], + 'should have found the right scripts that need updating' + ); + + // get results from cache + const result = cache.getCache(); + assert.equal( + result.script ? Object.keys(result.script).length : 0, + 5, + 'only 5 scripts expected' + ); + // check if conversions happened + expect( + await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'get_ampscript-rcb-id', 'html') + ); + expect(await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'ssjs')) + .to.not.exist; + + expect( + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'script', + 'get_ampincluded-rcb-id', + 'html' + ) + ); + expect( + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'ssjs') + ).to.not.exist; + + expect( + await testUtils.getActualFile('testExisting_script_mixed', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'get_mixed-rcb-id', 'html') + ); + expect(await testUtils.getActualFile('testExisting_script_mixed', 'script', 'ssjs')).to + .not.exist; + + assert.equal( + testUtils.getAPIHistoryLength(), + 15, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + script: null, + }, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].script, + ['testExisting_script_ampscript', 'testExisting_script_ampincluded'], + 'should have found the right scripts that need updating' + ); + + // get results from cache + const result = cache.getCache(); + assert.equal( + result.script ? Object.keys(result.script).length : 0, + 5, + 'only 5 scripts expected' + ); + // check if conversions happened + expect( + await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'script', + 'get_ampscript-rcb-key', + 'html' + ) + ); + expect(await testUtils.getActualFile('testExisting_script_ampscript', 'script', 'ssjs')) + .to.not.exist; + + expect( + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'script', + 'get_ampincluded-rcb-key', + 'html' + ) + ); + expect( + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'ssjs') + ).to.not.exist; + + expect( + await testUtils.getActualFile('testExisting_script_mixed', 'script', 'html') + ).to.equal( + await testUtils.getExpectedFile('9999999', 'script', 'get_mixed-rcb-key', 'html') + ); + expect(await testUtils.getActualFile('testExisting_script_mixed', 'script', 'ssjs')).to + .not.exist; + + assert.equal( + testUtils.getAPIHistoryLength(), + 15, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); }); From e84be64c313fe92037bcb2e5a6f982e62d4d6154 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 16:24:30 +0200 Subject: [PATCH 344/359] #1270: fix existing script tests for changes introduced by rcb --- .../resources/9999999/script/get_ampincluded-expected.html | 5 +++++ .../resources/9999999/script/get_ampincluded-expected.ssjs | 5 ----- test/resources/9999999/script/get_ampscript-expected.html | 7 ++++++- test/resources/9999999/script/get_mixed-expected.html | 5 ++++- test/type.script.test.js | 6 +++--- 5 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 test/resources/9999999/script/get_ampincluded-expected.html delete mode 100644 test/resources/9999999/script/get_ampincluded-expected.ssjs diff --git a/test/resources/9999999/script/get_ampincluded-expected.html b/test/resources/9999999/script/get_ampincluded-expected.html new file mode 100644 index 000000000..cd0777f11 --- /dev/null +++ b/test/resources/9999999/script/get_ampincluded-expected.html @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/test/resources/9999999/script/get_ampincluded-expected.ssjs b/test/resources/9999999/script/get_ampincluded-expected.ssjs deleted file mode 100644 index 8c5acec4b..000000000 --- a/test/resources/9999999/script/get_ampincluded-expected.ssjs +++ /dev/null @@ -1,5 +0,0 @@ -line1 -%%[ - SET @test = 'bla bla' -]%% -line2 %%= v(@test) =%% still line2 line3 diff --git a/test/resources/9999999/script/get_ampscript-expected.html b/test/resources/9999999/script/get_ampscript-expected.html index 8c5acec4b..988f0e756 100644 --- a/test/resources/9999999/script/get_ampscript-expected.html +++ b/test/resources/9999999/script/get_ampscript-expected.html @@ -2,4 +2,9 @@ %%[ SET @test = 'bla bla' ]%% -line2 %%= v(@test) =%% still line2 line3 +line2 %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% still line2 line3 + diff --git a/test/resources/9999999/script/get_mixed-expected.html b/test/resources/9999999/script/get_mixed-expected.html index 99c35e107..4fce50c94 100644 --- a/test/resources/9999999/script/get_mixed-expected.html +++ b/test/resources/9999999/script/get_mixed-expected.html @@ -5,5 +5,8 @@ %%[ SET @test = 'bla bla' ]%% -line2 %%= v(@test) =%% still line2; collapsed to line2 because it's assumed +line2 %%= ContentBlockByKey("mcdev-issue-1157") =%% still line2; collapsed to line2 because it's assumed HTML + diff --git a/test/type.script.test.js b/test/type.script.test.js index f5a4770de..2c015db94 100644 --- a/test/type.script.test.js +++ b/test/type.script.test.js @@ -87,12 +87,12 @@ describe('type: script', () => { 'returned metadata was not equal expected' ); expect( - await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'html') + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'ssjs') ).to.not.exist; expect( - await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'ssjs') + await testUtils.getActualFile('testExisting_script_ampincluded', 'script', 'html') ).to.equal( - await testUtils.getExpectedFile('9999999', 'script', 'get_ampincluded', 'ssjs') + await testUtils.getExpectedFile('9999999', 'script', 'get_ampincluded', 'html') ); // test with mixed code (ssjs and ampscript side-by-side) From 998c4fc8bd5a42f891acdb01f17ef6f89cf6646c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 17:04:03 +0200 Subject: [PATCH 345/359] #1270: add tests for rcb asset --- .../asset/block-1157-retrieve-expected.html | 2 +- ...ng_asset_message-html-rcb-id-expected.html | 33 +++ ...g_asset_message-html-rcb-key-expected.html | 33 +++ ..._asset_message-html-rcb-name-expected.html | 35 +++ ...sset_message-preheader-rcb-id-expected.amp | 4 + ...set_message-preheader-rcb-key-expected.amp | 4 + ...et_message-preheader-rcb-name-expected.amp | 4 + ...ing_asset_message-text-rcb-id-expected.amp | 4 + ...ng_asset_message-text-rcb-key-expected.amp | 4 + ...g_asset_message-text-rcb-name-expected.amp | 4 + .../content/assets/1295064/get-response.json | 2 +- .../content/assets/808714/get-response.json | 7 +- test/type.asset.test.js | 254 ++++++++++++++++++ 13 files changed, 385 insertions(+), 5 deletions(-) create mode 100644 test/resources/9999999/asset/testExisting_asset_message-html-rcb-id-expected.html create mode 100644 test/resources/9999999/asset/testExisting_asset_message-html-rcb-key-expected.html create mode 100644 test/resources/9999999/asset/testExisting_asset_message-html-rcb-name-expected.html create mode 100644 test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-id-expected.amp create mode 100644 test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-key-expected.amp create mode 100644 test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-name-expected.amp create mode 100644 test/resources/9999999/asset/testExisting_asset_message-text-rcb-id-expected.amp create mode 100644 test/resources/9999999/asset/testExisting_asset_message-text-rcb-key-expected.amp create mode 100644 test/resources/9999999/asset/testExisting_asset_message-text-rcb-name-expected.amp diff --git a/test/resources/9999999/asset/block-1157-retrieve-expected.html b/test/resources/9999999/asset/block-1157-retrieve-expected.html index 19d29887d..ffee646b5 100644 --- a/test/resources/9999999/asset/block-1157-retrieve-expected.html +++ b/test/resources/9999999/asset/block-1157-retrieve-expected.html @@ -17,7 +17,7 @@
my 2nd html
-
%%=TreatAsContent(ContentBlockByName("Content Builder\my very long path\Content Blocks Library\COMMON\some other folder\my code snippet"))=%%
+
%%=TreatAsContent(ContentBlockByFake("Content Builder\my very long path\Content Blocks Library\COMMON\some other folder\my code snippet"))=%%
diff --git a/test/resources/9999999/asset/testExisting_asset_message-html-rcb-id-expected.html b/test/resources/9999999/asset/testExisting_asset_message-html-rcb-id-expected.html new file mode 100644 index 000000000..37ccf3a44 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-html-rcb-id-expected.html @@ -0,0 +1,33 @@ +Update Profile + + + + +
+ This email was sent by: %%Member_Busname%%
%%Member_Addr%% %%Member_City%%, %%Member_State%%, + %%Member_PostalCode%%, %%Member_Country%%

+
+Manage Subscriptions %%= ContentBlockById(1295064) =%% + +%%= ContentBlockById(1295064) =%% + +%%= ContentBlockById(1295064) =%% + diff --git a/test/resources/9999999/asset/testExisting_asset_message-html-rcb-key-expected.html b/test/resources/9999999/asset/testExisting_asset_message-html-rcb-key-expected.html new file mode 100644 index 000000000..88c13b4d1 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-html-rcb-key-expected.html @@ -0,0 +1,33 @@ +Update Profile + + + + +
+ This email was sent by: %%Member_Busname%%
%%Member_Addr%% %%Member_City%%, %%Member_State%%, + %%Member_PostalCode%%, %%Member_Country%%

+
+Manage Subscriptions %%= ContentBlockByKey("mcdev-issue-1157") =%% + +%%= ContentBlockByKey("mcdev-issue-1157") =%% + +%%= ContentBlockByKey("mcdev-issue-1157") =%% + diff --git a/test/resources/9999999/asset/testExisting_asset_message-html-rcb-name-expected.html b/test/resources/9999999/asset/testExisting_asset_message-html-rcb-name-expected.html new file mode 100644 index 000000000..1bf9d9da6 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-html-rcb-name-expected.html @@ -0,0 +1,35 @@ +Update Profile + + + + +
+ This email was sent by: %%Member_Busname%%
%%Member_Addr%% %%Member_City%%, %%Member_State%%, + %%Member_PostalCode%%, %%Member_Country%%

+
+Manage Subscriptions %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% + +%%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% + +%%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% + diff --git a/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-id-expected.amp b/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-id-expected.amp new file mode 100644 index 000000000..2c521eee7 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-id-expected.amp @@ -0,0 +1,4 @@ +%%= ContentBlockById(1295064) =%% %%= ContentBlockById(1295064) =%% %%= ContentBlockById(1295064) =%% diff --git a/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-key-expected.amp b/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-key-expected.amp new file mode 100644 index 000000000..a72b4a4d9 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-key-expected.amp @@ -0,0 +1,4 @@ +%%= ContentBlockByKey("mcdev-issue-1157") =%% %%= ContentBlockByKey("mcdev-issue-1157") =%% %%= ContentBlockByKey("mcdev-issue-1157") =%% diff --git a/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-name-expected.amp b/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-name-expected.amp new file mode 100644 index 000000000..20d5640d3 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-preheader-rcb-name-expected.amp @@ -0,0 +1,4 @@ +%%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% diff --git a/test/resources/9999999/asset/testExisting_asset_message-text-rcb-id-expected.amp b/test/resources/9999999/asset/testExisting_asset_message-text-rcb-id-expected.amp new file mode 100644 index 000000000..2c521eee7 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-text-rcb-id-expected.amp @@ -0,0 +1,4 @@ +%%= ContentBlockById(1295064) =%% %%= ContentBlockById(1295064) =%% %%= ContentBlockById(1295064) =%% diff --git a/test/resources/9999999/asset/testExisting_asset_message-text-rcb-key-expected.amp b/test/resources/9999999/asset/testExisting_asset_message-text-rcb-key-expected.amp new file mode 100644 index 000000000..a72b4a4d9 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-text-rcb-key-expected.amp @@ -0,0 +1,4 @@ +%%= ContentBlockByKey("mcdev-issue-1157") =%% %%= ContentBlockByKey("mcdev-issue-1157") =%% %%= ContentBlockByKey("mcdev-issue-1157") =%% diff --git a/test/resources/9999999/asset/testExisting_asset_message-text-rcb-name-expected.amp b/test/resources/9999999/asset/testExisting_asset_message-text-rcb-name-expected.amp new file mode 100644 index 000000000..20d5640d3 --- /dev/null +++ b/test/resources/9999999/asset/testExisting_asset_message-text-rcb-name-expected.amp @@ -0,0 +1,4 @@ +%%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% diff --git a/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json b/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json index d33670c1c..94d12294e 100644 --- a/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json +++ b/test/resources/9999999/asset/v1/content/assets/1295064/get-response.json @@ -45,7 +45,7 @@ "name": "Content Builder", "parentId": 0 }, - "content": "
\n my 1st html\n
\n\n%%[ /* my ampscript */ ]%%\n\n\n\n
\n my 2nd html\n
\n
%%=TreatAsContent(ContentBlockByName(\"Content Builder\\my very long path\\Content Blocks Library\\COMMON\\some other folder\\my code snippet\"))=%%
", + "content": "
\n my 1st html\n
\n\n%%[ /* my ampscript */ ]%%\n\n\n\n
\n my 2nd html\n
\n
%%=TreatAsContent(ContentBlockByFake(\"Content Builder\\my very long path\\Content Blocks Library\\COMMON\\some other folder\\my code snippet\"))=%%
", "design": "", "meta": { "wrapperStyles": { diff --git a/test/resources/9999999/asset/v1/content/assets/808714/get-response.json b/test/resources/9999999/asset/v1/content/assets/808714/get-response.json index a93eeb69c..1f89ab53d 100644 --- a/test/resources/9999999/asset/v1/content/assets/808714/get-response.json +++ b/test/resources/9999999/asset/v1/content/assets/808714/get-response.json @@ -59,6 +59,7 @@ }, "preheader": { "thumbnail": {}, + "content": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%% %%= ContentBlockById(1295064) =%% %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%% ", "availableViews": [], "data": { "email": { @@ -71,7 +72,7 @@ }, "html": { "thumbnail": {}, - "content": "Update Profile\n\n \n \n \n
\n This email was sent by: %%Member_Busname%%
%%Member_Addr%%\n %%Member_City%%, %%Member_State%%, %%Member_PostalCode%%, %%Member_Country%%
\n
\nManage Subscriptions\n", + "content": "Update Profile\n\n \n \n \n
\n This email was sent by: %%Member_Busname%%
%%Member_Addr%%\n %%Member_City%%, %%Member_State%%, %%Member_PostalCode%%, %%Member_Country%%
\n
\nManage Subscriptions\n%%= ContentBlockByKey(\"mcdev-issue-1157\") =%% %%= ContentBlockById(1295064) =%% %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%% ", "availableViews": [], "data": { "email": { @@ -84,15 +85,15 @@ }, "text": { "thumbnail": {}, + "content": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%% %%= ContentBlockById(1295064) =%% %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%% ", "availableViews": [], "data": { "email": { "options": { - "generateFrom": "html" + "generateFrom": null } } }, - "generateFrom": "html", "modelVersion": 2 }, "viewAsAWebPage": { diff --git a/test/type.asset.test.js b/test/type.asset.test.js index 68ed05dcf..5266c1f04 100644 --- a/test/type.asset.test.js +++ b/test/type.asset.test.js @@ -543,4 +543,258 @@ describe('type: asset', () => { return; }); }); + + describe('ReplaceContentBlockByX ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + asset: null, + }, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].asset, + ['testExisting_asset_message'], + 'should have found the right assets that need updating' + ); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.asset ? Object.keys(result.asset).length : 0, + 5, + 'only 5 assets expected' + ); + // check if conversions happened + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'html', + 'views.html.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-html-rcb-name', + 'html' + ) + ); + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'amp', + 'views.preheader.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-preheader-rcb-name', + 'amp' + ) + ); + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'amp', + 'views.text.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-text-rcb-name', + 'amp' + ) + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 26, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + asset: null, + }, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].asset, + ['testExisting_asset_message'], + 'should have found the right assets that need updating' + ); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.asset ? Object.keys(result.asset).length : 0, + 5, + 'only 5 assets expected' + ); + // check if conversions happened + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'html', + 'views.html.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-html-rcb-id', + 'html' + ) + ); + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'amp', + 'views.preheader.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-preheader-rcb-id', + 'amp' + ) + ); + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'amp', + 'views.text.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-text-rcb-id', + 'amp' + ) + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 26, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + asset: null, + }, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].asset, + ['testExisting_asset_message'], + 'should have found the right assets that need updating' + ); + // get results from cache + const result = cache.getCache(); + assert.equal( + result.asset ? Object.keys(result.asset).length : 0, + 5, + 'only 5 assets expected' + ); + // check if conversions happened + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'html', + 'views.html.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-html-rcb-key', + 'html' + ) + ); + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'amp', + 'views.preheader.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-preheader-rcb-key', + 'amp' + ) + ); + expect( + await getActualFile( + 'testExisting_asset_message', + 'asset', + 'message', + 'amp', + 'views.text.content' + ) + ).to.equal( + await testUtils.getExpectedFile( + '9999999', + 'asset', + 'testExisting_asset_message-text-rcb-key', + 'amp' + ) + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 26, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); }); From 671ab192b40c30191ae7a79d69ca5f0b840f4750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 17:20:03 +0200 Subject: [PATCH 346/359] #1270: add tests for rcb senderProfile --- test/general.test.js | 4 +- .../senderProfile/get-rcb-id-expected.json | 16 +++ .../senderProfile/get-rcb-key-expected.json | 16 +++ .../senderProfile/get-rcb-name-expected.json | 16 +++ .../senderProfile/retrieve-response.xml | 18 +++ test/type.senderProfile.test.js | 117 +++++++++++++++++- 6 files changed, 181 insertions(+), 6 deletions(-) create mode 100644 test/resources/9999999/senderProfile/get-rcb-id-expected.json create mode 100644 test/resources/9999999/senderProfile/get-rcb-key-expected.json create mode 100644 test/resources/9999999/senderProfile/get-rcb-name-expected.json diff --git a/test/general.test.js b/test/general.test.js index dd29dfb2b..61343e923 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -72,8 +72,8 @@ describe('GENERAL', () => { ); assert.equal( Object.keys(result[buName]['senderProfile']).length, - 2, - 'retrieve should have returned 2 senderProfile' + 3, + 'retrieve should have returned 3 senderProfile' ); assert.equal( testUtils.getAPIHistoryLength(), diff --git a/test/resources/9999999/senderProfile/get-rcb-id-expected.json b/test/resources/9999999/senderProfile/get-rcb-id-expected.json new file mode 100644 index 000000000..9fcf3d081 --- /dev/null +++ b/test/resources/9999999/senderProfile/get-rcb-id-expected.json @@ -0,0 +1,16 @@ +{ + "CreatedDate": "2021-08-03T11:14:00", + "ModifiedDate": "2021-08-03T11:14:00", + "CustomerKey": "testExisting_senderProfile_rcb", + "Name": "testExisting_senderProfile_rcb", + "Description": "Send from joern.berkefeld@accenture.com", + "FromName": "%%= ContentBlockById(1295064) =%%", + "FromAddress": "%%= ContentBlockById(1295064) =%%", + "UseDefaultRMMRules": true, + "AutoForwardToEmailAddress": "%%= ContentBlockById(1295064) =%%", + "AutoForwardToName": "%%= ContentBlockById(1295064) =%%", + "DirectForward": false, + "AutoReply": false, + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "" +} diff --git a/test/resources/9999999/senderProfile/get-rcb-key-expected.json b/test/resources/9999999/senderProfile/get-rcb-key-expected.json new file mode 100644 index 000000000..deb1f2e80 --- /dev/null +++ b/test/resources/9999999/senderProfile/get-rcb-key-expected.json @@ -0,0 +1,16 @@ +{ + "CreatedDate": "2021-08-03T11:14:00", + "ModifiedDate": "2021-08-03T11:14:00", + "CustomerKey": "testExisting_senderProfile_rcb", + "Name": "testExisting_senderProfile_rcb", + "Description": "Send from joern.berkefeld@accenture.com", + "FromName": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "FromAddress": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "UseDefaultRMMRules": true, + "AutoForwardToEmailAddress": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "AutoForwardToName": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "DirectForward": false, + "AutoReply": false, + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "" +} diff --git a/test/resources/9999999/senderProfile/get-rcb-name-expected.json b/test/resources/9999999/senderProfile/get-rcb-name-expected.json new file mode 100644 index 000000000..9ad67c0f5 --- /dev/null +++ b/test/resources/9999999/senderProfile/get-rcb-name-expected.json @@ -0,0 +1,16 @@ +{ + "CreatedDate": "2021-08-03T11:14:00", + "ModifiedDate": "2021-08-03T11:14:00", + "CustomerKey": "testExisting_senderProfile_rcb", + "Name": "testExisting_senderProfile_rcb", + "Description": "Send from joern.berkefeld@accenture.com", + "FromName": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "FromAddress": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "UseDefaultRMMRules": true, + "AutoForwardToEmailAddress": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "AutoForwardToName": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "DirectForward": false, + "AutoReply": false, + "SenderHeaderEmailAddress": "", + "SenderHeaderName": "" +} diff --git a/test/resources/9999999/senderProfile/retrieve-response.xml b/test/resources/9999999/senderProfile/retrieve-response.xml index c10108b15..49502df76 100644 --- a/test/resources/9999999/senderProfile/retrieve-response.xml +++ b/test/resources/9999999/senderProfile/retrieve-response.xml @@ -57,6 +57,24 @@ + + + 2021-08-03T11:14:00 + 2021-08-03T11:14:00 + a75d452b-7ef4-eb11-b82d-48df37d1da99 + testExisting_senderProfile_rcb + testExisting_senderProfile_rcb + Send from joern.berkefeld@accenture.com + %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% + %%= ContentBlockByKey("mcdev-issue-1157") =%% + true + %%= ContentBlockById(1295064) =%% + %%= ContentBlockById(1295064) =%% + false + false + + + diff --git a/test/type.senderProfile.test.js b/test/type.senderProfile.test.js index 90356b34e..4c32e1777 100644 --- a/test/type.senderProfile.test.js +++ b/test/type.senderProfile.test.js @@ -26,8 +26,8 @@ describe('type: senderProfile', () => { const result = cache.getCache(); assert.equal( result.senderProfile ? Object.keys(result.senderProfile).length : 0, - 2, - 'only one senderProfile expected' + 3, + '3 senderProfiles expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_senderProfile', 'senderProfile'), @@ -58,8 +58,8 @@ describe('type: senderProfile', () => { const result = cache.getCache(); assert.equal( result.senderProfile ? Object.keys(result.senderProfile).length : 0, - 3, - 'two senderProfiles expected' + 4, + '4 senderProfiles expected' ); // confirm created item assert.deepEqual( @@ -144,4 +144,113 @@ describe('type: senderProfile', () => { return; }); }); + + describe('ReplaceContentBlockByX ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + senderProfile: null, + }, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + + // check if conversions happened + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-name'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 13, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + senderProfile: null, + }, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + + // check if conversions happened + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-id'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 13, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + senderProfile: null, + }, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right assets that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-key'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 13, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); }); From 031cdc5afcb53bd544981de3d2b93fbe5027ce61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 17:26:29 +0200 Subject: [PATCH 347/359] #0: fix bad folder id for dataExtension test data --- test/resources/9999999/dataExtension/retrieve-response.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/resources/9999999/dataExtension/retrieve-response.xml b/test/resources/9999999/dataExtension/retrieve-response.xml index 973e3f571..8e1c6d51e 100644 --- a/test/resources/9999999/dataExtension/retrieve-response.xml +++ b/test/resources/9999999/dataExtension/retrieve-response.xml @@ -116,7 +116,7 @@ false false - 290821 + 2 From d008674b02555f58fc35de4d4cd5f98a833f61e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 17:30:13 +0200 Subject: [PATCH 348/359] #1270: clarify that buildTemplate and buildDefinition can be used without keys/names - if typekeycombo was handed in --- @types/lib/index.d.ts | 8 ++++---- @types/lib/index.d.ts.map | 2 +- lib/index.js | 4 ++-- test/general.test.js | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts index cb2151cf5..2647090e1 100644 --- a/@types/lib/index.d.ts +++ b/@types/lib/index.d.ts @@ -231,21 +231,21 @@ declare class Mcdev { * * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type - * @param {string[]} keyArr customerkey of the metadata + * @param {string[] | undefined} keyArr customerkey of the metadata * @param {string} market market localizations * @returns {Promise.} - */ - static buildTemplate(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr: string[], market: string): Promise; + static buildTemplate(businessUnit: string, selectedTypes: string | TypeKeyCombo, keyArr: string[] | undefined, market: string): Promise; /** * Build a specific metadata file based on a template. * * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type - * @param {string[]} nameArr name of the metadata + * @param {string[] | undefined} nameArr name of the metadata * @param {string} market market localizations * @returns {Promise.} - */ - static buildDefinition(businessUnit: string, selectedTypes: string | TypeKeyCombo, nameArr: string[], market: string): Promise; + static buildDefinition(businessUnit: string, selectedTypes: string | TypeKeyCombo, nameArr: string[] | undefined, market: string): Promise; /** * Build a specific metadata file based on a template using a list of bu-market combos * diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index 08c9ef6b4..fbfe7b1df 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBA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AAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL,IAAI,CAIhB;IACD;;;;;OAKG;IACH,wBAHW,MAAM,GACJ,IAAI,CA6ChB;IACD;;;;;;;;;;OAUG;IACH;QAPyB,KAAK,GAAnB,MAAM;QAEQ,MAAM,GAApB,MAAM;Q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B,2BAA2B,EAAE,GAC3B;YAAiB,MAAM,GAAE,MAAM;MAAE,CAuF7C;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA0E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index 9e59a2602..a4467fab3 100644 --- a/lib/index.js +++ b/lib/index.js @@ -821,7 +821,7 @@ class Mcdev { * * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type - * @param {string[]} keyArr customerkey of the metadata + * @param {string[] | undefined} keyArr customerkey of the metadata * @param {string} market market localizations * @returns {Promise.} - */ @@ -862,7 +862,7 @@ class Mcdev { * * @param {string} businessUnit references credentials from properties.json * @param {string | TypeKeyCombo} selectedTypes limit retrieval to given metadata type - * @param {string[]} nameArr name of the metadata + * @param {string[] | undefined} nameArr name of the metadata * @param {string} market market localizations * @returns {Promise.} - */ diff --git a/test/general.test.js b/test/general.test.js index 61343e923..3569b8b45 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -315,7 +315,7 @@ describe('GENERAL', () => { const templateResult = await handler.buildTemplate( buName, typeKeyCombo, - null, + undefined, 'testSourceMarket' ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); @@ -349,7 +349,7 @@ describe('GENERAL', () => { const definitionResult = await handler.buildDefinition( buName, typeKeyCombo, - null, + undefined, 'testTargetMarket' ); assert.equal( @@ -692,7 +692,7 @@ describe('GENERAL', () => { const templateResult = await handler.buildTemplate( buName, typeKeyCombo, - null, + undefined, 'testSourceMarket' ); assert.equal(process.exitCode, 0, 'buildTemplate should not have thrown an error'); From 8cd93ed585974169abebc3eb30579ac03e2188a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 17:42:14 +0200 Subject: [PATCH 349/359] #1270: add tests for rcb triggeredSend --- .../triggeredSend/get-rcb-id-expected.json | 29 +++++ .../triggeredSend/get-rcb-key-expected.json | 29 +++++ .../triggeredSend/get-rcb-name-expected.json | 29 +++++ ...ctive,Inactive,Moved,Canceled-response.xml | 47 +++++++ test/type.triggeredSend.test.js | 115 +++++++++++++++++- 5 files changed, 246 insertions(+), 3 deletions(-) create mode 100644 test/resources/9999999/triggeredSend/get-rcb-id-expected.json create mode 100644 test/resources/9999999/triggeredSend/get-rcb-key-expected.json create mode 100644 test/resources/9999999/triggeredSend/get-rcb-name-expected.json diff --git a/test/resources/9999999/triggeredSend/get-rcb-id-expected.json b/test/resources/9999999/triggeredSend/get-rcb-id-expected.json new file mode 100644 index 000000000..a759353dd --- /dev/null +++ b/test/resources/9999999/triggeredSend/get-rcb-id-expected.json @@ -0,0 +1,29 @@ +{ + "AllowedSlots": 0, + "AutoAddSubscribers": false, + "AutoUpdateSubscribers": false, + "BatchInterval": 0, + "BccEmail": "", + "CreatedDate": "2018-06-25T05:58:00", + "CustomerKey": "testExisting_triggeredSend_rcb", + "Description": "Unsubscribe_Email", + "DynamicEmailSubject": "%%= ContentBlockById(1295064) =%%", + "EmailSubject": "%%= ContentBlockById(1295064) =%%", + "FromAddress": "%%= ContentBlockById(1295064) =%%", + "FromName": "%%= ContentBlockById(1295064) =%%", + "IsMultipart": false, + "IsWrapped": true, + "Keyword": "", + "ModifiedDate": "2018-06-25T05:58:00", + "Name": "testExisting_triggeredSend_rcb", + "NewSlotTrigger": 0, + "c__priority": "Medium", + "SuppressTracking": false, + "TriggeredSendStatus": "New", + "TriggeredSendType": "Continuous", + "r__asset_key": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__folder_Path": "Triggered Sends", + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile_rcb" +} diff --git a/test/resources/9999999/triggeredSend/get-rcb-key-expected.json b/test/resources/9999999/triggeredSend/get-rcb-key-expected.json new file mode 100644 index 000000000..b0f97d66f --- /dev/null +++ b/test/resources/9999999/triggeredSend/get-rcb-key-expected.json @@ -0,0 +1,29 @@ +{ + "AllowedSlots": 0, + "AutoAddSubscribers": false, + "AutoUpdateSubscribers": false, + "BatchInterval": 0, + "BccEmail": "", + "CreatedDate": "2018-06-25T05:58:00", + "CustomerKey": "testExisting_triggeredSend_rcb", + "Description": "Unsubscribe_Email", + "DynamicEmailSubject": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "EmailSubject": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "FromAddress": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "FromName": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "IsMultipart": false, + "IsWrapped": true, + "Keyword": "", + "ModifiedDate": "2018-06-25T05:58:00", + "Name": "testExisting_triggeredSend_rcb", + "NewSlotTrigger": 0, + "c__priority": "Medium", + "SuppressTracking": false, + "TriggeredSendStatus": "New", + "TriggeredSendType": "Continuous", + "r__asset_key": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__folder_Path": "Triggered Sends", + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile_rcb" +} diff --git a/test/resources/9999999/triggeredSend/get-rcb-name-expected.json b/test/resources/9999999/triggeredSend/get-rcb-name-expected.json new file mode 100644 index 000000000..d0d03a398 --- /dev/null +++ b/test/resources/9999999/triggeredSend/get-rcb-name-expected.json @@ -0,0 +1,29 @@ +{ + "AllowedSlots": 0, + "AutoAddSubscribers": false, + "AutoUpdateSubscribers": false, + "BatchInterval": 0, + "BccEmail": "", + "CreatedDate": "2018-06-25T05:58:00", + "CustomerKey": "testExisting_triggeredSend_rcb", + "Description": "Unsubscribe_Email", + "DynamicEmailSubject": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "EmailSubject": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "FromAddress": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "FromName": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "IsMultipart": false, + "IsWrapped": true, + "Keyword": "", + "ModifiedDate": "2018-06-25T05:58:00", + "Name": "testExisting_triggeredSend_rcb", + "NewSlotTrigger": 0, + "c__priority": "Medium", + "SuppressTracking": false, + "TriggeredSendStatus": "New", + "TriggeredSendType": "Continuous", + "r__asset_key": "testExisting_asset_message", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__folder_Path": "Triggered Sends", + "r__sendClassification_key": "testExisting_sendClassification", + "r__senderProfile_key": "testExisting_senderProfile_rcb" +} diff --git a/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml b/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml index 83f6115b8..1231c44ed 100644 --- a/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml +++ b/test/resources/9999999/triggeredSendDefinition/retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml @@ -68,6 +68,53 @@ 0 4 + + + + TestEmailAddr + + + 2018-06-25T05:58:00 + 2018-06-25T05:58:00 + b3150cf0-6e78-e811-80d4-1402ec721c9d + testExisting_triggeredSend_rcb + false + testExisting_triggeredSend_rcb + Unsubscribe_Email + + 89348 + + + + testExisting_sendClassification + + + + + testExisting_senderProfile_rcb + + %%= ContentBlockByName("Content Builder\dont strip non ssjs content") =%% + %%= ContentBlockByKey("mcdev-issue-1157") =%% + false + Continuous + New + + + 531213 + + + false + false + 0 + + %%= ContentBlockById(1295064) =%% + %%= ContentBlockById(1295064) =%% + false + true + 0 + 0 + 4 + diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index 5bfcc87b2..543bf2672 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -26,8 +26,8 @@ describe('type: triggeredSend', () => { const result = cache.getCache(); assert.equal( result.triggeredSend ? Object.keys(result.triggeredSend).length : 0, - 1, - 'only one triggeredSend expected' + 2, + 'only 2 triggeredSend expected' ); assert.deepEqual( await testUtils.getActualJson('testExisting_triggeredSend', 'triggeredSend'), @@ -57,7 +57,7 @@ describe('type: triggeredSend', () => { const result = cache.getCache(); assert.equal( result.triggeredSend ? Object.keys(result.triggeredSend).length : 0, - 2, + 3, 'two triggeredSends expected' ); // confirm created item @@ -156,4 +156,113 @@ describe('type: triggeredSend', () => { describe('Pause ================', () => { it('Should pause a triggeredSend by key'); }); + + describe('ReplaceContentBlockByX ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + triggeredSend: null, + }, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].triggeredSend, + ['testExisting_triggeredSend_rcb'], + 'should have found the right triggeredSends that need updating' + ); + + // check if conversions happened + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_triggeredSend_rcb', 'triggeredSend'), + await testUtils.getExpectedJson('9999999', 'triggeredSend', 'get-rcb-name'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 24, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + triggeredSend: null, + }, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].triggeredSend, + ['testExisting_triggeredSend_rcb'], + 'should have found the right triggeredSends that need updating' + ); + + // check if conversions happened + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_triggeredSend_rcb', 'triggeredSend'), + await testUtils.getExpectedJson('9999999', 'triggeredSend', 'get-rcb-id'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 24, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + triggeredSend: null, + }, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].triggeredSend, + ['testExisting_triggeredSend_rcb'], + 'should have found the right assets that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_triggeredSend_rcb', 'triggeredSend'), + await testUtils.getExpectedJson('9999999', 'triggeredSend', 'get-rcb-key'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 24, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); }); From 448865a646000658cd7bdcfdc9ca4b399ef90eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Thu, 6 Jun 2024 18:02:15 +0200 Subject: [PATCH 350/359] #1270: add tests for rcb journey --- .../get-response.json | 12 +- .../get-response.json | 12 +- .../9999999/journey/build-expected.json | 12 +- .../journey/get-quicksend-expected.json | 12 +- .../get-quicksend-rcb-id-expected.json | 232 ++++++++++++++++++ .../get-quicksend-rcb-key-expected.json | 232 ++++++++++++++++++ .../get-quicksend-rcb-name-expected.json | 232 ++++++++++++++++++ .../9999999/journey/template-expected.json | 12 +- test/type.journey.test.js | 109 ++++++++ 9 files changed, 835 insertions(+), 30 deletions(-) create mode 100644 test/resources/9999999/journey/get-quicksend-rcb-id-expected.json create mode 100644 test/resources/9999999/journey/get-quicksend-rcb-key-expected.json create mode 100644 test/resources/9999999/journey/get-quicksend-rcb-name-expected.json diff --git a/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json b/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json index dadcd9ed5..d1a7ab46c 100644 --- a/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json +++ b/test/resources/9999999/interaction/v1/interactions/3c3f4112-9b43-43ca-8a89-aa0375b2c1a2/get-response.json @@ -31,8 +31,8 @@ "triggeredSend": { "autoAddSubscribers": true, "autoUpdateSubscribers": true, - "bccEmail": "", - "ccEmail": "", + "bccEmail": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "ccEmail": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "created": {}, "description": "my activity info text", "domainExclusions": [ @@ -41,17 +41,17 @@ "name": "testExisting_DomainExclusion" } ], - "dynamicEmailSubject": "testExisting_ email subject", + "dynamicEmailSubject": "testExisting_ dynamic email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "emailId": 531213, - "emailSubject": "testExisting_ email subject", - "exclusionFilter": "/* insert ampscript here */", + "emailSubject": "testExisting_ email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockById(1295064) =%%", "isSalesforceTracking": false, "isMultipart": true, "isSendLogging": true, "isStoppedOnJobError": false, "keyword": "", "modified": {}, - "preHeader": "testExisting_ email preheader", + "preHeader": "testExisting_ email preheader %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "priority": 3, "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", "suppressionLists": [ diff --git a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json index dadcd9ed5..d1a7ab46c 100644 --- a/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json +++ b/test/resources/9999999/interaction/v1/interactions/key_testExisting_journey_Quicksend/get-response.json @@ -31,8 +31,8 @@ "triggeredSend": { "autoAddSubscribers": true, "autoUpdateSubscribers": true, - "bccEmail": "", - "ccEmail": "", + "bccEmail": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "ccEmail": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "created": {}, "description": "my activity info text", "domainExclusions": [ @@ -41,17 +41,17 @@ "name": "testExisting_DomainExclusion" } ], - "dynamicEmailSubject": "testExisting_ email subject", + "dynamicEmailSubject": "testExisting_ dynamic email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "emailId": 531213, - "emailSubject": "testExisting_ email subject", - "exclusionFilter": "/* insert ampscript here */", + "emailSubject": "testExisting_ email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockById(1295064) =%%", "isSalesforceTracking": false, "isMultipart": true, "isSendLogging": true, "isStoppedOnJobError": false, "keyword": "", "modified": {}, - "preHeader": "testExisting_ email preheader", + "preHeader": "testExisting_ email preheader %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "priority": 3, "sendClassificationId": "95da425b-a06f-e611-96fe-38eaa7142c61", "suppressionLists": [ diff --git a/test/resources/9999999/journey/build-expected.json b/test/resources/9999999/journey/build-expected.json index 829b51b46..409d064f0 100644 --- a/test/resources/9999999/journey/build-expected.json +++ b/test/resources/9999999/journey/build-expected.json @@ -25,20 +25,20 @@ "triggeredSend": { "autoAddSubscribers": true, "autoUpdateSubscribers": true, - "bccEmail": "", - "ccEmail": "", + "bccEmail": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "ccEmail": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "created": {}, "description": "my activity info text", - "dynamicEmailSubject": "testTemplated_ email subject", - "emailSubject": "testTemplated_ email subject", - "exclusionFilter": "/* insert ampscript here */", + "dynamicEmailSubject": "testTemplated_ dynamic email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "emailSubject": "testTemplated_ email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockById(1295064) =%%", "isSalesforceTracking": false, "isMultipart": true, "isSendLogging": true, "isStoppedOnJobError": false, "keyword": "", "modified": {}, - "preHeader": "testTemplated_ email preheader", + "preHeader": "testTemplated_ email preheader %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "suppressTracking": true, "throttleLimit": 0, "throttleOpens": "1/1/0001 12:00:00 AM", diff --git a/test/resources/9999999/journey/get-quicksend-expected.json b/test/resources/9999999/journey/get-quicksend-expected.json index a34d705bc..c08e6fa6d 100644 --- a/test/resources/9999999/journey/get-quicksend-expected.json +++ b/test/resources/9999999/journey/get-quicksend-expected.json @@ -28,20 +28,20 @@ "triggeredSend": { "autoAddSubscribers": true, "autoUpdateSubscribers": true, - "bccEmail": "", - "ccEmail": "", + "bccEmail": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "ccEmail": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "created": {}, "description": "my activity info text", - "dynamicEmailSubject": "testExisting_ email subject", - "emailSubject": "testExisting_ email subject", - "exclusionFilter": "/* insert ampscript here */", + "dynamicEmailSubject": "testExisting_ dynamic email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "emailSubject": "testExisting_ email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockById(1295064) =%%", "isSalesforceTracking": false, "isMultipart": true, "isSendLogging": true, "isStoppedOnJobError": false, "keyword": "", "modified": {}, - "preHeader": "testExisting_ email preheader", + "preHeader": "testExisting_ email preheader %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "suppressTracking": true, "throttleLimit": 0, "throttleOpens": "1/1/0001 12:00:00 AM", diff --git a/test/resources/9999999/journey/get-quicksend-rcb-id-expected.json b/test/resources/9999999/journey/get-quicksend-rcb-id-expected.json new file mode 100644 index 000000000..ee1e4bf63 --- /dev/null +++ b/test/resources/9999999/journey/get-quicksend-rcb-id-expected.json @@ -0,0 +1,232 @@ +{ + "key": "testExisting_journey_Quicksend", + "name": "testExisting_journey_Quicksend", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", + "activities": [ + { + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testExisting_asset_mail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "%%= ContentBlockById(1295064) =%%", + "ccEmail": "%%= ContentBlockById(1295064) =%%", + "created": {}, + "description": "my activity info text", + "dynamicEmailSubject": "testExisting_ dynamic email subject %%= ContentBlockById(1295064) =%%", + "emailSubject": "testExisting_ email subject %%= ContentBlockById(1295064) =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockById(1295064) =%%", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "testExisting_ email preheader %%= ContentBlockById(1295064) =%%", + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers", + "suppressionLists": ["Suppression Lists/testExisting_suppressionList"] + }, + "r__dataExtension_key": { + "domainExclusions": ["testExisting_DomainExclusion"] + }, + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", + "c__priority": "High", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message" + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "sourceInteractionId": "00000000-0000-0000-0000-000000000000", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", + "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { "email": false } + }, + "executionMode": "Production", + "status": "Draft", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/resources/9999999/journey/get-quicksend-rcb-key-expected.json b/test/resources/9999999/journey/get-quicksend-rcb-key-expected.json new file mode 100644 index 000000000..088afe29d --- /dev/null +++ b/test/resources/9999999/journey/get-quicksend-rcb-key-expected.json @@ -0,0 +1,232 @@ +{ + "key": "testExisting_journey_Quicksend", + "name": "testExisting_journey_Quicksend", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", + "activities": [ + { + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testExisting_asset_mail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "ccEmail": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "created": {}, + "description": "my activity info text", + "dynamicEmailSubject": "testExisting_ dynamic email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "emailSubject": "testExisting_ email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "testExisting_ email preheader %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers", + "suppressionLists": ["Suppression Lists/testExisting_suppressionList"] + }, + "r__dataExtension_key": { + "domainExclusions": ["testExisting_DomainExclusion"] + }, + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", + "c__priority": "High", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message" + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "sourceInteractionId": "00000000-0000-0000-0000-000000000000", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", + "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { "email": false } + }, + "executionMode": "Production", + "status": "Draft", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/resources/9999999/journey/get-quicksend-rcb-name-expected.json b/test/resources/9999999/journey/get-quicksend-rcb-name-expected.json new file mode 100644 index 000000000..503c89a76 --- /dev/null +++ b/test/resources/9999999/journey/get-quicksend-rcb-name-expected.json @@ -0,0 +1,232 @@ +{ + "key": "testExisting_journey_Quicksend", + "name": "testExisting_journey_Quicksend", + "lastPublishedDate": "0001-01-01T00:00:00", + "description": "", + "version": 1, + "workflowApiVersion": 1, + "createdDate": "2024-04-24T12:18:43.47", + "modifiedDate": "2024-04-24T12:19:12.803", + "activities": [ + { + "id": "e20dcaa3-a750-44cf-9ce8-42d00378b8b4", + "key": "EMAILV2-1", + "name": "testExisting_asset_mail", + "description": "", + "type": "EMAILV2", + "outcomes": [ + { + "key": "a6b9c1af-cd89-4ce8-ba4f-bd4289188dc2", + "arguments": {}, + "metaData": { "invalid": false } + } + ], + "arguments": {}, + "configurationArguments": { + "isModified": true, + "googleAnalyticsCampaignName": "", + "triggeredSend": { + "autoAddSubscribers": true, + "autoUpdateSubscribers": true, + "bccEmail": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "ccEmail": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "created": {}, + "description": "my activity info text", + "dynamicEmailSubject": "testExisting_ dynamic email subject %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "emailSubject": "testExisting_ email subject %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "isSalesforceTracking": false, + "isMultipart": true, + "isSendLogging": true, + "isStoppedOnJobError": false, + "keyword": "", + "modified": {}, + "preHeader": "testExisting_ email preheader %%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "suppressTracking": true, + "throttleLimit": 0, + "throttleOpens": "1/1/0001 12:00:00 AM", + "throttleCloses": "1/1/0001 12:00:00 AM", + "isTrackingClicks": true, + "r__list_PathName": { + "publicationList": "my subscribers/All Subscribers", + "suppressionLists": ["Suppression Lists/testExisting_suppressionList"] + }, + "r__dataExtension_key": { + "domainExclusions": ["testExisting_DomainExclusion"] + }, + "r__senderProfile_key": "testExisting_senderProfile", + "r__sendClassification_key": "testExisting_sendClassification", + "c__priority": "High", + "r__asset_name_readOnly": "testExisting_asset_message", + "r__asset_key": "testExisting_asset_message" + }, + "applicationExtensionKey": "jb-email-activity" + }, + "metaData": { + "category": "message", + "version": "1.0", + "icon": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "iconSmall": "https://jb-email-activity.s7.marketingcloudapps.com/img/email-icon.svg", + "statsContactIcon": null, + "original_icon": "/img/email-icon.svg", + "original_iconSmall": "/img/email-icon.svg", + "sections": {}, + "isConfigured": true + }, + "schema": { + "arguments": { + "requestID": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "messageKey": { + "dataType": "Text", + "isNullable": true, + "direction": "Out", + "readOnly": false, + "access": "Hidden" + }, + "activityId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "definitionId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "emailSubjectDataBound": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "contactId": { + "dataType": "Number", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "contactKey": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "emailAddress": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectId": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "sourceCustomObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "fieldType": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "eventData": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "obfuscationProperties": { + "dataType": "Text", + "isNullable": true, + "direction": "In", + "readOnly": false, + "access": "Hidden" + }, + "customObjectKey": { + "dataType": "LongNumber", + "isNullable": true, + "direction": "In", + "readOnly": true, + "access": "Hidden" + }, + "definitionInstanceId": { + "dataType": "Text", + "isNullable": false, + "direction": "In", + "readOnly": false, + "access": "Hidden" + } + } + } + } + ], + "triggers": [ + { + "key": "TRIGGER", + "name": "TRIGGER", + "description": "", + "type": "EmailAudience", + "outcomes": [], + "arguments": {}, + "configurationArguments": {}, + "metaData": { + "sourceInteractionId": "00000000-0000-0000-0000-000000000000", + "eventDefinitionKey": "DEAudience-11be962d-064c-83d9-2804-7d1befc10325", + "chainType": "None", + "configurationRequired": false, + "iconUrl": "/images/icon-data-extension.svg", + "title": "Data Extension", + "entrySourceGroupConfigUrl": "jb:///data/entry/audience/entrysourcegroupconfig.json" + } + } + ], + "goals": [], + "exits": [], + "notifiers": [], + "entryMode": "MultipleEntries", + "definitionType": "Quicksend", + "channel": "email", + "defaults": { + "email": ["{{Event.DEAudience-11be962d-064c-83d9-2804-7d1befc10325.\"Email\"}}"], + "properties": { + "analyticsTracking": { + "enabled": true, + "analyticsType": "google", + "urlDomainsToTrack": [] + } + } + }, + "metaData": { + "dataSource": "ContactsModel", + "isScheduleSet": true, + "highThroughputSending": { "email": false } + }, + "executionMode": "Production", + "status": "Draft", + "scheduledStatus": "Draft", + "r__folder_Path": "my journeys" +} diff --git a/test/resources/9999999/journey/template-expected.json b/test/resources/9999999/journey/template-expected.json index 428055f77..cbdea3e34 100644 --- a/test/resources/9999999/journey/template-expected.json +++ b/test/resources/9999999/journey/template-expected.json @@ -25,20 +25,20 @@ "triggeredSend": { "autoAddSubscribers": true, "autoUpdateSubscribers": true, - "bccEmail": "", - "ccEmail": "", + "bccEmail": "%%= ContentBlockByName(\"Content Builder\\dont strip non ssjs content\") =%%", + "ccEmail": "%%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "created": {}, "description": "my activity info text", - "dynamicEmailSubject": "{{{prefix}}} email subject", - "emailSubject": "{{{prefix}}} email subject", - "exclusionFilter": "/* insert ampscript here */", + "dynamicEmailSubject": "{{{prefix}}} dynamic email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "emailSubject": "{{{prefix}}} email subject %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", + "exclusionFilter": "/* insert ampscript here */ %%= ContentBlockById(1295064) =%%", "isSalesforceTracking": false, "isMultipart": true, "isSendLogging": true, "isStoppedOnJobError": false, "keyword": "", "modified": {}, - "preHeader": "{{{prefix}}} email preheader", + "preHeader": "{{{prefix}}} email preheader %%= ContentBlockByKey(\"mcdev-issue-1157\") =%%", "suppressTracking": true, "throttleLimit": 0, "throttleOpens": "1/1/0001 12:00:00 AM", diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 7ffc6aa7e..89ccecbff 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -279,4 +279,113 @@ describe('type: journey', () => { return; }); }); + + describe('ReplaceContentBlockByX ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + }, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right journeys that need updating' + ); + + // check if conversions happened + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-name'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 38, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + }, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right journeys that need updating' + ); + + // check if conversions happened + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-id'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 38, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + }, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right assets that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-key'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 38, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); }); From 229e1db5c494fe318e1890877074152c82d7751f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 07:53:40 +0200 Subject: [PATCH 351/359] #1270: add test for multi-type rcb run --- test/general.test.js | 140 ++++++++++++++++++++++++++++++++ test/type.journey.test.js | 2 - test/type.senderProfile.test.js | 2 - test/type.triggeredSend.test.js | 2 - 4 files changed, 140 insertions(+), 6 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index 3569b8b45..cb1c42a66 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -16,6 +16,146 @@ describe('GENERAL', () => { testUtils.mockReset(); }); + describe('ReplaceContentBlockByX ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + senderProfile: null, + }, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right journeys that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-name'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-name'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 51, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + senderProfile: null, + }, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right journeys that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-id'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-id'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 51, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + senderProfile: null, + }, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-key'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-key'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 51, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + }); + describe('with --metadata ================', () => { describe('retrieve --metadata ~~~', () => { it('retrieve single type without keys', async () => { diff --git a/test/type.journey.test.js b/test/type.journey.test.js index 89ccecbff..ef459b0bd 100644 --- a/test/type.journey.test.js +++ b/test/type.journey.test.js @@ -301,7 +301,6 @@ describe('type: journey', () => { 'should have found the right journeys that need updating' ); - // check if conversions happened // check if conversions happened assert.deepEqual( await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), @@ -337,7 +336,6 @@ describe('type: journey', () => { 'should have found the right journeys that need updating' ); - // check if conversions happened // check if conversions happened assert.deepEqual( await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), diff --git a/test/type.senderProfile.test.js b/test/type.senderProfile.test.js index 4c32e1777..cdb01a7ee 100644 --- a/test/type.senderProfile.test.js +++ b/test/type.senderProfile.test.js @@ -166,7 +166,6 @@ describe('type: senderProfile', () => { 'should have found the right senderProfiles that need updating' ); - // check if conversions happened // check if conversions happened assert.deepEqual( await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), @@ -202,7 +201,6 @@ describe('type: senderProfile', () => { 'should have found the right senderProfiles that need updating' ); - // check if conversions happened // check if conversions happened assert.deepEqual( await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), diff --git a/test/type.triggeredSend.test.js b/test/type.triggeredSend.test.js index 543bf2672..d93beec54 100644 --- a/test/type.triggeredSend.test.js +++ b/test/type.triggeredSend.test.js @@ -178,7 +178,6 @@ describe('type: triggeredSend', () => { 'should have found the right triggeredSends that need updating' ); - // check if conversions happened // check if conversions happened assert.deepEqual( await testUtils.getActualJson('testExisting_triggeredSend_rcb', 'triggeredSend'), @@ -214,7 +213,6 @@ describe('type: triggeredSend', () => { 'should have found the right triggeredSends that need updating' ); - // check if conversions happened // check if conversions happened assert.deepEqual( await testUtils.getActualJson('testExisting_triggeredSend_rcb', 'triggeredSend'), From 6d137dfe404b3943349f1301bb3d5837a88f8731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 08:34:25 +0200 Subject: [PATCH 352/359] #1270: allow running rcb without --metadata option --- @types/lib/index.d.ts | 8 ++++---- @types/lib/index.d.ts.map | 2 +- lib/cli.js | 19 +++++++------------ lib/index.js | 4 ++-- 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/@types/lib/index.d.ts b/@types/lib/index.d.ts index 2647090e1..4b611f1f1 100644 --- a/@types/lib/index.d.ts +++ b/@types/lib/index.d.ts @@ -300,12 +300,12 @@ declare class Mcdev { * Updates the key to match the name field * * @param {string} businessUnit name of BU - * @param {TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type + * @param {TypeKeyCombo|undefined} selectedTypesArr limit retrieval to given metadata type * @param {ContentBlockConversionTypes} to what to replace with * @param {ContentBlockConversionTypes[]} [fromList] what to replace * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys */ - static replaceCbReference(businessUnit: string, selectedTypesArr: TypeKeyCombo, to: ContentBlockConversionTypes, fromList?: ContentBlockConversionTypes[]): Promise<{ + static replaceCbReference(businessUnit: string, selectedTypesArr: TypeKeyCombo | undefined, to: ContentBlockConversionTypes, fromList?: ContentBlockConversionTypes[]): Promise<{ [x: string]: object; }>; /** @@ -373,11 +373,11 @@ declare class Mcdev { /** * helper to convert CSVs into an array. if only one value was given, it's also returned as an array * - * @param {string|string[]} metadataOption potentially comma-separated value or null + * @param {string|string[]|undefined} metadataOption potentially comma-separated value or null * @param {string[]} [allowedIdentifiers] 'key', 'id', 'name' * @param {boolean} [firstOnly] removes all but the first entry if enabled * @returns {TypeKeyCombo} values split into an array. */ - static metadataToTypeKey(metadataOption: string | string[], allowedIdentifiers?: string[], firstOnly?: boolean): TypeKeyCombo; + static metadataToTypeKey(metadataOption: string | string[] | undefined, allowedIdentifiers?: string[], firstOnly?: boolean): TypeKeyCombo; } //# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/@types/lib/index.d.ts.map b/@types/lib/index.d.ts.map index fbfe7b1df..f805d4297 100644 --- a/@types/lib/index.d.ts.map +++ b/@types/lib/index.d.ts.map @@ -1 +1 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;sBAC1C,OAAO,qBAAqB,EAAE,OAAO;+BACrC,OAAO,qBAAqB,EAAE,gBAAgB;mCAC9C,OAAO,qBAAqB,EAAE,oBAAoB;kCAClD,OAAO,qBAAqB,EAAE,mBAAmB;8BACjD,OAAO,qBAAqB,EAAE,eAAe;iCAC7C,OAAO,qBAAqB,EAAE,kBAAkB;oCAChD,OAAO,qBAAqB,EAAE,qBAAqB;mCACnD,OAAO,qBAAqB,EAAE,oBAAoB;8BAClD,OAAO,qBAAqB,EAAE,eAAe;gCAC7C,OAAO,qBAAqB,EAAE,iBAAiB;0BAC/C,OAAO,qBAAqB,EAAE,WAAW;2BACzC,OAAO,qBAAqB,EAAE,YAAY;0BAC1C,OAAO,qBAAqB,EAAE,WAAW;0CACzC,OAAO,qBAAqB,EAAE,2BAA2B;AAlBtE;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;;GAEG;AACH;IACI;;OAEG;IACH,kBAFa,MAAM,CAKlB;IACD;;;;;OAKG;IACH,4CAHW,eAAe,GACb,IAAI,CAIhB;IACD;;;;;;;;OAQG;IACH;QAL0B,MAAM,GAArB,OAAO;QACQ,OAAO,GAAtB,OAAO;QACQ,KAAK,GAApB,OAAO;QACL,IAAI,CAIhB;IACD;;;;;OAKG;IACH,wBAHW,MAAM,GACJ,IAAI,CA6ChB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MAAE,CAI/C;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,oBACN,YAAY,MACZ,2BAA2B,aAC3B,2BAA2B,EAAE,GAC3B;YAAiB,MAAM,GAAE,MAAM;MAAE,CAuF7C;IAED;;;;;;;OAOG;IACH,6BALW,MAAM,oBACN,MAAM,EAAE,GAAG,YAAY,SACvB,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM;MAAE,CAwE7C;IACD;;;;;;;;OAQG;IACH,qCANW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,gBAChD,MAAM,iBACN,MAAM,SACN,MAAM,EAAE,GACN;YAAiB,MAAM,GAAE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA0E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,uBACf,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/index.js"],"names":[],"mappings":";uBAoBa,OAAO,qBAAqB,EAAE,QAAQ;0BACtC,OAAO,qBAAqB,EAAE,WAAW;8BACzC,OAAO,qBAAqB,EAAE,eAAe;2BAC7C,OAAO,qBAAqB,EAAE,YAAY;s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AE,MAAM,EAAE;MAAE,CAmK/C;IACD;;;;;;;;;OASG;IACH,mCAPW,SAAS,GAAC,OAAO,GAAC,SAAS,GAAC,oBAAoB,QAChD,MAAM,MACN,MAAM,SACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAuD9B;IAED;;;;;;OAMG;IACH,kDAJW,MAAM,YACN,QAAQ,GACN,QAAS,MAAM,EAAE,CAAC,CA0D9B;IACD;;;;;;;;OAQG;IACH,6BANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CA0E9B;IACD;;;;;;;;OAQG;IACH,wCANW,MAAM,MACN,MAAM,QACN,MAAM,WACN,MAAM,EAAE,GACN,QAAS,MAAM,EAAE,CAAC,CAyE9B;IACD;;;;;;;OAOG;IACH,yCALW,MAAM,GAAC,MAAM,EAAE,GAAC,SAAS,uBACzB,MAAM,EAAE,cACR,OAAO,GACL,YAAY,CA2ExB;CACJ"} \ No newline at end of file diff --git a/lib/cli.js b/lib/cli.js index 80d781d8b..a6e38b75d 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -831,13 +831,6 @@ yargs(hideBin(process.argv)) 'the business unit on which to perform the operation (in format "credential name/BU name")', demandOption: true, }) - .option('metadata', { - type: 'string', - alias: 'm', - group: 'Required parameters for replaceContentBlock:', - describe: 'type or type:key or type:i:id or type:n:name to fix', - demandOption: true, - }) .option('to', { type: 'string', alias: 't', @@ -846,6 +839,12 @@ yargs(hideBin(process.argv)) describe: 'what ampscript function to replace it with (key, name, id)', demandOption: true, }) + .option('metadata', { + type: 'string', + alias: 'm', + group: 'Optional parameters for replaceContentBlock:', + describe: 'type or type:key or type:i:id or type:n:name to fix', + }) .option('from', { type: 'string', alias: 'f', @@ -888,11 +887,7 @@ yargs(hideBin(process.argv)) handler: (argv) => { Mcdev.setOptions(argv); const typeKeyCombo = Mcdev.metadataToTypeKey(argv.metadata); - if ('undefined' === typeof typeKeyCombo) { - console.log('Error: --metadata value invalid'); // eslint-disable-line no-console - } else { - Mcdev.replaceCbReference(argv.bu, typeKeyCombo, argv.to, argv.from); - } + Mcdev.replaceCbReference(argv.bu, typeKeyCombo, argv.to, argv.from); }, }) // @ts-expect-error diff --git a/lib/index.js b/lib/index.js index a4467fab3..ccbf9e568 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1007,7 +1007,7 @@ class Mcdev { * Updates the key to match the name field * * @param {string} businessUnit name of BU - * @param {TypeKeyCombo} selectedTypesArr limit retrieval to given metadata type + * @param {TypeKeyCombo|undefined} selectedTypesArr limit retrieval to given metadata type * @param {ContentBlockConversionTypes} to what to replace with * @param {ContentBlockConversionTypes[]} [fromList] what to replace * @returns {Promise.>} key1: business unit name, key2:type value: list of fixed item keys @@ -1644,7 +1644,7 @@ class Mcdev { /** * helper to convert CSVs into an array. if only one value was given, it's also returned as an array * - * @param {string|string[]} metadataOption potentially comma-separated value or null + * @param {string|string[]|undefined} metadataOption potentially comma-separated value or null * @param {string[]} [allowedIdentifiers] 'key', 'id', 'name' * @param {boolean} [firstOnly] removes all but the first entry if enabled * @returns {TypeKeyCombo} values split into an array. From 8b380514b3bb7f4cfd0926e2abfea2397fe41502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 08:37:38 +0200 Subject: [PATCH 353/359] #1270: add no-type-specified test for rcb --- test/general.test.js | 452 ++++++++++++++++++++++++++---------- test/mockRoot/.mcdevrc.json | 16 +- 2 files changed, 338 insertions(+), 130 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index cb1c42a66..c3fdb61c1 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -17,142 +17,338 @@ describe('GENERAL', () => { }); describe('ReplaceContentBlockByX ================', () => { - it('Should replace references with ContentBlockByName w/o deploy', async () => { - handler.setOptions({ skipDeploy: true }); - - // WHEN - const replace = await handler.replaceCbReference( - 'testInstance/testBU', - { - journey: null, - senderProfile: null, - }, - 'name' - ); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); - // retrieve result - assert.deepEqual( - replace['testInstance/testBU'].journey, - ['testExisting_journey_Quicksend'], - 'should have found the right journeys that need updating' - ); - assert.deepEqual( - replace['testInstance/testBU'].senderProfile, - ['testExisting_senderProfile_rcb'], - 'should have found the right senderProfiles that need updating' - ); + describe('with types specified ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + senderProfile: null, + }, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right journeys that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); - // check if conversions happened - assert.deepEqual( - await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-name'), - 'returned JSON was not equal expected' - ); - assert.deepEqual( - await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), - await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-name'), - 'returned JSON was not equal expected' - ); + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-name'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_senderProfile_rcb', + 'senderProfile' + ), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-name'), + 'returned JSON was not equal expected' + ); - assert.equal( - testUtils.getAPIHistoryLength(), - 51, - 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' - ); - return; - }); + assert.equal( + testUtils.getAPIHistoryLength(), + 51, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); - it('Should replace references with ContentBlockById w/o deploy', async () => { - handler.setOptions({ skipDeploy: true }); - - // WHEN - const replace = await handler.replaceCbReference( - 'testInstance/testBU', - { - journey: null, - senderProfile: null, - }, - 'id' - ); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); - // retrieve result - assert.deepEqual( - replace['testInstance/testBU'].journey, - ['testExisting_journey_Quicksend'], - 'should have found the right journeys that need updating' - ); - assert.deepEqual( - replace['testInstance/testBU'].senderProfile, - ['testExisting_senderProfile_rcb'], - 'should have found the right senderProfiles that need updating' - ); + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); - // check if conversions happened - assert.deepEqual( - await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-id'), - 'returned JSON was not equal expected' - ); - assert.deepEqual( - await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), - await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-id'), - 'returned JSON was not equal expected' - ); + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + senderProfile: null, + }, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right journeys that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); - assert.equal( - testUtils.getAPIHistoryLength(), - 51, - 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' - ); - return; + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-id'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_senderProfile_rcb', + 'senderProfile' + ), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-id'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 51, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + { + journey: null, + senderProfile: null, + }, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-key'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_senderProfile_rcb', + 'senderProfile' + ), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-key'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 51, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); }); - it('Should replace references with ContentBlockByKey w/o deploy', async () => { - handler.setOptions({ skipDeploy: true }); - - // WHEN - const replace = await handler.replaceCbReference( - 'testInstance/testBU', - { - journey: null, - senderProfile: null, - }, - 'key' - ); - // THEN - assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); - // retrieve result - assert.deepEqual( - replace['testInstance/testBU'].journey, - ['testExisting_journey_Quicksend'], - 'should have found the right assets that need updating' - ); - assert.deepEqual( - replace['testInstance/testBU'].senderProfile, - ['testExisting_senderProfile_rcb'], - 'should have found the right senderProfiles that need updating' - ); + describe('without types specified ================', () => { + it('Should replace references with ContentBlockByName w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); - // check if conversions happened - assert.deepEqual( - await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), - await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-key'), - 'returned JSON was not equal expected' - ); - assert.deepEqual( - await testUtils.getActualJson('testExisting_senderProfile_rcb', 'senderProfile'), - await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-key'), - 'returned JSON was not equal expected' - ); + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + undefined, + 'name' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].asset, + ['testExisting_asset_message'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].script, + ['testExisting_script_ampscript', 'testExisting_script_ampincluded'], + 'should have found the right scripts that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].triggeredSend, + ['testExisting_triggeredSend_rcb'], + 'should have found the right assets that need updating' + ); - assert.equal( - testUtils.getAPIHistoryLength(), - 51, - 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' - ); - return; + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-name'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_senderProfile_rcb', + 'senderProfile' + ), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-name'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 116, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockById w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + undefined, + 'id' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].asset, + ['testExisting_asset_message'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].script, + ['testExisting_script_ampscript', 'testExisting_script_ampincluded'], + 'should have found the right scripts that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].triggeredSend, + ['testExisting_triggeredSend_rcb'], + 'should have found the right assets that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-id'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_senderProfile_rcb', + 'senderProfile' + ), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-id'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 116, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); + + it('Should replace references with ContentBlockByKey w/o deploy', async () => { + handler.setOptions({ skipDeploy: true }); + + // WHEN + const replace = await handler.replaceCbReference( + 'testInstance/testBU', + undefined, + 'key' + ); + // THEN + assert.equal(process.exitCode, 0, 'retrieve should not have thrown an error'); + // retrieve result + assert.deepEqual( + replace['testInstance/testBU'].asset, + ['testExisting_asset_message'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].journey, + ['testExisting_journey_Quicksend'], + 'should have found the right assets that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].script, + ['testExisting_script_ampscript', 'testExisting_script_ampincluded'], + 'should have found the right scripts that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].senderProfile, + ['testExisting_senderProfile_rcb'], + 'should have found the right senderProfiles that need updating' + ); + assert.deepEqual( + replace['testInstance/testBU'].triggeredSend, + ['testExisting_triggeredSend_rcb'], + 'should have found the right assets that need updating' + ); + + // check if conversions happened + assert.deepEqual( + await testUtils.getActualJson('testExisting_journey_Quicksend', 'journey'), + await testUtils.getExpectedJson('9999999', 'journey', 'get-quicksend-rcb-key'), + 'returned JSON was not equal expected' + ); + assert.deepEqual( + await testUtils.getActualJson( + 'testExisting_senderProfile_rcb', + 'senderProfile' + ), + await testUtils.getExpectedJson('9999999', 'senderProfile', 'get-rcb-key'), + 'returned JSON was not equal expected' + ); + + assert.equal( + testUtils.getAPIHistoryLength(), + 116, + 'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' + ); + return; + }); }); }); @@ -1191,7 +1387,7 @@ describe('GENERAL', () => { // check if certain types were returned assert.equal( - typeArr.find((type) => type.apiName === 'dataExtension').apiName, + typeArr.find((type) => type.apiName === 'dataExtension')?.apiName, 'dataExtension', 'Expected to find dataExtension type' ); diff --git a/test/mockRoot/.mcdevrc.json b/test/mockRoot/.mcdevrc.json index 49943786a..e1089cb3b 100644 --- a/test/mockRoot/.mcdevrc.json +++ b/test/mockRoot/.mcdevrc.json @@ -72,20 +72,32 @@ "documentOnRetrieve": ["user", "automation", "dataExtension", "role"], "retrieve": [ "asset", + "attributeGroup", + "attributeSet", "automation", "dataExtension", "dataExtract", + "deliveryProfile", "emailSend", - "fileTransfer", + "event", "fileLocation", + "fileTransfer", "importFile", + "journey", "list", "mobileCode", "mobileKeyword", + "mobileMessage", "query", "role", "script", - "triggeredSend" + "sendClassification", + "senderProfile", + "transactionalEmail", + "transactionalPush", + "transactionalSMS", + "triggeredSend", + "verification" ] }, "version": "6.0.2" From 9b4944260dbbf4c9a6a383b4207191f48f2a3676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 08:40:22 +0200 Subject: [PATCH 354/359] #1270 code comments --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index ccbf9e568..5f67709cc 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1039,7 +1039,7 @@ class Mcdev { } } - // define final from/to values + // define final from/to values and, if from was not set, auto-set it to remaining values not set for to const referenceFrom = fromList || allowedFromTo.filter((item) => item !== to); const referenceTo = to; From dd97295eea109ed292b2f5bd18e62c22f93108f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 08:45:16 +0200 Subject: [PATCH 355/359] #1270: fix rcb tests for assets --- test/general.test.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/general.test.js b/test/general.test.js index c3fdb61c1..9b099c2a9 100644 --- a/test/general.test.js +++ b/test/general.test.js @@ -191,7 +191,7 @@ describe('GENERAL', () => { ); assert.deepEqual( replace['testInstance/testBU'].script, - ['testExisting_script_ampscript', 'testExisting_script_ampincluded'], + ['testExisting_script_ampincluded', 'testExisting_script_mixed'], 'should have found the right scripts that need updating' ); assert.deepEqual( @@ -252,7 +252,7 @@ describe('GENERAL', () => { ); assert.deepEqual( replace['testInstance/testBU'].script, - ['testExisting_script_ampscript', 'testExisting_script_ampincluded'], + ['testExisting_script_ampscript', 'testExisting_script_mixed'], 'should have found the right scripts that need updating' ); assert.deepEqual( From f9dd76feea98907e2c09e65e186e1ad5cfdb4acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 09:44:39 +0200 Subject: [PATCH 356/359] #0: npm audit fix bumped follow-redirects from 1.15.4 to 1.15.6 --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 58730864d..f06680d47 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2970,9 +2970,9 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==" }, "node_modules/follow-redirects": { - "version": "1.15.4", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.4.tgz", - "integrity": "sha512-Cr4D/5wlrb0z9dgERpUL3LrmPKVDsETIJhaCMeDfuFYcqa5bldGV6wBsAN6X/vxlXQtFBMrXdXxdL8CbDTGniw==", + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", "funding": [ { "type": "individual", From e952477046dc0db44d99604197e8211b07f167c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 09:46:39 +0200 Subject: [PATCH 357/359] 7.0.0 --- package-lock.json | 4 ++-- package.json | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f06680d47..4b07f1d1e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "mcdev", - "version": "6.0.2", + "version": "7.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "mcdev", - "version": "6.0.2", + "version": "7.0.0", "license": "MIT", "dependencies": { "beauty-amp-core2": "0.4.9", diff --git a/package.json b/package.json index 05bb68a38..688b26700 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcdev", - "version": "6.0.2", + "version": "7.0.0", "description": "Accenture Salesforce Marketing Cloud DevTools", "author": "Accenture: joern.berkefeld, douglas.midgley, robert.zimmermann, maciej.barnas", "license": "MIT", @@ -113,7 +113,9 @@ "fsevents": "*" }, "lint-staged": { - "*.js": ["eslint --fix"] + "*.js": [ + "eslint --fix" + ] }, "type": "module" } From 2aa77365d56cfa424ca8ef74ba1a6133485bc22b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 09:48:15 +0200 Subject: [PATCH 358/359] #0: prep for 7.0.0 release --- .github/ISSUE_TEMPLATE/bug.yml | 1 + test/mockRoot/.mcdevrc.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml index cdfed5fcd..7a3938a68 100644 --- a/.github/ISSUE_TEMPLATE/bug.yml +++ b/.github/ISSUE_TEMPLATE/bug.yml @@ -39,6 +39,7 @@ body: label: Version description: What version of our software are you running? (mcdev --version) options: + - 7.0.0 - 6.0.2 - 6.0.1 - 6.0.0 diff --git a/test/mockRoot/.mcdevrc.json b/test/mockRoot/.mcdevrc.json index e1089cb3b..34f5355eb 100644 --- a/test/mockRoot/.mcdevrc.json +++ b/test/mockRoot/.mcdevrc.json @@ -100,5 +100,5 @@ "verification" ] }, - "version": "6.0.2" + "version": "7.0.0" } From 5733acc4d4797e7b85717bca7e81db4d19e94d66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Fri, 7 Jun 2024 09:51:17 +0200 Subject: [PATCH 359/359] #0: improve release template --- .github/PULL_REQUEST_TEMPLATE/pr_template_release.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md b/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md index ffe1abb2c..40ad2755c 100644 --- a/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md +++ b/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md @@ -2,13 +2,19 @@ ## Checklist +### Before merge + - [ ] Wiki updated with info in ticket listed under **Documentation** - [ ] ran `npm audit fix` - [ ] ran `npm run lint:fix` - [ ] ran `npm run version:major/minor/patch` - [ ] updated [bug template](/.github/ISSUE_TEMPLATE/bug.yml) to include the new version - [ ] updated [.mcdevrc](/test/mockRoot/.mcdevrc.json) for tests to the new version -- [ ] (after merge) moved version tag to merge commit & pushed to remote + +### After merge + +- [ ] merged all dependabot PRs to main branch +- [ ] moved version tag to merge commit & pushed to remote - [ ] closed GitHub milestone - [ ] created [new GitHub Release](https://github.com/Accenture/sfmc-devtools/releases/new)