Skip to content

Commit

Permalink
#778: rename triggeredSendDefinition to triggeredSend - part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Mar 10, 2023
1 parent 771ffcc commit 4634f78
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 63 deletions.
100 changes: 50 additions & 50 deletions docs/dist/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ Provides default functionality that can be overwritten by child metadata type cl
<dt><a href="#TransactionalSMS">TransactionalSMS</a> ⇐ <code><a href="#TransactionalMessage">TransactionalMessage</a></code></dt>
<dd><p>TransactionalSMS MetadataType</p>
</dd>
<dt><a href="#TriggeredSendDefinition">TriggeredSendDefinition</a> ⇐ <code><a href="#MetadataType">MetadataType</a></code></dt>
<dt><a href="#TriggeredSend">TriggeredSend</a> ⇐ <code><a href="#MetadataType">MetadataType</a></code></dt>
<dd><p>MessageSendActivity MetadataType</p>
</dd>
<dt><a href="#Retriever">Retriever</a></dt>
Expand Down Expand Up @@ -4938,33 +4938,33 @@ additionally, the documentation for dataExtension and automation should be retur
| --- | --- | --- |
| keyArr | <code>Array.&lt;string&gt;</code> | customerkey of the metadata |

<a name="TriggeredSendDefinition"></a>
<a name="TriggeredSend"></a>

## TriggeredSendDefinition[<code>MetadataType</code>](#MetadataType)
## TriggeredSend[<code>MetadataType</code>](#MetadataType)
MessageSendActivity MetadataType

