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/.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 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 - -
Builds metadata from a template using market specific customisation
-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.
-main class
-MetadataType
FileTransfer MetadataType
-MetadataType
AttributeGroup MetadataType
-MetadataType
AttributeSet MetadataType
-MetadataType
Automation MetadataType
-MetadataType
Campaign MetadataType
-MetadataType
ContentArea MetadataType
-MetadataType
DataExtension MetadataType
-MetadataType
DataExtensionField MetadataType
-MetadataType
DataExtensionTemplate MetadataType
-MetadataType
DataExtract MetadataType
-MetadataType
DataExtractType MetadataType -Only for Caching No retrieve/upsert is required -as this is a configuration in the EID
-MetadataType
ImportFile MetadataType
-MetadataType
Email MetadataType
-MetadataType
MessageSendActivity MetadataType
-MetadataType
Event MetadataType
-MetadataType
ImportFile MetadataType
-MetadataType
FileTransfer MetadataType
-MetadataType
Filter MetadataType
-MetadataType
Folder MetadataType
-MetadataType
ImportFile 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
-MetadataType
List MetadataType
-MetadataType class that gets extended by their specific metadata type class. -Provides default functionality that can be overwritten by child metadata type classes
-MetadataType
MobileCode MetadataType
-MetadataType
MobileKeyword MetadataType
-MetadataType
MobileMessage MetadataType
-MetadataType
Query MetadataType
-MetadataType
ImportFile MetadataType
-MetadataType
Script MetadataType
-MetadataType
SendClassification MetadataType
-TransactionalMessage
TransactionalEmail MetadataType
-MetadataType
TransactionalMessage MetadataType
-TransactionalMessage
TransactionalPush TransactionalMessage
-TransactionalMessage
TransactionalSMS MetadataType
-MetadataType
MessageSendActivity MetadataType
-MetadataType
MetadataType
-MetadataType
Verification MetadataType
-Retrieves metadata from a business unit and saves it to the local filesystem.
-Helper that handles retrieval of BU info
-TYPE.Cache
CLI helper class
-Central class for loading and validating properties from config and auth
-DevOps helper class
-File extends fs-extra. It adds logger and util methods for file handling
-CLI helper class
-CLI helper class
-CLI helper class
-CLI helper class
-Util that contains logger and simple util methods
-Array.<string>
helper to convert CSVs into an array. if only one value was given, it's also returned as an array
-Promise.<Object.<string, Array.<string>>>
run a method across BUs
-Promise.<Array.<string>>
helper for Mcdev.#runMethod
-Array.<string>
helper for Mcdev.#runOnBU
-Promise.<Array.<string>>
Updates the key to match the name field
-boolean
helper for postRetrieveTasks and execute
-Promise.<{key:string, response:object}>
helper for execute
-Promise.<{key:string, response:object}>
helper for execute
-Promise.<{key:string, response:object}>
helper for pause
-helper for preDeployTasks and execute
-Promise.<void>
helper for postDeployTasks
-Promise.<{key:string, response:object}>
helper for postDeployTasks
-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
-Array.<string>
helper for DataExtension.#fixShared
-Promise.<Array.<string>>
helper for DataExtension.#fixShared
-Promise.<boolean>
method that actually takes care of triggering the update for a particular BU-sharedDe combo -helper for DataExtension.#fixShared_onBU
-Promise.<string>
add a new field to the shared DE to trigger an update to the data model -helper for DataExtension.#fixShared_item
-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
-Promise
delete the field added by DataExtension.#fixShared_item_addField -helper for DataExtension.#fixShared_item
-string
SDK
Returns an SDK instance to be used for API calls
-Promise.<string>
gets file from Retrieve folder
-string
gets file from Retrieve folder
-Object.<string, string>
object-key=metadata type, value=array of external keys
-Object.<string, any>
key=customer key
-object
object
object
object
Object.<string, any>
object
object
object
key=customer key
-object
object
object
object
REST format
-object
SOAP format
-object
object
Object.<string, AutomationItem>
object
signals what to insert automatically for things usually asked via wizard
-object
object
object
object
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/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
}
}
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.