Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into feature/789-add-su…
Browse files Browse the repository at this point in the history
…pport-for-mobileconnect-smsMessage
  • Loading branch information
JoernBerkefeld committed Mar 27, 2023
2 parents e0034b5 + 27b8952 commit 8eb9047
Show file tree
Hide file tree
Showing 41 changed files with 1,036 additions and 395 deletions.
72 changes: 58 additions & 14 deletions docs/dist/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ main class
* [Mcdev](#Mcdev)
* [.setSkipInteraction([skipInteraction])](#Mcdev.setSkipInteraction) ⇒ <code>void</code>
* [.setLoggingLevel(argv)](#Mcdev.setLoggingLevel) ⇒ <code>void</code>
* [.setOptions(argv)](#Mcdev.setOptions) ⇒ <code>void</code>
* [.createDeltaPkg(argv)](#Mcdev.createDeltaPkg) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
* [.selectTypes()](#Mcdev.selectTypes) ⇒ <code>Promise</code>
* [.explainTypes()](#Mcdev.explainTypes) ⇒ <code>void</code>
Expand Down Expand Up @@ -521,6 +522,17 @@ configures what is displayed in the console
| [argv.verbose] | <code>boolean</code> | chatty user CLI output |
| [argv.debug] | <code>boolean</code> | enables developer output & features |

<a name="Mcdev.setOptions"></a>

### Mcdev.setOptions(argv) ⇒ <code>void</code>
configures what is displayed in the console

**Kind**: static method of [<code>Mcdev</code>](#Mcdev)

| Param | Type | Description |
| --- | --- | --- |
| argv | <code>object</code> | list of command line parameters given by user |

<a name="Mcdev.createDeltaPkg"></a>

### Mcdev.createDeltaPkg(argv) ⇒ <code>Promise.&lt;Array.&lt;TYPE.DeltaPkgItem&gt;&gt;</code>
Expand Down Expand Up @@ -3142,7 +3154,7 @@ Provides default functionality that can be overwritten by child metadata type cl
* [.updateSOAP(metadataEntry, [handleOutside])](#MetadataType.updateSOAP) ⇒ <code>Promise.&lt;object&gt;</code> \| <code>null</code>
* [._handleSOAPErrors(ex, msg, [metadataEntry], [handleOutside])](#MetadataType._handleSOAPErrors)
* [.getSOAPErrorMsg(ex)](#MetadataType.getSOAPErrorMsg) ⇒ <code>string</code>
* [.retrieveSOAP(retrieveDir, [requestParams], [additionalFields])](#MetadataType.retrieveSOAP) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</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>
* [.parseResponseBody(body, [singleRetrieve])](#MetadataType.parseResponseBody) ⇒ <code>TYPE.MetadataTypeMap</code>
* [.deleteFieldByDefinition(metadataEntry, fieldPath, definitionProperty, origin)](#MetadataType.deleteFieldByDefinition) ⇒ <code>void</code>
Expand Down Expand Up @@ -3455,7 +3467,7 @@ helper for [upsert](#MetadataType.upsert)

| Param | Type | Description |
| --- | --- | --- |
| metadata | <code>TYPE.MetadataTypeItem</code> | single metadata itme |
| metadata | <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 |
Expand Down Expand Up @@ -3540,7 +3552,7 @@ helper for [_handleSOAPErrors](_handleSOAPErrors)

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

### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [additionalFields]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
### MetadataType.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata

**Kind**: static method of [<code>MetadataType</code>](#MetadataType)
Expand All @@ -3550,6 +3562,7 @@ Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type int
| --- | --- | --- |
| retrieveDir | <code>string</code> | Directory where retrieved metadata directory will be saved |
| [requestParams] | <code>TYPE.SoapRequestParams</code> | required for the specific request (filter for example) |
| [singleRetrieve] | <code>string</code> \| <code>number</code> | key of single item to filter by |
| [additionalFields] | <code>Array.&lt;string&gt;</code> | Returns specified fields even if their retrieve definition is not set to true |

<a name="MetadataType.retrieveREST"></a>
Expand Down Expand Up @@ -5337,8 +5350,9 @@ MetadataType
* [.postDeployTasks(upsertResults)](#User.postDeployTasks) ⇒ <code>Promise.&lt;void&gt;</code>
* [._getRoleObjectForDeploy(roleId, roleName, userId, assignmentOnly, [isRoleRemovale])](#User._getRoleObjectForDeploy) ⇒ <code>object</code>
* [.retrieveChangelog()](#User.retrieveChangelog) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
* [.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields])](#User.retrieveSOAP) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
* [.document([metadata])](#User.document) ⇒ <code>Promise.&lt;void&gt;</code>
* [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ <code>TYPE.MetadataTypeItem</code>
* [.postRetrieveTasks(metadata)](#User.postRetrieveTasks) ⇒ <code>TYPE.MetadataTypeItem</code> \| <code>void</code>

<a name="User.retrieve"></a>

Expand Down Expand Up @@ -5407,7 +5421,7 @@ helper for [upsert](#MetadataType.upsert)

| Param | Type | Description |
| --- | --- | --- |
| metadata | <code>TYPE.MetadataTypeItem</code> | single metadata item |
| metadata | <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.UserDocumentDiff&gt;</code> | list of items to update |
Expand Down Expand Up @@ -5448,6 +5462,21 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c

**Kind**: static method of [<code>User</code>](#User)
**Returns**: <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code> - Promise of metadata
<a name="User.retrieveSOAP"></a>

### User.retrieveSOAP(retrieveDir, [requestParams], [singleRetrieve], [additionalFields]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
Retrieves SOAP via generic fuel-soap wrapper based metadata of metadata type into local filesystem. executes callback with retrieved metadata

**Kind**: static method of [<code>User</code>](#User)
**Returns**: <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code> - Promise of item map

| Param | Type | Description |
| --- | --- | --- |
| retrieveDir | <code>string</code> | Directory where retrieved metadata directory will be saved |
| [requestParams] | <code>TYPE.SoapRequestParams</code> | required for the specific request (filter for example) |
| [singleRetrieve] | <code>string</code> \| <code>number</code> | key of single item to filter by |
| [additionalFields] | <code>Array.&lt;string&gt;</code> | Returns specified fields even if their retrieve definition is not set to true |

<a name="User.document"></a>

### User.document([metadata]) ⇒ <code>Promise.&lt;void&gt;</code>
Expand All @@ -5462,15 +5491,15 @@ Creates markdown documentation of all roles

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

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

**Kind**: static method of [<code>User</code>](#User)
**Returns**: <code>TYPE.MetadataTypeItem</code> - Array with one metadata object and one query string
**Returns**: <code>TYPE.MetadataTypeItem</code> \| <code>void</code> - a single item

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

<a name="Retriever"></a>

Expand Down Expand Up @@ -7936,23 +7965,38 @@ key=customer key
| --- | --- | --- |
| [ID] | <code>string</code> | equal to UserID; optional in update/create calls |
| UserID | <code>string</code> | equal to ID; required in update/create calls |
| AccountUserID | <code>number</code> | user.AccountUserID |
| [AccountUserID] | <code>number</code> | user.AccountUserID |
| c__AccountUserID | <code>number</code> | copy of AccountUserID |
| CustomerKey | <code>string</code> | user.CustomerKey |
| Name | <code>string</code> | user.Name |
| Email | <code>string</code> | user.Email |
| NotificationEmailAddress | <code>string</code> | user.NotificationEmailAddress |
| ActiveFlag | <code>boolean</code> | user.ActiveFlag === true ? '✓' : '-' |
| IsAPIUser | <code>boolean</code> | user.IsAPIUser === true ? '✓' : '-' |
| MustChangePassword | <code>boolean</code> | user.MustChangePassword === true ? '✓' : '-' |
| DefaultBusinessUnit | <code>boolean</code> | defaultBUName |
| AssociatedBusinessUnits__c | <code>Array.&lt;number&gt;</code> | associatedBus |
| [Roles] | <code>object</code> | roles (API only) |
| RoleNamesGlobal__c | <code>Array.&lt;string&gt;</code> | roles |
| type__c | <code>&#x27;User&#x27;</code> \| <code>&#x27;Installed Package&#x27;</code> | roles |
| DefaultBusinessUnit | <code>number</code> | defaultBUName |
| c__AssociatedBusinessUnits | <code>Array.&lt;number&gt;</code> | associatedBus |
| [Roles] | <code>object</code> | (API only) |
| [Roles.Role] | <code>Array.&lt;object&gt;</code> | roles (API only) |
| c__RoleNamesGlobal | <code>Array.&lt;string&gt;</code> | roles |
| UserPermissions | <code>Array.&lt;string&gt;</code> | userPermissions |
| LastSuccessfulLogin | <code>string</code> | this.timeSinceDate(user.LastSuccessfulLogin) |
| CreatedDate | <code>string</code> | user.CreatedDate |
| ModifiedDate | <code>string</code> | user.ModifiedDate |
| Client | <code>object</code> | - |
| [Client.ID] | <code>number</code> | EID e.g:7281698 |
| Client.ModifiedBy | <code>number</code> | AccountUserID of user who last modified this user |
| c__type | <code>&#x27;User&#x27;</code> \| <code>&#x27;Installed Package&#x27;</code> | - |
| [IsLocked] | <code>boolean</code> | (API only) |
| [Unlock] | <code>boolean</code> | used to unlock a user that has IsLocked === true |
| c__IsLocked_readOnly | <code>boolean</code> | copy of IsLocked |
| c__TimeZoneName | <code>string</code> | name of timezone |
| [TimeZone] | <code>object</code> | (API only) |
| [TimeZone.Name] | <code>string</code> | (API only) |
| [TimeZone.ID] | <code>string</code> | (API only) |
| c__LocaleCode | <code>&#x27;en-US&#x27;</code> \| <code>&#x27;fr-CA&#x27;</code> \| <code>&#x27;fr-FR&#x27;</code> \| <code>&#x27;de-DE&#x27;</code> \| <code>&#x27;it-IT&#x27;</code> \| <code>&#x27;ja-JP&#x27;</code> \| <code>&#x27;pt-BR&#x27;</code> \| <code>&#x27;es-419&#x27;</code> \| <code>&#x27;es-ES&#x27;</code> | fr-CA, en-US, ... |
| [Locale] | <code>object</code> | (API only) |
| [Locale.LocaleCode] | <code>&#x27;en-US&#x27;</code> \| <code>&#x27;fr-CA&#x27;</code> \| <code>&#x27;fr-FR&#x27;</code> \| <code>&#x27;de-DE&#x27;</code> \| <code>&#x27;it-IT&#x27;</code> \| <code>&#x27;ja-JP&#x27;</code> \| <code>&#x27;pt-BR&#x27;</code> \| <code>&#x27;es-419&#x27;</code> \| <code>&#x27;es-ES&#x27;</code> | (API only) |

<a name="BusinessUnitAssignmentConfiguration"></a>

Expand Down
61 changes: 24 additions & 37 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.retrieve(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY));
},
})
Expand Down Expand Up @@ -69,8 +68,8 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);

Mcdev.deploy(argv.BU, csvToArray(argv.TYPE), csvToArray(argv.KEY), argv.fromRetrieve);
},
})
Expand All @@ -84,17 +83,15 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.initProject(argv.credentialsName);
},
})
.command({
command: 'join',
desc: `clones an existing project from git`,
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.joinProject();
},
})
Expand All @@ -109,8 +106,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.findBUs(argv.credentialsName);
},
})
Expand All @@ -124,8 +120,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.badKeys(argv.BU);
},
})
Expand All @@ -147,8 +142,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.document(argv.BU, argv.TYPE);
},
})
Expand All @@ -173,8 +167,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.deleteByKey(argv.BU, argv.TYPE, argv.EXTERNALKEY);
},
})
Expand Down Expand Up @@ -203,8 +196,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.retrieveAsTemplate(argv.BU, argv.TYPE, csvToArray(argv.NAME), argv.MARKET);
},
})
Expand Down Expand Up @@ -233,8 +225,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.buildTemplate(argv.BU, argv.TYPE, csvToArray(argv.KEY), argv.MARKET);
},
})
Expand Down Expand Up @@ -262,8 +253,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.buildDefinition(argv.BU, argv.TYPE, argv.NAME, argv.MARKET);
},
})
Expand All @@ -287,8 +277,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.buildDefinitionBulk(argv.LISTNAME, argv.TYPE, argv.NAME);
},
})
Expand All @@ -297,8 +286,7 @@ yargs
aliases: ['st'],
desc: 'lets you choose what metadata types to retrieve',
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.selectTypes();
},
})
Expand All @@ -307,8 +295,7 @@ yargs
aliases: ['et'],
desc: 'explains metadata types that can be retrieved',
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.explainTypes();
},
})
Expand All @@ -333,8 +320,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.createDeltaPkg(argv);
},
})
Expand All @@ -359,8 +345,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.getFilesToCommit(argv.BU, argv.TYPE, csvToArray(argv.KEY));
},
})
Expand All @@ -384,8 +369,7 @@ yargs
});
},
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.refresh(argv.BU, argv.TYPE, csvToArray(argv.KEY));
},
})
Expand All @@ -394,8 +378,7 @@ yargs
aliases: ['up'],
desc: 'Add NPM dependencies and IDE configuration files to your project',
handler: (argv) => {
Mcdev.setSkipInteraction(argv.skipInteraction);
Mcdev.setLoggingLevel(argv);
Mcdev.setOptions(argv);
Mcdev.upgrade(argv.skipInteraction);
},
})
Expand All @@ -415,12 +398,16 @@ yargs
alias: ['yes', 'y'],
description: 'Interactive questions where possible and go with defaults instead',
})
.option('api', {
description: 'Print API calls to log ',
choices: ['log', 'cli'],
})
.demandCommand(1, 'Please enter a valid command')
.strict()
.recommendCommands()
.wrap(yargs.terminalWidth())
.epilog(
'Copyright 2022. Accenture. Get support at https://github.com/Accenture/sfmc-devtools/issues'
'Copyright 2023. Accenture. Get support at https://github.com/Accenture/sfmc-devtools/issues'
)
.help().argv;

Expand Down
Loading

0 comments on commit 8eb9047

Please sign in to comment.