diff --git a/packages/destination-actions/src/destinations/liveramp-audiences/__tests__/__snapshots__/snapshot.test.ts.snap b/packages/destination-actions/src/destinations/liveramp-audiences/__tests__/__snapshots__/snapshot.test.ts.snap index b0b90d1c8c..ba18b90da5 100644 --- a/packages/destination-actions/src/destinations/liveramp-audiences/__tests__/__snapshots__/snapshot.test.ts.snap +++ b/packages/destination-actions/src/destinations/liveramp-audiences/__tests__/__snapshots__/snapshot.test.ts.snap @@ -1,73 +1,73 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Testing snapshot for LiverampAudiences's audienceEnteredS3 destination action: all fields 1`] = ` -"audience_key,testType,testType -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\"" +"audience_key,testType +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\"" `; exports[`Testing snapshot for LiverampAudiences's audienceEnteredS3 destination action: missing minimum payload size 1`] = `[PayloadValidationError: received payload count below LiveRamp's ingestion limits. expected: >=25 actual: 1]`; exports[`Testing snapshot for LiverampAudiences's audienceEnteredS3 destination action: required fields 1`] = ` -"audience_key,testType,testType -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" -\\"8I!3YmPiv2%lv7\\",\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\"" +"audience_key,testType +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\" +\\"8I!3YmPiv2%lv7\\",\\"047e87c5aeaa6844b0125de813f7683f636401c49b092afd324d2c32d21ccaff\\"" `; exports[`Testing snapshot for LiverampAudiences's audienceEnteredS3 destination action: required fields 2`] = ` Headers { Symbol(map): Object { "authorization": Array [ - "AWS4-HMAC-SHA256 Credential=12345/19700101/us-west/s3/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=4a5564353d61d819ae9759a627f4a4e9e0fd4acde988984d3220c391f0abde5e", + "AWS4-HMAC-SHA256 Credential=12345/19700101/us-west/s3/aws4_request, SignedHeaders=content-length;content-type;host;x-amz-content-sha256;x-amz-date, Signature=4d3fa5773e208c949b4c6278e1eb76fdc88ddb4c9ebece9ffacf3e40e1ff2a51", ], "content-length": Array [ - "2555", + "2121", ], "content-type": Array [ "application/x-www-form-urlencoded; charset=utf-8", @@ -79,7 +79,7 @@ Headers { "Segment (Actions)", ], "x-amz-content-sha256": Array [ - "7fced28a29b028b75193be3b3824c4df2fcc96ba80b74a741afc069f54bd6156", + "a8ed2a4ab5e742f5669c17ebc3f5cb0f79dc29fd08c23aa41a1e27a8c339b957", ], "x-amz-date": Array [ "19700101T000012Z", @@ -114,15 +114,6 @@ Array [ 121, 112, 101, - 44, - 116, - 101, - 115, - 116, - 84, - 121, - 112, - 101, 10, 34, 105, @@ -139,20 +130,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -234,20 +211,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -329,20 +292,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -424,20 +373,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -519,20 +454,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -614,20 +535,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -709,20 +616,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -804,20 +697,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -899,20 +778,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -994,20 +859,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1089,20 +940,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1184,20 +1021,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1279,20 +1102,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1374,20 +1183,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1469,20 +1264,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1564,20 +1345,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1659,20 +1426,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1754,20 +1507,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1849,20 +1588,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -1944,20 +1669,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2039,20 +1750,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2134,20 +1831,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2210,24 +1893,10 @@ Array [ 53, 101, 100, - 56, - 51, - 34, - 10, - 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, + 56, + 51, 34, - 44, + 10, 34, 105, 50, @@ -2324,20 +1993,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2419,20 +2074,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2527,15 +2168,6 @@ Array [ 121, 112, 101, - 44, - 116, - 101, - 115, - 116, - 84, - 121, - 112, - 101, 10, 34, 105, @@ -2552,20 +2184,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2647,20 +2265,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2742,20 +2346,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2837,20 +2427,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -2932,20 +2508,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3027,20 +2589,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3122,20 +2670,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3217,20 +2751,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3312,20 +2832,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3407,20 +2913,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3502,20 +2994,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3597,20 +3075,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3692,20 +3156,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3787,20 +3237,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -3860,27 +3296,13 @@ Array [ 55, 102, 52, - 53, - 101, - 100, - 56, - 51, - 34, - 10, - 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, + 53, + 101, + 100, + 56, + 51, 34, - 44, + 10, 34, 105, 50, @@ -3977,20 +3399,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4072,20 +3480,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4167,20 +3561,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4262,20 +3642,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4357,20 +3723,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4452,20 +3804,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4547,20 +3885,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4642,20 +3966,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4737,20 +4047,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4832,20 +4128,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -4947,15 +4229,6 @@ Array [ 121, 112, 101, - 44, - 116, - 101, - 115, - 116, - 84, - 121, - 112, - 101, 10, 34, 105, @@ -4972,20 +4245,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5067,20 +4326,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5162,20 +4407,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5257,20 +4488,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5352,20 +4569,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5447,20 +4650,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5523,24 +4712,10 @@ Array [ 53, 101, 100, - 56, - 51, - 34, - 10, - 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, + 56, + 51, 34, - 44, + 10, 34, 105, 50, @@ -5637,20 +4812,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5732,20 +4893,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5827,20 +4974,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -5922,20 +5055,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6017,20 +5136,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6112,20 +5217,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6207,20 +5298,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6302,20 +5379,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6397,20 +5460,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6492,20 +5541,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6587,20 +5622,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6682,20 +5703,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6777,20 +5784,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6872,20 +5865,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -6967,20 +5946,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -7062,20 +6027,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -7157,20 +6108,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, @@ -7252,20 +6189,6 @@ Array [ 34, 44, 34, - 105, - 50, - 57, - 57, - 56, - 41, - 66, - 97, - 77, - 111, - 122, - 34, - 44, - 34, 50, 102, 54, diff --git a/packages/destination-actions/src/destinations/liveramp-audiences/__tests__/operations.test.ts b/packages/destination-actions/src/destinations/liveramp-audiences/__tests__/operations.test.ts new file mode 100644 index 0000000000..59b601f98c --- /dev/null +++ b/packages/destination-actions/src/destinations/liveramp-audiences/__tests__/operations.test.ts @@ -0,0 +1,90 @@ +import { generateFile } from '../operations' +import type { Payload } from '../audienceEnteredSftp/generated-types' + +describe(`Test operations helper functions:`, () => { + it('should generate CSV with hashed and unhashed identifier data', async () => { + const payloads: Payload[] = [ + // Entry with hashed identifier data + { + audience_key: 'aud001', + delimiter: ',', + identifier_data: { + email: '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b' + }, + filename: 'test_file_name.csv', + enable_batching: true + }, + // Entry with unhashed identifier data + { + audience_key: 'aud002', + delimiter: ',', + unhashed_identifier_data: { + email: 'test@example.com' + }, + filename: 'test_file_name.csv', + enable_batching: true + }, + // Entry with both hashed and unhashed identifier data + { + audience_key: 'aud003', + delimiter: ',', + identifier_data: { + email: '973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b' + }, + unhashed_identifier_data: { + email: 'test@example.com' + }, + filename: 'test_file_name.csv', + enable_batching: true + } + ] + + const result = generateFile(payloads) + + const expectedFileContents = `audience_key,email\n"aud001","973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b"\n"aud002","973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b"\n"aud003","973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b"` + + expect(result).toMatchObject({ + filename: 'test_file_name.csv', + fileContents: Buffer.from(expectedFileContents) + }) + }) + + it('should generate CSV even if rows have missing data', async () => { + const payloads: Payload[] = [ + { + audience_key: 'aud001', + delimiter: ',', + filename: 'test_file_name.csv', + enable_batching: true + }, + { + audience_key: 'aud002', + delimiter: ',', + unhashed_identifier_data: { + email: 'test@example.com' + }, + filename: 'test_file_name.csv', + enable_batching: true + }, + { + audience_key: 'aud003', + delimiter: ',', + unhashed_identifier_data: { + email: 'test@example.com', + example_identifier: 'example-id' + }, + filename: 'test_file_name.csv', + enable_batching: true + } + ] + + const result = generateFile(payloads) + + const expectedFileContents = `audience_key,email,example_identifier\n"aud001"\n"aud002","973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b"\n"aud003","973dfe463ec85785f5f95af5ba3906eedb2d931c24e69824a89ea65dba4e813b","66a0acf498240ea61ce3ce698c5a30eb6824242b39695f8689d7c32499c79748"` + + expect(result).toMatchObject({ + filename: 'test_file_name.csv', + fileContents: Buffer.from(expectedFileContents) + }) + }) +}) diff --git a/packages/destination-actions/src/destinations/liveramp-audiences/operations.ts b/packages/destination-actions/src/destinations/liveramp-audiences/operations.ts index de59b96dcf..ab519399cf 100644 --- a/packages/destination-actions/src/destinations/liveramp-audiences/operations.ts +++ b/packages/destination-actions/src/destinations/liveramp-audiences/operations.ts @@ -32,45 +32,44 @@ Generates the LiveRamp ingestion file. Expected format: liveramp_audience_key[1],identifier_data[0..n] */ function generateFile(payloads: s3Payload[] | sftpPayload[]) { - const headers: string[] = ['audience_key'] + // Using a Set to keep track of headers + const headers = new Set() + headers.add('audience_key') - // Prepare header row - if (payloads[0].identifier_data) { - for (const identifier of Object.getOwnPropertyNames(payloads[0].identifier_data)) { - headers.push(identifier) - } - } - - if (payloads[0].unhashed_identifier_data) { - for (const identifier of Object.getOwnPropertyNames(payloads[0].unhashed_identifier_data)) { - headers.push(identifier) - } - } - - let rows = Buffer.from(headers.join(payloads[0].delimiter) + '\n') + // Declare rows as an empty Buffer + let rows = Buffer.from('') // Prepare data rows for (let i = 0; i < payloads.length; i++) { const payload = payloads[i] const row: string[] = [enquoteIdentifier(payload.audience_key)] - if (payload.identifier_data) { - for (const key in payload.identifier_data) { - if (Object.prototype.hasOwnProperty.call(payload.identifier_data, key)) { - row.push(enquoteIdentifier(String(payload.identifier_data[key]))) - } - } - } + // Process unhashed_identifier_data first if (payload.unhashed_identifier_data) { for (const key in payload.unhashed_identifier_data) { if (Object.prototype.hasOwnProperty.call(payload.unhashed_identifier_data, key)) { + headers.add(key) row.push(`"${hash(normalize(key, String(payload.unhashed_identifier_data[key])))}"`) } } } + + // Process identifier_data, skipping keys that have already been processed + if (payload.identifier_data) { + for (const key in payload.identifier_data) { + if (Object.prototype.hasOwnProperty.call(payload.identifier_data, key) && !headers.has(key)) { + headers.add(key) + row.push(enquoteIdentifier(String(payload.identifier_data[key]))) + } + } + } + rows = Buffer.concat([rows, Buffer.from(row.join(payload.delimiter) + (i + 1 === payloads.length ? '' : '\n'))]) } + // Add headers to the beginning of the file contents + rows = Buffer.concat([Buffer.from(Array.from(headers).join(payloads[0].delimiter) + '\n'), rows]) + const filename = payloads[0].filename return { filename, fileContents: rows } }