diff --git a/.coverage-comment-template.md b/.coverage-comment-template.md
deleted file mode 100644
index 4aceff38b..000000000
--- a/.coverage-comment-template.md
+++ /dev/null
@@ -1,20 +0,0 @@
-## Coverage Report
-
-Commit: [{{short_commit_sha}}]({{commit_link}})
-Base: [{{base_ref}}@{{base_short_commit_sha}}]({{base_commit_link}})
-
-| Type | Base | This PR |
-| ------------------------- | ------------------------------------------ | ---------------------------------------------------------------------------------- |
-| Total Statements Coverage | {{base_total_statements_coverage_percent}} | {{total_statements_coverage_percent}} ({{total_statements_coverage_percent_diff}}) |
-| Total Branches Coverage | {{base_total_branches_coverage_percent}} | {{total_branches_coverage_percent}} ({{total_branches_coverage_percent_diff}}) |
-| Total Functions Coverage | {{base_total_functions_coverage_percent}} | {{total_functions_coverage_percent}} ({{total_functions_coverage_percent_diff}}) |
-| Total Lines Coverage | {{base_total_lines_coverage_percent}} | {{total_lines_coverage_percent}} ({{total_lines_coverage_percent_diff}}) |
-
-
-Details (changed files)
-{{changed_files_coverage_table}}
-
-
-Details (all files)
-{{files_coverage_table}}
-
diff --git a/.coverage-comment-template.svelte b/.coverage-comment-template.svelte
index 8455cd02f..ae2267b27 100644
--- a/.coverage-comment-template.svelte
+++ b/.coverage-comment-template.svelte
@@ -1,178 +1,194 @@
Coverage Report
-Commit: {short_commit_sha}
-Base: {base_ref}@{base_short_commit_sha}
+Commit:{short_commit_sha}
+Base: {base_ref}@{base_short_commit_sha}
-
- Type |
- {#if has_base_data}
- Base |
- {/if}
- This PR |
-
-
- {#each summary_list as {type, percent}}
-
- {type} |
+
+ Type |
{#if has_base_data}
-
- {#if Number.isFinite(percent.base)}
- {percent.base}%
- {:else}
- -
- {/if}
- |
+ Base |
{/if}
-
- {#if Number.isFinite(percent.total)}
- {percent.total}%
- {#if has_base_data}
- ({formatPercentDiff(percent.diff)})
- {/if}
- {:else}
- -
- {/if}
- |
-
- {/each}
-
-
-
-
- Details (changed testable files):
-
-
- File |
- Statements |
- Branches |
- Functions |
- Lines |
+ This PR |
- {#each changed_files_coverage_data as [file, data]}
- {@const percents = [
- data.statements.pct,
- data.branches.pct,
- data.functions.pct,
- data.lines.pct
- ]}
-
-
- {file}
- |
- {#each percents as percent}
-
- {#if Number.isFinite(percent)}
- {percent}%
- {:else}
- -
- {/if}
- |
- {/each}
-
- {/each}
+ {#each summary_list as { type, percent }}
+
+ {type} |
+ {#if has_base_data}
+
+ {#if Number.isFinite(percent.base)}
+ {percent.base}%
+ {:else}
+ -
+ {/if}
+ |
+ {/if}
+
+ {#if Number.isFinite(percent.total)}
+ {percent.total}%
+ {#if has_base_data}
+ ({formatPercentDiff(percent.diff)})
+ {/if}
+ {:else}
+ -
+ {/if}
+ |
+
+ {/each}
-
-
\ No newline at end of file
+
+
+
+ Details (changed files):
+
+
+ File |
+ Statements |
+ Branches |
+ Functions |
+ Lines |
+
+
+ {#each changed_files_coverage_data as [file, data]}
+ {@const percents = [
+ data.statements.pct,
+ data.branches.pct,
+ data.functions.pct,
+ data.lines.pct,
+ ]}
+
+
+ {file}
+ |
+ {#each percents as percent}
+
+ {#if Number.isFinite(percent)}
+ {percent}%
+ {:else}
+ -
+ {/if}
+ |
+ {/each}
+
+ {/each}
+
+
+
diff --git a/.github/ISSUE_TEMPLATE/bug.yml b/.github/ISSUE_TEMPLATE/bug.yml
index bca928014..c133ed59c 100644
--- a/.github/ISSUE_TEMPLATE/bug.yml
+++ b/.github/ISSUE_TEMPLATE/bug.yml
@@ -39,6 +39,7 @@ body:
label: Version
description: What version of our software are you running? (mcdev --version)
options:
+ - 5.1.0
- 5.0.2
- 5.0.1
- 5.0.0
diff --git a/.github/workflows/coverage-base-update.yml b/.github/workflows/coverage-base-update.yml
index 87dd0f1b4..a84e002d2 100644
--- a/.github/workflows/coverage-base-update.yml
+++ b/.github/workflows/coverage-base-update.yml
@@ -1,8 +1,12 @@
-name: Update coverage comment
+name: Update coverage comment # base-update.yml
on:
pull_request:
types: [edited]
+permissions:
+ # allow dependabot to execute this workflow
+ pull-requests: write
+
jobs:
hello_world_job:
runs-on: ubuntu-latest
@@ -48,7 +52,7 @@ jobs:
files: 'base-artifacts/coverage-summary.json, artifacts/coverage-summary.json'
- name: Update Coverage comment
- uses: sidx1024/report-nyc-coverage-github-action@v1.2.6
+ uses: sidx1024/report-nyc-coverage-github-action@v1.2.7
if: steps.check_files.outputs.files_exists == 'true'
# Only runs if all of the files exists
with:
diff --git a/.github/workflows/coverage-develop-branch.yml b/.github/workflows/coverage-develop-branch.yml
index 9ace0197d..d14c5fbe3 100644
--- a/.github/workflows/coverage-develop-branch.yml
+++ b/.github/workflows/coverage-develop-branch.yml
@@ -1,24 +1,25 @@
-name: Test coverage for develop branch
+name: Test coverage for develop branch # default-branch.yml
on:
push:
branches:
- develop
+permissions:
+ # allow dependabot to execute this workflow
+ pull-requests: write
+
jobs:
hello_world_job:
runs-on: ubuntu-latest
- name: Test and report
+ name: Test and upload coverage
steps:
- name: Checkout
uses: actions/checkout@v3
with:
- ref: ${{ github.event.pull_request.head.sha }}
+ ref: ${{ github.event.ref }}
fetch-depth: 1000
- - name: Fetch base
- run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000
-
- uses: actions/setup-node@v3
with:
node-version: 16
diff --git a/.github/workflows/coverage-main-branch.yml b/.github/workflows/coverage-main-branch.yml
index ce40479d9..9aa2b1ff3 100644
--- a/.github/workflows/coverage-main-branch.yml
+++ b/.github/workflows/coverage-main-branch.yml
@@ -1,24 +1,25 @@
-name: Test coverage for main branch
+name: Test coverage for main branch # default-branch.yml
on:
push:
branches:
- main
+permissions:
+ # allow dependabot to execute this workflow
+ pull-requests: write
+
jobs:
hello_world_job:
runs-on: ubuntu-latest
- name: Test and report
+ name: Test and upload coverage
steps:
- name: Checkout
uses: actions/checkout@v3
with:
- ref: ${{ github.event.pull_request.head.sha }}
+ ref: ${{ github.event.ref }}
fetch-depth: 1000
- - name: Fetch base
- run: git fetch origin ${{ github.event.pull_request.base.ref }} --depth=1000
-
- uses: actions/setup-node@v3
with:
node-version: 16
diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 9ea664a6b..82d75fb38 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -1,6 +1,11 @@
on: [pull_request]
-name: Test coverage report
+name: Test coverage report # main.yml
+
+permissions:
+ # allow dependabot to execute this workflow
+ pull-requests: write
+
jobs:
hello_world_job:
runs-on: ubuntu-latest
@@ -69,7 +74,7 @@ jobs:
files: 'base-artifacts/coverage-summary.json'
- name: Report coverage
- uses: sidx1024/report-nyc-coverage-github-action@v1.2.6
+ uses: sidx1024/report-nyc-coverage-github-action@v1.2.7
id: report
with:
coverage_file: 'artifacts/test-coverage-output/coverage-summary.json'
diff --git a/.husky/post-checkout b/.husky/post-checkout
index e2201380c..2607e40f5 100644
--- a/.husky/post-checkout
+++ b/.husky/post-checkout
@@ -10,7 +10,8 @@ then
fi
TEMPLATE="#$TICKETID: "
echo "[POST_CHECKOUT] Setting template commit to '$TEMPLATE'"
-echo $TEMPLATE > ".git/templatemessage"
+# wrap $TEMPLATE in quotes or else it is trimmed automatically
+echo "$TEMPLATE" > ".git/templatemessage"
# ### run npm install ###
@@ -21,7 +22,7 @@ IFS=$'\n'
NEWHEAD=$1
# $2 is the previous HEAD pointer
OLDHEAD=$2
-# extract all paths to package-lock.json files
+# extract all paths to package-lock.json files
PACKAGE_LOCK_REGEX="(^package-lock\.json)"
PACKAGES=$(git diff --name-only $NEWHEAD $OLDHEAD | grep -E $PACKAGE_LOCK_REGEX || true)
diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md
index d9363cd3c..8027e7538 100644
--- a/docs/dist/documentation.md
+++ b/docs/dist/documentation.md
@@ -186,17 +186,17 @@ Provides default functionality that can be overwritten by child metadata type cl
csvToArray(csv) ⇒ Array.<string>
helper to convert CSVs into an array. if only one value was given, it's also returned as an array
+Automation.(metadataMap, key) ⇒ Promise.<void>
+helper for postDeployTasks
+
+Automation.(metadataMap, originalMetadataMap, key)
+helper for postDeployTasks
+
getUserName(userList, item, fieldname) ⇒ string
setupSDK(sessionKey, authObject) ⇒ SDK
Returns an SDK instance to be used for API calls
-createNewLoggerTransport() ⇒ object
-wrapper around our standard winston logging to console and logfile
-
-startLogger() ⇒ void
-initiate winston logger
-
## Typedefs
@@ -496,6 +496,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>
@@ -748,6 +750,35 @@ Build a specific metadata file based on a template using a list of bu-market com
| selectedType | string
| supported metadata type |
| keyArr | Array.<string>
| customerkey of the metadata |
+
+
+### Mcdev.execute(businessUnit, [selectedTypesArr], keys) ⇒ Promise.<boolean>
+Start an item (query)
+
+**Kind**: static method of [Mcdev
](#Mcdev)
+**Returns**: Promise.<boolean>
- true if all started successfully, false if not
+
+| Param | Type | Description |
+| --- | --- | --- |
+| businessUnit | string
| name of BU |
+| [selectedTypesArr] | Array.<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)
+
+**Kind**: static method of [Mcdev
](#Mcdev)
+**Returns**: Promise.<boolean>
- true if all items were executed, false otherwise
+
+| 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 |
+
## Asset ⇐ [MetadataType
](#MetadataType)
@@ -1206,7 +1237,7 @@ Automation MetadataType
* [.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
+ * [.postRetrieveTasks(metadata)](#Automation.postRetrieveTasks) ⇒ TYPE.AutomationItem
\| void
* [.deploy(metadata, targetBU, retrieveDir, [isRefresh])](#Automation.deploy) ⇒ Promise.<TYPE.AutomationMap>
* [.create(metadata)](#Automation.create) ⇒ Promise
* [.update(metadata, metadataBefore)](#Automation.update) ⇒ Promise
@@ -1215,7 +1246,6 @@ Automation MetadataType
* [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ Promise.<void>
* [.setFolderPath(metadata)](#Automation.setFolderPath)
* [.setFolderId(metadata)](#Automation.setFolderId)
- * [.parseMetadata(metadata)](#Automation.parseMetadata) ⇒ TYPE.AutomationItem
\| void
* [._buildSchedule(scheduleObject)](#Automation._buildSchedule) ⇒ TYPE.AutomationScheduleSoap
* [._calcTime(offsetServer, dateInput, [offsetInput])](#Automation._calcTime) ⇒ string
* [.document([metadata])](#Automation.document) ⇒ Promise.<void>
@@ -1268,11 +1298,11 @@ Retrieve a specific Automation Definition by Name
-### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem
+### Automation.postRetrieveTasks(metadata) ⇒ TYPE.AutomationItem
\| void
manages post retrieve steps
**Kind**: static method of [Automation
](#Automation)
-**Returns**: TYPE.AutomationItem
- metadata
+**Returns**: TYPE.AutomationItem
\| void
- parsed item
| Param | Type | Description |
| --- | --- | --- |
@@ -1378,18 +1408,6 @@ automation-specific script that retrieves the folder ID from cache and updates t
| --- | --- | --- |
| metadata | TYPE.MetadataTypeItem
| a single item |
-
-
-### Automation.parseMetadata(metadata) ⇒ TYPE.AutomationItem
\| void
-parses retrieved Metadata before saving
-
-**Kind**: static method of [Automation
](#Automation)
-**Returns**: TYPE.AutomationItem
\| void
- parsed item
-
-| Param | Type | Description |
-| --- | --- | --- |
-| metadata | TYPE.AutomationItem
| a single automation definition |
-
### Automation.\_buildSchedule(scheduleObject) ⇒ TYPE.AutomationScheduleSoap
@@ -3155,6 +3173,7 @@ Provides default functionality that can be overwritten by child metadata type cl
* [.create(metadata, deployDir)](#MetadataType.create) ⇒ void
* [.update(metadata, [metadataBefore])](#MetadataType.update) ⇒ void
* [.refresh()](#MetadataType.refresh) ⇒ void
+ * [.execute()](#MetadataType.execute) ⇒ 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>
@@ -3167,6 +3186,7 @@ Provides default functionality that can be overwritten by child metadata type cl
* [.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}>
+ * [.executeREST(uri, key)](#MetadataType.executeREST) ⇒ Promise.<string>
* [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ Promise.<void>
* [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ TYPE.MetadataTypeMap
* [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ void
@@ -3466,6 +3486,12 @@ Abstract update method that needs to be implemented in child metadata type
### 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)
@@ -3633,6 +3659,19 @@ Retrieves Metadata for Rest Types
| [templateVariables] | TYPE.TemplateMap
| variables to be replaced in the metadata |
| [singleRetrieve] | string
\| number
| key of single item to filter by |
+
+
+### MetadataType.executeREST(uri, key) ⇒ Promise.<string>
+Used to execute a query/automation etc.
+
+**Kind**: static method of [MetadataType
](#MetadataType)
+**Returns**: Promise.<string>
- 'OK' if started execution successfully, otherwise - 'Error'
+
+| Param | Type | Description |
+| --- | --- | --- |
+| uri | string
| REST endpoint where the POST request should be sent |
+| key | string
| item key |
+
### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ Promise.<void>
@@ -4548,6 +4587,7 @@ Query MetadataType
* [Query](#Query) ⇐ [MetadataType
](#MetadataType)
* [.retrieve(retrieveDir, [_], [__], [key])](#Query.retrieve) ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}>
+ * [.execute(keyArr)](#Query.execute) ⇒ Promise.<boolean>
* [.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
@@ -4577,6 +4617,18 @@ Retrieves Metadata of queries
| [__] | void
| unused parameter |
| [key] | string
| customer key of single item to retrieve |
+
+
+### Query.execute(keyArr) ⇒ Promise.<boolean>
+a function to start query execution via API
+
+**Kind**: static method of [Query
](#Query)
+**Returns**: Promise.<boolean>
- Returns true if all items were executed successfully, otherwise false
+
+| Param | Type | Description |
+| --- | --- | --- |
+| keyArr | Array.<string>
| customerkey of the metadata |
+
### Query.retrieveForCache() ⇒ Promise.<{metadata: TYPE.QueryMap, type: string}>
@@ -5833,19 +5885,21 @@ CLI entry for SFMC DevTools
* [.includesStartsWith(arr, search)](#Util.includesStartsWith) ⇒ boolean
* [.includesStartsWithIndex(arr, search)](#Util.includesStartsWithIndex) ⇒ number
* [.checkMarket(market, properties)](#Util.checkMarket) ⇒ boolean
- * [.verifyMarketList(mlName, properties)](#Util.verifyMarketList) ⇒ void
+ * [.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
* [.getMetadataHierachy(metadataTypes)](#Util.getMetadataHierachy) ⇒ Object.<string, Array.<string>>
* [.resolveObjPath(path, obj)](#Util.resolveObjPath) ⇒ any
- * [.execSync(cmd, [args], [hideOutput])](#Util.execSync) ⇒ string
+ * [.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)
@@ -5919,11 +5973,10 @@ check if a market name exists in current mcdev config
-### Util.verifyMarketList(mlName, properties) ⇒ void
+### Util.verifyMarketList(mlName, properties)
ensure provided MarketList exists and it's content including markets and BUs checks out
**Kind**: static method of [Util
](#Util)
-**Returns**: void
- throws errors if problems were found
| Param | Type | Description |
| --- | --- | --- |
@@ -5992,6 +6045,30 @@ 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 | Default | Description |
+| --- | --- | --- | --- |
+| [noLogFile] | boolean
| false
| 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 | 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 |
+
### Util.metadataLogger(level, type, method, payload, [source]) ⇒ void
@@ -6061,11 +6138,11 @@ let's you dynamically walk down an object and get a value
-### Util.execSync(cmd, [args], [hideOutput]) ⇒ string
+### 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
- output of command if hideOutput is true
+**Returns**: string
\| void
- output of command if hideOutput is true
| Param | Type | Description |
| --- | --- | --- |
@@ -7698,19 +7775,21 @@ Util that contains logger and simple util methods
* [.includesStartsWith(arr, search)](#Util.includesStartsWith) ⇒ boolean
* [.includesStartsWithIndex(arr, search)](#Util.includesStartsWithIndex) ⇒ number
* [.checkMarket(market, properties)](#Util.checkMarket) ⇒ boolean
- * [.verifyMarketList(mlName, properties)](#Util.verifyMarketList) ⇒ void
+ * [.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
* [.getMetadataHierachy(metadataTypes)](#Util.getMetadataHierachy) ⇒ Object.<string, Array.<string>>
* [.resolveObjPath(path, obj)](#Util.resolveObjPath) ⇒ any
- * [.execSync(cmd, [args], [hideOutput])](#Util.execSync) ⇒ string
+ * [.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)
@@ -7784,11 +7863,10 @@ check if a market name exists in current mcdev config
-### Util.verifyMarketList(mlName, properties) ⇒ void
+### Util.verifyMarketList(mlName, properties)
ensure provided MarketList exists and it's content including markets and BUs checks out
**Kind**: static method of [Util
](#Util)
-**Returns**: void
- throws errors if problems were found
| Param | Type | Description |
| --- | --- | --- |
@@ -7857,6 +7935,30 @@ 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 | Default | Description |
+| --- | --- | --- | --- |
+| [noLogFile] | boolean
| false
| 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 | 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 |
+
### Util.metadataLogger(level, type, method, payload, [source]) ⇒ void
@@ -7926,11 +8028,11 @@ let's you dynamically walk down an object and get a value
-### Util.execSync(cmd, [args], [hideOutput]) ⇒ string
+### 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
- output of command if hideOutput is true
+**Returns**: string
\| void
- output of command if hideOutput is true
| Param | Type | Description |
| --- | --- | --- |
@@ -8064,6 +8166,32 @@ 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 |
+
+
+## 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)
+helper for [postDeployTasks](postDeployTasks)
+
+**Kind**: global function
+
+| 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 |
+
## getUserName(userList, item, fieldname) ⇒ string
@@ -8089,19 +8217,6 @@ Returns an SDK instance to be used for API calls
| sessionKey | string
| key for specific BU |
| authObject | TYPE.AuthObject
| credentials for specific BU |
-
-
-## createNewLoggerTransport() ⇒ object
-wrapper around our standard winston logging to console and logfile
-
-**Kind**: global function
-**Returns**: object
- initiated logger for console and file
-
-
-## startLogger() ⇒ void
-initiate winston logger
-
-**Kind**: global function
## TypeKeyCombo : Object.<string, string>
diff --git a/lib/Deployer.js b/lib/Deployer.js
index 29e267c2d..3d064049a 100644
--- a/lib/Deployer.js
+++ b/lib/Deployer.js
@@ -103,7 +103,7 @@ class Deployer {
buMultiMetadataTypeMap[cred + '/' + bu] = multiMetadataTypeMap;
counter_credBu++;
Util.logger.info('');
- Util.restartLogger();
+ Util.startLogger(true);
}
} else {
// anything but "*" passed in
@@ -157,7 +157,7 @@ class Deployer {
buMultiMetadataTypeMap[cred + '/' + buPath] = multiMetadataTypeMap;
counter_credBu++;
Util.logger.info('');
- Util.restartLogger();
+ Util.startLogger(true);
}
Util.logger.info(`\n :: ${counter_credBu} BUs for ${cred}\n`);
} else {
@@ -387,7 +387,7 @@ class Deployer {
const allFolders = Object.keys(metadata[metadataType])
.filter(
// filter out root folders (which would not have a slash in their path)
- (key) => metadata[metadataType][key].r__folder_Path.includes('/')
+ (key) => metadata[metadataType][key].r__folder_Path?.includes('/')
)
.filter(
// filter out dataExtension folders other than standard & shared (--> synchronized / salesforce are not allowed)
diff --git a/lib/cli.js b/lib/cli.js
index 992d6f9f9..931c78b19 100644
--- a/lib/cli.js
+++ b/lib/cli.js
@@ -389,6 +389,30 @@ yargs
Mcdev.refresh(argv.BU, argv.TYPE, csvToArray(argv.KEY));
},
})
+ .command({
+ command: 'execute ',
+ aliases: ['exec'],
+ desc: 'executes the entity (query/journey/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)',
+ });
+ },
+ handler: (argv) => {
+ Mcdev.setOptions(argv);
+ Mcdev.execute(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY));
+ },
+ })
.command({
command: 'upgrade',
aliases: ['up'],
@@ -410,6 +434,10 @@ yargs
type: 'boolean',
description: 'Only output errors to CLI',
})
+ .option('noLogFile', {
+ type: 'boolean',
+ description: 'Only output log to CLI but not to files',
+ })
.option('skipInteraction', {
alias: ['yes', 'y'],
description: 'Interactive questions where possible and go with defaults instead',
diff --git a/lib/index.js b/lib/index.js
index ecd28d298..3589f02b6 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -59,6 +59,7 @@ class Mcdev {
'json',
'refresh',
'skipInteraction',
+ 'noLogFile',
];
for (const option of knownOptions) {
if (argv[option] !== undefined) {
@@ -89,6 +90,7 @@ class Mcdev {
* @returns {Promise.} list of changed items
*/
static async createDeltaPkg(argv) {
+ Util.startLogger();
Util.logger.info('Create Delta Package ::');
const properties = await config.getProperties();
if (!(await config.checkProperties(properties))) {
@@ -111,6 +113,7 @@ class Mcdev {
* @returns {Promise} .
*/
static async selectTypes() {
+ Util.startLogger();
const properties = await config.getProperties();
if (!(await config.checkProperties(properties))) {
return null;
@@ -127,6 +130,7 @@ class Mcdev {
* @returns {Promise.} success flag
*/
static async upgrade() {
+ Util.startLogger();
const properties = await config.getProperties();
if (!properties) {
Util.logger.error('No config found. Please run mcdev init');
@@ -149,6 +153,7 @@ class Mcdev {
* @returns {Promise.