Skip to content

Commit

Permalink
feat: onboard yandex metrica offline events destination, initial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yashasvibajpai committed Apr 1, 2024
1 parent 81290e8 commit b55ef38
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
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,
};
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.

0 comments on commit b55ef38

Please sign in to comment.