**Kind**: global class
**Extends**: [<code>MetadataType</code>](#MetadataType)

* [TriggeredSendDefinition](#TriggeredSendDefinition)[<code>MetadataType</code>](#MetadataType)
* [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSendDefinition.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
* [.create(metadata)](#TriggeredSendDefinition.create) ⇒ <code>Promise</code>
* [.update(metadata, [handleOutside])](#TriggeredSendDefinition.update) ⇒ <code>Promise</code>
* [.deleteByKey(customerKey)](#TriggeredSendDefinition.deleteByKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
* [.postRetrieveTasks(metadata)](#TriggeredSendDefinition.postRetrieveTasks) ⇒ <code>TYPE.MetadataTypeItem</code>
* [.setFolderPath(metadata)](#TriggeredSendDefinition.setFolderPath)
* [.parseMetadata(metadata)](#TriggeredSendDefinition.parseMetadata) ⇒ <code>TYPE.MetadataTypeItem</code> \| <code>void</code>
* [.preDeployTasks(metadata)](#TriggeredSendDefinition.preDeployTasks) ⇒ <code>TYPE.MetadataTypeItem</code>
* [.refresh([keyArr])](#TriggeredSendDefinition.refresh) ⇒ <code>Promise.&lt;void&gt;</code>
* [._findRefreshableItems()](#TriggeredSendDefinition._findRefreshableItems) ⇒ <code>Promise.&lt;Array.&lt;string&gt;&gt;</code>
* [._refreshItem(key, checkKey)](#TriggeredSendDefinition._refreshItem) ⇒ <code>Promise.&lt;boolean&gt;</code>

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

### TriggeredSendDefinition.retrieve(retrieveDir, [_], [__], [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
* [TriggeredSend](#TriggeredSend)[<code>MetadataType</code>](#MetadataType)
* [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
* [.create(metadata)](#TriggeredSend.create) ⇒ <code>Promise</code>
* [.update(metadata, [handleOutside])](#TriggeredSend.update) ⇒ <code>Promise</code>
* [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
* [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ <code>TYPE.MetadataTypeItem</code>
* [.setFolderPath(metadata)](#TriggeredSend.setFolderPath)
* [.parseMetadata(metadata)](#TriggeredSend.parseMetadata) ⇒ <code>TYPE.MetadataTypeItem</code> \| <code>void</code>
* [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ <code>TYPE.MetadataTypeItem</code>
* [.refresh([keyArr])](#TriggeredSend.refresh) ⇒ <code>Promise.&lt;void&gt;</code>
* [._findRefreshableItems()](#TriggeredSend._findRefreshableItems) ⇒ <code>Promise.&lt;Array.&lt;string&gt;&gt;</code>
* [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ <code>Promise.&lt;boolean&gt;</code>

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

### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ <code>Promise.&lt;TYPE.MetadataTypeMapObj&gt;</code>
Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata

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

| Param | Type | Description |
Expand All @@ -4974,115 +4974,115 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c
| [__] | <code>void</code> | unused parameter |
| [key] | <code>string</code> | customer key of single item to retrieve |

<a name="TriggeredSendDefinition.create"></a>
<a name="TriggeredSend.create"></a>

### TriggeredSendDefinition.create(metadata) ⇒ <code>Promise</code>
### TriggeredSend.create(metadata) ⇒ <code>Promise</code>
Create a single TSD.

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

| Param | Type | Description |
| --- | --- | --- |
| metadata | <code>TYPE.MetadataTypeItem</code> | single metadata entry |

<a name="TriggeredSendDefinition.update"></a>
<a name="TriggeredSend.update"></a>

### TriggeredSendDefinition.update(metadata, [handleOutside]) ⇒ <code>Promise</code>
### TriggeredSend.update(metadata, [handleOutside]) ⇒ <code>Promise</code>
Updates a single TSD.

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

| Param | Type | Description |
| --- | --- | --- |
| metadata | <code>TYPE.MetadataTypeItem</code> | single metadata entry |
| [handleOutside] | <code>boolean</code> | if the API reponse is irregular this allows you to handle it outside of this generic method |

<a name="TriggeredSendDefinition.deleteByKey"></a>
<a name="TriggeredSend.deleteByKey"></a>

### TriggeredSendDefinition.deleteByKey(customerKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
### TriggeredSend.deleteByKey(customerKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
Delete a metadata item from the specified business unit

**Kind**: static method of [<code>TriggeredSendDefinition</code>](#TriggeredSendDefinition)
**Kind**: static method of [<code>TriggeredSend</code>](#TriggeredSend)
**Returns**: <code>Promise.&lt;boolean&gt;</code> - deletion success status

| Param | Type | Description |
| --- | --- | --- |
| customerKey | <code>string</code> | Identifier of data extension |

<a name="TriggeredSendDefinition.postRetrieveTasks"></a>
<a name="TriggeredSend.postRetrieveTasks"></a>

### TriggeredSendDefinition.postRetrieveTasks(metadata) ⇒ <code>TYPE.MetadataTypeItem</code>
### TriggeredSend.postRetrieveTasks(metadata) ⇒ <code>TYPE.MetadataTypeItem</code>
manages post retrieve steps

**Kind**: static method of [<code>TriggeredSendDefinition</code>](#TriggeredSendDefinition)
**Kind**: static method of [<code>TriggeredSend</code>](#TriggeredSend)
**Returns**: <code>TYPE.MetadataTypeItem</code> - Array with one metadata object and one query string

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

<a name="TriggeredSendDefinition.setFolderPath"></a>
<a name="TriggeredSend.setFolderPath"></a>

### TriggeredSendDefinition.setFolderPath(metadata)
### TriggeredSend.setFolderPath(metadata)
generic script that retrieves the folder path from cache and updates the given metadata with it after retrieve

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

| Param | Type | Description |
| --- | --- | --- |
| metadata | <code>TYPE.MetadataTypeItem</code> | a single script activity definition |

<a name="TriggeredSendDefinition.parseMetadata"></a>
<a name="TriggeredSend.parseMetadata"></a>

### TriggeredSendDefinition.parseMetadata(metadata) ⇒ <code>TYPE.MetadataTypeItem</code> \| <code>void</code>
### TriggeredSend.parseMetadata(metadata) ⇒ <code>TYPE.MetadataTypeItem</code> \| <code>void</code>
parses retrieved Metadata before saving

**Kind**: static method of [<code>TriggeredSendDefinition</code>](#TriggeredSendDefinition)
**Kind**: static method of [<code>TriggeredSend</code>](#TriggeredSend)
**Returns**: <code>TYPE.MetadataTypeItem</code> \| <code>void</code> - Array with one metadata object and one sql string

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

<a name="TriggeredSendDefinition.preDeployTasks"></a>
<a name="TriggeredSend.preDeployTasks"></a>

### TriggeredSendDefinition.preDeployTasks(metadata) ⇒ <code>TYPE.MetadataTypeItem</code>
### TriggeredSend.preDeployTasks(metadata) ⇒ <code>TYPE.MetadataTypeItem</code>
prepares a TSD for deployment

**Kind**: static method of [<code>TriggeredSendDefinition</code>](#TriggeredSendDefinition)
**Kind**: static method of [<code>TriggeredSend</code>](#TriggeredSend)
**Returns**: <code>TYPE.MetadataTypeItem</code> - metadata object

| Param | Type | Description |
| --- | --- | --- |
| metadata | <code>TYPE.MetadataTypeItem</code> | of a single TSD |

<a name="TriggeredSendDefinition.refresh"></a>
<a name="TriggeredSend.refresh"></a>

### TriggeredSendDefinition.refresh([keyArr]) ⇒ <code>Promise.&lt;void&gt;</code>
### TriggeredSend.refresh([keyArr]) ⇒ <code>Promise.&lt;void&gt;</code>
TSD-specific refresh method that finds active TSDs and refreshes them

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

| Param | Type | Description |
| --- | --- | --- |
| [keyArr] | <code>Array.&lt;string&gt;</code> | metadata keys |

<a name="TriggeredSendDefinition._findRefreshableItems"></a>
<a name="TriggeredSend._findRefreshableItems"></a>

### TriggeredSendDefinition.\_findRefreshableItems() ⇒ <code>Promise.&lt;Array.&lt;string&gt;&gt;</code>
### TriggeredSend.\_findRefreshableItems() ⇒ <code>Promise.&lt;Array.&lt;string&gt;&gt;</code>
helper for [refresh](refresh) that finds active TSDs on the server and filters it by the same rules that [retrieve](retrieve) is using to avoid refreshing TSDs with broken dependencies

**Kind**: static method of [<code>TriggeredSendDefinition</code>](#TriggeredSendDefinition)
**Kind**: static method of [<code>TriggeredSend</code>](#TriggeredSend)
**Returns**: <code>Promise.&lt;Array.&lt;string&gt;&gt;</code> - keyArr
<a name="TriggeredSendDefinition._refreshItem"></a>
<a name="TriggeredSend._refreshItem"></a>

### TriggeredSendDefinition.\_refreshItem(key, checkKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
### TriggeredSend.\_refreshItem(key, checkKey) ⇒ <code>Promise.&lt;boolean&gt;</code>
helper for [refresh](refresh) that pauses, publishes and starts a triggered send

**Kind**: static method of [<code>TriggeredSendDefinition</code>](#TriggeredSendDefinition)
**Kind**: static method of [<code>TriggeredSend</code>](#TriggeredSend)
**Returns**: <code>Promise.&lt;boolean&gt;</code> - true if refresh was successful

| Param | Type | Description |
Expand Down
2 changes: 1 addition & 1 deletion lib/MetadataTypeDefinitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MetadataTypeDefinitions = {
transactionalEmail: require('./metadataTypes/definitions/TransactionalEmail.definition'),
transactionalPush: require('./metadataTypes/definitions/TransactionalPush.definition'),
transactionalSMS: require('./metadataTypes/definitions/TransactionalSMS.definition'),
triggeredSendDefinition: require('./metadataTypes/definitions/TriggeredSendDefinition.definition'),
triggeredSend: require('./metadataTypes/definitions/TriggeredSend.definition'),
};

module.exports = MetadataTypeDefinitions;
2 changes: 1 addition & 1 deletion lib/MetadataTypeInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const MetadataTypeInfo = {
transactionalEmail: require('./metadataTypes/TransactionalEmail'),
transactionalPush: require('./metadataTypes/TransactionalPush'),
transactionalSMS: require('./metadataTypes/TransactionalSMS'),
triggeredSendDefinition: require('./metadataTypes/TriggeredSendDefinition'),
triggeredSend: require('./metadataTypes/TriggeredSend'),
};

module.exports = MetadataTypeInfo;
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ class Mcdev {
static async refresh(businessUnit, type, keyArr) {
Util.logger.info('mcdev:: refresh');
if (!type || !Util._isValidType(type, true)) {
type = 'triggeredSendDefinition';
type = 'triggeredSend';
Util.logger.info(' - setting type to ' + type);
}
const properties = await config.getProperties();
Expand Down
8 changes: 4 additions & 4 deletions lib/metadataTypes/Interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ class Interaction extends MetadataType {
if (item.configurationArguments?.triggeredSendKey) {
// triggeredSendKey is not always set but triggeredSendId is
cache.searchForField(
'triggeredSendDefinition',
'triggeredSend',
item.configurationArguments.triggeredSendKey,
'CustomerKey',
'CustomerKey'
Expand All @@ -346,7 +346,7 @@ class Interaction extends MetadataType {
} else if (item.configurationArguments?.triggeredSendId) {
// triggeredSendKey is not always set but triggeredSendId is
item.configurationArguments.triggeredSendKey = cache.searchForField(
'triggeredSendDefinition',
'triggeredSend',
item.configurationArguments.triggeredSendId,
'ObjectID',
'CustomerKey'
Expand All @@ -357,7 +357,7 @@ class Interaction extends MetadataType {
Util.logger.warn(
` - ${this.definition.type} '${metadata[this.definition.nameField]}' (${
metadata[this.definition.keyField]
}): Could not find triggeredSendDefinition (${ex.message})`
}): Could not find triggeredSend (${ex.message})`
);
}
}
Expand Down Expand Up @@ -562,7 +562,7 @@ class Interaction extends MetadataType {
}
// triggeredSendKey is not always set but triggeredSendId is
item.configurationArguments.triggeredSendId = cache.searchForField(
'triggeredSendDefinition',
'triggeredSend',
item.configurationArguments.triggeredSendKey,
'CustomerKey',
'ObjectID'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const cacheTypes = {
*
* @augments MetadataType
*/
class TriggeredSendDefinition extends MetadataType {
class TriggeredSend extends MetadataType {
/**
* Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata
*
Expand Down Expand Up @@ -423,6 +423,6 @@ class TriggeredSendDefinition extends MetadataType {
}

// Assign definition to static attributes
TriggeredSendDefinition.definition = require('../MetadataTypeDefinitions').triggeredSendDefinition;
TriggeredSend.definition = require('../MetadataTypeDefinitions').triggeredSend;

module.exports = TriggeredSendDefinition;
module.exports = TriggeredSend;
2 changes: 1 addition & 1 deletion lib/metadataTypes/definitions/Interaction.definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// update: https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/putUpdateInteraction.html
module.exports = {
bodyIteratorField: 'items',
dependencies: ['folder-journey', 'triggeredSendDefinition', 'event'], // ! interaction and transactionalEmail both link to each other. caching transactionalEmail here "manually" instead of via dependencies array, assuming that it is quicker than the other way round
dependencies: ['folder-journey', 'triggeredSend', 'event'], // ! interaction and transactionalEmail both link to each other. caching transactionalEmail here "manually" instead of via dependencies array, assuming that it is quicker than the other way round
folderIdField: 'categoryId',
hasExtended: false,
idField: 'id',
Expand Down
4 changes: 2 additions & 2 deletions test/mockRoot/.mcdevrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
"dataExtract",
"emailSendDefinition",
"fileTransfer",
"ftpLocation",
"fileLocation",
"importFile",
"list",
"mobileCode",
"mobileKeyword",
"query",
"role",
"script",
"triggeredSendDefinition"
"triggeredSend"
]
},
"version": "4.3.4"
Expand Down

0 comments on commit 4634f78

Please sign in to comment.