mcdev 3.0.3 → 3.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.eslintrc.json +1 -1
  2. package/.github/ISSUE_TEMPLATE/bug.yml +75 -0
  3. package/.github/ISSUE_TEMPLATE/task.md +1 -1
  4. package/.issuetracker +11 -3
  5. package/.vscode/settings.json +3 -3
  6. package/CHANGELOG.md +66 -0
  7. package/README.md +245 -141
  8. package/boilerplate/config.json +3 -2
  9. package/docs/dist/documentation.md +799 -338
  10. package/lib/Deployer.js +4 -1
  11. package/lib/MetadataTypeDefinitions.js +1 -0
  12. package/lib/MetadataTypeInfo.js +1 -0
  13. package/lib/Retriever.js +30 -14
  14. package/lib/cli.js +298 -0
  15. package/lib/index.js +773 -1019
  16. package/lib/metadataTypes/AccountUser.js +389 -0
  17. package/lib/metadataTypes/Asset.js +8 -7
  18. package/lib/metadataTypes/Automation.js +121 -56
  19. package/lib/metadataTypes/DataExtension.js +133 -97
  20. package/lib/metadataTypes/DataExtensionField.js +134 -4
  21. package/lib/metadataTypes/DataExtract.js +9 -5
  22. package/lib/metadataTypes/EventDefinition.js +9 -5
  23. package/lib/metadataTypes/FileTransfer.js +9 -5
  24. package/lib/metadataTypes/ImportFile.js +13 -12
  25. package/lib/metadataTypes/MetadataType.js +41 -33
  26. package/lib/metadataTypes/Query.js +2 -3
  27. package/lib/metadataTypes/Role.js +13 -8
  28. package/lib/metadataTypes/Script.js +2 -2
  29. package/lib/metadataTypes/definitions/AccountUser.definition.js +227 -0
  30. package/lib/metadataTypes/definitions/Asset.definition.js +1 -0
  31. package/lib/metadataTypes/definitions/DataExtension.definition.js +1 -1
  32. package/lib/metadataTypes/definitions/ImportFile.definition.js +2 -1
  33. package/lib/metadataTypes/definitions/Script.definition.js +5 -5
  34. package/lib/retrieveChangelog.js +96 -0
  35. package/lib/util/cli.js +4 -6
  36. package/lib/util/init.git.js +2 -1
  37. package/lib/util/util.js +17 -0
  38. package/package.json +18 -22
  39. package/.github/ISSUE_TEMPLATE/bug_report.md +0 -30
  40. package/img/README.md/troubleshoot-nodejs-postinstall.jpg +0 -0
  41. package/postinstall.js +0 -41
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- <a id="markdown-accenture-sfmc-devtools" name="accenture-sfmc-devtools"></a>
2
-
3
1
  # Accenture SFMC DevTools
4
2
 
