From c970fdf9ad1caee3dcb279974923d43da8951092 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Berkefeld?= Date: Wed, 23 Aug 2023 13:47:00 +0200 Subject: [PATCH] #1088: remove additional fields from retrieve to increase readability --- .../definitions/AttributeSet.definition.js | 14 +- .../attributeSet/retrieve-expected.json | 36 +-- .../schema/setDefinitions/get-response.json | 276 +----------------- 3 files changed, 18 insertions(+), 308 deletions(-) diff --git a/lib/metadataTypes/definitions/AttributeSet.definition.js b/lib/metadataTypes/definitions/AttributeSet.definition.js index 4c2dcbea8..30cc2e8e3 100644 --- a/lib/metadataTypes/definitions/AttributeSet.definition.js +++ b/lib/metadataTypes/definitions/AttributeSet.definition.js @@ -660,9 +660,10 @@ module.exports = { template: null, }, 'valueDefinitions[].definitionID': { + // likely the main ID of the value definition. No use for simple checks on git though as long as we cannot update it isCreateable: null, isUpdateable: null, - retrieving: true, + retrieving: false, template: null, }, 'valueDefinitions[].definitionKey': { @@ -858,22 +859,31 @@ module.exports = { retrieving: false, template: null, }, + 'valueDefinitions[].storageFieldReferenceID': { + isCreateable: null, + isUpdateable: null, + retrieving: false, + template: null, + }, 'valueDefinitions[].storageFieldReferenceID.type': { + // always "guid" isCreateable: null, isUpdateable: null, retrieving: true, template: null, }, 'valueDefinitions[].storageFieldReferenceID.value': { + // unknown GUID isCreateable: null, isUpdateable: null, retrieving: true, template: null, }, 'valueDefinitions[].storageName': { + // always equal valueDefinitions[].definitionKey, except for when that is CustomObjectKey - then this will be _CustomObjectKey (with an underscore) isCreateable: null, isUpdateable: null, - retrieving: true, + retrieving: false, template: null, }, 'valueDefinitions[].valueDefinitionID': { diff --git a/test/resources/9999999/attributeSet/retrieve-expected.json b/test/resources/9999999/attributeSet/retrieve-expected.json index c994c2dec..f24f33133 100644 --- a/test/resources/9999999/attributeSet/retrieve-expected.json +++ b/test/resources/9999999/attributeSet/retrieve-expected.json @@ -72,7 +72,6 @@ "valueDefinitions": [ { "dataType": "LongNumber", - "definitionID": "548b787a-5238-ee11-b85a-48df37d1de8a", "definitionKey": "CustomObjectKey", "description": "", "isHidden": true, @@ -82,12 +81,10 @@ "isReadOnly": true, "isSystemDefined": true, "isUpdateable": true, - "name": "Custom Object Key", - "storageName": "_CustomObjectKey" + "name": "Custom Object Key" }, { "dataType": "Text", - "definitionID": "588b787a-5238-ee11-b85a-48df37d1de8a", "definitionKey": "FirstName", "description": "", "isHidden": false, @@ -98,16 +95,10 @@ "isSystemDefined": false, "isUpdateable": true, "length": 50, - "name": "FirstName", - "storageFieldReferenceID": { - "type": "guid", - "value": "391bfc9e-ea85-4610-a24b-d8400a36cdfc" - }, - "storageName": "FirstName" + "name": "FirstName" }, { "dataType": "Text", - "definitionID": "578b787a-5238-ee11-b85a-48df37d1de8a", "definitionKey": "LastName", "description": "", "isHidden": false, @@ -118,16 +109,10 @@ "isSystemDefined": false, "isUpdateable": true, "length": 55, - "name": "LastName", - "storageFieldReferenceID": { - "type": "guid", - "value": "3f80ba1f-f957-400f-88cb-a9303491026d" - }, - "storageName": "LastName" + "name": "LastName" }, { "dataType": "EmailAddress", - "definitionID": "568b787a-5238-ee11-b85a-48df37d1de8a", "definitionKey": "EmailAddress", "description": "", "isHidden": false, @@ -138,16 +123,10 @@ "isSystemDefined": false, "isUpdateable": true, "length": 254, - "name": "EmailAddress", - "storageFieldReferenceID": { - "type": "guid", - "value": "41b9575b-da06-41ed-8551-f76868451a51" - }, - "storageName": "EmailAddress" + "name": "EmailAddress" }, { "dataType": "Text", - "definitionID": "558b787a-5238-ee11-b85a-48df37d1de8a", "definitionKey": "ContactKey", "description": "", "isHidden": false, @@ -158,12 +137,7 @@ "isSystemDefined": false, "isUpdateable": true, "length": 50, - "name": "ContactKey", - "storageFieldReferenceID": { - "type": "guid", - "value": "49d0db37-dff0-49d9-9d82-eb29b345f238" - }, - "storageName": "ContactKey" + "name": "ContactKey" } ] } diff --git a/test/resources/9999999/hub/v1/contacts/schema/setDefinitions/get-response.json b/test/resources/9999999/hub/v1/contacts/schema/setDefinitions/get-response.json index 2826a4f3b..aef3bea05 100644 --- a/test/resources/9999999/hub/v1/contacts/schema/setDefinitions/get-response.json +++ b/test/resources/9999999/hub/v1/contacts/schema/setDefinitions/get-response.json @@ -19827,7 +19827,7 @@ "leftRelationshipReferenceType": "CustomerData", "relationshipAttributes": [ { - "leftAttributeID": "9503534e-6816-e811-80d0-1402ec7222b5", + "leftAttributeID": "9393dc39-31e2-e611-80cc-1402ec7222b4", "leftConnectingID": { "identifierType": "FullyQualifiedName" }, @@ -20180,280 +20180,6 @@ "setDefinitionID": "528b787a-5238-ee11-b85a-48df37d1de8a", "setDefinitionKey": "testExisting_dataExtensionShared", "name": "testExisting_dataExtensionShared" - }, - { - "definitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "Contact", - "definitionName": { - "value": "Contact" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - }, - "relationships": [ - { - "canModify": false, - "canRemove": false, - "isHidden": false, - "isSystemDefined": false, - "isGroupToSetRelationship": true, - "leftItem": { - "cardinality": "One", - "connectingID": { - "identifierType": "FullyQualifiedName" - }, - "identifier": "9103534e-6816-e811-80d0-1402ec7222b5", - "relationshipType": "AttributeGroup" - }, - "leftRelationshipIDs": [ - { - "type": "int16", - "value": "2" - } - ], - "leftRelationshipReferenceType": "CustomerData", - "relationshipAttributes": [ - { - "leftAttributeID": "9403534e-6816-e811-80d0-1402ec7222b5", - "leftConnectingID": { - "identifierType": "FullyQualifiedName" - }, - "rightAttributeID": "9403534e-6816-e811-80d0-1402ec7222b5", - "rightConnectingID": { - "identifierType": "FullyQualifiedName" - } - } - ], - "relationshipID": "9a03534e-6816-e811-80d0-1402ec7222b5", - "rightItem": { - "cardinality": "One", - "connectingID": { - "identifierType": "FullyQualifiedName" - }, - "identifier": "9203534e-6816-e811-80d0-1402ec7222b5", - "relationshipType": "AttributeSet" - } - } - ], - "valueDefinitions": [ - { - "baseType": "Numeric", - "customerDataID": 9, - "dataSourceID": 1, - "dataSourceName": {}, - "dataType": "Byte", - "description": "", - "localizedDescription": { - "value": "" - }, - "definitionID": "660eea87-ed21-ee11-b861-48df37d1dc79", - "definitionKey": "Status", - "definitionName": { - "value": "Status" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - }, - "fullyQualifiedName": "Contact.Status", - "isHidden": true, - "isIdentityValue": false, - "isNullable": true, - "isPrimaryKey": false, - "isReadOnly": true, - "isSystemDefined": true, - "isUpdateable": false, - "parentDefinition": { - "definitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "Contact", - "definitionName": { - "value": "Contact" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - } - }, - "parentType": "Set", - "storageName": "Status", - "valueDefinitionID": "660eea87-ed21-ee11-b861-48df37d1dc79", - "valueDefinitionKey": "Status", - "name": "Status", - "setDefinitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "setDefinitionKey": "Contact", - "setDefinitionName": { - "value": "Contact" - }, - "parentIdentifier": "9203534e-6816-e811-80d0-1402ec7222b5" - }, - { - "baseType": "Numeric", - "customerDataID": 1, - "dataSourceID": 1, - "dataSourceName": {}, - "dataType": "Number", - "description": "", - "localizedDescription": { - "value": "" - }, - "definitionID": "9303534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "BusinessUnitID", - "definitionName": { - "value": "Business Unit ID" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - }, - "fullyQualifiedName": "Contact.Business Unit ID", - "isHidden": true, - "isIdentityValue": false, - "isNullable": false, - "isPrimaryKey": true, - "isReadOnly": true, - "isSystemDefined": true, - "isUpdateable": false, - "parentDefinition": { - "definitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "Contact", - "definitionName": { - "value": "Contact" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - } - }, - "parentType": "Set", - "storageName": "ClientID", - "valueDefinitionID": "9303534e-6816-e811-80d0-1402ec7222b5", - "valueDefinitionKey": "BusinessUnitID", - "name": "Business Unit ID", - "setDefinitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "setDefinitionKey": "Contact", - "setDefinitionName": { - "value": "Contact" - }, - "parentIdentifier": "9203534e-6816-e811-80d0-1402ec7222b5" - }, - { - "baseType": "Text", - "customerDataID": 3, - "dataSourceID": 1, - "dataSourceName": {}, - "dataType": "Text", - "description": "", - "localizedDescription": { - "value": "" - }, - "definitionID": "9503534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "ContactKey", - "definitionName": { - "value": "Contact Key" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - }, - "fullyQualifiedName": "Contact.Contact Key", - "isHidden": false, - "isIdentityValue": false, - "isNullable": false, - "isPrimaryKey": false, - "isReadOnly": true, - "isSystemDefined": true, - "isUpdateable": false, - "length": -1, - "parentDefinition": { - "definitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "Contact", - "definitionName": { - "value": "Contact" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - } - }, - "parentType": "Set", - "storageName": "SubscriberKey", - "valueDefinitionID": "9503534e-6816-e811-80d0-1402ec7222b5", - "valueDefinitionKey": "ContactKey", - "name": "Contact Key", - "setDefinitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "setDefinitionKey": "Contact", - "setDefinitionName": { - "value": "Contact" - }, - "parentIdentifier": "9203534e-6816-e811-80d0-1402ec7222b5" - }, - { - "baseType": "Numeric", - "customerDataID": 2, - "dataSourceID": 1, - "dataSourceName": {}, - "dataType": "Number", - "description": "", - "localizedDescription": { - "value": "" - }, - "definitionID": "9403534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "ContactID", - "definitionName": { - "value": "Contact ID" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - }, - "fullyQualifiedName": "Contact.Contact ID", - "isHidden": false, - "isIdentityValue": false, - "isNullable": false, - "isPrimaryKey": true, - "isReadOnly": true, - "isSystemDefined": true, - "isUpdateable": false, - "parentDefinition": { - "definitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "definitionKey": "Contact", - "definitionName": { - "value": "Contact" - }, - "connectingID": { - "identifierType": "FullyQualifiedName" - } - }, - "parentType": "Set", - "storageName": "SubscriberID", - "valueDefinitionID": "9403534e-6816-e811-80d0-1402ec7222b5", - "valueDefinitionKey": "ContactID", - "name": "Contact ID", - "setDefinitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "setDefinitionKey": "Contact", - "setDefinitionName": { - "value": "Contact" - }, - "parentIdentifier": "9203534e-6816-e811-80d0-1402ec7222b5" - } - ], - "applicationID": "ce703ed3-e01f-4f5f-900d-76a95b363e29", - "applicationKey": "com.exacttarget.contacts", - "attributeCount": 0, - "canAddValues": false, - "canChangeValues": false, - "canModify": false, - "canRemove": false, - "createdBy": -1000, - "createDate": "2018-02-20T12:03:00", - "localizedDescription": {}, - "fullyQualifiedName": "Contact", - "isCustomObjectBacked": false, - "isEvent": false, - "isHidden": false, - "isReadOnly": true, - "isRoot": false, - "isSendable": false, - "isSystemDefined": true, - "parentID": "00000000-0000-0000-0000-000000000000", - "relationshipCount": 1, - "storageObjectIDs": ["2ba72136-9f31-4a79-ab62-4ba5d19cd759"], - "setDefinitionID": "9203534e-6816-e811-80d0-1402ec7222b5", - "setDefinitionKey": "Contact", - "name": "Contact" } ], "responseContext": {