mcdev 5.1.0 → 5.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +4 -4
- package/.fork/custom-commands.json +12 -0
- package/.github/ISSUE_TEMPLATE/bug.yml +2 -0
- package/.github/PULL_REQUEST_TEMPLATE/pr_template_release.md +19 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +2 -2
- package/.github/workflows/coverage-develop-branch.yml +0 -2
- package/.github/workflows/coverage-main-branch.yml +0 -2
- package/.github/workflows/coverage.yml +0 -2
- package/.husky/post-checkout +1 -0
- package/.husky/post-merge +1 -0
- package/.vscode/extensions.json +4 -0
- package/docs/dist/documentation.md +1034 -296
- package/lib/Deployer.js +25 -25
- package/lib/MetadataTypeDefinitions.js +2 -1
- package/lib/MetadataTypeInfo.js +2 -1
- package/lib/Retriever.js +1 -1
- package/lib/cli.js +165 -10
- package/lib/index.js +398 -95
- package/lib/metadataTypes/Asset.js +10 -11
- package/lib/metadataTypes/AttributeGroup.js +76 -2
- package/lib/metadataTypes/AttributeSet.js +367 -0
- package/lib/metadataTypes/Automation.js +483 -137
- package/lib/metadataTypes/DataExtension.js +465 -68
- package/lib/metadataTypes/DataExtensionField.js +31 -14
- package/lib/metadataTypes/Event.js +2 -3
- package/lib/metadataTypes/Folder.js +1 -1
- package/lib/metadataTypes/Journey.js +13 -7
- package/lib/metadataTypes/MetadataType.js +212 -54
- package/lib/metadataTypes/MobileKeyword.js +9 -9
- package/lib/metadataTypes/MobileMessage.js +5 -5
- package/lib/metadataTypes/Query.js +26 -10
- package/lib/metadataTypes/Script.js +3 -3
- package/lib/metadataTypes/TransactionalEmail.js +94 -17
- package/lib/metadataTypes/TransactionalMessage.js +3 -2
- package/lib/metadataTypes/TransactionalSMS.js +5 -5
- package/lib/metadataTypes/TriggeredSend.js +25 -50
- package/lib/metadataTypes/User.js +7 -4
- package/lib/metadataTypes/Verification.js +230 -0
- package/lib/metadataTypes/definitions/AttributeGroup.definition.js +119 -108
- package/lib/metadataTypes/definitions/{SetDefinition.definition.js → AttributeSet.definition.js} +123 -43
- package/lib/metadataTypes/definitions/Automation.definition.js +23 -15
- package/lib/metadataTypes/definitions/ImportFile.definition.js +36 -6
- package/lib/metadataTypes/definitions/TransactionalEmail.definition.js +19 -1
- package/lib/metadataTypes/definitions/TriggeredSend.definition.js +1 -0
- package/lib/metadataTypes/definitions/Verification.definition.js +88 -0
- package/lib/util/cache.js +9 -4
- package/lib/util/cli.js +40 -0
- package/lib/util/file.js +2 -2
- package/lib/util/init.js +84 -0
- package/lib/util/util.js +121 -13
- package/package.json +13 -13
- package/test/mockRoot/.mcdevrc.json +1 -1
- package/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testExisting_dataExtensionShared.dataExtension-meta.json +59 -0
- package/test/mockRoot/deploy/testInstance/_ParentBU_/dataExtension/testNew_dataExtensionShared.dataExtension-meta.json +23 -0
- package/test/mockRoot/deploy/testInstance/testBU/automation/testExisting_automation.automation-meta.json +1 -2
- package/test/mockRoot/deploy/testInstance/testBU/automation/testNew_automation.automation-meta.json +9 -6
- package/test/mockRoot/deploy/testInstance/testBU/dataExtension/testExisting_dataExtension.dataExtension-meta.json +1 -0
- package/test/mockRoot/deploy/testInstance/testBU/dataExtract/testExisting_dataExtract.dataExtract-meta.json +35 -0
- package/test/mockRoot/deploy/testInstance/testBU/dataExtract/testNew_dataExtract.dataExtract-meta.json +35 -0
- package/test/mockRoot/deploy/testInstance/testBU/fileTransfer/testExisting_fileTransfer.fileTransfer-meta.json +17 -0
- package/test/mockRoot/deploy/testInstance/testBU/fileTransfer/testNew_fileTransfer.fileTransfer-meta.json +17 -0
- package/test/mockRoot/deploy/testInstance/testBU/importFile/testExisting_importFile.importFile-meta.json +29 -0
- package/test/mockRoot/deploy/testInstance/testBU/importFile/testNew_importFile.importFile-meta.json +29 -0
- package/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.json +11 -0
- package/test/mockRoot/deploy/testInstance/testBU/query/testExisting_query_fixKeys.query-meta.sql +6 -0
- package/test/mockRoot/deploy/testInstance/testBU/script/testExisting_script.script-meta.json +6 -0
- package/test/mockRoot/deploy/testInstance/testBU/script/testExisting_script.script-meta.ssjs +1 -0
- package/test/mockRoot/deploy/testInstance/testBU/script/testNew_script.script-meta.json +6 -0
- package/test/mockRoot/deploy/testInstance/testBU/script/testNew_script.script-meta.ssjs +1 -0
- package/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testExisting_temail.transactionalEmail-meta.json +3 -4
- package/test/mockRoot/deploy/testInstance/testBU/transactionalEmail/testNew_temail.transactionalEmail-meta.json +1 -6
- package/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testExisting_triggeredSend.triggeredSend-meta.json +29 -0
- package/test/mockRoot/deploy/testInstance/testBU/triggeredSend/testNew_triggeredSend.triggeredSend-meta.json +29 -0
- package/test/mockRoot/deploy/testInstance/testBU/verification/testExisting_39f6a488-20eb-4ba0-b0b9.verification-meta.json +11 -0
- package/test/mockRoot/deploy/testInstance/testBU/verification/testNew_39f6a488-20eb-4ba0-b0b9.verification-meta.json +11 -0
- package/test/resourceFactory.js +77 -12
- package/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDCustomerKey=testExisting_userANDEmaillike@-response.xml +27 -0
- package/test/resources/1111111/accountUser/retrieve-ActiveFlag=falseANDEmaillike@-response.xml +156 -0
- package/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml +87 -0
- package/test/resources/1111111/accountUser/retrieve-ActiveFlag=trueANDEmaillike@-response.xml +156 -0
- package/test/resources/1111111/accountUser/retrieve-CustomerKey=testExisting_userANDActiveFlag=trueANDEmailisNullORNamelikeapp userANDMustChangePassword=false-response.xml +27 -0
- package/test/resources/1111111/accountUserAccount/retrieve-AccountUser.AccountUserID=700301950-response.xml +60 -0
- package/test/resources/1111111/data/v1/customobjectdata/key/testExisting_dataExtensionShared/rowset/get-response.json +13 -0
- package/test/resources/1111111/dataExtension/create-expected.json +23 -0
- package/test/resources/1111111/dataExtension/create-response.xml +59 -0
- package/test/resources/1111111/dataExtension/retrieve-expected.json +55 -0
- package/test/resources/1111111/dataExtension/retrieve-expected.md +18 -0
- package/test/resources/1111111/dataExtension/retrieve-response.xml +27 -1
- package/test/resources/1111111/dataExtension/update-expected.json +55 -0
- package/test/resources/1111111/dataExtension/update-response.xml +57 -0
- package/test/resources/1111111/dataExtensionField/retrieve-CustomerKey=[testExisting_dataExtensionShared].[TriggerUpdate_randomNumber_]-response.xml +45 -0
- package/test/resources/1111111/dataExtensionField/retrieve-DataExtension.CustomerKey=testExisting_dataExtensionShared-response.xml +98 -0
- package/test/resources/1111111/dataExtensionField/retrieve-DataExtension.CustomerKey=testNew_dataExtensionSharedORDataExtension.CustomerKey=testExisting_dataExtensionShared-response.xml +98 -0
- package/test/resources/1111111/dataExtensionField/retrieve-response.xml +98 -0
- package/test/resources/1111111/dataExtensionTemplate/retrieve-response.xml +303 -0
- package/test/resources/1111111/dataFolder/retrieve-ContentType=synchronizeddataextensionORContentType=shared_salesforcedataextensionORContentType=shared_dataextensionORContentType=shared_dataORContentType=salesforcedataextensionORContentType=dataextensionORContentType=hidden-response.xml +387 -0
- package/test/resources/1111111/dataFolder/retrieve-response.xml +353 -9
- package/test/resources/1111111/user/retrieve-expected.md +4 -2
- package/test/resources/9999999/attributeGroup/retrieve-expected.json +25 -0
- package/test/resources/9999999/attributeSet/retrieve-expected.json +143 -0
- package/test/resources/9999999/automation/build-expected.json +5 -2
- package/test/resources/9999999/automation/create-expected.json +11 -8
- package/test/resources/9999999/automation/create-testNew_automation-expected.md +5 -4
- package/test/resources/9999999/automation/patch_fixKeys-pause-expected.json +44 -0
- package/test/resources/9999999/automation/patch_fixKeys-schedule-expected.json +44 -0
- package/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-ad2e-1f7f8788c560-response.xml +42 -0
- package/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_pause-response.xml +42 -0
- package/test/resources/9999999/automation/perform-08afb0e2-b00a-4c88-fixKey_schedule-response.xml +42 -0
- package/test/resources/9999999/automation/perform-a8afb0e2-b00a-4c88-ad2e-1f7f8788c560-response.xml +42 -0
- package/test/resources/9999999/automation/retrieve-expected.json +5 -2
- package/test/resources/9999999/automation/retrieve-testExisting_automation-expected.md +3 -2
- package/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-ad2e-1f7f8788c560-response.xml +52 -0
- package/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-ad2e-pause-response.xml +38 -0
- package/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_pause-response.xml +52 -0
- package/test/resources/9999999/automation/schedule-08afb0e2-b00a-4c88-fixKey_schedule-response.xml +52 -0
- package/test/resources/9999999/automation/schedule-a8afb0e2-b00a-4c88-ad2e-1f7f8788c560-response.xml +52 -0
- package/test/resources/9999999/automation/template-expected.json +5 -2
- package/test/resources/9999999/automation/update-expected.json +1 -2
- package/test/resources/9999999/automation/update-testExisting_automation-expected.md +2 -2
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +7 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/get-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-ad2e-pause/patch-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/get-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_pause/patch-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/get-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/08afb0e2-b00a-4c88-fixKey_schedule/patch-response.json +85 -0
- package/test/resources/9999999/automation/v1/automations/a8afb0e2-b00a-4c88-ad2e-1f7f8788c560/get-response.json +1 -1
- package/test/resources/9999999/automation/v1/automations/post-response.json +27 -19
- package/test/resources/9999999/automation/v1/dataextracts/56c5370a-f988-4f36-b0ee-0f876573f6d7/patch-response.json +38 -0
- package/test/resources/9999999/automation/v1/dataextracts/post-response.json +38 -0
- package/test/resources/9999999/automation/v1/dataextracttypes/get-response.json +50 -0
- package/test/resources/9999999/automation/v1/dataverifications/post-response.json +12 -0
- package/test/resources/9999999/automation/v1/dataverifications/testExisting_39f6a488-20eb-4ba0-b0b9/delete-response.json +0 -0
- package/test/resources/9999999/automation/v1/dataverifications/testExisting_39f6a488-20eb-4ba0-b0b9/get-response.json +12 -0
- package/test/resources/9999999/automation/v1/dataverifications/testExisting_39f6a488-20eb-4ba0-b0b9/patch-response.json +12 -0
- package/test/resources/9999999/automation/v1/filetransfers/72c328ac-f5b0-4e37-91d3-a775666f15a6/patch-response.json +18 -0
- package/test/resources/9999999/automation/v1/filetransfers/post-response.json +18 -0
- package/test/resources/9999999/automation/v1/ftplocations/get-response.json +18 -0
- package/test/resources/9999999/automation/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b/patch-response.json +31 -0
- package/test/resources/9999999/automation/v1/imports/get-response.json +1 -1
- package/test/resources/9999999/automation/v1/imports/post-response.json +30 -0
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dae/actions/start/post-response.txt +1 -0
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeys/get-response.json +17 -0
- package/test/resources/9999999/automation/v1/queries/549f0568-607c-4940-afef-437965094dat_fixKeys/patch-response.json +18 -0
- package/test/resources/9999999/automation/v1/queries/get-response.json +18 -1
- package/test/resources/9999999/automation/v1/scripts/39f6a488-20eb-4ba0-b0b9-023725b574e4/patch-response.json +10 -0
- package/test/resources/9999999/automation/v1/scripts/get-response.json +12 -2
- package/test/resources/9999999/automation/v1/scripts/post-response.json +10 -0
- package/test/resources/9999999/dataExtension/build-expected.json +16 -0
- package/test/resources/9999999/dataExtension/delete-response.xml +42 -0
- package/test/resources/9999999/dataExtension/retrieve-Name=testExisting_dataExtension-response.xml +52 -0
- package/test/resources/9999999/dataExtension/retrieve-expected.json +16 -0
- package/test/resources/9999999/dataExtension/retrieve-expected.md +3 -1
- package/test/resources/9999999/dataExtension/template-expected.json +16 -0
- package/test/resources/9999999/dataExtension/update-expected.json +17 -1
- package/test/resources/9999999/dataExtensionField/retrieve-CustomerKey=[testExisting_dataExtension].[LastName]-response.xml +44 -0
- package/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testExisting_dataExtension-response.xml +133 -0
- package/test/resources/9999999/dataExtensionField/retrieve-DataExtension.CustomerKey=testNew_dataExtensionORDataExtension.CustomerKey=testExisting_dataExtension-response.xml +99 -0
- package/test/resources/9999999/dataExtensionField/retrieve-response.xml +36 -1
- package/test/resources/9999999/dataExtract/build-expected.json +35 -0
- package/test/resources/9999999/dataExtract/get-expected.json +39 -0
- package/test/resources/9999999/dataExtract/patch-expected.json +37 -0
- package/test/resources/9999999/dataExtract/post-expected.json +37 -0
- package/test/resources/9999999/dataExtract/template-expected.json +35 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=contextual_suppression_listORContentType=publicationORContentType=suppression_listORContentType=mysubsORContentType=list-response.xml +136 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=ssjsactivity-response.xml +48 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=synchronizeddataextensionORContentType=shared_salesforcedataextensionORContentType=shared_dataextensionORContentType=shared_dataORContentType=salesforcedataextensionORContentType=dataextensionORContentType=hidden-response.xml +117 -0
- package/test/resources/9999999/dataFolder/retrieve-ContentType=triggered_send_journeybuilderORContentType=triggered_sendORContentType=hidden-response.xml +276 -0
- package/test/resources/9999999/dataFolder/retrieve-response.xml +23 -0
- package/test/resources/9999999/email/retrieve-response.xml +203 -0
- package/test/resources/9999999/fileTransfer/build-expected.json +15 -0
- package/test/resources/9999999/fileTransfer/get-expected.json +17 -0
- package/test/resources/9999999/fileTransfer/patch-expected.json +17 -0
- package/test/resources/9999999/fileTransfer/post-expected.json +17 -0
- package/test/resources/9999999/fileTransfer/template-expected.json +15 -0
- package/test/resources/9999999/hub/v1/contacts/schema/attributeGroups/get-response.json +628 -0
- package/test/resources/9999999/hub/v1/contacts/schema/setDefinitions/get-response.json +20194 -0
- package/test/resources/9999999/importFile/build-expected.json +27 -0
- package/test/resources/9999999/importFile/get-expected.json +29 -0
- package/test/resources/9999999/importFile/patch-expected.json +29 -0
- package/test/resources/9999999/importFile/post-expected.json +29 -0
- package/test/resources/9999999/importFile/template-expected.json +27 -0
- package/test/resources/9999999/interaction/v1/interactions/233d4413-922c-4568-85a5-e5cc77efc3be/delete-response.json +1 -0
- package/test/resources/9999999/legacy/v1/beta/bulk/automations/automation/definition/get-response.json +1 -1
- package/test/resources/9999999/messaging/v1/email/definitions/post-response.json +1 -1
- package/test/resources/9999999/messaging/v1/email/definitions/testExisting_temail/delete-response.json +6 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_pause-response.xml +32 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixKey_schedule-response.xml +32 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_paused-response.xml +32 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_fixedKey_scheduled-response.xml +32 -0
- package/test/resources/9999999/program/retrieve-CustomerKey=testExisting_automation_pause-response.xml +30 -0
- package/test/resources/9999999/program/retrieve-response.xml +21 -3
- package/test/resources/9999999/query/patch_fixKeys-expected.json +11 -0
- package/test/resources/9999999/query/patch_fixKeys-expected.sql +6 -0
- package/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query_fixKeysANDStatus=Active-response.xml +30 -0
- package/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testExisting_query_fixedKeysANDStatus=Active-response.xml +30 -0
- package/test/resources/9999999/queryDefinition/retrieve-CustomerKey=testNew_queryANDStatus=Active-response.xml +30 -0
- package/test/resources/9999999/script/build-expected.json +6 -0
- package/test/resources/9999999/script/build-expected.ssjs +1 -0
- package/test/resources/9999999/script/get-expected.json +8 -0
- package/test/resources/9999999/script/get-expected.ssjs +1 -0
- package/test/resources/9999999/script/get_noScriptTag-expected.html +1 -0
- package/test/resources/9999999/script/get_noScriptTag-expected.json +8 -0
- package/test/resources/9999999/script/patch-expected.json +8 -0
- package/test/resources/9999999/script/patch-expected.ssjs +1 -0
- package/test/resources/9999999/script/post-expected.json +8 -0
- package/test/resources/9999999/script/post-expected.ssjs +1 -0
- package/test/resources/9999999/script/template-expected.json +6 -0
- package/test/resources/9999999/script/template-expected.ssjs +1 -0
- package/test/resources/9999999/transactionalEmail/build-expected.json +3 -7
- package/test/resources/9999999/transactionalEmail/get-expected.json +3 -7
- package/test/resources/9999999/transactionalEmail/patch-expected.json +3 -7
- package/test/resources/9999999/transactionalEmail/post-expected.json +3 -7
- package/test/resources/9999999/transactionalEmail/template-expected.json +3 -7
- package/test/resources/9999999/triggeredSend/build-expected.json +29 -0
- package/test/resources/9999999/triggeredSend/get-expected.json +29 -0
- package/test/resources/9999999/triggeredSend/patch-expected.json +29 -0
- package/test/resources/9999999/triggeredSend/post-expected.json +29 -0
- package/test/resources/9999999/triggeredSend/template-expected.json +29 -0
- package/test/resources/9999999/triggeredSendDefinition/create-response.xml +75 -0
- package/test/resources/9999999/triggeredSendDefinition/delete-response.xml +36 -0
- package/test/resources/9999999/triggeredSendDefinition/{retrieve-response.xml → retrieve-TriggeredSendStatusINNew,Active,Inactive,Moved,Canceled-response.xml} +4 -4
- package/test/resources/9999999/triggeredSendDefinition/update-response.xml +74 -0
- package/test/resources/9999999/verification/build-expected.json +11 -0
- package/test/resources/9999999/verification/get-expected.json +11 -0
- package/test/resources/9999999/verification/patch-expected.json +11 -0
- package/test/resources/9999999/verification/post-expected.json +11 -0
- package/test/resources/9999999/verification/template-expected.json +11 -0
- package/test/type.attributeGroup.test.js +55 -0
- package/test/type.attributeSet.test.js +55 -0
- package/test/type.automation.test.js +650 -17
- package/test/type.dataExtension.test.js +205 -46
- package/test/type.dataExtract.test.js +194 -0
- package/test/type.fileTransfer.test.js +192 -0
- package/test/type.importFile.test.js +193 -0
- package/test/type.journey.test.js +38 -11
- package/test/type.mobileKeyword.test.js +6 -5
- package/test/type.mobileMessage.test.js +6 -4
- package/test/type.query.test.js +470 -17
- package/test/type.script.test.js +372 -0
- package/test/type.transactionalEmail.test.js +12 -11
- package/test/type.transactionalPush.test.js +2 -4
- package/test/type.transactionalSMS.test.js +2 -4
- package/test/type.triggeredSend.test.js +154 -0
- package/test/type.user.test.js +22 -10
- package/test/type.verification.test.js +173 -0
- package/test/utils.js +11 -2
- package/types/mcdev.d.js +14 -0
- package/lib/metadataTypes/SetDefinition.js +0 -37
- /package/test/resources/1111111/accountUser/{retrieve-response.xml → retrieve-ActiveFlag=trueANDCustomerKey=testExisting_userANDEmaillike@-response.xml} +0 -0
- /package/test/resources/1111111/accountUserAccount/{retrieve-response.xml → retrieve-AccountUser.AccountUserIDIN700301950,700301951,7471228-response.xml} +0 -0
- /package/test/resources/1111111/businessUnit/{retrieve-response.xml → retrieve-ID=1111111-response.xml} +0 -0
- /package/test/resources/1111111/list/{retrieve-response.xml → retrieve-CustomerKey=All SubscribersORListName=All Subscribers-response.xml} +0 -0
- /package/test/resources/1111111/role/{retrieve-response.xml → retrieve-IsPrivate=false-response.xml} +0 -0
- /package/test/resources/9999999/emailSendDefinition/{retrieve-response.xml → retrieve-IsPlatformObject=falseANDDescriptionnotEqualsSFSendDefinition-response.xml} +0 -0
- /package/test/resources/9999999/queryDefinition/{retrieve-response.xml → retrieve-CustomerKey=testExisting_queryANDStatus=Active-response.xml} +0 -0
|
@@ -31,7 +31,7 @@ class DataExtensionField extends MetadataType {
|
|
|
31
31
|
return super.retrieveSOAP(null, requestParams, null, additionalFields);
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* helper for
|
|
34
|
+
* helper for DataExtension.retrieveFieldsForSingleDe that sorts the fields into an array
|
|
35
35
|
*
|
|
36
36
|
* @param {TYPE.DataExtensionFieldMap} fieldsObj customerKey-based list of fields for one dataExtension
|
|
37
37
|
* @returns {TYPE.DataExtensionFieldItem[]} sorted array of field objects
|
|
@@ -99,6 +99,10 @@ class DataExtensionField extends MetadataType {
|
|
|
99
99
|
* @returns {Promise.<Object.<string, TYPE.DataExtensionFieldItem>>} existing fields by their original name to allow re-adding FieldType after update
|
|
100
100
|
*/
|
|
101
101
|
static async prepareDeployColumnsOnUpdate(deployColumns, deKey) {
|
|
102
|
+
// create list of DE keys that had changes to their fields to be able to use it as a filter in the --fixShared logic
|
|
103
|
+
this.fixShared_fields ||= {};
|
|
104
|
+
this.fixShared_fields[deKey] ||= {};
|
|
105
|
+
|
|
102
106
|
// get row count to know which field restrictions apply
|
|
103
107
|
let hasData = false;
|
|
104
108
|
try {
|
|
@@ -184,6 +188,10 @@ class DataExtensionField extends MetadataType {
|
|
|
184
188
|
changeFound = true;
|
|
185
189
|
}
|
|
186
190
|
}
|
|
191
|
+
// share fields with fixShared logic
|
|
192
|
+
this.fixShared_fields[deKey][item.Name] = JSON.parse(JSON.stringify(item));
|
|
193
|
+
this.fixShared_fields[deKey][item.Name].FieldType = itemOld.FieldType;
|
|
194
|
+
|
|
187
195
|
if (!changeFound) {
|
|
188
196
|
deployColumns.splice(i, 1);
|
|
189
197
|
Util.logger.verbose(`no change - removed field [${deKey}].[${item.Name}]`);
|
|
@@ -217,6 +225,8 @@ class DataExtensionField extends MetadataType {
|
|
|
217
225
|
}
|
|
218
226
|
// Field doesn't exist in target, therefore Remove ObjectID if present
|
|
219
227
|
delete item.ObjectID;
|
|
228
|
+
|
|
229
|
+
this.fixShared_fields[deKey][item.Name] = JSON.parse(JSON.stringify(item));
|
|
220
230
|
}
|
|
221
231
|
if (Util.isTrue(item.IsPrimaryKey) && Util.isFalse(item.IsRequired)) {
|
|
222
232
|
// applicable: with or without data
|
|
@@ -248,6 +258,7 @@ class DataExtensionField extends MetadataType {
|
|
|
248
258
|
}` + deployColumns.map((item) => item.Name).join(', ')
|
|
249
259
|
)
|
|
250
260
|
);
|
|
261
|
+
|
|
251
262
|
return existingFieldByName;
|
|
252
263
|
}
|
|
253
264
|
|
|
@@ -265,24 +276,28 @@ class DataExtensionField extends MetadataType {
|
|
|
265
276
|
* Delete a data extension from the specified business unit
|
|
266
277
|
*
|
|
267
278
|
* @param {string} customerKey Identifier of metadata
|
|
279
|
+
* @param {string} [fieldId] for programmatic deletes only one can pass in the ID directly
|
|
268
280
|
* @returns {boolean} deletion success flag
|
|
269
281
|
*/
|
|
270
|
-
static async deleteByKeySOAP(customerKey) {
|
|
282
|
+
static async deleteByKeySOAP(customerKey, fieldId) {
|
|
271
283
|
const [deKey, fieldKey] = customerKey.split('.');
|
|
272
284
|
customerKey = `[${deKey}].[${fieldKey}]`;
|
|
273
285
|
|
|
286
|
+
let fieldObjectID = fieldId;
|
|
274
287
|
// get the object id
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
288
|
+
if (!fieldObjectID) {
|
|
289
|
+
const response = await this.retrieveForCache(
|
|
290
|
+
{
|
|
291
|
+
filter: {
|
|
292
|
+
leftOperand: 'CustomerKey',
|
|
293
|
+
operator: 'equals',
|
|
294
|
+
rightOperand: customerKey,
|
|
295
|
+
},
|
|
281
296
|
},
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
297
|
+
['Name', 'ObjectID']
|
|
298
|
+
);
|
|
299
|
+
fieldObjectID = response.metadata[customerKey]?.ObjectID;
|
|
300
|
+
}
|
|
286
301
|
if (!fieldObjectID) {
|
|
287
302
|
Util.logger.error(`Could not find ${customerKey} on your BU`);
|
|
288
303
|
return false;
|
|
@@ -304,8 +319,10 @@ class DataExtensionField extends MetadataType {
|
|
|
304
319
|
null
|
|
305
320
|
);
|
|
306
321
|
|
|
307
|
-
|
|
308
|
-
|
|
322
|
+
if (!fieldId) {
|
|
323
|
+
Util.logger.info(` - deleted ${this.definition.type}: ${customerKey}`);
|
|
324
|
+
this.postDeleteTasks(customerKey);
|
|
325
|
+
}
|
|
309
326
|
return true;
|
|
310
327
|
} catch (ex) {
|
|
311
328
|
const errorMsg = ex.results?.length
|
|
@@ -136,12 +136,11 @@ class Event extends MetadataType {
|
|
|
136
136
|
* @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField
|
|
137
137
|
* @param {string} deployDir directory where deploy metadata are saved
|
|
138
138
|
* @param {string} retrieveDir directory where metadata after deploy should be saved
|
|
139
|
-
* @param {boolean} [isRefresh] optional flag - so far not used by eventDefinition
|
|
140
139
|
* @returns {Promise.<TYPE.MetadataTypeMap>} Promise of keyField => metadata map
|
|
141
140
|
*/
|
|
142
|
-
static async deploy(metadata, deployDir, retrieveDir
|
|
141
|
+
static async deploy(metadata, deployDir, retrieveDir) {
|
|
143
142
|
Util.logBeta(this.definition.type);
|
|
144
|
-
return super.deploy(metadata, deployDir, retrieveDir
|
|
143
|
+
return super.deploy(metadata, deployDir, retrieveDir);
|
|
145
144
|
}
|
|
146
145
|
|
|
147
146
|
/**
|
|
@@ -452,7 +452,7 @@ class Folder extends MetadataType {
|
|
|
452
452
|
* Returns file contents mapped to their filename without '.json' ending
|
|
453
453
|
*
|
|
454
454
|
* @param {string} dir directory that contains '.json' files to be read
|
|
455
|
-
* @param {boolean} [listBadKeys
|
|
455
|
+
* @param {boolean} [listBadKeys] do not print errors, used for badKeys()
|
|
456
456
|
* @returns {TYPE.MetadataTypeMap} fileName => fileContent map
|
|
457
457
|
*/
|
|
458
458
|
static getJsonFromFS(dir, listBadKeys) {
|
|
@@ -191,14 +191,21 @@ class Journey extends MetadataType {
|
|
|
191
191
|
);
|
|
192
192
|
const results = this.parseResponseBody(response, key);
|
|
193
193
|
singleKey = results[key].id;
|
|
194
|
+
if (version && version > results[key].version) {
|
|
195
|
+
Util.logger.error(
|
|
196
|
+
`The chosen version (${version}) is higher than the latest known version (${results[key].version}). Please choose a lower version.`
|
|
197
|
+
);
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
194
200
|
Util.logger.debug(`Deleting interaction ${key} via its ID ${singleKey}`);
|
|
195
201
|
}
|
|
196
202
|
if (!/^\d+$/.test(version)) {
|
|
197
|
-
|
|
203
|
+
Util.logger.error(
|
|
198
204
|
'Version is required for deleting interactions to avoid accidental deletion of the wrong item. Please append it at the end of the key or id, separated by forward-slash. Example for deleting version 4: ' +
|
|
199
205
|
key +
|
|
200
206
|
'/4'
|
|
201
207
|
);
|
|
208
|
+
return false;
|
|
202
209
|
}
|
|
203
210
|
Util.logger.warn(
|
|
204
211
|
`Deleting Journeys via this command breaks following retrieve-by-key/id requests until you've deployed/created a new draft version! You can get still get the latest available version of your journey by retrieving all interactions on this BU.`
|
|
@@ -216,12 +223,11 @@ class Journey extends MetadataType {
|
|
|
216
223
|
* @param {TYPE.MetadataTypeMap} metadata metadata mapped by their keyField
|
|
217
224
|
* @param {string} deployDir directory where deploy metadata are saved
|
|
218
225
|
* @param {string} retrieveDir directory where metadata after deploy should be saved
|
|
219
|
-
* @param {boolean} [isRefresh] optional flag - so far not used by interaction
|
|
220
226
|
* @returns {Promise.<TYPE.MetadataTypeMap>} Promise of keyField => metadata map
|
|
221
227
|
*/
|
|
222
|
-
static async deploy(metadata, deployDir, retrieveDir
|
|
228
|
+
static async deploy(metadata, deployDir, retrieveDir) {
|
|
223
229
|
Util.logBeta(this.definition.type);
|
|
224
|
-
return super.deploy(metadata, deployDir, retrieveDir
|
|
230
|
+
return super.deploy(metadata, deployDir, retrieveDir);
|
|
225
231
|
}
|
|
226
232
|
|
|
227
233
|
/**
|
|
@@ -265,7 +271,7 @@ class Journey extends MetadataType {
|
|
|
265
271
|
}
|
|
266
272
|
|
|
267
273
|
/**
|
|
268
|
-
* helper for Journey's {@link saveResults}. Gets executed after retreive of metadata type and
|
|
274
|
+
* helper for Journey's {@link Journey.saveResults}. Gets executed after retreive of metadata type and
|
|
269
275
|
*
|
|
270
276
|
* @param {TYPE.MetadataTypeMap} metadataMap key=customer key, value=metadata
|
|
271
277
|
*/
|
|
@@ -478,7 +484,7 @@ class Journey extends MetadataType {
|
|
|
478
484
|
return metadata;
|
|
479
485
|
}
|
|
480
486
|
/**
|
|
481
|
-
* helper for {@link postRetrieveTasks}
|
|
487
|
+
* helper for {@link Journey.postRetrieveTasks}
|
|
482
488
|
*
|
|
483
489
|
* @private
|
|
484
490
|
* @param {TYPE.MetadataTypeItem} metadata a single item
|
|
@@ -800,7 +806,7 @@ class Journey extends MetadataType {
|
|
|
800
806
|
}
|
|
801
807
|
|
|
802
808
|
/**
|
|
803
|
-
* helper for {@link preDeployTasks}
|
|
809
|
+
* helper for {@link Journey.preDeployTasks}
|
|
804
810
|
*
|
|
805
811
|
* @private
|
|
806
812
|
* @param {TYPE.MetadataTypeItem} metadata a single item
|