Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.0.2 #947

Merged
merged 101 commits into from
May 30, 2023
Merged

5.0.2 #947

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
4128d06
#800: ensure document is not run on keyed REST retrieves
JoernBerkefeld Mar 13, 2023
d8e321c
#0: improve API request body log
JoernBerkefeld May 11, 2023
0d22d37
#889: switch mobileKeyword's keyField to `id` to avoid duplicate over…
JoernBerkefeld May 12, 2023
5844061
#0: correct eslint jsdoc/tag-lines setting to match existing code aft…
JoernBerkefeld May 12, 2023
154568c
#906: ensure explainTypes cli output is valid json with double quotes
JoernBerkefeld May 15, 2023
43e2f66
Merge pull request #907 from Accenture/task/906-add-double-quotes-to-…
JoernBerkefeld May 15, 2023
45e3459
Bump simple-git from 3.16.0 to 3.18.0
dependabot[bot] May 16, 2023
e81b7b7
Merge pull request #900 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 16, 2023
9a7be1a
Bump lint-staged from 13.2.0 to 13.2.2
dependabot[bot] May 16, 2023
c4ae8e6
Merge pull request #901 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 16, 2023
21d9ff7
Bump deep-equal from 2.1.0 to 2.2.1
dependabot[bot] May 16, 2023
f0b4eb0
Merge pull request #899 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 16, 2023
ca0097a
Bump eslint-plugin-jsdoc from 43.1.1 to 44.2.4
dependabot[bot] May 16, 2023
3615299
Merge pull request #908 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 16, 2023
a0e7e60
#912: run npm install on git checkout, merge if necessary and always …
JoernBerkefeld May 17, 2023
5d9afc9
#912: enable debugging temporarily
JoernBerkefeld May 17, 2023
ab4be95
#912: refactoring
JoernBerkefeld May 17, 2023
1e418cb
#912: debug msgs
JoernBerkefeld May 17, 2023
cd43d9b
#912: attempt at fixing error
JoernBerkefeld May 17, 2023
13de337
#912: improve log output for when no updates are required
JoernBerkefeld May 17, 2023
3c42ae4
#912: improve hook logs
JoernBerkefeld May 17, 2023
48a19da
#912: fix call to git diff
JoernBerkefeld May 17, 2023
16a290c
#912: install something for testing purposes
JoernBerkefeld May 17, 2023
ccd4122
Merge branch 'task/912-git-hook-test' into task/912-ensure-mcdev-coll…
JoernBerkefeld May 17, 2023
bf9e4f3
#912: test
JoernBerkefeld May 17, 2023
5c279fb
#912: HUSKY_GIT_PARAMS
JoernBerkefeld May 17, 2023
b2cf57b
#912: test git parameters
JoernBerkefeld May 17, 2023
e28f540
#912: debug info
JoernBerkefeld May 17, 2023
c2d21f5
#912: fiddle with variables
JoernBerkefeld May 17, 2023
16d12bd
#912: turn PACKAGES into an array
JoernBerkefeld May 17, 2023
dee8d3a
#912: fix array
JoernBerkefeld May 17, 2023
a7fcc6d
#912: fix errorCode 1 when nothing was found
JoernBerkefeld May 17, 2023
f0aff18
#912: refactoring
JoernBerkefeld May 17, 2023
5223df8
#912: remove test install
JoernBerkefeld May 17, 2023
3c84ef0
#912: cleanup
JoernBerkefeld May 17, 2023
45d29e8
Merge pull request #913 from Accenture/task/912-ensure-mcdev-collabor…
JoernBerkefeld May 17, 2023
5557d8b
#914: catch error for unrecognized branch names that broke the post-c…
JoernBerkefeld May 17, 2023
31d83c3
#914: make "type-subfolder" in branch name optional for post-checkout…
JoernBerkefeld May 17, 2023
687036e
Merge pull request #916 from Accenture/task/914-allow-standard-github…
JoernBerkefeld May 17, 2023
0ee272c
#914: ensure numbers are only taken from the start
JoernBerkefeld May 17, 2023
6a53889
Merge pull request #917 from Accenture/task/914-allow-standard-github…
JoernBerkefeld May 17, 2023
5086250
Bump eslint-plugin-unicorn from 46.0.0 to 47.0.0
dependabot[bot] May 17, 2023
0680d68
#0: eslint --fix
JoernBerkefeld May 17, 2023
8fafdd7
Merge pull request #897 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 17, 2023
7db8847
Merge branch 'develop' into bugfix/889-if-keywords-exist-multiple-tim…
JoernBerkefeld May 17, 2023
bc33a05
#923: corrected dataExtensionField rename log message
JoernBerkefeld May 24, 2023
61591a0
#923: add empty test for renaming fields
JoernBerkefeld May 24, 2023
f14f0f0
Merge pull request #929 from Accenture/bugfix/923-dataextensionfield-…
JoernBerkefeld May 24, 2023
c8759df
#892: delete old interaction folder on retrieve of journey
JoernBerkefeld May 24, 2023
5e6d09f
Merge pull request #930 from Accenture/bugfix/892-delete-old-interact…
JoernBerkefeld May 24, 2023
4b0530d
#909: clarify that bd and bdb require the template's file name
JoernBerkefeld May 24, 2023
5ffb804
Merge pull request #931 from Accenture/bugfix/909-builddefinition-and…
JoernBerkefeld May 24, 2023
76bd1ae
Merge remote-tracking branch 'origin/develop' into bugfix/889-if-keyw…
JoernBerkefeld May 24, 2023
dc00219
#889: eslint --fix and jsdoc fixes
JoernBerkefeld May 24, 2023
cccad4f
#889: rewrite how other types check mobileKeywords
JoernBerkefeld May 24, 2023
350e6bb
#889: ensure mobileKeywords for which the mobileCode was deleted are …
JoernBerkefeld May 25, 2023
44df15d
#12: refactoring
JoernBerkefeld May 25, 2023
c51a715
#12: re-retrieve automation after deployment to get accurate json
JoernBerkefeld May 25, 2023
dbb2036
Merge pull request #935 from Accenture/bugfix/12-upsert-response-not-…
JoernBerkefeld May 25, 2023
8c304fb
Merge branch 'develop' into bugfix/889-if-keywords-exist-multiple-tim…
JoernBerkefeld May 26, 2023
3a43aea
#889: ensure we always keep the id if it is used as key
JoernBerkefeld May 26, 2023
a5d2337
#889: fix mobileKeyword test cases after switching keyField to "id"
JoernBerkefeld May 26, 2023
b608672
#889: revert previous commit
JoernBerkefeld May 26, 2023
e5fff96
#889: switch to custom keyField c__codeKeyword and support RETRIEVE
JoernBerkefeld May 26, 2023
cc01898
#889: enable DELETE with new custom keyField
JoernBerkefeld May 26, 2023
4fc45c8
#889: enable DEPLOY with new custom keyField
JoernBerkefeld May 26, 2023
e4569db
#889: enable updating the keyword via changeKeyValue / changeKeyField
JoernBerkefeld May 26, 2023
89959fb
#889: ensure lowercased searches are not rejected
JoernBerkefeld May 26, 2023
8d35cb6
Revert "#889: fix mobileKeyword test cases after switching keyField t…
JoernBerkefeld May 26, 2023
8c8781f
#889: fix test cases for new code.keyword custom keyField
JoernBerkefeld May 26, 2023
7cd3620
Revert "#889: switch mobileKeyword's keyField to `id` to avoid duplic…
JoernBerkefeld May 26, 2023
751aee3
#889: apply same code.keyword logic to retrieve and retrieveAsTemplate
JoernBerkefeld May 26, 2023
84733d5
#889: remove searchForMobileKeyword; reference c__codeKeyword across …
JoernBerkefeld May 26, 2023
0c60da4
#889: enforce upper-cased keywords in tests
JoernBerkefeld May 26, 2023
5ab2c35
#936: allow "Revert ..." commit messages
JoernBerkefeld May 26, 2023
6250cf9
Merge pull request #937 from Accenture/bugfix/936-commit-msg-hook-doe…
JoernBerkefeld May 26, 2023
42efc6e
Merge branch 'develop' into bugfix/889-if-keywords-exist-multiple-tim…
JoernBerkefeld May 26, 2023
b772bb5
#889: enhance debug log for filtered keywords
JoernBerkefeld May 26, 2023
665018e
Bump eslint from 8.39.0 to 8.41.0
dependabot[bot] May 30, 2023
43e99a9
Merge pull request #921 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 30, 2023
b8537d7
Bump eslint-plugin-jsdoc from 44.2.4 to 45.0.0
dependabot[bot] May 30, 2023
3ed057f
Merge pull request #939 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 30, 2023
3cfb7b7
Bump yargs from 17.6.0 to 17.7.2
dependabot[bot] May 30, 2023
5e83b42
Merge pull request #922 from Accenture/dependabot/npm_and_yarn/develo…
JoernBerkefeld May 30, 2023
de952f1
Merge branch 'develop' into bugfix/889-if-keywords-exist-multiple-tim…
JoernBerkefeld May 30, 2023
af86916
Merge pull request #932 from Accenture/bugfix/889-if-keywords-exist-m…
JoernBerkefeld May 30, 2023
e10a521
#893: bump sfmc-sdk from 1.0.0 to 1.0.1 to handle the API issue
JoernBerkefeld May 30, 2023
6b120a9
Merge pull request #941 from Accenture/bugfix/893-retrieving-mobileke…
JoernBerkefeld May 30, 2023
a03a822
Merge branch 'develop' into bugfix/800-document-wrongly-executed-duri…
JoernBerkefeld May 30, 2023
4f5a916
#800: ensure retrieve-by-key does not trigger documenting if document…
JoernBerkefeld May 30, 2023
a998c6c
#800: improve logs
JoernBerkefeld May 30, 2023
1646d29
#800: ensure document is not run for users if only specific keys were…
JoernBerkefeld May 30, 2023
7e0b929
#800: remove outdated check (replaced by definition.documentInOneFile)
JoernBerkefeld May 30, 2023
1f3e0d3
#800: add tests for when document is run (user, dataExtension)
JoernBerkefeld May 30, 2023
bea555f
Merge pull request #942 from Accenture/bugfix/800-document-wrongly-ex…
JoernBerkefeld May 30, 2023
270eb47
#945: corrected expected SQL to have uppercased "AS" statements
JoernBerkefeld May 30, 2023
7493647
#945: ensure we re-initialize the prettier config for each file exten…
JoernBerkefeld May 30, 2023
575554d
#945: only initialize prettier config if we actually plan on saving f…
JoernBerkefeld May 30, 2023
e098cb2
Merge pull request #946 from Accenture/bugfix/945-queries-not-correct…
JoernBerkefeld May 30, 2023
c343c64
5.0.2
JoernBerkefeld May 30, 2023
2791d80
#0: prepping 5.0.2 release
JoernBerkefeld May 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
}
}
],
"jsdoc/tag-lines": ["warn", "any", { "startLines": 1 }],
"spaced-comment": ["warn", "always", { "block": { "exceptions": ["*"], "balanced": true } }]
},
"overrides": [
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ body:
label: Version
description: What version of our software are you running? (mcdev --version)
options:
- 5.0.2
- 5.0.1
- 5.0.0
- 4.3.4
Expand Down
2 changes: 1 addition & 1 deletion .husky/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
. "$(dirname "$0")/_/husky.sh"
INPUT_FILE=$1
START_LINE=`head -n1 $INPUT_FILE`
PATTERN="^(#[[:digit:]]|Merge)"
PATTERN="^(#[[:digit:]]|Merge|Revert)"

if ! [[ "$START_LINE" =~ $PATTERN ]] ; then
echo "Bad commit message, see example: \"#431 commit message\", you provided: \"$START_LINE\""
Expand Down
37 changes: 34 additions & 3 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

# ### git commit message template ###
git config commit.template .git/templatemessage
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '((feature|bug|bugfix|fix|hotfix|task|chore)\/)\K\d{1,7}'`
echo "[POST_CHECKOUT] Setting template commit to $TICKETID"
echo "#$TICKETID: " > ".git/templatemessage"
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '^((feature|bug|bugfix|fix|hotfix|task|chore)\/)?\K\d{1,7}' || true`
if [ -z "$TICKETID" ]
then
TICKETID="0"
fi
TEMPLATE="#$TICKETID: "
echo "[POST_CHECKOUT] Setting template commit to '$TEMPLATE'"
echo $TEMPLATE > ".git/templatemessage"


# ### run npm install ###
echo "[POST-CHECKOUT] 📦 Checking for changes to dependencies"
# define how to split strings into array elements
IFS=$'\n'
# $1 is the new HEAD pointer
NEWHEAD=$1
# $2 is the previous HEAD pointer
OLDHEAD=$2
# 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)

if [[ ${PACKAGES[@]} ]]; then
for package in $PACKAGES; do
echo "📦 $package was changed."
done
echo "📦 Running npm install to update your dependencies..."
npm install
else
echo "📦 All packages up-to-date. No need to run npm install."
fi
21 changes: 21 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/sh
# ### run npm install ###
. "$(dirname "$0")/_/husky.sh"


echo "[POST-MERGE] 📦 Checking for changes to dependencies"

IFS=$'\n'
# extract all paths to package-lock.json files
PACKAGE_LOCK_REGEX="(^package-lock\.json)"
PACKAGES=$(git diff --name-only HEAD^1 HEAD | grep -E $PACKAGE_LOCK_REGEX || true)

if [[ ${PACKAGES[@]} ]]; then
for package in $PACKAGES; do
echo "📦 $package was changed."
done
echo "📦 Running npm install to update your dependencies..."
npm install
else
echo "📦 All packages up-to-date. No need to run npm install."
fi
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run docs
git update-index --add docs/dist/documentation.md
npx --no lint-staged
75 changes: 60 additions & 15 deletions docs/dist/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ Automation MetadataType
* [.update(metadata, metadataBefore)](#Automation.update) ⇒ <code>Promise</code>
* [.preDeployTasks(metadata)](#Automation.preDeployTasks) ⇒ <code>Promise.&lt;TYPE.AutomationItem&gt;</code>
* [.validateDeployMetadata(metadata)](#Automation.validateDeployMetadata) ⇒ <code>boolean</code>
* [.postDeployTasks(metadata, originalMetadata)](#Automation.postDeployTasks) ⇒ <code>Promise.&lt;void&gt;</code>
* [.postDeployTasks(metadataMap, originalMetadataMap)](#Automation.postDeployTasks) ⇒ <code>Promise.&lt;void&gt;</code>
* [.setFolderPath(metadata)](#Automation.setFolderPath)
* [.setFolderId(metadata)](#Automation.setFolderId)
* [.parseMetadata(metadata)](#Automation.parseMetadata) ⇒ <code>TYPE.AutomationItem</code> \| <code>void</code>
Expand Down Expand Up @@ -1345,16 +1345,16 @@ Whitelisted Activites are deployed but require configuration

<a name="Automation.postDeployTasks"></a>

### Automation.postDeployTasks(metadata, originalMetadata) ⇒ <code>Promise.&lt;void&gt;</code>
### Automation.postDeployTasks(metadataMap, originalMetadataMap) ⇒ <code>Promise.&lt;void&gt;</code>
Gets executed after deployment of metadata type

**Kind**: static method of [<code>Automation</code>](#Automation)
**Returns**: <code>Promise.&lt;void&gt;</code> - -

| Param | Type | Description |
| --- | --- | --- |
| metadata | <code>TYPE.AutomationMap</code> | metadata mapped by their keyField |
| originalMetadata | <code>TYPE.AutomationMap</code> | metadata to be updated (contains additioanl fields) |
| metadataMap | <code>TYPE.AutomationMap</code> | metadata mapped by their keyField |
| originalMetadataMap | <code>TYPE.AutomationMap</code> | metadata to be updated (contains additioanl fields) |

<a name="Automation.setFolderPath"></a>

Expand Down Expand Up @@ -3167,6 +3167,7 @@ Provides default functionality that can be overwritten by child metadata type cl
* [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ <code>string</code>
* [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
* [.retrieveREST(retrieveDir, uri, [templateVariables], [singleRetrieve])](#MetadataType.retrieveREST) ⇒ <code>Promise.&lt;{metadata: (TYPE.MetadataTypeMap\|TYPE.MetadataTypeItem), type: string}&gt;</code>
* [.runDocumentOnRetrieve([singleRetrieve], metadataMap)](#MetadataType.runDocumentOnRetrieve) ⇒ <code>Promise.&lt;void&gt;</code>
* [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ <code>TYPE.MetadataTypeMap</code>
* [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ <code>void</code>
* [.removeNotCreateableFields(metadataEntry)](#MetadataType.removeNotCreateableFields) ⇒ <code>void</code>
Expand Down Expand Up @@ -3632,6 +3633,19 @@ Retrieves Metadata for Rest Types
| [templateVariables] | <code>TYPE.TemplateMap</code> | variables to be replaced in the metadata |
| [singleRetrieve] | <code>string</code> \| <code>number</code> | key of single item to filter by |

<a name="MetadataType.runDocumentOnRetrieve"></a>

### MetadataType.runDocumentOnRetrieve([singleRetrieve], metadataMap) ⇒ <code>Promise.&lt;void&gt;</code>
helper for [retrieveREST](retrieveREST) and [retrieveSOAP](retrieveSOAP)

**Kind**: static method of [<code>MetadataType</code>](#MetadataType)
**Returns**: <code>Promise.&lt;void&gt;</code> - -

| Param | Type | Description |
| --- | --- | --- |
| [singleRetrieve] | <code>string</code> \| <code>number</code> | key of single item to filter by |
| metadataMap | <code>TYPE.MetadataTypeMap</code> | saved metadata |

<a name="MetadataType.parseResponseBody"></a>

### MetadataType.parseResponseBody(body, [singleRetrieve]) ⇒ <code>TYPE.MetadataTypeMap</code>
Expand Down Expand Up @@ -4006,11 +4020,13 @@ MobileKeyword MetadataType

* [MobileKeyword](#MobileKeyword) ⇐ [<code>MetadataType</code>](#MetadataType)
* [.retrieve(retrieveDir, [_], [__], [key])](#MobileKeyword.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code> \| <code>void</code>
* [.parseResponseBody(body, [singleRetrieve])](#MobileKeyword.parseResponseBody) ⇒ <code>TYPE.MetadataTypeMap</code>
* [.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate)](#MobileKeyword.createOrUpdate) ⇒ <code>&#x27;create&#x27;</code> \| <code>&#x27;update&#x27;</code> \| <code>&#x27;skip&#x27;</code>
* [.retrieveForCache(_, __, [key])](#MobileKeyword.retrieveForCache) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
* [.retrieveAsTemplate(templateDir, name, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
* [.create(MobileKeyword)](#MobileKeyword.create) ⇒ <code>Promise</code>
* [.retrieveAsTemplate(templateDir, key, templateVariables)](#MobileKeyword.retrieveAsTemplate) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
* [.create(metadata)](#MobileKeyword.create) ⇒ <code>Promise</code>
* [.update(metadata)](#MobileKeyword.update) ⇒ <code>Promise</code>
* [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ <code>TYPE.CodeExtractItem</code> \| <code>TYPE.MetadataTypeItem</code>
* [.postRetrieveTasks(metadata)](#MobileKeyword.postRetrieveTasks) ⇒ <code>TYPE.CodeExtractItem</code> \| <code>TYPE.MetadataTypeItem</code> \| <code>void</code>
* [.prepExtractedCode(metadataScript)](#MobileKeyword.prepExtractedCode) ⇒ <code>Object</code>
* [.buildDefinitionForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildDefinitionForNested) ⇒ <code>Promise.&lt;Array.&lt;Array.&lt;string&gt;&gt;&gt;</code>
* [.buildTemplateForNested(templateDir, targetDir, metadata, templateVariables, templateName)](#MobileKeyword.buildTemplateForNested) ⇒ <code>Promise.&lt;Array.&lt;Array.&lt;string&gt;&gt;&gt;</code>
Expand Down Expand Up @@ -4039,6 +4055,35 @@ Endpoint /legacy/v1/beta/mobile/keyword/ return all Mobile Keywords with all det
| [__] | <code>void</code> | unused parameter |
| [key] | <code>string</code> | customer key of single item to retrieve |

<a name="MobileKeyword.parseResponseBody"></a>

### MobileKeyword.parseResponseBody(body, [singleRetrieve]) ⇒ <code>TYPE.MetadataTypeMap</code>
Builds map of metadata entries mapped to their keyfields

**Kind**: static method of [<code>MobileKeyword</code>](#MobileKeyword)
**Returns**: <code>TYPE.MetadataTypeMap</code> - keyField => metadata map

| Param | Type | Description |
| --- | --- | --- |
| body | <code>object</code> | json of response body |
| [singleRetrieve] | <code>string</code> \| <code>number</code> | key of single item to filter by |

<a name="MobileKeyword.createOrUpdate"></a>

### MobileKeyword.createOrUpdate(metadataMap, metadataKey, hasError, metadataToUpdate, metadataToCreate) ⇒ <code>&#x27;create&#x27;</code> \| <code>&#x27;update&#x27;</code> \| <code>&#x27;skip&#x27;</code>
helper for [upsert](#MetadataType.upsert)

**Kind**: static method of [<code>MobileKeyword</code>](#MobileKeyword)
**Returns**: <code>&#x27;create&#x27;</code> \| <code>&#x27;update&#x27;</code> \| <code>&#x27;skip&#x27;</code> - action to take

| Param | Type | Description |
| --- | --- | --- |
| metadataMap | <code>TYPE.MetadataTypeMap</code> | list of metadata |
| metadataKey | <code>string</code> | key of item we are looking at |
| hasError | <code>boolean</code> | error flag from previous code |
| metadataToUpdate | <code>Array.&lt;TYPE.MetadataTypeItemDiff&gt;</code> | list of items to update |
| metadataToCreate | <code>Array.&lt;TYPE.MetadataTypeItem&gt;</code> | list of items to create |

<a name="MobileKeyword.retrieveForCache"></a>

### MobileKeyword.retrieveForCache(_, __, [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
Expand All @@ -4055,29 +4100,29 @@ Retrieves event definition metadata for caching

<a name="MobileKeyword.retrieveAsTemplate"></a>

### MobileKeyword.retrieveAsTemplate(templateDir, name, templateVariables) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
Retrieve a specific keyword
### MobileKeyword.retrieveAsTemplate(templateDir, key, templateVariables) ⇒ <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code>
retrieve an item and create a template from it

**Kind**: static method of [<code>MobileKeyword</code>](#MobileKeyword)
**Returns**: <code>Promise.&lt;TYPE.MetadataTypeItemObj&gt;</code> - Promise of metadata

| Param | Type | Description |
| --- | --- | --- |
| templateDir | <code>string</code> | Directory where retrieved metadata directory will be saved |
| name | <code>string</code> | name of the metadata file |
| key | <code>string</code> | name of the metadata file |
| templateVariables | <code>TYPE.TemplateMap</code> | variables to be replaced in the metadata |

<a name="MobileKeyword.create"></a>

### MobileKeyword.create(MobileKeyword) ⇒ <code>Promise</code>
Creates a single Event Definition
### MobileKeyword.create(metadata) ⇒ <code>Promise</code>
Creates a single item

**Kind**: static method of [<code>MobileKeyword</code>](#MobileKeyword)
**Returns**: <code>Promise</code> - Promise

| Param | Type | Description |
| --- | --- | --- |
| MobileKeyword | <code>TYPE.MetadataTypeItem</code> | a single Event Definition |
| metadata | <code>TYPE.MetadataTypeItem</code> | a single item |

<a name="MobileKeyword.update"></a>

Expand All @@ -4093,11 +4138,11 @@ Updates a single item

<a name="MobileKeyword.postRetrieveTasks"></a>

### MobileKeyword.postRetrieveTasks(metadata) ⇒ <code>TYPE.CodeExtractItem</code> \| <code>TYPE.MetadataTypeItem</code>
### MobileKeyword.postRetrieveTasks(metadata) ⇒ <code>TYPE.CodeExtractItem</code> \| <code>TYPE.MetadataTypeItem</code> \| <code>void</code>
manages post retrieve steps

**Kind**: static method of [<code>MobileKeyword</code>](#MobileKeyword)
**Returns**: <code>TYPE.CodeExtractItem</code> \| <code>TYPE.MetadataTypeItem</code> - Array with one metadata object and one ssjs string
**Returns**: <code>TYPE.CodeExtractItem</code> \| <code>TYPE.MetadataTypeItem</code> \| <code>void</code> - Array with one metadata object and one ssjs string; or single metadata object; nothing if filtered

| Param | Type | Description |
| --- | --- | --- |
Expand Down
1 change: 0 additions & 1 deletion lib/Deployer.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class Deployer {
/**
* Creates a Deployer, uses v2 auth if v2AuthOptions are passed.
*
*
* @param {TYPE.Mcdevrc} properties General configuration to be used in retrieve
* @param {TYPE.BuObject} buObject properties for auth
*/
Expand Down
16 changes: 8 additions & 8 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ yargs
},
})
.command({
command: 'buildDefinition <BU> <TYPE> <NAME> <MARKET>',
command: 'buildDefinition <BU> <TYPE> <FILENAME> <MARKET>',
aliases: ['bd'],
desc: 'builds metadata definition based on template',
builder: (yargs) => {
Expand All @@ -253,9 +253,9 @@ yargs
type: 'string',
describe: 'metadata type',
})
.positional('NAME', {
.positional('FILENAME', {
type: 'string',
describe: 'name of the metadata component',
describe: 'File name of the metadata template without the extension',
})
.positional('MARKET', {
type: 'string',
Expand All @@ -264,11 +264,11 @@ yargs
},
handler: (argv) => {
Mcdev.setOptions(argv);
Mcdev.buildDefinition(argv.BU, argv.TYPE, argv.NAME, argv.MARKET);
Mcdev.buildDefinition(argv.BU, argv.TYPE, argv.FILENAME, argv.MARKET);
},
})
.command({
command: 'buildDefinitionBulk <LISTNAME> <TYPE> <NAME>',
command: 'buildDefinitionBulk <LISTNAME> <TYPE> <FILENAME>',
aliases: ['bdb'],
desc: 'builds metadata definition based on template en bulk',
builder: (yargs) => {
Expand All @@ -281,14 +281,14 @@ yargs
type: 'string',
describe: 'metadata type',
})
.positional('NAME', {
.positional('FILENAME', {
type: 'string',
describe: 'name of the metadata component',
describe: 'File name of the metadata template without the extension',
});
},
handler: (argv) => {
Mcdev.setOptions(argv);
Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, argv.NAME);
Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, argv.FILENAME);
},
})
.command({
Expand Down
3 changes: 2 additions & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ class Mcdev {
cred = buObject.credential;
bu = buObject.businessUnit;
// clean up old folders after types were renamed
// TODO: Remove this with version 5.0.0
// TODO: Remove renamedTypes-logic 6 months after version 5 release
const renamedTypes = {
emailSend: 'emailSendDefinition',
event: 'eventDefinition',
fileLocation: 'ftpLocation',
journey: 'interaction',
triggeredSend: 'triggeredSendDefinition',
user: 'accountUser',
};
Expand Down
6 changes: 4 additions & 2 deletions lib/metadataTypes/Asset.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ class Asset extends MetadataType {
static async retrieve(retrieveDir, _, subTypeArr, key) {
const items = [];
subTypeArr ||= this._getSubTypes();
await File.initPrettier();
if (retrieveDir) {
await File.initPrettier();
}
// loop through subtypes and return results of each subType for caching (saving is handled per subtype)
for (const subType of subTypeArr) {
// each subtype contains multiple different specific types (images contains jpg and png for example)
Expand Down Expand Up @@ -235,7 +237,7 @@ class Asset extends MetadataType {
rightOperand: {
property: 'id',
simpleOperator: 'greaterThan',
value: items[items.length - 1].id,
value: items.at(-1).id,
},
};
lastPage = 0;
Expand Down
Loading