Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(release): pull release/v1.85.0 into main #3889

Merged
merged 30 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
04c0694
feat: sources v2 spec support along with adapters
vinayteki95 Oct 17, 2024
778b028
chore: unwanted file .python-version removed, updated .gitignore
vinayteki95 Oct 17, 2024
de8faba
chore: lint check github workflow issue for non js files fixed
vinayteki95 Oct 21, 2024
3f8e75d
chore: refactoring version conversion adapter to readable format
vinayteki95 Oct 25, 2024
5705f2e
chore: stricter types, extra test cases for v2
vinayteki95 Oct 28, 2024
c92ae6e
Merge branch 'develop' into feat.sources-v2-spec-controller
vinayteki95 Nov 12, 2024
7ad4423
chore: remove query_parameter injection
vinayteki95 Nov 12, 2024
640a11e
feat: moved userSchema to connection config in GARL vdmv2 (#3870)
sandeepdsvs Nov 12, 2024
70ab9c8
chore: fix workflow to consider empty commits
vinayteki95 Nov 12, 2024
839281b
Merge branch 'develop' into feat.sources-v2-spec-controller
vinayteki95 Nov 12, 2024
1c134f8
feat: iterable EUDC (#3828)
aanshi07 Nov 13, 2024
383584f
chore(release): pull main into develop post release v1.84.0 (#3874)
shrouti1507 Nov 13, 2024
51bbc02
feat: now getting consent related fields from connection config from …
sandeepdsvs Nov 13, 2024
704e9bd
Merge branch 'develop' into feat.sources-v2-spec-controller
vinayteki95 Nov 13, 2024
e6b5fb7
chore: output of conversion is optional
vinayteki95 Nov 13, 2024
e90d2ad
chore: added test cases for v1-v2 conversion errors
vinayteki95 Nov 13, 2024
c51cfbb
feat: sources v2 spec support along with adapters (#3810)
vinayteki95 Nov 13, 2024
12ac3de
feat: added support to eu/us2 datacenter for gainsight px destination…
manish339k Nov 15, 2024
6554893
chore: clean up Marketo implementation for file upload et al (#3872)
utsabc Nov 15, 2024
3d7db73
feat: onboarding intercom v2 retl support (#3843)
manish339k Nov 15, 2024
becb4fa
feat: iterable EUDC deleteUsers (#3881)
aanshi07 Nov 15, 2024
c43f0bd
chore(shopify): seperate pixel server side events logic from legacy t…
yashasvibajpai Nov 15, 2024
a80f874
fix: adding uuid transformation for airship (#3884)
shrouti1507 Nov 18, 2024
0aeaa39
fix: revert gaec changes (#3885)
aashishmalik Nov 18, 2024
f3ff409
feat: onboard linkedin audience destination (#3857)
ItsSudip Nov 18, 2024
d57f48e
fix: handling invalid timestamp for adjust source (#3866)
shrouti1507 Nov 18, 2024
8520278
feat: update pinterest_tag single product events with new mapping (#3…
ItsSudip Nov 18, 2024
74fab0e
chore: test case cleanup (#3888)
krishna2020 Nov 18, 2024
79e5979
fix: adding logger for undefined source event (#3879)
shrouti1507 Nov 18, 2024
f3b0300
chore(release): 1.85.0
web-flow Nov 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/verify.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Verify

Check warning on line 1 in .github/workflows/verify.yml

View workflow job for this annotation

GitHub Actions / Check for formatting & lint errors

File ignored by default.

on:
pull_request:
Expand Down Expand Up @@ -33,9 +33,19 @@
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Filter JS/TS Files
run: |
echo "${{ steps.files.outputs.added_modified }}" | tr ' ' '\n' | grep -E '\.(js|ts|jsx|tsx)$' > changed_files.txt
if [ ! -s changed_files.txt ]; then
echo "No JS/TS files to format or lint."
exit 0
fi

- name: Run format Checks
run: |
npx prettier ${{steps.files.outputs.added_modified}} --write
if [ -s changed_files.txt ]; then
npx prettier --write $(cat changed_files.txt)
fi

- run: git diff --exit-code

Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Logs

Check warning on line 1 in .gitignore

View workflow job for this annotation

GitHub Actions / Check for formatting & lint errors

File ignored by default.
logs
*.log
npm-debug.log*
Expand Down Expand Up @@ -122,6 +122,7 @@

# Stores VSCode versions used for testing VSCode extensions
.vscode-test
.vscode

# yarn v2
.yarn/cache
Expand All @@ -133,9 +134,9 @@
# Others
**/.DS_Store
.dccache

.python-version
.idea

# component test report
test_reports/
temp/
temp/
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,30 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [1.85.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.84.0...v1.85.0) (2024-11-18)


### Features

* added support to eu/us2 datacenter for gainsight px destination ([#3871](https://github.com/rudderlabs/rudder-transformer/issues/3871)) ([12ac3de](https://github.com/rudderlabs/rudder-transformer/commit/12ac3de6e7cc91a6cd52c33bc342f74bbaa8a631))
* iterable EUDC ([#3828](https://github.com/rudderlabs/rudder-transformer/issues/3828)) ([1c134f8](https://github.com/rudderlabs/rudder-transformer/commit/1c134f84601aaea78581078137cb9955de576f9e))
* iterable EUDC deleteUsers ([#3881](https://github.com/rudderlabs/rudder-transformer/issues/3881)) ([becb4fa](https://github.com/rudderlabs/rudder-transformer/commit/becb4fa54e9093ed69779f54c36864cb9d28d321))
* moved userSchema to connection config in GARL vdmv2 ([#3870](https://github.com/rudderlabs/rudder-transformer/issues/3870)) ([640a11e](https://github.com/rudderlabs/rudder-transformer/commit/640a11eb3dca5735fed3ad9ad5bd058974b069d6))
* now getting consent related fields from connection config from retl for GARL ([#3877](https://github.com/rudderlabs/rudder-transformer/issues/3877)) ([51bbc02](https://github.com/rudderlabs/rudder-transformer/commit/51bbc02d5b00ce1b8fe8c91b4a7041e926bae9bd))
* onboard linkedin audience destination ([#3857](https://github.com/rudderlabs/rudder-transformer/issues/3857)) ([f3ff409](https://github.com/rudderlabs/rudder-transformer/commit/f3ff4092d455508dd3354ffb22d345fa97f4d1f2))
* onboarding intercom v2 retl support ([#3843](https://github.com/rudderlabs/rudder-transformer/issues/3843)) ([3d7db73](https://github.com/rudderlabs/rudder-transformer/commit/3d7db7366e30df31c37cc473e344da82b49ed885))
* sources v2 spec support along with adapters ([04c0694](https://github.com/rudderlabs/rudder-transformer/commit/04c069486bdd3c101906fa6c621e983090fcab25))
* sources v2 spec support along with adapters ([#3810](https://github.com/rudderlabs/rudder-transformer/issues/3810)) ([c51cfbb](https://github.com/rudderlabs/rudder-transformer/commit/c51cfbb4664a8531dce23b2d06fe40997f95697e))
* update pinterest_tag single product events with new mapping ([#3858](https://github.com/rudderlabs/rudder-transformer/issues/3858)) ([8520278](https://github.com/rudderlabs/rudder-transformer/commit/85202781de3464bd46fe910159d2b143cd4209e8))


### Bug Fixes

* adding logger for undefined source event ([#3879](https://github.com/rudderlabs/rudder-transformer/issues/3879)) ([79e5979](https://github.com/rudderlabs/rudder-transformer/commit/79e597907eee126b4187e4534b2aa2253d1431da))
* adding uuid transformation for airship ([#3884](https://github.com/rudderlabs/rudder-transformer/issues/3884)) ([a80f874](https://github.com/rudderlabs/rudder-transformer/commit/a80f87486dc93b423e4fe6efbee6f4cb8330ba02))
* handling invalid timestamp for adjust source ([#3866](https://github.com/rudderlabs/rudder-transformer/issues/3866)) ([d57f48e](https://github.com/rudderlabs/rudder-transformer/commit/d57f48e989d18d469bea0de94293bc685300945b))
* revert gaec changes ([#3885](https://github.com/rudderlabs/rudder-transformer/issues/3885)) ([0aeaa39](https://github.com/rudderlabs/rudder-transformer/commit/0aeaa391b025fc68de6e3d63a6721f067c5be318))

## [1.84.0](https://github.com/rudderlabs/rudder-transformer/compare/v1.83.2...v1.84.0) (2024-11-11)


Expand Down
18 changes: 10 additions & 8 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rudder-transformer",
"version": "1.84.0",
"version": "1.85.0",
"description": "",
"homepage": "https://github.com/rudderlabs/rudder-transformer#readme",
"bugs": {
Expand Down Expand Up @@ -64,7 +64,7 @@
"@koa/router": "^12.0.0",
"@ndhoule/extend": "^2.0.0",
"@pyroscope/nodejs": "^0.2.9",
"@rudderstack/integrations-lib": "^0.2.12",
"@rudderstack/integrations-lib": "^0.2.13",
"@rudderstack/json-template-engine": "^0.18.0",
"@rudderstack/workflow-engine": "^0.8.13",
"@shopify/jest-koa-mocks": "^5.1.1",
Expand Down Expand Up @@ -118,7 +118,7 @@
"truncate-utf8-bytes": "^1.0.2",
"ua-parser-js": "^1.0.37",
"unset-value": "^2.0.1",
"uuid": "^9.0.0",
"uuid": "^9.0.1",
"valid-url": "^1.0.9",
"zod": "^3.22.4"
},
Expand Down
10 changes: 10 additions & 0 deletions src/cdk/v2/destinations/linkedin_audience/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export const SUPPORTED_EVENT_TYPE = 'record';
export const ACTION_TYPES = ['insert', 'delete'];
export const BASE_ENDPOINT = 'https://api.linkedin.com/rest';
export const USER_ENDPOINT = '/dmpSegments/audienceId/users';
export const COMPANY_ENDPOINT = '/dmpSegments/audienceId/companies';
export const FIELD_MAP = {
sha256Email: 'SHA256_EMAIL',
sha512Email: 'SHA512_EMAIL',
googleAid: 'GOOGLE_AID',
};
89 changes: 89 additions & 0 deletions src/cdk/v2/destinations/linkedin_audience/procWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
bindings:
- path: ./config
exportAll: true
- path: ./utils
exportAll: true
- name: defaultRequestConfig
path: ../../../../v0/util

steps:
- name: validateInput
description: Validate input, if all the required fields are available or not.
template: |
const config = .connection.config.destination;
const secret = .metadata.secret;
let messageType = .message.type;
$.assertConfig(config.audienceId, "Audience Id is not present. Aborting");
$.assertConfig(secret.accessToken, "Access Token is not present. Aborting");
$.assertConfig(config.audienceType, "audienceType is not present. Aborting");
$.assert(messageType, "Message Type is not present. Aborting message.");
$.assert(messageType.toLowerCase() === $.SUPPORTED_EVENT_TYPE, `Event type ${.message.type.toLowerCase()} is not supported. Aborting message.`);
$.assert(.message.fields, "`fields` is not present. Aborting message.");
$.assert(.message.identifiers, "`identifiers` is not present inside properties. Aborting message.");
$.assert($.containsAll([.message.action], $.ACTION_TYPES), "Unsupported action type. Aborting message.")

- name: getConfigs
description: This step fetches the configs from different places and combines them.
template: |
const config = .connection.config.destination;
{
audienceType: config.audienceType,
audienceId: config.audienceId,
accessToken: .metadata.secret.accessToken,
isHashRequired: config.isHashRequired,
}

- name: prepareUserTypeBasePayload
condition: $.outputs.getConfigs.audienceType === 'user'
steps:
- name: prepareUserIds
description: Prepare user ids for user audience type
template: |
const identifiers = $.outputs.getConfigs.isHashRequired === true ?
$.hashIdentifiers(.message.identifiers) :
.message.identifiers;
$.prepareUserIds(identifiers)

- name: preparePayload
description: Prepare base payload for user audiences
template: |
const payload = {
'elements': [
{
'action': $.generateActionType(.message.action),
'userIds': $.outputs.prepareUserTypeBasePayload.prepareUserIds,
....message.fields
}
]
}
payload;

- name: prepareCompanyTypeBasePayload
description: Prepare base payload for company audiences
condition: $.outputs.getConfigs.audienceType === 'company'
template: |
const payload = {
'elements': [
{
'action': $.generateActionType(.message.action),
....message.identifiers,
....message.fields
}
]
}
payload;

- name: buildResponseForProcessTransformation
description: build response depending upon batch size
template: |
const response = $.defaultRequestConfig();
response.body.JSON = {...$.outputs.prepareUserTypeBasePayload, ...$.outputs.prepareCompanyTypeBasePayload};
response.endpoint = $.generateEndpoint($.outputs.getConfigs.audienceType, $.outputs.getConfigs.audienceId);
response.headers = {
"Authorization": "Bearer " + $.outputs.getConfigs.accessToken,
"Content-Type": "application/json",
"X-RestLi-Method": "BATCH_CREATE",
"X-Restli-Protocol-Version": "2.0.0",
"LinkedIn-Version": "202409"
};
response;
40 changes: 40 additions & 0 deletions src/cdk/v2/destinations/linkedin_audience/rtWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
bindings:
- path: ./utils
- name: handleRtTfSingleEventError
path: ../../../../v0/util/index

steps:
- name: validateInput
template: |
$.assert(Array.isArray(^) && ^.length > 0, "Invalid event array")

- name: transform
externalWorkflow:
path: ./procWorkflow.yaml
bindings:
- name: batchMode
value: true
loopOverInput: true

- name: successfulEvents
template: |
$.outputs.transform#idx.output.({
"message": .[],
"destination": ^ [idx].destination,
"metadata": ^ [idx].metadata
})[]

- name: failedEvents
template: |
$.outputs.transform#idx.error.(
$.handleRtTfSingleEventError(^[idx], .originalError ?? ., {})
)[]

- name: batchSuccessfulEvents
description: Batches the successfulEvents
template: |
$.batchResponseBuilder($.outputs.successfulEvents);

- name: finalPayload
template: |
[...$.outputs.batchSuccessfulEvents, ...$.outputs.failedEvents]
87 changes: 87 additions & 0 deletions src/cdk/v2/destinations/linkedin_audience/utils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import lodash from 'lodash';
import { hashToSha256 } from '@rudderstack/integrations-lib';
import { createHash } from 'crypto';
import { BASE_ENDPOINT, COMPANY_ENDPOINT, FIELD_MAP, USER_ENDPOINT } from './config';

export function hashIdentifiers(identifiers: string[]): Record<string, string> {
const hashedIdentifiers = {};
Object.keys(identifiers).forEach((key) => {
if (key === 'sha256Email') {
hashedIdentifiers[key] = hashToSha256(identifiers[key]);
} else if (key === 'sha512Email') {
hashedIdentifiers[key] = createHash('sha512').update(identifiers[key]).digest('hex');
} else {
hashedIdentifiers[key] = identifiers[key];

Check warning on line 14 in src/cdk/v2/destinations/linkedin_audience/utils.ts

View check run for this annotation

Codecov / codecov/patch

src/cdk/v2/destinations/linkedin_audience/utils.ts#L13-L14

Added lines #L13 - L14 were not covered by tests
}
});
return hashedIdentifiers;
}

export function prepareUserIds(
identifiers: Record<string, string>,
): { idType: string; idValue: string }[] {
const userIds: { idType: string; idValue: string }[] = [];
Object.keys(identifiers).forEach((key) => {
userIds.push({ idType: FIELD_MAP[key], idValue: identifiers[key] });
});
return userIds;
}

export function generateEndpoint(audienceType: string, audienceId: string) {
if (audienceType === 'user') {
return BASE_ENDPOINT + USER_ENDPOINT.replace('audienceId', audienceId);
}
return BASE_ENDPOINT + COMPANY_ENDPOINT.replace('audienceId', audienceId);
}

export function batchResponseBuilder(successfulEvents) {
const chunkOnActionType = lodash.groupBy(
successfulEvents,
(event) => event.message[0].body.JSON.elements[0].action,
);
const result: any = [];
Object.keys(chunkOnActionType).forEach((actionType) => {
const firstEvent = chunkOnActionType[actionType][0];
const { method, endpoint, headers, type, version } = firstEvent.message[0];
const batchEvent = {
batchedRequest: {
body: {
JSON: { elements: firstEvent.message[0].body.JSON.elements },
JSON_ARRAY: {},
XML: {},
FORM: {},
},
version,
type,
method,
endpoint,
headers,
params: {},
files: {},
},
metadata: [firstEvent.metadata],
batched: true,
statusCode: 200,
destination: firstEvent.destination,
};
firstEvent.metadata = [firstEvent.metadata];
chunkOnActionType[actionType].forEach((element, index) => {
if (index !== 0) {
batchEvent.batchedRequest.body.JSON.elements.push(element.message[0].body.JSON.elements[0]);
batchEvent.metadata.push(element.metadata);
}
});
result.push(batchEvent);
});
return result;
}

export const generateActionType = (actionType: string): string => {
if (actionType === 'insert') {
return 'ADD';
}
if (actionType === 'delete') {
return 'REMOVE';

Check warning on line 84 in src/cdk/v2/destinations/linkedin_audience/utils.ts

View check run for this annotation

Codecov / codecov/patch

src/cdk/v2/destinations/linkedin_audience/utils.ts#L84

Added line #L84 was not covered by tests
}
return actionType;

Check warning on line 86 in src/cdk/v2/destinations/linkedin_audience/utils.ts

View check run for this annotation

Codecov / codecov/patch

src/cdk/v2/destinations/linkedin_audience/utils.ts#L86

Added line #L86 was not covered by tests
};
Loading
Loading