@@ -371,7 +392,7 @@ Source and target business units are also compared before the deployment to appl
* [new Deployer(properties, buObject)](#new_Deployer_new)
* _instance_
* [.metadata](#Deployer+metadata) : TYPE.MultiMetadataTypeMap
- * [._deploy([typeArr], [keyArr], [fromRetrieve], [isRefresh])](#Deployer+_deploy) ⇒ Promise.<TYPE.MultiMetadataTypeMap>
+ * [._deploy([typeArr], [keyArr], [fromRetrieve])](#Deployer+_deploy) ⇒ Promise.<TYPE.MultiMetadataTypeMap>
* _static_
* [.deploy(businessUnit, [selectedTypesArr], [keyArr], [fromRetrieve])](#Deployer.deploy) ⇒ Promise.<Object.<string, TYPE.MultiMetadataTypeMap>>
* [._deployBU(cred, bu, properties, [typeArr], [keyArr], [fromRetrieve])](#Deployer._deployBU) ⇒ Promise.<TYPE.MultiMetadataTypeMap>
@@ -395,7 +416,7 @@ Creates a Deployer, uses v2 auth if v2AuthOptions are passed.
**Kind**: instance property of [Deployer](#Deployer)
-### deployer.\_deploy([typeArr], [keyArr], [fromRetrieve], [isRefresh]) ⇒ Promise.<TYPE.MultiMetadataTypeMap>
+### deployer.\_deploy([typeArr], [keyArr], [fromRetrieve]) ⇒ Promise.<TYPE.MultiMetadataTypeMap>
Deploy all metadata that is located in the deployDir
**Kind**: instance method of [Deployer](#Deployer)
@@ -406,7 +427,6 @@ Deploy all metadata that is located in the deployDir
| [typeArr] | Array.<TYPE.SupportedMetadataTypes> | limit deployment to given metadata type (can include subtype) |
| [keyArr] | Array.<string> | limit deployment to given metadata keys |
| [fromRetrieve] | boolean | if true, no folders will be updated/created |
-| [isRefresh] | boolean | optional flag to indicate that triggeredSend should be refreshed after deployment of assets |
@@ -426,7 +446,7 @@ Deploys all metadata located in the 'deploy' directory to the specified business
### Deployer.\_deployBU(cred, bu, properties, [typeArr], [keyArr], [fromRetrieve]) ⇒ Promise.<TYPE.MultiMetadataTypeMap>
-helper for [deploy](deploy)
+helper for [deploy](#Deployer.deploy)
**Kind**: static method of [Deployer](#Deployer)
**Returns**: Promise.<TYPE.MultiMetadataTypeMap> - ensure that BUs are worked on sequentially
@@ -448,11 +468,11 @@ 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 | Default | Description |
-| --- | --- | --- | --- |
-| deployDir | string | | root directory of metadata. |
-| [typeArr] | Array.<string> | | limit deployment to given metadata type |
-| [listBadKeys] | boolean | false | do not print errors, used for badKeys() |
+| 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() |
@@ -496,8 +516,8 @@ main class
* [.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>>
- * [.execute(businessUnit, [selectedTypesArr], keys)](#Mcdev.execute) ⇒ Promise.<boolean>
- * [._executeBU(cred, bu, [selectedTypesArr], keyArr)](#Mcdev._executeBU) ⇒ Promise.<boolean>
+ * [.execute(businessUnit, [selectedType], [keys])](#Mcdev.execute) ⇒ Promise.<boolean>
+ * [.pause(businessUnit, [selectedType], [keys])](#Mcdev.pause) ⇒ Promise.<boolean>
@@ -752,8 +772,8 @@ Build a specific metadata file based on a template using a list of bu-market com
-### Mcdev.execute(businessUnit, [selectedTypesArr], keys) ⇒ Promise.<boolean>
-Start an item (query)
+### Mcdev.execute(businessUnit, [selectedType], [keys]) ⇒ Promise.<boolean>
+Start/execute an item
**Kind**: static method of [Mcdev](#Mcdev)
**Returns**: Promise.<boolean> - true if all started successfully, false if not
@@ -761,23 +781,22 @@ Start an item (query)
| Param | Type | Description |
| --- | --- | --- |
| businessUnit | string | name of BU |
-| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit to given metadata types |
-| keys | Array.<string> | customerkey of the metadata |
+| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types |
+| [keys] | Array.<string> | customerkey of the metadata |
-
+
-### Mcdev.\_executeBU(cred, bu, [selectedTypesArr], keyArr) ⇒ Promise.<boolean>
-helper for [execute](execute)
+### Mcdev.pause(businessUnit, [selectedType], [keys]) ⇒ Promise.<boolean>
+pause an item
**Kind**: static method of [Mcdev](#Mcdev)
-**Returns**: Promise.<boolean> - true if all items were executed, false otherwise
+**Returns**: Promise.<boolean> - true if all started successfully, false if not
| Param | Type | Description |
| --- | --- | --- |
-| cred | string | name of Credential |
-| bu | string | name of BU |
-| [selectedTypesArr] | Array.<TYPE.SupportedMetadataTypes> | limit execution to given metadata type |
-| keyArr | Array.<string> | customerkey of the metadata |
+| businessUnit | string | name of BU |
+| [selectedType] | TYPE.SupportedMetadataTypes | limit to given metadata types |
+| [keys] | Array.<string> | customerkey of the metadata |
@@ -798,7 +817,7 @@ FileTransfer MetadataType
* [._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, [isRefresh])](#Asset.postDeployTasks) ⇒ Promise.<void>
+ * [.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>
@@ -931,7 +950,7 @@ This method retrieves these and saves them alongside the metadata json
### Asset.\_readExtendedFileFromFS(metadata, subType, deployDir, [pathOnly]) ⇒ Promise.<string>
-helper for [preDeployTasks](preDeployTasks)
+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
@@ -959,7 +978,7 @@ manages post retrieve steps
-### Asset.postDeployTasks(metadata, _, createdUpdated, [isRefresh]) ⇒ Promise.<void>
+### Asset.postDeployTasks(metadata, _, createdUpdated) ⇒ Promise.<void>
Gets executed after deployment of metadata type
**Kind**: static method of [Asset](#Asset)
@@ -970,7 +989,6 @@ Gets executed after deployment of metadata type
| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField |
| _ | TYPE.MetadataTypeMap | originalMetadata to be updated (contains additioanl fields) |
| createdUpdated | Object | counter representing successful creates/updates |
-| [isRefresh] | boolean | optional flag to indicate that triggeredSend should be refreshed after deployment of assets |
@@ -1078,7 +1096,7 @@ Asset-specific script that retrieves the folder ID from cache and updates the gi
### Asset.\_mergeCode(metadata, deployDir, subType, [templateName], [fileListOnly]) ⇒ Promise.<Array.<TYPE.CodeExtract>>
-helper for [preDeployTasks](preDeployTasks) that loads extracted code content back into JSON
+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)
@@ -1094,7 +1112,7 @@ helper for [preDeployTasks](preDeployTasks) that loads extracted code content ba
### Asset.\_mergeCode\_slots(prefix, metadataSlots, readDirArr, subtypeExtension, subDirArr, fileList, customerKey, [templateName], [fileListOnly]) ⇒ Promise.<void>
-helper for [preDeployTasks](preDeployTasks) that loads extracted code content back into JSON
+helper for [preDeployTasks](#Asset.preDeployTasks) that loads extracted code content back into JSON
**Kind**: static method of [Asset](#Asset)
**Returns**: Promise.<void> - -
@@ -1114,7 +1132,7 @@ helper for [preDeployTasks](preDeployTasks) that loads extracted code content ba
### Asset.\_extractCode(metadata) ⇒ TYPE.CodeExtractItem
-helper for [postRetrieveTasks](postRetrieveTasks) that finds code content in JSON and extracts it
+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)
@@ -1238,7 +1256,9 @@ Automation MetadataType
* [.retrieveForCache()](#Automation.retrieveForCache) ⇒ Promise.<TYPE.AutomationMapObj>
* [.retrieveAsTemplate(templateDir, name, templateVariables)](#Automation.retrieveAsTemplate) ⇒ Promise.<TYPE.AutomationItemObj>
* [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem \| void
- * [.deploy(metadata, targetBU, retrieveDir, [isRefresh])](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap>
+ * [.execute(keyArr)](#Automation.execute) ⇒ Promise.<boolean>
+ * [.pause(keyArr)](#Automation.pause) ⇒ Promise.<boolean>
+ * [.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>
@@ -1308,9 +1328,33 @@ manages post retrieve steps
| --- | --- | --- |
| metadata | TYPE.AutomationItem | a single automation |
+
+
+### Automation.execute(keyArr) ⇒ Promise.<boolean>
+a function to start query execution via API
+
+**Kind**: static method of [Automation](#Automation)
+**Returns**: Promise.<boolean> - Returns true if all items were executed successfully, otherwise false
+
+| Param | Type | Description |
+| --- | --- | --- |
+| keyArr | Array.<string> | customerkey of the metadata |
+
+
+
+### Automation.pause(keyArr) ⇒ Promise.<boolean>
+a function to start query execution via API
+
+**Kind**: static method of [Automation](#Automation)
+**Returns**: Promise.<boolean> - Returns true if all items were executed successfully, otherwise false
+
+| Param | Type | Description |
+| --- | --- | --- |
+| keyArr | Array.<string> | customerkey of the metadata |
+
-### Automation.deploy(metadata, targetBU, retrieveDir, [isRefresh]) ⇒ Promise.<TYPE.AutomationMap>
+### 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)
@@ -1321,7 +1365,6 @@ Deploys automation - the saved file is the original one due to large differences
| 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 |
-| [isRefresh] | boolean | optional flag - so far not used by automation |
@@ -2335,7 +2378,7 @@ Event MetadataType
* [.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, [isRefresh])](#Event.deploy) ⇒ Promise.<TYPE.MetadataTypeMap>
+ * [.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
@@ -2405,7 +2448,7 @@ Delete a metadata item from the specified business unit
-### Event.deploy(metadata, deployDir, retrieveDir, [isRefresh]) ⇒ Promise.<TYPE.MetadataTypeMap>
+### 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)
@@ -2416,7 +2459,6 @@ Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta)
| 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 |
-| [isRefresh] | boolean | optional flag - so far not used by eventDefinition |
@@ -2747,10 +2789,10 @@ Returns file contents mapped to their filename without '.json' ending
**Kind**: static method of [Folder](#Folder)
**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| dir | string | | directory that contains '.json' files to be read |
-| [listBadKeys] | boolean | false | do not print errors, used for badKeys() |
+| Param | Type | Description |
+| --- | --- | --- |
+| dir | string | directory that contains '.json' files to be read |
+| [listBadKeys] | boolean | do not print errors, used for badKeys() |
@@ -2923,7 +2965,7 @@ definitionId: A unique UUID provided by Salesforce Marketing Cloud. Each version
* [Journey](#Journey) ⇐ [MetadataType](#MetadataType)
* [.retrieve(retrieveDir, [_], [__], [key])](#Journey.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj>
* [.deleteByKey(key)](#Journey.deleteByKey) ⇒ Promise.<boolean>
- * [.deploy(metadata, deployDir, retrieveDir, [isRefresh])](#Journey.deploy) ⇒ Promise.<TYPE.MetadataTypeMap>
+ * [.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>
@@ -2961,7 +3003,7 @@ Delete a metadata item from the specified business unit
-### Journey.deploy(metadata, deployDir, retrieveDir, [isRefresh]) ⇒ Promise.<TYPE.MetadataTypeMap>
+### 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)
@@ -2972,7 +3014,6 @@ Deploys metadata - merely kept here to be able to print [logBeta](#Util.logBeta)
| 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 |
-| [isRefresh] | boolean | optional flag - so far not used by interaction |
@@ -3016,7 +3057,7 @@ Helper for writing Metadata to disk, used for Retrieve and deploy
### Journey.\_postRetrieveTasksBulk(metadataMap)
-helper for Journey's [saveResults](saveResults). Gets executed after retreive of metadata type and
+helper for Journey's [saveResults](#Journey.saveResults). Gets executed after retreive of metadata type and
**Kind**: static method of [Journey](#Journey)
@@ -3155,8 +3196,8 @@ Provides default functionality that can be overwritten by child metadata type cl
* [.buObject](#MetadataType.buObject) : TYPE.BuObject
* [.getJsonFromFS(dir, [listBadKeys])](#MetadataType.getJsonFromFS) ⇒ TYPE.MetadataTypeMap
* [.getFieldNamesToRetrieve([additionalFields], [isCaching])](#MetadataType.getFieldNamesToRetrieve) ⇒ Array.<string>
- * [.deploy(metadata, deployDir, retrieveDir, [isRefresh])](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap>
- * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated, [isRefresh])](#MetadataType.postDeployTasks) ⇒ void
+ * [.deploy(metadata, deployDir, retrieveDir)](#MetadataType.deploy) ⇒ Promise.<TYPE.MetadataTypeMap>
+ * [.postDeployTasks(upsertResults, originalMetadata, createdUpdated)](#MetadataType.postDeployTasks) ⇒ void
* [.postCreateTasks(metadataEntry, apiResponse)](#MetadataType.postCreateTasks) ⇒ void
* [.postUpdateTasks(metadataEntry, apiResponse)](#MetadataType.postUpdateTasks) ⇒ void
* [.postDeployTasks_legacyApi(metadataEntry, apiResponse)](#MetadataType.postDeployTasks_legacyApi) ⇒ Promise.<void>
@@ -3174,9 +3215,10 @@ Provides default functionality that can be overwritten by child metadata type cl
* [.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, [isRefresh])](#MetadataType.upsert) ⇒ Promise.<TYPE.MetadataTypeMap>
+ * [.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
@@ -3237,10 +3279,10 @@ Returns file contents mapped to their filename without '.json' ending
**Kind**: static method of [MetadataType](#MetadataType)
**Returns**: TYPE.MetadataTypeMap - fileName => fileContent map
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| dir | string | | directory that contains '.json' files to be read |
-| [listBadKeys] | boolean | false | do not print errors, used for badKeys() |
+| Param | Type | Description |
+| --- | --- | --- |
+| dir | string | directory that contains '.json' files to be read |
+| [listBadKeys] | boolean | do not print errors, used for badKeys() |
@@ -3257,7 +3299,7 @@ Returns fieldnames of Metadata Type. 'this.definition.fields' variable only set
-### MetadataType.deploy(metadata, deployDir, retrieveDir, [isRefresh]) ⇒ Promise.<TYPE.MetadataTypeMap>
+### MetadataType.deploy(metadata, deployDir, retrieveDir) ⇒ Promise.<TYPE.MetadataTypeMap>
Deploys metadata
**Kind**: static method of [MetadataType](#MetadataType)
@@ -3268,11 +3310,10 @@ Deploys metadata
| metadata | TYPE.MetadataTypeMap | metadata mapped by their keyField |
| deployDir | string | directory where deploy metadata are saved |
| retrieveDir | string | directory where metadata after deploy should be saved |
-| [isRefresh] | boolean | optional flag to indicate that triggeredSend should be refreshed after deployment of assets |
-### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated, [isRefresh]) ⇒ void
+### MetadataType.postDeployTasks(upsertResults, originalMetadata, createdUpdated) ⇒ void
Gets executed after deployment of metadata type
**Kind**: static method of [MetadataType](#MetadataType)
@@ -3282,12 +3323,11 @@ Gets executed after deployment of metadata type
| 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 |
-| [isRefresh] | boolean | optional flag to indicate that triggeredSend should be refreshed after deployment of assets |
### MetadataType.postCreateTasks(metadataEntry, apiResponse) ⇒ void
-helper for [createREST](createREST)
+helper for [createREST](#MetadataType.createREST)
**Kind**: static method of [MetadataType](#MetadataType)
@@ -3299,7 +3339,7 @@ helper for [createREST](createREST)
### MetadataType.postUpdateTasks(metadataEntry, apiResponse) ⇒ void
-helper for [updateREST](updateREST)
+helper for [updateREST](#MetadataType.updateREST)
**Kind**: static method of [MetadataType](#MetadataType)
@@ -3311,7 +3351,7 @@ helper for [updateREST](updateREST)
### MetadataType.postDeployTasks\_legacyApi(metadataEntry, apiResponse) ⇒ Promise.<void>
-helper for [createREST](createREST) when legacy API endpoints as these do not return the created item but only their new id
+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> - -
@@ -3492,6 +3532,12 @@ Abstract refresh method that needs to be implemented in child metadata type
### 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)
@@ -3524,7 +3570,7 @@ test if metadata was actually changed or not to potentially skip it during deplo
-### MetadataType.upsert(metadataMap, deployDir, [isRefresh]) ⇒ Promise.<TYPE.MetadataTypeMap>
+### 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)
@@ -3534,7 +3580,6 @@ MetadataType upsert, after retrieving from target and comparing to check if crea
| --- | --- | --- |
| metadataMap | TYPE.MetadataTypeMap | metadata mapped by their keyField |
| deployDir | string | directory where deploy metadata are saved |
-| [isRefresh] | boolean | optional flag to indicate that triggeredSend should be refreshed after deployment of assets |
@@ -3590,7 +3635,7 @@ Updates a single metadata entry via REST
| --- | --- | --- | --- |
| 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 |
+| [httpMethod] | 'patch' \| 'post' \| 'put' | patch | defaults to 'patch'; some update requests require PUT instead of PATCH |
@@ -3620,7 +3665,7 @@ Updates a single metadata entry via fuel-soap (generic lib not wrapper)
### MetadataType.getSOAPErrorMsg(ex) ⇒ string
-helper for [_handleSOAPErrors](_handleSOAPErrors)
+helper for [_handleSOAPErrors](#MetadataType._handleSOAPErrors)
**Kind**: static method of [MetadataType](#MetadataType)
**Returns**: string - error message
@@ -3675,7 +3720,7 @@ Used to execute a query/automation etc.
### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void>
-helper for [retrieveREST](retrieveREST) and [retrieveSOAP](retrieveSOAP)
+helper for [retrieveREST](#MetadataType.retrieveREST) and [retrieveSOAP](#MetadataType.retrieveSOAP)
**Kind**: static method of [MetadataType](#MetadataType)
**Returns**: Promise.<void> - -
@@ -3769,10 +3814,10 @@ 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 | Default | Description |
-| --- | --- | --- | --- |
-| metadataEntry | TYPE.MetadataTypeItem | | metadata entry |
-| [include] | boolean | false | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude |
+| Param | Type | Description |
+| --- | --- | --- |
+| metadataEntry | TYPE.MetadataTypeItem | metadata entry |
+| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude |
@@ -3782,10 +3827,10 @@ 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 | Default | Description |
-| --- | --- | --- | --- |
-| metadataEntry | object | | metadata entry |
-| [include] | boolean | false | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude |
+| Param | Type | Description |
+| --- | --- | --- |
+| metadataEntry | object | metadata entry |
+| [include] | boolean | true: use definition.include / options.include; false=exclude: use definition.filter / options.exclude |
@@ -3805,7 +3850,7 @@ Helper for writing Metadata to disk, used for Retrieve and deploy
### MetadataType.applyTemplateValues(code, templateVariables) ⇒ string
-helper for [buildDefinitionForNested](buildDefinitionForNested)
+helper for [buildDefinitionForNested](#MetadataType.buildDefinitionForNested)
searches extracted file for template variable names and applies the market values
**Kind**: static method of [MetadataType](#MetadataType)
@@ -3819,7 +3864,7 @@ searches extracted file for template variable names and applies the market value
### MetadataType.applyTemplateNames(code, templateVariables) ⇒ string
-helper for [buildTemplateForNested](buildTemplateForNested)
+helper for [buildTemplateForNested](#MetadataType.buildTemplateForNested)
searches extracted file for template variable values and applies the market variable names
**Kind**: static method of [MetadataType](#MetadataType)
@@ -3833,7 +3878,7 @@ searches extracted file for template variable values and applies the market vari
### MetadataType.buildDefinitionForNested(templateDir, targetDir, metadata, variables, templateName) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildDefinition](buildDefinition)
+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)
@@ -3850,7 +3895,7 @@ handles extracted code if any are found for complex types (e.g script, asset, qu
### MetadataType.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildTemplate](buildTemplate)
+helper for [buildTemplate](#MetadataType.buildTemplate)
handles extracted code if any are found for complex types
**Kind**: static method of [MetadataType](#MetadataType)
@@ -3995,11 +4040,11 @@ 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 | Default | Description |
-| --- | --- | --- | --- |
-| readDir | string | | root directory of metadata. |
-| [listBadKeys] | boolean | false | do not print errors, used for badKeys() |
-| [buMetadata] | 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 |
@@ -4190,7 +4235,7 @@ manages post retrieve steps
### MobileKeyword.prepExtractedCode(metadataScript) ⇒ Object
-helper for [parseMetadata](parseMetadata) and [_buildForNested](_buildForNested)
+helper for [postRetrieveTasks](#MobileKeyword.postRetrieveTasks) and [_buildForNested](#MobileKeyword._buildForNested)
**Kind**: static method of [MobileKeyword](#MobileKeyword)
**Returns**: Object - returns found extension and file content
@@ -4240,7 +4285,7 @@ scripts are saved as 1 json and 1 ssjs file. both files need to be run through t
### MobileKeyword.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildTemplateForNested](buildTemplateForNested) / [buildDefinitionForNested](buildDefinitionForNested)
+helper for [buildTemplateForNested](#MobileKeyword.buildTemplateForNested) / [buildDefinitionForNested](#MobileKeyword.buildDefinitionForNested)
handles extracted code if any are found for complex types
**Kind**: static method of [MobileKeyword](#MobileKeyword)
@@ -4271,7 +4316,7 @@ prepares an event definition for deployment
### MobileKeyword.postCreateTasks(metadataEntry, apiResponse) ⇒ void
-helper for [createREST](createREST)
+helper for [createREST](#MetadataType.createREST)
**Kind**: static method of [MobileKeyword](#MobileKeyword)
@@ -4283,7 +4328,7 @@ helper for [createREST](createREST)
### MobileKeyword.postUpdateTasks(metadataEntry, apiResponse) ⇒ void
-helper for [updateREST](updateREST)
+helper for [updateREST](#MetadataType.updateREST)
**Kind**: static method of [MobileKeyword](#MobileKeyword)
@@ -4295,7 +4340,7 @@ helper for [updateREST](updateREST)
### MobileKeyword.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string>
-helper for [preDeployTasks](preDeployTasks) that loads extracted code content back into JSON
+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
@@ -4423,7 +4468,7 @@ Creates a single item
### MobileMessage.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string>
-helper for [preDeployTasks](preDeployTasks) that loads extracted code content back into JSON
+helper for [preDeployTasks](#MobileMessage.preDeployTasks) that loads extracted code content back into JSON
**Kind**: static method of [MobileMessage](#MobileMessage)
**Returns**: Promise.<string> - code
@@ -4437,7 +4482,7 @@ helper for [preDeployTasks](preDeployTasks) that loads extracted code content ba
### MobileMessage.prepExtractedCode(code) ⇒ Object
-helper for [parseMetadata](parseMetadata) and [_buildForNested](_buildForNested)
+helper for [postRetrieveTasks](#MobileMessage.postRetrieveTasks) and [_buildForNested](#MobileMessage._buildForNested)
**Kind**: static method of [MobileMessage](#MobileMessage)
**Returns**: Object - returns found extension and file content
@@ -4487,7 +4532,7 @@ prepares an event definition for deployment
### MobileMessage.postCreateTasks(metadataEntry, apiResponse) ⇒ void
-helper for [createREST](createREST)
+helper for [createREST](#MetadataType.createREST)
**Kind**: static method of [MobileMessage](#MobileMessage)
@@ -4499,7 +4544,7 @@ helper for [createREST](createREST)
### MobileMessage.postUpdateTasks(metadataEntry, apiResponse) ⇒ void
-helper for [updateREST](updateREST)
+helper for [updateREST](#MetadataType.updateREST)
**Kind**: static method of [MobileMessage](#MobileMessage)
@@ -4549,7 +4594,7 @@ scripts are saved as 1 json and 1 ssjs file. both files need to be run through t
### MobileMessage.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildTemplateForNested](buildTemplateForNested) / [buildDefinitionForNested](buildDefinitionForNested)
+helper for [buildTemplateForNested](#MobileMessage.buildTemplateForNested) / [buildDefinitionForNested](#MobileMessage.buildDefinitionForNested)
handles extracted code if any are found for complex types
**Kind**: static method of [MobileMessage](#MobileMessage)
@@ -4601,6 +4646,7 @@ Query MetadataType
* [.checkForErrors(ex)](#Query.checkForErrors) ⇒ Array.<string> \| void
* [.deleteByKey(customerKey)](#Query.deleteByKey) ⇒ boolean
* [.postDeleteTasks(customerKey)](#Query.postDeleteTasks) ⇒ void
+ * [.postDeployTasks(upsertResults)](#Query.postDeployTasks)
@@ -4702,7 +4748,7 @@ prepares a Query for deployment
### Query.applyTemplateValues(code, templateVariables) ⇒ string
-helper for [buildDefinitionForNested](buildDefinitionForNested)
+helper for [buildDefinitionForNested](#Query.buildDefinitionForNested)
searches extracted SQL file for template variables and applies the market values
**Kind**: static method of [Query](#Query)
@@ -4799,6 +4845,17 @@ clean up after deleting a metadata item
| --- | --- | --- |
| 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)
@@ -4992,7 +5049,7 @@ Creates a single Script
### Script.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string>
-helper for [preDeployTasks](preDeployTasks) that loads extracted code content back into JSON
+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
@@ -5057,7 +5114,7 @@ scripts are saved as 1 json and 1 ssjs file. both files need to be run through t
### Script.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildTemplateForNested](buildTemplateForNested) / [buildDefinitionForNested](buildDefinitionForNested)
+helper for [buildTemplateForNested](#Script.buildTemplateForNested) / [buildDefinitionForNested](#Script.buildDefinitionForNested)
handles extracted code if any are found for complex types
**Kind**: static method of [Script](#Script)
@@ -5087,7 +5144,7 @@ Splits the script metadata into two parts and parses in a standard manner
### Script.prepExtractedCode(metadataScript, metadataName) ⇒ Object
-helper for [parseMetadata](parseMetadata) and [_buildForNested](_buildForNested)
+helper for [parseMetadata](#Script.parseMetadata) and [_buildForNested](#Script._buildForNested)
**Kind**: static method of [Script](#Script)
**Returns**: Object - returns found extension and file content
@@ -5371,7 +5428,7 @@ prepares for deployment
### TransactionalSMS.\_mergeCode(metadata, deployDir, [templateName]) ⇒ Promise.<string>
-helper for [preDeployTasks](preDeployTasks) that loads extracted code content back into JSON
+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
@@ -5397,7 +5454,7 @@ manages post retrieve steps
### TransactionalSMS.prepExtractedCode(metadataScript) ⇒ Object
-helper for [parseMetadata](parseMetadata) and [_buildForNested](_buildForNested)
+helper for [postRetrieveTasks](#TransactionalSMS.postRetrieveTasks) and [_buildForNested](#TransactionalSMS._buildForNested)
**Kind**: static method of [TransactionalSMS](#TransactionalSMS)
**Returns**: Object - returns found extension and file content
@@ -5409,7 +5466,7 @@ helper for [parseMetadata](parseMetadata) and [_buildForNested](_buildForNested)
### TransactionalSMS.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildDefinition](#MetadataType.buildDefinition)
+helper for [TransactionalMessage.buildDefinition](TransactionalMessage.buildDefinition)
handles extracted code if any are found for complex types
**Kind**: static method of [TransactionalSMS](#TransactionalSMS)
@@ -5426,7 +5483,7 @@ handles extracted code if any are found for complex types
### TransactionalSMS.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildTemplate](#MetadataType.buildTemplate)
+helper for [TransactionalMessage.buildTemplate](TransactionalMessage.buildTemplate)
handles extracted code if any are found for complex types
**Kind**: static method of [TransactionalSMS](#TransactionalSMS)
@@ -5447,7 +5504,7 @@ scripts are saved as 1 json and 1 ssjs file. both files need to be run through t
### TransactionalSMS.\_buildForNested(templateDir, targetDir, metadata, templateVariables, templateName, mode) ⇒ Promise.<Array.<Array.<string>>>
-helper for [buildTemplateForNested](buildTemplateForNested) / [buildDefinitionForNested](buildDefinitionForNested)
+helper for [buildTemplateForNested](#TransactionalSMS.buildTemplateForNested) / [buildDefinitionForNested](#TransactionalSMS.buildDefinitionForNested)
handles extracted code if any are found for complex types
**Kind**: static method of [TransactionalSMS](#TransactionalSMS)
@@ -5500,13 +5557,11 @@ MessageSendActivity MetadataType
* [.create(metadata)](#TriggeredSend.create) ⇒ Promise
* [.update(metadata)](#TriggeredSend.update) ⇒ Promise
* [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean>
- * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem
- * [.setFolderPath(metadata)](#TriggeredSend.setFolderPath)
- * [.parseMetadata(metadata)](#TriggeredSend.parseMetadata) ⇒ TYPE.MetadataTypeItem \| void
+ * [.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()](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj>
+ * [.findRefreshableItems([assetLoaded])](#TriggeredSend.findRefreshableItems) ⇒ Promise.<TYPE.MetadataTypeMapObj>
* [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean>
@@ -5562,30 +5617,7 @@ Delete a metadata item from the specified business unit
-### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem
-manages post retrieve steps
-
-**Kind**: static method of [TriggeredSend](#TriggeredSend)
-**Returns**: TYPE.MetadataTypeItem - Array with one metadata object and one query string
-
-| Param | Type | Description |
-| --- | --- | --- |
-| metadata | TYPE.MetadataTypeItem | a single query |
-
-
-
-### TriggeredSend.setFolderPath(metadata)
-generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve
-
-**Kind**: static method of [TriggeredSend](#TriggeredSend)
-
-| Param | Type | Description |
-| --- | --- | --- |
-| metadata | TYPE.MetadataTypeItem | a single script activity definition |
-
-
-
-### TriggeredSend.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem \| void
+### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem \| void
parses retrieved Metadata before saving
**Kind**: static method of [TriggeredSend](#TriggeredSend)
@@ -5593,7 +5625,7 @@ parses retrieved Metadata before saving
| Param | Type | Description |
| --- | --- | --- |
-| metadata | TYPE.MetadataTypeItem | a single query activity definition |
+| metadata | TYPE.MetadataTypeItem | a single item |
@@ -5623,7 +5655,7 @@ TSD-specific refresh method that finds active TSDs and refreshes them
### TriggeredSend.getKeysForValidTSDs(metadata) ⇒ Promise.<Array.<string>>
-helper for [refresh](refresh) that extracts the keys from the TSD item map and eli
+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
@@ -5634,15 +5666,20 @@ helper for [refresh](refresh) that extracts the keys from the TSD item map and e
-### TriggeredSend.findRefreshableItems() ⇒ Promise.<TYPE.MetadataTypeMapObj>
-helper for [refresh](refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](retrieve) is using to avoid refreshing TSDs with broken dependencies
+### 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](refresh) that pauses, publishes and starts a triggered send
+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
@@ -5862,7 +5899,7 @@ Retrieve metadata of specified types into local file system and Retriever.metada
### retriever.\_getTypeDependencies(metadataTypes) ⇒ Array.<TYPE.SupportedMetadataTypes>
-helper for [retrieve](retrieve) to get all dependencies of the given types
+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
@@ -5908,6 +5945,8 @@ CLI entry for SFMC DevTools
* [.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
@@ -6053,9 +6092,9 @@ 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 | Default | Description |
-| --- | --- | --- | --- |
-| [noLogFile] | boolean | false | optional flag to indicate if we should log to file; CLI logs are always on |
+| Param | Type | Description |
+| --- | --- | --- |
+| [noLogFile] | boolean | optional flag to indicate if we should log to file; CLI logs are always on |
@@ -6064,10 +6103,10 @@ initiate winston logger
**Kind**: static method of [Util](#Util)
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| [restart] | boolean | false | if true, logger will be restarted; otherwise, an existing logger will be used |
-| [noLogFile] | boolean | false | if false, logger will log to file; otherwise, only to console |
+| 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 |
@@ -6264,6 +6303,32 @@ the following is invalid:
// 3
```
+
+
+### 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 |
+
## MetadataTypeDefinitions
@@ -6801,12 +6866,12 @@ reads file from local file system.
**Kind**: static method of [File](#File)
**Returns**: Promise.<string> \| void - file contents; void on error
-| Param | Type | Default | 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 | "'utf8'" | read file with encoding (defaults to utf-8) |
+| 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) |
@@ -6869,9 +6934,9 @@ Initalises Prettier formatting lib async.
**Kind**: static method of [File](#File)
**Returns**: Promise.<boolean> - success of config load
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| [filetype] | string | "'html'" | filetype ie. JSON or SSJS |
+| Param | Type | Description |
+| --- | --- | --- |
+| [filetype] | string | filetype ie. JSON or SSJS |
@@ -7798,6 +7863,8 @@ Util that contains logger and simple util methods
* [.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
@@ -7943,9 +8010,9 @@ 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 | Default | Description |
-| --- | --- | --- | --- |
-| [noLogFile] | boolean | false | optional flag to indicate if we should log to file; CLI logs are always on |
+| Param | Type | Description |
+| --- | --- | --- |
+| [noLogFile] | boolean | optional flag to indicate if we should log to file; CLI logs are always on |
@@ -7954,10 +8021,10 @@ initiate winston logger
**Kind**: static method of [Util](#Util)
-| Param | Type | Default | Description |
-| --- | --- | --- | --- |
-| [restart] | boolean | false | if true, logger will be restarted; otherwise, an existing logger will be used |
-| [noLogFile] | boolean | false | if false, logger will log to file; otherwise, only to console |
+| 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 |
@@ -8154,6 +8221,32 @@ the following is invalid:
// 3
```
+
+
+### 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 |
+
## csvToArray(csv) ⇒ Array.<string>
@@ -8166,6 +8259,98 @@ helper to convert CSVs into an array. if only one value was given, it's also ret
| --- | --- | --- |
| csv | string | potentially comma-separated value or null |
+
+
+## Mcdev.(methodName, businessUnit, [selectedType], [keys]) ⇒ Promise.<boolean>
+run a method across BUs
+
+**Kind**: global function
+**Returns**: Promise.<boolean> - true if all started successfully, false if not
+
+| Param | Type | Description |
+| --- | --- | --- |
+| methodName | 'execute' \| 'pause' | 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.<boolean>
+helper for [Mcdev.#runMethod](Mcdev.#runMethod)
+
+**Kind**: global function
+**Returns**: Promise.<boolean> - true if all items were executed, false otherwise
+
+| Param | Type | Description |
+| --- | --- | --- |
+| methodName | 'execute' \| 'pause' | 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 |
+
+
+
+## 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.<object>
+helper for [execute](#Automation.execute)
+
+**Kind**: global function
+**Returns**: Promise.<object> - Returns the result of the API call
+
+| Param | Type | Description |
+| --- | --- | --- |
+| metadataMap | TYPE.AutomationMap | map of metadata |
+| key | string | key of the metadata |
+
+
+
+## Automation.(metadata) ⇒ Promise.<object>
+helper for [pause](#Automation.pause)
+
+**Kind**: global function
+**Returns**: Promise.<object> - schedule reponse
+
+| 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>
@@ -8181,10 +8366,11 @@ helper for [postDeployTasks](#Automation.postDeployTasks)
-## Automation.(metadataMap, originalMetadataMap, key)
-helper for [postDeployTasks](postDeployTasks)
+## Automation.(metadataMap, originalMetadataMap, key) ⇒ Promise.<object>
+helper for [postDeployTasks](#Automation.postDeployTasks)
**Kind**: global function
+**Returns**: Promise.<object> - -
| Param | Type | Description |
| --- | --- | --- |
diff --git a/lib/Deployer.js b/lib/Deployer.js
index 3d064049a..8df75ff6d 100644
--- a/lib/Deployer.js
+++ b/lib/Deployer.js
@@ -180,7 +180,7 @@ class Deployer {
return buMultiMetadataTypeMap;
}
/**
- * helper for {@link deploy}
+ * helper for {@link Deployer.deploy}
*
* @param {string} cred name of Credential
* @param {string} bu name of BU
@@ -215,10 +215,9 @@ class Deployer {
* @param {TYPE.SupportedMetadataTypes[]} [typeArr] limit deployment to given metadata type (can include subtype)
* @param {string[]} [keyArr] limit deployment to given metadata keys
* @param {boolean} [fromRetrieve] if true, no folders will be updated/created
- * @param {boolean} [isRefresh] optional flag to indicate that triggeredSend should be refreshed after deployment of assets
* @returns {Promise.} Promise of all deployed metadata
*/
- async _deploy(typeArr, keyArr, fromRetrieve, isRefresh) {
+ async _deploy(typeArr, keyArr, fromRetrieve) {
if (await File.pathExists(this.deployDir)) {
/** @type {TYPE.MultiMetadataTypeMap} */
this.metadata = Deployer.readBUMetadata(this.deployDir, typeArr);
@@ -297,8 +296,7 @@ class Deployer {
const result = await MetadataTypeInfo[type].deploy(
this.metadata[type],
this.deployDir,
- this.retrieveDir,
- isRefresh
+ this.retrieveDir
);
multiMetadataTypeMap[type] = result;
cache.mergeMetadata(type, result);
@@ -312,7 +310,7 @@ class Deployer {
*
* @param {string} deployDir root directory of metadata.
* @param {string[]} [typeArr] limit deployment to given metadata type
- * @param {boolean} [listBadKeys=false] do not print errors, used for badKeys()
+ * @param {boolean} [listBadKeys] do not print errors, used for badKeys()
* @returns {TYPE.MultiMetadataTypeMap} Metadata of BU in local directory
*/
static readBUMetadata(deployDir, typeArr, listBadKeys) {
diff --git a/lib/Retriever.js b/lib/Retriever.js
index 86ecf781e..f32acd2e3 100644
--- a/lib/Retriever.js
+++ b/lib/Retriever.js
@@ -189,7 +189,7 @@ class Retriever {
}
/**
- * helper for {@link retrieve} to get all dependencies of the given types
+ * helper for {@link Retriever.retrieve} to get all dependencies of the given types
*
* @param {TYPE.SupportedMetadataTypes[]} metadataTypes list of metadata types to retrieve; can include subtypes!
* @returns {TYPE.SupportedMetadataTypes[]} unique list dependent metadata types
diff --git a/lib/cli.js b/lib/cli.js
index 59bc224ea..d27d1b0ab 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -31,6 +31,12 @@ yargs
.positional('KEY', {
type: 'string',
describe: 'metadata keys that shall be exclusively downloaded',
+ })
+ .option('like', {
+ type: 'string',
+ group: 'Options for retrieve:',
+ describe:
+ 'filter metadata components (can include % as wildcard or _ for a single character)',
});
},
handler: (argv) => {
@@ -59,22 +65,31 @@ yargs
})
.option('changeKeyField', {
type: 'string',
+ group: 'Options for deploy:',
describe:
'enables updating the key of the deployed metadata with the value in provided field (e.g. c__newKey). Can be used to sync name and key fields.',
})
.option('changeKeyValue', {
type: 'string',
+ group: 'Options for deploy:',
describe:
'allows updating the key of the metadata to the provided value. Only available if a single type and key is deployed',
})
.option('fromRetrieve', {
type: 'boolean',
+ group: 'Options for deploy:',
describe: 'optionally deploy from retrieve folder',
})
.option('refresh', {
type: 'boolean',
+ group: 'Options for deploy:',
describe:
'optional for asset-message: runs refresh command for related triggeredSends after deploy',
+ })
+ .option('execute', {
+ type: 'boolean',
+ group: 'Options for deploy:',
+ describe: 'optional for query: runs execute after deploy',
});
},
handler: (argv) => {
@@ -307,6 +322,7 @@ yargs
builder: (yargs) => {
yargs.option('json', {
type: 'boolean',
+ group: 'Options for explainTypes:',
describe: 'optionaly return info in json format',
});
},
@@ -316,7 +332,7 @@ yargs
},
})
.command({
- command: 'createDeltaPkg [range] [--filter ] [--commitHistory ]',
+ command: 'createDeltaPkg [range]',
aliases: ['cdp'],
desc: 'Copies commit-based file delta into deploy folder',
builder: (yargs) => {
@@ -327,11 +343,13 @@ yargs
})
.option('filter', {
type: 'string',
+ group: 'Options for createDeltaPkg:',
describe:
'Disable templating & instead filter by the specified BU path (comma separated), can include subtype, will be prefixed with "retrieve/"',
})
.option('commitHistory', {
type: 'number',
+ group: 'Options for createDeltaPkg:',
describe: 'Number of commits to look back for changes (supersedes config)',
});
},
@@ -390,8 +408,8 @@ yargs
},
})
.command({
- command: 'execute ',
- aliases: ['exec'],
+ command: 'execute [KEY]',
+ aliases: ['exec', 'start'],
desc: 'executes the entity (query/journey/automation etc.)',
builder: (yargs) => {
yargs
@@ -406,11 +424,49 @@ yargs
.positional('KEY', {
type: 'string',
describe: 'key(s) of the metadata component(s)',
+ })
+ .option('like', {
+ type: 'string',
+ group: 'Options for execute:',
+ describe:
+ 'filter metadata components (can include % as wildcard or _ for a single character)',
+ });
+ },
+ handler: (argv) => {
+ Mcdev.setOptions(argv);
+ // ! do not allow multiple types to be passed in here via csvToArray
+ Mcdev.execute(argv.BU, argv.TYPE, csvToArray(argv.KEY));
+ },
+ })
+ .command({
+ command: 'pause [KEY]',
+ aliases: ['p', 'stop'],
+ desc: 'pauses the entity (automation etc.)',
+ builder: (yargs) => {
+ yargs
+ .positional('BU', {
+ type: 'string',
+ describe: 'the business unit where to start an item',
+ })
+ .positional('TYPE', {
+ type: 'string',
+ describe: 'metadata type',
+ })
+ .positional('KEY', {
+ type: 'string',
+ describe: 'key(s) of the metadata component(s)',
+ })
+ .option('like', {
+ type: 'string',
+ group: 'Options for pause:',
+ describe:
+ 'filter metadata components (can include % as wildcard or _ for a single character)',
});
},
handler: (argv) => {
Mcdev.setOptions(argv);
- Mcdev.execute(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY));
+ // ! do not allow multiple types to be passed in here via csvToArray
+ Mcdev.pause(argv.BU, argv.TYPE, csvToArray(argv.KEY));
},
})
.command({
@@ -490,9 +546,13 @@ function csvToArray(csv) {
return !csv
? null
: csv.includes(',')
- ? csv.split(',').map((item) =>
- // allow whitespace in comma-separated lists
- item.trim()
- )
- : [csv.trim()];
+ ? csv
+ .split(',')
+ .map((item) =>
+ // allow whitespace in comma-separated lists
+ item.trim()
+ )
+ // make sure trailing commas are ignored
+ .filter(Boolean)
+ : [csv.trim()].filter(Boolean);
}
diff --git a/lib/index.js b/lib/index.js
index ea55c327d..da03af85c 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -51,15 +51,17 @@ class Mcdev {
static setOptions(argv) {
const knownOptions = [
'api',
- 'commitHistory',
'changeKeyField',
'changeKeyValue',
+ 'commitHistory',
'filter',
'fromRetrieve',
'json',
+ 'like',
+ 'noLogFile',
'refresh',
+ 'execute',
'skipInteraction',
- 'noLogFile',
];
for (const option of knownOptions) {
if (argv[option] !== undefined) {
@@ -173,20 +175,20 @@ class Mcdev {
}
if (businessUnit === '*') {
- Util.logger.info('\n :: Retrieving all BUs for all credentials');
+ Util.logger.info(':: Retrieving all BUs for all credentials');
let counter_credTotal = 0;
for (const cred in properties.credentials) {
- Util.logger.info(`\n :: Retrieving all BUs for ${cred}`);
+ Util.logger.info(`:: Retrieving all BUs for ${cred}`);
let counter_credBu = 0;
for (const bu in properties.credentials[cred].businessUnits) {
- await this._retrieveBU(cred, bu, selectedTypesArr, keys);
+ await this.#retrieveBU(cred, bu, selectedTypesArr, keys);
counter_credBu++;
Util.startLogger(true);
}
counter_credTotal += counter_credBu;
- Util.logger.info(`\n :: ${counter_credBu} BUs for ${cred}\n`);
+ Util.logger.info(`:: ${counter_credBu} BUs for ${cred}\n`);
}
- Util.logger.info(`\n :: ${counter_credTotal} BUs in total\n`);
+ Util.logger.info(`:: ${counter_credTotal} BUs in total\n`);
} else {
let [cred, bu] = businessUnit ? businessUnit.split('/') : [null, null];
// to allow all-BU via user selection we need to run this here already
@@ -210,17 +212,17 @@ class Mcdev {
}
if (bu === '*' && properties.credentials && properties.credentials[cred]) {
- Util.logger.info(`\n :: Retrieving all BUs for ${cred}`);
+ Util.logger.info(`:: Retrieving all BUs for ${cred}`);
let counter_credBu = 0;
for (const bu in properties.credentials[cred].businessUnits) {
- await this._retrieveBU(cred, bu, selectedTypesArr, keys);
+ await this.#retrieveBU(cred, bu, selectedTypesArr, keys);
counter_credBu++;
Util.startLogger(true);
}
- Util.logger.info(`\n :: ${counter_credBu} BUs for ${cred}\n`);
+ Util.logger.info(`:: ${counter_credBu} BUs for ${cred}\n`);
} else {
// retrieve a single BU; return
- const retrieveChangelog = await this._retrieveBU(
+ const retrieveChangelog = await this.#retrieveBU(
cred,
bu,
selectedTypesArr,
@@ -235,7 +237,7 @@ class Mcdev {
}
}
/**
- * helper for {@link retrieve}
+ * helper for {@link Mcdev.retrieve}
*
* @private
* @param {string} cred name of Credential
@@ -245,7 +247,7 @@ class Mcdev {
* @param {boolean} [changelogOnly] skip saving, only create json in memory
* @returns {Promise.