3
+ <a id="markdown-accenture-sfmc-devtools" name="accenture-sfmc-devtools"></a>
4
+
5
5
  [![NPM](https://nodei.co/npm/mcdev.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/mcdev)
6
6
 
7
7
  Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/rollout, backup and development tool for Salesforce Marketing Cloud. It allows you to retrieve and deploy configuration and code across Business Units and instances.
@@ -17,6 +17,7 @@ Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/roll
17
17
  - [2.3. Initial project setup](#23-initial-project-setup)
18
18
  - [2.4. Joining a project that was set up before](#24-joining-a-project-that-was-set-up-before)
19
19
  - [2.5. Recommended additional installs](#25-recommended-additional-installs)
20
+ - [2.6 Using mcdev in other node packages](#26-using-mcdev-in-other-node-packages)
20
21
  - [3. Updating Accenture SFMC DevTools](#3-updating-accenture-sfmc-devtools)
21
22
  - [4. Troubleshoot Install/Update](#4-troubleshoot-installupdate)
22
23
  - [4.1. Installing specific version](#41-installing-specific-version)
@@ -44,14 +45,16 @@ Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/roll
44
45
  - [6.2.7. createDeltaPkg](#627-createdeltapkg)
45
46
  - [7. Advanced Configuration](#7-advanced-configuration)
46
47
  - [7.1. Config Options](#71-config-options)
47
- - [7.2. Metadata specific settings](#72-metadata-specific-settings)
48
+ - [7.2. Metadata specific settings & options](#72-metadata-specific-settings--options)
48
49
  - [7.2.1. Retention Policy fields in Data Extensions](#721-retention-policy-fields-in-data-extensions)
50
+ - [7.2.2. Adding/Updating Fields on existing Data Extensions](#722-addingupdating-fields-on-existing-data-extensions)
51
+ - [7.2.3. Renaming fields of a Data Extensions](#723-renaming-fields-of-a-data-extensions)
52
+ - [7.3. Market Configuration](#73-market-configuration)
53
+ - [7.4. Market List Configuration](#74-market-list-configuration)
49
54
  - [8. Examples](#8-examples)
50
55
  - [8.1. Retrieve and deploy Data Extension](#81-retrieve-and-deploy-data-extension)
51
56
  - [8.2. Metadata Retrieving/Backup](#82-metadata-retrievingbackup)
52
57
  - [8.3. Automation Deployment](#83-automation-deployment)
53
- - [8.4. Market Configuration](#84-market-configuration)
54
- - [8.5. Market List Configuration](#85-market-list-configuration)
55
58
  - [9. Contribute](#9-contribute)
56
59
  - [9.1. Install Guide for Developers](#91-install-guide-for-developers)
57
60
  - [9.2. Local install](#92-local-install)
@@ -60,28 +63,28 @@ Accenture Salesforce Marketing Cloud DevTools (mcdev) is a rapid deployment/roll
60
63
 
61
64
  <!-- /TOC -->
62
65
 
63
- <a id="markdown-1-changelog" name="1-changelog"></a>
64
-
65
66
  ## 1. Changelog
66
67
 
67
- Find info on the latest changes in our [Changelog](CHANGELOG.md).
68
+ <a id="markdown-changelog" name="changelog"></a>
68
69
 
69
- <a id="markdown-2-getting-started" name="2-getting-started"></a>
70
+ Find info on the latest changes in our [Changelog](CHANGELOG.md).
70
71
 
71
72
  ## 2. Getting Started
72
73
 
74
+ <a id="markdown-getting-started" name="getting-started"></a>
75
+
73
76
  Accenture SFMC DevTools can be installed as Node.JS package. The following guide will demonstrate how you can get started within 10 minutes or less.
74
77
 
75
78
  <a name="pre-requisites"></a>
76
79
 
77
- <a id="markdown-21-pre-requisites" name="21-pre-requisites"></a>
78
-
79
80
  ### 2.1. Pre-requisites
80
81
 
81
- <a id="markdown-211-install-nodejs-with-npm" name="211-install-nodejs-with-npm"></a>
82
+ <a id="markdown-pre-requisites" name="pre-requisites"></a>
82
83
 
83
84
  #### 2.1.1. Install Node.js with npm
84
85
 
86
+ <a id="markdown-install-node.js-with-npm" name="install-node.js-with-npm"></a>
87
+
85
88
  1. To check if it is already installed, at the OS command prompt, type: `node --version`
86
89
  - If this command reports Node version 14.16.x or later, you’re done—proceed to the next installation. If the reported version is earlier than 14.16.x, continue to step 2.
87
90
  - If you get a “command not found” error message, continue to step 2.
@@ -89,10 +92,10 @@ Accenture SFMC DevTools can be installed as Node.JS package. The following guide
89
92
  3. Download and run the latest **LTS** installer for your operating system.
90
93
  4. When the installer finishes, try step 1 again. If it fails, please restart your terminal. If it still does not work, reboot your computer and try the version check then.
91
94
 
92
- <a id="markdown-212-install-the-git-command-line" name="212-install-the-git-command-line"></a>
93
-
94
95
  #### 2.1.2. Install the Git Command Line
95
96
 
97
+ <a id="markdown-install-the-git-command-line" name="install-the-git-command-line"></a>
98
+
96
99
  1. To check if git is already installed, at the OS command prompt, type: `git version`
97
100
  - If this command reports a git version such as “git version 2.31.0” (or "git version 2.31.0.windows.1" on Windows), you’re done. Proceed to native Android or iOS environment setup.
98
101
  - If you get a “command not found” error message, continue to step 2.
@@ -103,10 +106,10 @@ Accenture SFMC DevTools can be installed as Node.JS package. The following guide
103
106
 
104
107
  <a name="install-mcdev"></a>
105
108
 
106
- <a id="markdown-22-install-accenture-sfmc-devtools" name="22-install-accenture-sfmc-devtools"></a>
107
-
108
109
  ### 2.2. Install Accenture SFMC DevTools
109
110
 
111
+ <a id="markdown-install-accenture-sfmc-devtools" name="install-accenture-sfmc-devtools"></a>
112
+
110
113
  If you experience issues installing Accenture SFMC DevTools, please check out the [Troubleshoot Install/Update](#troubleshoot-installupdate) section in this manual.
111
114
 
112
115
  **How to:**
@@ -122,12 +125,10 @@ When completed you will see `+ mcdev@3.0.0` printed to your screen (or the curre
122
125
  >
123
126
  > You may choose to install mcdev globally or locally. Global install runs faster and allows you to initialize new projects by running `mcdev init` in any directory. If your project does require a local installation, please refer to the [Local Install Guide](#local-install).
124
127
 
125
- <a name="initial-project-setup"></a>
126
-
127
- <a id="markdown-23-initial-project-setup" name="23-initial-project-setup"></a>
128
-
129
128
  ### 2.3. Initial project setup
130
129
 
130
+ <a id="markdown-initial-project-setup" name="initial-project-setup"></a>
131
+
131
132
  After the successful installation, you will now need to setup the connection to your Marketing Cloud instance.
132
133
 
133
134
  1. In your Marketing Cloud instance
@@ -152,16 +153,16 @@ After the successful installation, you will now need to setup the connection to
152
153
  3. If this is the first time you set up Accenture SFMC DevTools or you recently upgraded Accenture SFMC DevTools, please restart VS Code now! A pop-up will likely appear in the lower right corner prompting you to install recommended extensions.
153
154
  4. Done.
154
155
  3. Sharing the project with your team
155
- 1. Make sure you have a Git repo (Bitbucket, GitHub, GitLab) set up somewhere. Usually your client will have to do this for you. Sometimes, we host client repos in our own Innersource, which is instance of Bitbucket.
156
+ 1. Make sure you have a Git repo (Bitbucket, GitHub, GitLab) set up somewhere. If you are an SI partner, usually, your client will have to do this for you.
156
157
  > While running `mcdev init`, the tool already made sure to set up a local Git repo for you. Now, you need to upload ("push") it to the online repo:
157
158
  2. Open the URL of your online repo and find the "CLONE" button. This will likely show you a normal URL, ending on ".git"
158
159
  3. Add this as your repository remote named "origin". If you use a GUI based tool, that should be fairly simple, otherwise execute `git remote add origin YOUR-URL` in your project folder.
159
160
  4. Now run `git push -u origin master` to actually start the upload.
160
161
 
161
- <a id="markdown-24-joining-a-project-that-was-set-up-before" name="24-joining-a-project-that-was-set-up-before"></a>
162
-
163
162
  ### 2.4. Joining a project that was set up before
164
163
 
164
+ <a id="markdown-joining-a-project-that-was-set-up-before" name="joining-a-project-that-was-set-up-before"></a>
165
+
165
166
  If Accenture SFMC DevTools was already used to set up the project by somebody in your team, including all of the steps in the above chapter [Initial project configuration](#initial-project-setup), then basically you are in luck. Things are much faster from here on:
166
167
 
167
168
  1. Make sure you went through the chapters [Pre-requisites](#pre-requisites) and [Install Accenture SFMC DevTools](#install-mcdev). Do skip [Initial project configuration](#initial-project-setup)!
@@ -174,10 +175,10 @@ If Accenture SFMC DevTools was already used to set up the project by somebody in
174
175
  7. At this point the system will recognize the previously set up project and ask you for `Client ID`, `Client Secret` and the `Authentication Base URI`.
175
176
  8. Done.
176
177
 
177
- <a id="markdown-25-recommended-additional-installs" name="25-recommended-additional-installs"></a>
178
-
179
178
  ### 2.5. Recommended additional installs
180
179
 
180
+ <a id="markdown-recommended-additional-installs" name="recommended-additional-installs"></a>
181
+
181
182
  The following seeks to enhance your daily process. Our guide assumes that you are using [Visual Studio Code](https://code.visualstudio.com/download) to develop, backup and deploy your project. For smooth operations we highly recommend the following Marketing Cloud specific plugins for it.
182
183
 
183
184
  Nevertheless, Accenture SFMC DevTools will run without them and is not associated with the development of these publicly available apps & plugins.
@@ -213,12 +214,34 @@ Please note that Visual Studio Code might warn you about using the local install
213
214
 
214
215
  ![VSCode Eslint install warning](img/README.md/vscode-eslint-allow_everywhere.jpg)
215
216
 
216
- <a name="updating-mcdev"></a>
217
+ ### 2.6 Using mcdev in other node packages
217
218
 
218
- <a id="markdown-3-updating-accenture-sfmc-devtools" name="3-updating-accenture-sfmc-devtools"></a>
219
+ Install it locally first via the following (or with a [specific version](#41-installing-specific-version)):
220
+
221
+ ```bash
222
+ npm install --save mcdev
223
+ ```
224
+
225
+ And then require it in your code:
226
+
227
+ ```javascript
228
+ const mcdev = require('mcdev');
229
+
230
+ // download all metadata from your instance's Parent BU
231
+ mcdev.retrieve('MyCredential/_ParentBU_');
232
+
233
+ // or download all metadata from your instance's Parent BU
234
+ mcdev.retrieve('MyCredential/_ParentBU_', 'dataExtension');
235
+ ```
236
+
237
+ For more details on the available methods look out for what Intellisense will return or refer to the [developer documentation](docs/dist/documentation.md).
238
+
239
+ <a name="updating-mcdev"></a>
219
240
 
220
241
  ## 3. Updating Accenture SFMC DevTools
221
242
 
243
+ <a id="markdown-updating-accenture-sfmc-devtools" name="updating-accenture-sfmc-devtools"></a>
244
+
222
245
  If you have mcdev already installed you can update your installation in a simplified way:
223
246
 
224
247
  ```bash
@@ -227,44 +250,46 @@ npm update -g mcdev
227
250
 
228
251
  <a name="troubleshoot-installupdate"></a>
229
252
 
230
- <a id="markdown-4-troubleshoot-installupdate" name="4-troubleshoot-installupdate"></a>
231
-
232
253
  ## 4. Troubleshoot Install/Update
233
254
 
234
- <a id="markdown-41-installing-specific-version" name="41-installing-specific-version"></a>
255
+ <a id="markdown-troubleshoot-install%2Fupdate" name="troubleshoot-install%2Fupdate"></a>
235
256
 
236
257
  ### 4.1. Installing specific version
237
258
 
259
+ <a id="installing-specific-version" name="installing-specific-version"></a>
260
+
238
261
  To work with our **developer-version** or to install a **specific older version** you can select any branch or tag from our git repository during install to do so:
239
262
 
240
- ```bash
241
- // most recent developer version (using the branch name)
242
- npm install -g mcdev@develop
263
+ **Most recent developer version (using the GitHub repo & branch name):**
243
264
 
244
- // install specific version (using a tag)
245
- npm install -g mcdev@3.0.0
265
+ ```bash
266
+ npm install -g accenture/sfmc-devtools#develop
246
267
  ```
247
268
 
248
- **Warning**: When you used the above method to install Accenture SFMC DevTools for a specific version or tag, trying to [update Accenture SFMC DevTools](#updating-mcdev) might not download the most recently published official version but instead stay on the version or branch you previously selected (in the above examples: develop, 3.0.0)!
269
+ **Install specific version (using a version tag on npm):**
249
270
 
250
- If you opted for `@develop` you will continue to get the latest developer udates. If, however, you opted for a version, you will have to use the install command again to overwrite whatever version you used before.
271
+ ```bash
272
+ npm install -g mcdev@3.1.0
273
+ ```
251
274
 
252
- > **Note**: The version is currently _not_ updated on the developer branch until a new release is published. Hence, you will not see a change if you run `mcdev --version`.
275
+ **Warning**: When you used the above method to install Accenture SFMC DevTools for a specific version or tag, trying to [update Accenture SFMC DevTools](#updating-mcdev) might not download the most recently published official version but instead stay on the version or branch you previously selected (in the above examples: develop, 3.1.0)!
253
276
 
254
- <a id="markdown-42-using-custom-clis" name="42-using-custom-clis"></a>
277
+ > **Note**: The version is currently _not_ updated on the developer branch until a new release is published. Hence, you will not see a change if you run `mcdev --version`.
255
278
 
256
279
  ### 4.2. Using custom CLIs
257
280
 
281
+ <a id="markdown-using-custom-clis" name="using-custom-clis"></a>
282
+
258
283
  Some users of Accenture SFMC DevTools prefer to use git bash or other CLIs instead of the operating system's default. Please note that some of the functionality of Accenture SFMC DevTools but also of other tools like the Node package manager (npm) do not necessarily function properly in these.
259
284
 
260
285
  If you encounter problems, we strongly recommend to first try it in the default CLI.
261
286
 
262
287
  <a name="missing-write-access-toon-macos"></a>
263
288
 
264
- <a id="markdown-43-missing-write-access-toon-macos" name="43-missing-write-access-toon-macos"></a>
265
-
266
289
  ### 4.3. Missing write access to...on MacOS
267
290
 
291
+ <a id="markdown-missing-write-access-to...on-macos" name="missing-write-access-to...on-macos"></a>
292
+
268
293
  Depending on your setup, the default global installs & updates might error out with "Missing write access to /usr/local/lib/node_modules". In this case prefix your command with `sudo`:
269
294
 
270
295
  ```bash
@@ -277,10 +302,10 @@ sudo npm update -g mcdev
277
302
 
278
303
  ![Mac sudo](img/README.md/troubleshoot-mac-sudo.png)
279
304
 
280
- <a id="markdown-44-running-scripts-is-disabled-on-this-system" name="44-running-scripts-is-disabled-on-this-system"></a>
281
-
282
305
  ### 4.4. ...running scripts is disabled on this system
283
306
 
307
+ <a id="markdown-...running-scripts-is-disabled-on-this-system" name="...running-scripts-is-disabled-on-this-system"></a>
308
+
284
309
  If you see the below error then your system's security settings are rather strict.
285
310
 
286
311
  ![Execution Policy](img/README.md/troubleshoot-execution_policy.jpg)
@@ -295,21 +320,17 @@ Steps to solve this:
295
320
 
296
321
  Please note that this change is global and not just for your current folder.
297
322
 
298
- <a id="markdown-45-operation-not-permitted-or-no-such-file-or-directory" name="45-operation-not-permitted-or-no-such-file-or-directory"></a>
299
-
300
323
  ### 4.5. Operation not permitted OR No such file or directory
301
324
 
325
+ <a id="markdown-operation-not-permitted-or-no-such-file-or-directory" name="operation-not-permitted-or-no-such-file-or-directory"></a>
326
+
302
327
  If you encounter out of the 3 following errors you will have to completely remove Node.JS and install it again afterwards.
303
328
 
304
329
  **Error 1:** Cannot find module index.js
305
330
 
306
331
  ![index.js not found](img/README.md/troubleshoot-nodejs-index.jpg)
307
332
 
308
- **Error 2:** Cannot find module postinstall.js
309
-
310
- ![postinstall.js not found](img/README.md/troubleshoot-nodejs-postinstall.jpg)
311
-
312
- **Error 3:** Operation not permitted
333
+ **Error 2:** Operation not permitted
313
334
 
314
335
  ![operation not permitted](img/README.md/troubleshoot-nodejs-permission.jpg)
315
336
 
@@ -345,10 +366,10 @@ Now, please follow the guides above in the [Pre-requisites](#pre-requisites) sec
345
366
 
346
367
  <a name="metadata-type-support"></a>
347
368
 
348
- <a id="markdown-5-metadata-type-support" name="5-metadata-type-support"></a>
349
-
350
369
  ## 5. Metadata Type Support
351
370
 
371
+ <a id="markdown-metadata-type-support" name="metadata-type-support"></a>
372
+
352
373
  The following metadata types are currently supported:
353
374
 
354
375
  | MetadataType | CLI Argument | Retrieve | Deploy | Template | Retrieved by Default | Description |
@@ -378,11 +399,12 @@ The following metadata types are currently supported:
378
399
  | List | `list` | Yes | in backlog | - | Yes | Old way of storing data. Still used for central Email Subscriber DB. |
379
400
  | Role | `role` | Yes | Yes | - | Yes | User Roles define groups that are used to grant users access to SFMC systems. |
380
401
  | Triggered Send | `triggeredSendDefinition` | Yes | Yes | - | Yes | **DEPRECATED**: Sends emails via API or DataExtension Event. |
381
-
382
- <a id="markdown-6-command-overview" name="6-command-overview"></a>
402
+ | User | `accountUser` | Yes | in backlog | - | - | Users and Installed Packages including their assigned Roles, BUs and personal permissions |
383
403
 
384
404
  ## 6. Command Overview
385
405
 
406
+ <a id="markdown-command-overview" name="command-overview"></a>
407
+
386
408
  If you installed mcdev globally as described above you can run mcdev in any directory. See our [install Accenture SFMC DevTools](#install-mcdev) chapter for more details.
387
409
 
388
410
  _Example (global install):_
@@ -405,16 +427,14 @@ _Note:_ Parameters listed below in between square brackets = `[...]` are optiona
405
427
 
406
428
  _Note:_ Credentials and Business Unit names can always be selected interactively. Try inputing a questionmark = `?` in their place if more parameters follow, or omit them completely if no other parameters are required for a command.
407
429
 
408
- <a id="markdown-61-maintenance-and-setup-commands" name="61-maintenance-and-setup-commands"></a>
409
-
410
430
  ### 6.1. Maintenance and setup commands
411
431
 
412
- <a name="init"></a>
413
-
414
- <a id="markdown-611-init" name="611-init"></a>
432
+ <a id="markdown-maintenance-and-setup-commands" name="maintenance-and-setup-commands"></a>
415
433
 
416
434
  #### 6.1.1. init
417
435
 
436
+ <a id="markdown-init" name="init"></a>
437
+
418
438
  _Command:_ `mcdev init`
419
439
 
420
440
  _Alias:_ -
@@ -451,10 +471,10 @@ Example url: `https://mcg123abcysykllg-0321cbs8bbt64.auth.marketingcloudapis.com
451
471
  >
452
472
  > To get the tenant subdomain, please take the Authentication Base Uri and extract the part after `https://` and before `.auth.marketingcloudapis.com`. In the above example this would therefore be `mcg123abcysykllg-0321cbs8bbt64`.
453
473
 
454
- <a id="markdown-612-upgrade" name="612-upgrade"></a>
455
-
456
474
  #### 6.1.2. upgrade
457
475
 
476
+ <a id="markdown-upgrade" name="upgrade"></a>
477
+
458
478
  _Command:_ `mcdev upgrade`
459
479
 
460
480
  _Alias:_ `mcdev up`
@@ -467,10 +487,10 @@ _Example:_
467
487
  mcdev upgrade
468
488
  ```
469
489
 
470
- <a id="markdown-613-reloadbus" name="613-reloadbus"></a>
471
-
472
490
  #### 6.1.3. reloadBUs
473
491
 
492
+ <a id="markdown-reloadbus" name="reloadbus"></a>
493
+
474
494
  _Command:_ `mcdev reloadBUs [credential]`
475
495
 
476
496
  _Alias:_ `mcdev rb`
@@ -483,10 +503,10 @@ _Example:_
483
503
  mcdev reloadBUs MyProject
484
504
  ```
485
505
 
486
- <a id="markdown-614-badkeys" name="614-badkeys"></a>
487
-
488
506
  #### 6.1.4. badKeys
489
507
 
508
+ <a id="markdown-badkeys" name="badkeys"></a>
509
+
490
510
  _Command:_ `mcdev badKeys [business unit]`
491
511
 
492
512
  _Alias:_ -
@@ -499,10 +519,10 @@ _Example:_
499
519
  mcdev badKeys MyProject/DEV
500
520
  ```
501
521
 
502
- <a id="markdown-615-document" name="615-document"></a>
503
-
504
522
  #### 6.1.5. document
505
523
 
524
+ <a id="markdown-document" name="document"></a>
525
+
506
526
  _Command:_ `mcdev document <TYPE> <business unit>`
507
527
 
508
528
  _Alias:_ `mcdev doc`
@@ -517,6 +537,7 @@ Currently supported types:
517
537
  | -------------- | --------------- |
518
538
  | Data Extension | `dataExtension` |
519
539
  | Role | `role` |
540
+ | User | `accountUser` |
520
541
 
521
542
  _Example:_
522
543
 
@@ -524,10 +545,10 @@ _Example:_
524
545
  mcdev document role myServer
525
546
  ```
526
547
 
527
- <a id="markdown-616-selecttypes" name="616-selecttypes"></a>
528
-
529
548
  #### 6.1.6. selectTypes
530
549
 
550
+ <a id="markdown-selecttypes" name="selecttypes"></a>
551
+
531
552
  _Command:_ `mcdev selectTypes`
532
553
 
533
554
  _Alias:_ `mcdev st`
@@ -542,10 +563,10 @@ mcdev selectTypes
542
563
 
543
564
  _Note:_ You may select non-standard types if you run `mcdev selectTypes --debug`. This may be needed in edge cases but is not recommended in most situations.
544
565
 
545
- <a id="markdown-617-explaintypes" name="617-explaintypes"></a>
546
-
547
566
  #### 6.1.7. explainTypes
548
567
 
568
+ <a id="markdown-explaintypes" name="explaintypes"></a>
569
+
549
570
  _Command:_ `mcdev explainTypes`
550
571
 
551
572
  _Alias:_ `mcdev et`
@@ -560,14 +581,14 @@ _Example:_
560
581
  mcdev explainTypes
561
582
  ```
562
583
 
563
- <a id="markdown-62-operational-commands" name="62-operational-commands"></a>
564
-
565
584
  ### 6.2. Operational commands
566
585
 
567
- <a id="markdown-621-retrieve" name="621-retrieve"></a>
586
+ <a id="markdown-operational-commands" name="operational-commands"></a>
568
587
 
569
588
  #### 6.2.1. retrieve
570
589
 
590
+ <a id="markdown-retrieve" name="retrieve"></a>
591
+
571
592
  _Command:_ `mcdev retrieve [business unit] [metadata type]`
572
593
 
573
594
  _Alias:_ `mcdev r`
@@ -622,10 +643,10 @@ mcdev retrieve "*"
622
643
 
623
644
  > Note: retrieve-all will fail in some CLIs if you do not wrap the asterix (\*) in quotes. This is due to the special meaning of \* as a parameter in these CLIs.
624
645
 
625
- <a id="markdown-622-deploy" name="622-deploy"></a>
626
-
627
646
  #### 6.2.2. deploy
628
647
 
648
+ <a id="markdown-deploy" name="deploy"></a>
649
+
629
650
  _Command:_ `mcdev deploy [business unit] [metadata type]`
630
651
 
631
652
  _Alias:_ `mcdev d`
@@ -668,10 +689,10 @@ mcdev deploy "*"
668
689
 
669
690
  > Note: deploy-all will fail in some CLIs if you do not wrap the asterix (\*) in quotes. This is due to the special meaning of \* as a parameter in these CLIs.
670
691
 
671
- <a id="markdown-623-delete" name="623-delete"></a>
672
-
673
692
  #### 6.2.3. delete
674
693
 
694
+ <a id="markdown-delete" name="delete"></a>
695
+
675
696
  _Command:_ `mcdev delete <business unit> <type> <external key>`
676
697
 
677
698
  _Alias:_ `mcdev del`
@@ -690,10 +711,10 @@ _Example:_
690
711
  mcdev delete MyProject/_ParentBU_ dataExtension MyUserTable
691
712
  ```
692
713
 
693
- <a id="markdown-624-retrieveastemplate" name="624-retrieveastemplate"></a>
694
-
695
714
  #### 6.2.4. retrieveAsTemplate
696
715
 
716
+ <a id="markdown-retrieveastemplate" name="retrieveastemplate"></a>
717
+
697
718
  _Command:_ `mcdev retrieveAsTemplate <business unit> <type> <name> <market>`
698
719
 
699
720
  _Alias:_ `mcdev rt`
@@ -728,10 +749,10 @@ This will result in the following files being created in your `template/` direct
728
749
  - `table2.dataExtension-meta.json`
729
750
  - `table3.dataExtension-meta.json`
730
751
 
731
- <a id="markdown-625-builddefinition" name="625-builddefinition"></a>
732
-
733
752
  #### 6.2.5. buildDefinition
734
753
 
754
+ <a id="markdown-builddefinition" name="builddefinition"></a>
755
+
735
756
  _Command:_ `mcdev buildDefinition <business unit> <type> <name> <market>`
736
757
 
737
758
  _Alias:_ `mcdev bd`
@@ -769,10 +790,10 @@ This will result in the following files being created in your `retrieve/MyProjec
769
790
  - `table2.dataExtension-meta.json`
770
791
  - `table3.dataExtension-meta.json`
771
792
 
772
- <a id="markdown-626-builddefinitionbulk" name="626-builddefinitionbulk"></a>
773
-
774
793
  #### 6.2.6. buildDefinitionBulk
775
794
 
795
+ <a id="markdown-builddefinitionbulk" name="builddefinitionbulk"></a>
796
+
776
797
  _Command:_ `mcdev buildDefinitionBulk <list name> <type> <name>`
777
798
 
778
799
  _Alias:_ `mcdev bdb`
@@ -789,10 +810,10 @@ _Example:_
789
810
  mcdev bdb pilotMarketsQA dataExtension MyUserTable
790
811
  ```
791
812
 
792
- <a id="markdown-627-createdeltapkg" name="627-createdeltapkg"></a>
793
-
794
813
  #### 6.2.7. createDeltaPkg
795
814
 
815
+ <a id="markdown-createdeltapkg" name="createdeltapkg"></a>
816
+
796
817
  _Command:_ `mcdev createDeltaPkg [range] [filter]`
797
818
 
798
819
  _Alias:_ `mcdev cdp`
@@ -920,10 +941,10 @@ mcdev createDeltaPkg d21b4221..HEAD 'MyProject/BU1,MyProject/BU3'
920
941
  > mcdev createDeltaPkg <range> [filter] --y
921
942
  > ```
922
943
 
923
- <a id="markdown-7-advanced-configuration" name="7-advanced-configuration"></a>
924
-
925
944
  ## 7. Advanced Configuration
926
945
 
946
+ <a id="markdown-advanced-configuration" name="advanced-configuration"></a>
947
+
927
948
  The tools confiuration can be changed in the file `.mcdevrc.json` located in the root of your project folder.
928
949
 
929
950
  It contains [Market Configuration](#market-configuration) (`markets: { ... }`), [Market List Configuration](#market-list-configuration) (`marketList: { ... }`) the list of usable Business Units per credentials, `directories`, as well as other `options`.
@@ -932,10 +953,10 @@ You will also find the configuration for what metadata shall be retrieved here i
932
953
 
933
954
  You will also find a secondary file named `.mcdev-auth.json` containing your credentials. **Do not commit this to your repository!** You should only commit `.mcdevrc.json` as this file contains project wide settings that do not compromise security.
934
955
 
935
- <a id="markdown-71-config-options" name="71-config-options"></a>
936
-
937
956
  ### 7.1. Config Options
938
957
 
958
+ <a id="markdown-config-options" name="config-options"></a>
959
+
939
960
  The central config in `.mcdevrc.json` holds multiple adjustable settings:
940
961
 
941
962
  ```json
@@ -998,23 +1019,24 @@ The central config in `.mcdevrc.json` holds multiple adjustable settings:
998
1019
  | directories.deploy | 'deploy/' | Where `deploy` searches for files to deploy |
999
1020
  | directories.retrieve | 'retrieve/' | Where `retrieve` stores downloaded files |
1000
1021
  | directories.roles | 'docs/roles/' | Directory for `document role` output |
1022
+ | directories.users | 'docs/users/' | Directory for `document accountUser` output |
1001
1023
  | directories.template | 'template/' | Where `rt` stores downloaded templates & `bd` retrieves them from |
1002
1024
  | directories.templateBuilds | ['retrieve/','deploy/'] | Where `bd` saves final deployment versions in. This can hold multiple directories, e.g. ['retrieve/','deploy/'] |
1003
1025
  | metaDataTypes.documentOnRetrieve | ['role','dataExtension'] | automatically executes `document` for selected types |
1004
1026
  | metaDataTypes.retrieve | _changes with each release_ | check [Metadata Type Support](#metadata-type-support) for current list |
1005
1027
 
1006
- <a id="markdown-72-metadata-specific-settings" name="72-metadata-specific-settings"></a>
1028
+ ### 7.2. Metadata specific settings & options
1007
1029
 
1008
- ### 7.2. Metadata specific settings
1009
-
1010
- <a id="markdown-721-retention-policy-fields-in-data-extensions" name="721-retention-policy-fields-in-data-extensions"></a>
1030
+ <a id="markdown-metadata-specific-settings" name="metadata-specific-settings"></a>
1011
1031
 
1012
1032
  #### 7.2.1. Retention Policy fields in Data Extensions
1013
1033
 
1034
+ <a id="markdown-retention-policy-fields-in-data-extensions" name="retention-policy-fields-in-data-extensions"></a>
1035
+
1014
1036
  The way retention policy is saved is a bit misleading and hence we wanted to provide a bit of guidance if you ever need to do a deep dive here.
1015
1037
 
1016
- | Field | Description | Values |
1017
- | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | ------------ |
1038
+ | Field | Description | Values |
1039
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
1018
1040
  | **DataRetentionPeriod** | this field should print the value of the unit of measure but it unfortunately is off by one (e.g. showing "weeks" instead of "months"). Also, it seems to have no impact on what's stored.<br> We therefore excluded it from retrieve/deploy | - |
1019
1041
  | **DataRetentionPeriodUnitOfMeasure** | represents drop down for "period after" selection | 6: years<br>5: months<br>4: weeks<br>2: days |
1020
1042
  | **DataRetentionPeriodLength** | represents number field for "period after" selection | min: 1<br>max: 999 |
@@ -1029,51 +1051,93 @@ To enable "delete All records and data extensions" you have to set RowBasedReten
1029
1051
 
1030
1052
  It seems the 2 other modes were added on top later and hence "all records and data extension" is the default retention mode.
1031
1053
 
1032
- <a id="markdown-8-examples" name="8-examples"></a>
1033
-
1034
- ## 8. Examples
1035
-
1036
- <a id="markdown-81-retrieve-and-deploy-data-extension" name="81-retrieve-and-deploy-data-extension"></a>
1037
-
1038
- ### 8.1. Retrieve and deploy Data Extension
1039
-
1040
- 1. Retrieve metadata by running `mcdev retrieve <BU>` (where the BU corresponds to a credential-Business Unit combo in the **.mcdevrc.json**)
1041
- 2. Create a directory called `deploy/` in the root directory
1042
- 3. Create a directory called `dataExtension/` in the `deploy/` directory
1043
- 4. Copy a single dataExtension directory from the `retrieve/<credential>/<BU-Name>/dataExtension/` directory into `deploy/<credential>/<BU-Name>/dataExtension/`
1044
- 5. Run `mcdev deploy <BU>` to deploy everything in the **deploy** folder to the specified Business Unit
1045
-
1046
- <a id="markdown-82-metadata-retrievingbackup" name="82-metadata-retrievingbackup"></a>
1047
-
1048
- ### 8.2. Metadata Retrieving/Backup
1049
-
1050
- Metadata of a Business Unit can be retrieved by running the following command:
1051
-
1052
- `mcdev retrieve <BU>`
1053
-
1054
- where `<BU>` needs to be replaced with `credentialName/businessUnit-Name` that is defined in **.mcdevrc.json**.
1054
+ #### 7.2.2. Adding/Updating Fields on existing Data Extensions
1055
1055
 
1056
- Run this command for each of your defined Business Units and this will result in a **retrieve** directory with a sub-directory for each Business Unit. Each sub-directory contains the metadata from this Business Unit that is currently supported to **retrieve**.
1056
+ <a id="markdown-8-examples" name="8-examples"></a>
1057
1057
 
1058
- This folder structure can be commited into a git repository and used as backup.
1058
+ There are a few rules to keep in mind when playing with Data Extensions fields:
1059
1059
 
1060
- <a id="markdown-83-automation-deployment" name="83-automation-deployment"></a>
1060
+ - The `FieldType` cannot be changed on existing fields; the API returns in error is the attribute is even provided unchanged during an update
1061
+ - `MaxLength` can be increased or kept on the same value but never decreased during an update
1062
+ - A Non-Required/Nullable field cannot be set to be required during an UPDATE
1063
+ - When new fields are added, they can be required, but then also have to have a `DefaultValue` set
1064
+ - The value for `IsRequired` should be 'true' or 'false'
1065
+ - The value for `IsPrimary` should be 'true' or 'false'
1061
1066
 
1062
- ### 8.3. Automation Deployment
1067
+ #### 7.2.3. Renaming fields of a Data Extensions
1063
1068
 
1064
- Now we want to deploy an Automation with it's related metadata. Select a retrieved Automation and copy it into the deploy folder. (`deploy/<credential>/<BU-Name>/automation/myAutomation.meta-automation.json`)
1069
+ With a small addition to the Data Extension's JSON it is possible to rename fields via MC DevTools. Imagine the following Data Extension:
1065
1070
 
1066
- Copy all related activity metadata of this automation into the deploy folder. (_Example:_ `deploy/<credential>/<BU-Name>/query/myquery.meta-query.json` and `deploy/<credential>/<BU-Name>/query/myquery.meta-query.sql`)
1071
+ ```json
1072
+ {
1073
+ "CustomerKey": "Account",
1074
+ "Name": "Account",
1075
+ "Description": "",
1076
+ "IsSendable": "false",
1077
+ "IsTestable": "false",
1078
+ "Fields": [
1079
+ {
1080
+ "Name": "BillingCity",
1081
+ "Scale": "0",
1082
+ "DefaultValue": "",
1083
+ "MaxLength": "40",
1084
+ "IsRequired": "false",
1085
+ "IsPrimaryKey": "true",
1086
+ "FieldType": "Text"
1087
+ },
1088
+ {
1089
+ "Name": "BillingCountry",
1090
+ "Scale": "0",
1091
+ "DefaultValue": "",
1092
+ "MaxLength": "80",
1093
+ "IsRequired": "false",
1094
+ "IsPrimaryKey": "false",
1095
+ "FieldType": "Text"
1096
+ }
1097
+ ],
1098
+ "r__folder_Path": "Data Extensions"
1099
+ }
1100
+ ```
1067
1101
 
1068
- To start the deployment run the following command:
1102
+ Imagine you wanted to rename `BillingCountry` to `BillingZip` for some reason. Previously, you could either go into the GUI or delete & recreate the field. Now, MC DevTools allows you to specify `Name_new` on the field and the tool will take care of the rest during **deployment**:
1069
1103
 
1070
- `mcdev deploy <BU>`
1104
+ ```json
1105
+ {
1106
+ "CustomerKey": "Account",
1107
+ "Name": "Account",
1108
+ "Description": "",
1109
+ "IsSendable": "false",
1110
+ "IsTestable": "false",
1111
+ "Fields": [
1112
+ {
1113
+ "Name": "BillingCity",
1114
+ "Scale": "0",
1115
+ "DefaultValue": "",
1116
+ "MaxLength": "40",
1117
+ "IsRequired": "false",
1118
+ "IsPrimaryKey": "true",
1119
+ "FieldType": "Text"
1120
+ },
1121
+ {
1122
+ "Name": "BillingCountry" /* old name, keep here for reference during the update! */,
1123
+ "Name_new": "BillingZip" /* new name */,
1124
+ "Scale": "0",
1125
+ "DefaultValue": "",
1126
+ "MaxLength": "80",
1127
+ "IsRequired": "false",
1128
+ "IsPrimaryKey": "false",
1129
+ "FieldType": "Text"
1130
+ }
1131
+ ],
1132
+ "r__folder_Path": "Data Extensions"
1133
+ }
1134
+ ```
1071
1135
 
1072
- <a name="market-configuration"></a>
1136
+ All you have to do is deploy the data extension again with Name_new specified for each field that needs to be renamed.
1073
1137
 
1074
- <a id="markdown-84-market-configuration" name="84-market-configuration"></a>
1138
+ ### 7.3. Market Configuration
1075
1139
 
1076
- ### 8.4. Market Configuration
1140
+ <a id="markdown-market-configuration" name="market-configuration"></a>
1077
1141
 
1078
1142
  You will want to setup configs for variable parts that change inbetween Business Units. We advise starting this _after_ you've first run the `retrieveAsTemplate` command. This might sound counterintuitive but when you review what was copied into your template folder you will likely spot these variable parts the fastest and can then start setting up your market config. Please consider this an iterative process as you will likely run `rt` followed by another update of your config multiple times until you got it right.
1079
1143
 
@@ -1195,9 +1259,9 @@ Way more complex example with dedicated "Parent" BUs per enviroment (DEV, QA, PR
1195
1259
 
1196
1260
  <a name="market-list-configuration"></a>
1197
1261
 
1198
- <a id="markdown-85-market-list-configuration" name="85-market-list-configuration"></a>
1262
+ ### 7.4. Market List Configuration
1199
1263
 
1200
- ### 8.5. Market List Configuration
1264
+ <a id="markdown-market-list-configuration" name="market-list-configuration"></a>
1201
1265
 
1202
1266
  Market Lists are very powerful and you will quickly notice how much time they can safe you during your deployment preparation.
1203
1267
  Let's first look at an example list config:
@@ -1278,16 +1342,56 @@ Apart from that we can see 4 types of lists here:
1278
1342
  3. `Parent-medium-multi`/`Parent-large-multi` (medium:_instance parent_; large:_environment parent_): Any scripts, queries, automations that are executed on the parent but require one per child (e.g. query to fill country-specific Shared Data Extensions)
1279
1343
  4. `Children` (_child BUs_): everything that is needed on the market specific Business Units.
1280
1344
 
1281
- <a id="markdown-9-contribute" name="9-contribute"></a>
1345
+ ## 8. Examples
1346
+
1347
+ <a id="markdown-examples" name="examples"></a>
1348
+
1349
+ ### 8.1. Retrieve and deploy Data Extension
1350
+
1351
+ <a id="markdown-retrieve-and-deploy-data-extension" name="retrieve-and-deploy-data-extension"></a>
1352
+
1353
+ 1. Retrieve metadata by running `mcdev retrieve <BU>` (where the BU corresponds to a credential-Business Unit combo in the **.mcdevrc.json**)
1354
+ 2. Create a directory called `deploy/` in the root directory
1355
+ 3. Create a directory called `dataExtension/` in the `deploy/` directory
1356
+ 4. Copy a single dataExtension directory from the `retrieve/<credential>/<BU-Name>/dataExtension/` directory into `deploy/<credential>/<BU-Name>/dataExtension/`
1357
+ 5. Run `mcdev deploy <BU>` to deploy everything in the **deploy** folder to the specified Business Unit
1358
+
1359
+ ### 8.2. Metadata Retrieving/Backup
1360
+
1361
+ <a id="markdown-metadata-retrieving%2Fbackup" name="metadata-retrieving%2Fbackup"></a>
1362
+
1363
+ Metadata of a Business Unit can be retrieved by running the following command:
1364
+
1365
+ `mcdev retrieve <BU>`
1366
+
1367
+ where `<BU>` needs to be replaced with `credentialName/businessUnit-Name` that is defined in **.mcdevrc.json**.
1368
+
1369
+ Run this command for each of your defined Business Units and this will result in a **retrieve** directory with a sub-directory for each Business Unit. Each sub-directory contains the metadata from this Business Unit that is currently supported to **retrieve**.
1370
+
1371
+ This folder structure can be commited into a git repository and used as backup.
1372
+
1373
+ ### 8.3. Automation Deployment
1374
+
1375
+ <a id="markdown-automation-deployment" name="automation-deployment"></a>
1376
+
1377
+ Now we want to deploy an Automation with it's related metadata. Select a retrieved Automation and copy it into the deploy folder. (`deploy/<credential>/<BU-Name>/automation/myAutomation.meta-automation.json`)
1378
+
1379
+ Copy all related activity metadata of this automation into the deploy folder. (_Example:_ `deploy/<credential>/<BU-Name>/query/myquery.meta-query.json` and `deploy/<credential>/<BU-Name>/query/myquery.meta-query.sql`)
1380
+
1381
+ To start the deployment run the following command:
1382
+
1383
+ `mcdev deploy <BU>`
1282
1384
 
1283
1385
  ## 9. Contribute
1284
1386
 
1285
- If you want to enhance Accenture SFMC DevTools you are welcome to fork the repo and create a pull request. Please understand that we will have to conduct a code review before accepting your changes.
1387
+ <a id="markdown-contribute" name="contribute"></a>
1286
1388
 
1287
- <a id="markdown-91-install-guide-for-developers" name="91-install-guide-for-developers"></a>
1389
+ If you want to enhance Accenture SFMC DevTools you are welcome to fork the repo and create a pull request. Please understand that we will have to conduct a code review before accepting your changes.
1288
1390
 
1289
1391
  ### 9.1. Install Guide for Developers
1290
1392
 
1393
+ <a id="markdown-install-guide-for-developers" name="install-guide-for-developers"></a>
1394
+
1291
1395
  Instead of installing Accenture SFMC DevTools as a npm dependency from our git repo, we recommend cloning our repo and then linking it locally:
1292
1396
 
1293
1397
  Assuming you cloned Accenture SFMC DevTools into `C:\repos\sfmc-devtools\` (or `~/repos/sfmc-devtools/` on Mac) you can then go into your project directory, open a terminal there and run:
@@ -1320,10 +1424,10 @@ To test your new **global** developer setup, run `mcdev --version` in CLI which
1320
1424
 
1321
1425
  <a name="local-install"></a>
1322
1426
 
1323
- <a id="markdown-92-local-install" name="92-local-install"></a>
1324
-
1325
1427
  ### 9.2. Local install
1326
1428
 
1429
+ <a id="markdown-local-install" name="local-install"></a>
1430
+
1327
1431
  > **Warning:** local installation (leading to the use of [npx](https://github.com/npm/npx#readme)) causes issues when spaces are used in keys/names and is therefore not recommended.
1328
1432
  > You will also make setting up projects much harder if you choose the local installation as you cannot use `mcdev init` to automatically setup your entire project.
1329
1433
 
@@ -1345,10 +1449,10 @@ The following explains how you _could_ install it locally for certain edge cases
1345
1449
 
1346
1450
  When completed you will see `+ mcdev@3.0.0` printed to your screen (or the current version of it respectively).
1347
1451
 
1348
- <a id="markdown-93-npm-scripts" name="93-npm-scripts"></a>
1349
-
1350
1452
  ### 9.3. NPM Scripts
1351
1453
 
1454
+ <a id="markdown-npm-scripts" name="npm-scripts"></a>
1455
+
1352
1456
  - `start`: Main entry point
1353
1457
  - `mcdev`: alias for `start`
1354
1458
  - `build`: Runs documentation and linting scripts
@@ -1358,9 +1462,9 @@ When completed you will see `+ mcdev@3.0.0` printed to your screen (or the curre
1358
1462
  - `test`: Runs mocha tests - outdated
1359
1463
  - `upgrade`: run npm-check to test for updated depdencies
1360
1464
 
1361
- <a id="markdown-94-developer-documentation" name="94-developer-documentation"></a>
1362
-
1363
1465
  ### 9.4. Developer Documentation
1364
1466
 
1467
+ <a id="markdown-developer-documentation" name="developer-documentation"></a>
1468
+
1365
1469
  - [Link to API Documentation](docs/dist/documentation.md)
1366
1470
  - [Link to Considerations & Findings Documentation](docs/dist/considerations.md)