-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: onboard yandex metrica offline events destination, initial changes
- Loading branch information
1 parent
81290e8
commit b55ef38
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
src/cdk/v2/destinations/yandex_metrica_offline_events/config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const YANDEX_METRICA_OFFLINE_EVENTS = 'yandex_metrica_offline_events'; | ||
|
||
module.exports = { | ||
YANDEX_METRICA_OFFLINE_EVENTS, | ||
}; |
41 changes: 41 additions & 0 deletions
41
src/cdk/v2/destinations/yandex_metrica_offline_events/procWorkflow.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
bindings: | ||
- name: EventType | ||
path: ../../../../constants | ||
- path: ../../bindings/jsontemplate | ||
exportAll: true | ||
- path: ./config | ||
- name: removeUndefinedAndNullValues | ||
path: ../../../../v0/util | ||
- name: defaultRequestConfig | ||
path: ../../../../v0/util | ||
- path: ./utils | ||
|
||
steps: | ||
- name: validateInput | ||
template: | | ||
let messageType = .message.type; | ||
$.assert(messageType, "message Type is not present. Aborting message."); | ||
$.assert(.message.type.toLowerCase() ==='identify' || .message.type.toLowerCase() ==='track', "Event type " + .message.type.toLowerCase() + " is not supported. Aborting message."); | ||
$.assert(.message.traits || .message.properties, "Message traits/properties not present. Aborting message."); | ||
- name: prepareData | ||
template: | | ||
let data = .message.traits | ||
let identifierType = .message.context.externalId[0].identifierType; | ||
let identifierValue = .message.context.externalId[0].id; | ||
let ClientId = identifierValue; | ||
data.ClientId = ClientId; | ||
data | ||
- name: buildResponseForProcessTransformation | ||
description: build response | ||
template: | | ||
const response = $.defaultRequestConfig(); | ||
response.body.JSON = $.outputs.prepareData | ||
console.log(JSON.stringify(response)); | ||
response | ||
# header should change to clientID, YCLID etc | ||
# batching support -> rtWorkflow | ||
|
Empty file.