Skip to content

Commit

Permalink
#1406: add retrieve & delete tests for event
Browse files Browse the repository at this point in the history
  • Loading branch information
JoernBerkefeld committed Jul 5, 2024
1 parent 9bb1b4e commit ef66ebb
Show file tree
Hide file tree
Showing 13 changed files with 1,026 additions and 23 deletions.
14 changes: 13 additions & 1 deletion @types/lib/metadataTypes/Event.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,12 @@ declare namespace Event {
retrieving: boolean;
template: boolean;
};
'configurationArguments.unconfigured': {
isCreateable: boolean;
isUpdateable: boolean;
retrieving: boolean;
template: boolean;
};
createdBy: {
isCreateable: boolean;
isUpdateable: boolean;
Expand Down Expand Up @@ -530,6 +536,12 @@ declare namespace Event {
'metaData.automationData.scheduleObject.createdBy': {
isCreateable: boolean;
isUpdateable: boolean;
/**
* parses retrieved Metadata before saving
*
* @param {MetadataTypeItem} metadata a single event definition
* @returns {MetadataTypeItem} parsed metadata
*/
retrieving: boolean;
template: boolean;
};
Expand Down Expand Up @@ -959,7 +971,7 @@ declare namespace Event {
retrieving: boolean;
template: boolean;
};
r__dataExtension_CustomerKey: {
r__dataExtension_key: {
isCreateable: boolean;
isUpdateable: boolean;
retrieving: boolean;
Expand Down
2 changes: 1 addition & 1 deletion @types/lib/metadataTypes/Event.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion @types/lib/metadataTypes/definitions/Event.definition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@ declare namespace _default {
retrieving: boolean;
template: boolean;
};
'configurationArguments.unconfigured': {
isCreateable: boolean;
isUpdateable: boolean;
retrieving: boolean;
template: boolean;
};
createdBy: {
isCreateable: boolean;
isUpdateable: boolean;
Expand Down Expand Up @@ -855,7 +861,7 @@ declare namespace _default {
retrieving: boolean;
template: boolean;
};
r__dataExtension_CustomerKey: {
r__dataExtension_key: {
isCreateable: boolean;
isUpdateable: boolean;
retrieving: boolean;
Expand Down
7 changes: 6 additions & 1 deletion lib/metadataTypes/Event.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,12 @@ class Event extends MetadataType {
'CustomerKey',
'Name'
);
delete metadataItem.schema;
if (metadataItem.schema) {
delete metadataItem.schema;
Util.logger.info(
` - ${this.definition.type} ${metadataItem[this.definition.keyField]}: dataExtension ${metadataItem.r__dataExtension_key} found, ignoring schema-section in ${this.definition.type} json`
);
}
}
} catch {
// no action
Expand Down
14 changes: 7 additions & 7 deletions lib/metadataTypes/definitions/Event.definition.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,12 +279,12 @@ export default {
// retrieving: false,
// template: false,
// },
// 'configurationArguments.unconfigured': {
// isCreateable: false,
// isUpdateable: false,
// retrieving: false,
// template: false,
// },
'configurationArguments.unconfigured': {
isCreateable: false,
isUpdateable: false,
retrieving: false,
template: false,
},
// 'configurationArguments.version': {
// isCreateable: false,
// isUpdateable: false,
Expand Down Expand Up @@ -963,7 +963,7 @@ export default {
retrieving: true,
template: true,
},
r__dataExtension_CustomerKey: {
r__dataExtension_key: {
isCreateable: false,
isUpdateable: false,
retrieving: true,
Expand Down
2 changes: 1 addition & 1 deletion test/general.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ describe('GENERAL', () => {
);
assert.equal(
Object.keys(result[buName]['dataExtension']).length,
5,
6,
'retrieve should have returned 5 dataExtension'
);
assert.equal(
Expand Down
24 changes: 24 additions & 0 deletions test/resources/9999999/dataExtension/retrieve-response.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,30 @@
<RetainUntil />
<CategoryID>2</CategoryID>
</Results>
<Results xsi:type="DataExtension">
<PartnerKey xsi:nil="true" />
<CreatedDate>2024-07-05T08:01:54.803</CreatedDate>
<ModifiedDate>2024-07-05T08:01:58.923</ModifiedDate>
<ObjectID>f2cc2b21-d73a-ef11-a5c8-5cba2c702db8</ObjectID>
<CustomerKey>testExisting_event - 2024-07-05T080154625</CustomerKey>
<Name>testExisting_event - 2024-07-05T080154625</Name>
<Description />
<IsSendable>true</IsSendable>
<IsTestable>false</IsTestable>
<SendableDataExtensionField>
<PartnerKey xsi:nil="true" />
<ObjectID xsi:nil="true" />
<Name>ContactId</Name>
</SendableDataExtensionField>
<SendableSubscriberField>
<Name>_SubscriberKey</Name>
</SendableSubscriberField>
<RowBasedRetention>false</RowBasedRetention>
<ResetRetentionPeriodOnImport>false</ResetRetentionPeriodOnImport>
<DeleteAtEndOfRetentionPeriod>false</DeleteAtEndOfRetentionPeriod>
<RetainUntil />
<CategoryID>2</CategoryID>
</Results>
</RetrieveResponseMsg>
</soap:Body>
</soap:Envelope>
Loading

0 comments on commit ef66ebb

Please sign in to comment.