diff --git a/docs/dist/documentation.md b/docs/dist/documentation.md index 76a46badc..db558d883 100644 --- a/docs/dist/documentation.md +++ b/docs/dist/documentation.md @@ -120,7 +120,7 @@ Provides default functionality that can be overwritten by child metadata type cl
TransactionalMessage
TransactionalSMS MetadataType
MetadataType
MetadataType
MessageSendActivity MetadataType
Array.<string>
| customerkey of the metadata |
-
+
-## TriggeredSendDefinition ⇐ [MetadataType
](#MetadataType)
+## TriggeredSend ⇐ [MetadataType
](#MetadataType)
MessageSendActivity MetadataType
**Kind**: global class
**Extends**: [MetadataType
](#MetadataType)
-* [TriggeredSendDefinition](#TriggeredSendDefinition) ⇐ [MetadataType
](#MetadataType)
- * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSendDefinition.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj>
- * [.create(metadata)](#TriggeredSendDefinition.create) ⇒ Promise
- * [.update(metadata, [handleOutside])](#TriggeredSendDefinition.update) ⇒ Promise
- * [.deleteByKey(customerKey)](#TriggeredSendDefinition.deleteByKey) ⇒ Promise.<boolean>
- * [.postRetrieveTasks(metadata)](#TriggeredSendDefinition.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem
- * [.setFolderPath(metadata)](#TriggeredSendDefinition.setFolderPath)
- * [.parseMetadata(metadata)](#TriggeredSendDefinition.parseMetadata) ⇒ TYPE.MetadataTypeItem
\| void
- * [.preDeployTasks(metadata)](#TriggeredSendDefinition.preDeployTasks) ⇒ TYPE.MetadataTypeItem
- * [.refresh([keyArr])](#TriggeredSendDefinition.refresh) ⇒ Promise.<void>
- * [._findRefreshableItems()](#TriggeredSendDefinition._findRefreshableItems) ⇒ Promise.<Array.<string>>
- * [._refreshItem(key, checkKey)](#TriggeredSendDefinition._refreshItem) ⇒ Promise.<boolean>
-
-
-
-### TriggeredSendDefinition.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj>
+* [TriggeredSend](#TriggeredSend) ⇐ [MetadataType
](#MetadataType)
+ * [.retrieve(retrieveDir, [_], [__], [key])](#TriggeredSend.retrieve) ⇒ Promise.<TYPE.MetadataTypeMapObj>
+ * [.create(metadata)](#TriggeredSend.create) ⇒ Promise
+ * [.update(metadata, [handleOutside])](#TriggeredSend.update) ⇒ Promise
+ * [.deleteByKey(customerKey)](#TriggeredSend.deleteByKey) ⇒ Promise.<boolean>
+ * [.postRetrieveTasks(metadata)](#TriggeredSend.postRetrieveTasks) ⇒ TYPE.MetadataTypeItem
+ * [.setFolderPath(metadata)](#TriggeredSend.setFolderPath)
+ * [.parseMetadata(metadata)](#TriggeredSend.parseMetadata) ⇒ TYPE.MetadataTypeItem
\| void
+ * [.preDeployTasks(metadata)](#TriggeredSend.preDeployTasks) ⇒ TYPE.MetadataTypeItem
+ * [.refresh([keyArr])](#TriggeredSend.refresh) ⇒ Promise.<void>
+ * [._findRefreshableItems()](#TriggeredSend._findRefreshableItems) ⇒ Promise.<Array.<string>>
+ * [._refreshItem(key, checkKey)](#TriggeredSend._refreshItem) ⇒ Promise.<boolean>
+
+
+
+### TriggeredSend.retrieve(retrieveDir, [_], [__], [key]) ⇒ Promise.<TYPE.MetadataTypeMapObj>
Retrieves SOAP based metadata of metadata type into local filesystem. executes callback with retrieved metadata
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: Promise.<TYPE.MetadataTypeMapObj>
- Promise of metadata
| Param | Type | Description |
@@ -4974,24 +4974,24 @@ Retrieves SOAP based metadata of metadata type into local filesystem. executes c
| [__] | void
| unused parameter |
| [key] | string
| customer key of single item to retrieve |
-
+
-### TriggeredSendDefinition.create(metadata) ⇒ Promise
+### TriggeredSend.create(metadata) ⇒ Promise
Create a single TSD.
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: Promise
- Promise
| Param | Type | Description |
| --- | --- | --- |
| metadata | TYPE.MetadataTypeItem
| single metadata entry |
-
+
-### TriggeredSendDefinition.update(metadata, [handleOutside]) ⇒ Promise
+### TriggeredSend.update(metadata, [handleOutside]) ⇒ Promise
Updates a single TSD.
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: Promise
- Promise
| Param | Type | Description |
@@ -4999,90 +4999,90 @@ Updates a single TSD.
| metadata | TYPE.MetadataTypeItem
| single metadata entry |
| [handleOutside] | boolean
| if the API reponse is irregular this allows you to handle it outside of this generic method |
-
+
-### TriggeredSendDefinition.deleteByKey(customerKey) ⇒ Promise.<boolean>
+### TriggeredSend.deleteByKey(customerKey) ⇒ Promise.<boolean>
Delete a metadata item from the specified business unit
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: Promise.<boolean>
- deletion success status
| Param | Type | Description |
| --- | --- | --- |
| customerKey | string
| Identifier of data extension |
-
+
-### TriggeredSendDefinition.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem
+### TriggeredSend.postRetrieveTasks(metadata) ⇒ TYPE.MetadataTypeItem
manages post retrieve steps
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: TYPE.MetadataTypeItem
- Array with one metadata object and one query string
| Param | Type | Description |
| --- | --- | --- |
| metadata | TYPE.MetadataTypeItem
| a single query |
-
+
-### 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 [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
| Param | Type | Description |
| --- | --- | --- |
| metadata | TYPE.MetadataTypeItem
| a single script activity definition |
-
+
-### TriggeredSendDefinition.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem
\| void
+### TriggeredSend.parseMetadata(metadata) ⇒ TYPE.MetadataTypeItem
\| void
parses retrieved Metadata before saving
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: TYPE.MetadataTypeItem
\| void
- Array with one metadata object and one sql string
| Param | Type | Description |
| --- | --- | --- |
| metadata | TYPE.MetadataTypeItem
| a single query activity definition |
-
+
-### TriggeredSendDefinition.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem
+### TriggeredSend.preDeployTasks(metadata) ⇒ TYPE.MetadataTypeItem
prepares a TSD for deployment
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: TYPE.MetadataTypeItem
- metadata object
| Param | Type | Description |
| --- | --- | --- |
| metadata | TYPE.MetadataTypeItem
| of a single TSD |
-
+
-### TriggeredSendDefinition.refresh([keyArr]) ⇒ Promise.<void>
+### TriggeredSend.refresh([keyArr]) ⇒ Promise.<void>
TSD-specific refresh method that finds active TSDs and refreshes them
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: Promise.<void>
- -
| Param | Type | Description |
| --- | --- | --- |
| [keyArr] | Array.<string>
| metadata keys |
-
+
-### TriggeredSendDefinition.\_findRefreshableItems() ⇒ Promise.<Array.<string>>
+### TriggeredSend.\_findRefreshableItems() ⇒ Promise.<Array.<string>>
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 [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: Promise.<Array.<string>>
- keyArr
-
+
-### TriggeredSendDefinition.\_refreshItem(key, checkKey) ⇒ Promise.<boolean>
+### TriggeredSend.\_refreshItem(key, checkKey) ⇒ Promise.<boolean>
helper for [refresh](refresh) that pauses, publishes and starts a triggered send
-**Kind**: static method of [TriggeredSendDefinition
](#TriggeredSendDefinition)
+**Kind**: static method of [TriggeredSend
](#TriggeredSend)
**Returns**: Promise.<boolean>
- true if refresh was successful
| Param | Type | Description |
diff --git a/lib/MetadataTypeDefinitions.js b/lib/MetadataTypeDefinitions.js
index a53f85827..d44582b78 100644
--- a/lib/MetadataTypeDefinitions.js
+++ b/lib/MetadataTypeDefinitions.js
@@ -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;
diff --git a/lib/MetadataTypeInfo.js b/lib/MetadataTypeInfo.js
index 662692032..09fbaeac5 100644
--- a/lib/MetadataTypeInfo.js
+++ b/lib/MetadataTypeInfo.js
@@ -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;
diff --git a/lib/index.js b/lib/index.js
index 029ed1357..85b4474b0 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -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();
diff --git a/lib/metadataTypes/Interaction.js b/lib/metadataTypes/Interaction.js
index 047bc0423..e5e6df39c 100644
--- a/lib/metadataTypes/Interaction.js
+++ b/lib/metadataTypes/Interaction.js
@@ -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'
@@ -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'
@@ -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})`
);
}
}
@@ -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'
diff --git a/lib/metadataTypes/TriggeredSendDefinition.js b/lib/metadataTypes/TriggeredSend.js
similarity index 98%
rename from lib/metadataTypes/TriggeredSendDefinition.js
rename to lib/metadataTypes/TriggeredSend.js
index 684c913e7..e07fadd47 100644
--- a/lib/metadataTypes/TriggeredSendDefinition.js
+++ b/lib/metadataTypes/TriggeredSend.js
@@ -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
*
@@ -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;
diff --git a/lib/metadataTypes/definitions/Interaction.definition.js b/lib/metadataTypes/definitions/Interaction.definition.js
index d1ede2324..062711abb 100644
--- a/lib/metadataTypes/definitions/Interaction.definition.js
+++ b/lib/metadataTypes/definitions/Interaction.definition.js
@@ -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',
diff --git a/lib/metadataTypes/definitions/TriggeredSendDefinition.definition.js b/lib/metadataTypes/definitions/TriggeredSend.definition.js
similarity index 100%
rename from lib/metadataTypes/definitions/TriggeredSendDefinition.definition.js
rename to lib/metadataTypes/definitions/TriggeredSend.definition.js
diff --git a/test/mockRoot/.mcdevrc.json b/test/mockRoot/.mcdevrc.json
index 78dd4e70a..4d7213061 100644
--- a/test/mockRoot/.mcdevrc.json
+++ b/test/mockRoot/.mcdevrc.json
@@ -63,7 +63,7 @@
"dataExtract",
"emailSendDefinition",
"fileTransfer",
- "ftpLocation",
+ "fileLocation",
"importFile",
"list",
"mobileCode",
@@ -71,7 +71,7 @@
"query",
"role",
"script",
- "triggeredSendDefinition"
+ "triggeredSend"
]
},
"version": "4.3.4"