@segment/action-destinations 3.219.0 → 3.220.0-54bb01e8
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/dist/destinations/airship/utilities.js +2 -2
- package/dist/destinations/airship/utilities.js.map +1 -1
- package/dist/destinations/ambee/subscribeUserToCampaign/index.js +4 -2
- package/dist/destinations/ambee/subscribeUserToCampaign/index.js.map +1 -1
- package/dist/destinations/braze/updateUserProfile/index.js +1 -6
- package/dist/destinations/braze/updateUserProfile/index.js.map +1 -1
- package/dist/destinations/braze-cohorts/syncAudiences/index.js +6 -3
- package/dist/destinations/braze-cohorts/syncAudiences/index.js.map +1 -1
- package/dist/destinations/cordial/identities-fields.d.ts +1 -1
- package/dist/destinations/cordial/identities-fields.js +5 -3
- package/dist/destinations/cordial/identities-fields.js.map +1 -1
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js +10 -5
- package/dist/destinations/dynamic-yield-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.d.ts +1 -0
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js +8 -1
- package/dist/destinations/engage/sendgrid/sendEmail/SendEmailPerformer.js.map +1 -1
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.d.ts +0 -1
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js +1 -2
- package/dist/destinations/engage/twilio/utils/PhoneMessageSender.js.map +1 -1
- package/dist/destinations/fullstory/identifyUserV2/generated-types.d.ts +1 -1
- package/dist/destinations/fullstory/identifyUserV2/index.js +1 -1
- package/dist/destinations/fullstory/identifyUserV2/index.js.map +1 -1
- package/dist/destinations/fullstory/index.js +1 -1
- package/dist/destinations/fullstory/index.js.map +1 -1
- package/dist/destinations/fullstory/request-params.d.ts +2 -2
- package/dist/destinations/fullstory/request-params.js +6 -6
- package/dist/destinations/fullstory/request-params.js.map +1 -1
- package/dist/destinations/fullstory/trackEventV2/generated-types.d.ts +1 -1
- package/dist/destinations/fullstory/trackEventV2/index.js +1 -1
- package/dist/destinations/fullstory/trackEventV2/index.js.map +1 -1
- package/dist/destinations/google-sheets/postSheet/index.js +2 -1
- package/dist/destinations/google-sheets/postSheet/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertContact/index.d.ts +1 -1
- package/dist/destinations/hubspot/upsertContact/index.js +28 -8
- package/dist/destinations/hubspot/upsertContact/index.js.map +1 -1
- package/dist/destinations/hyperengage/commonFields.d.ts +3 -0
- package/dist/destinations/hyperengage/commonFields.js +165 -0
- package/dist/destinations/hyperengage/commonFields.js.map +1 -0
- package/dist/destinations/hyperengage/generated-types.d.ts +4 -0
- package/dist/destinations/{liveramp-audiences/audienceEnteredSFTP.types.js → hyperengage/generated-types.js} +1 -1
- package/dist/destinations/hyperengage/generated-types.js.map +1 -0
- package/dist/destinations/hyperengage/group/generated-types.d.ts +35 -0
- package/dist/destinations/hyperengage/group/generated-types.js +3 -0
- package/dist/destinations/hyperengage/group/generated-types.js.map +1 -0
- package/dist/destinations/hyperengage/group/index.d.ts +5 -0
- package/dist/destinations/hyperengage/group/index.js +81 -0
- package/dist/destinations/hyperengage/group/index.js.map +1 -0
- package/dist/destinations/hyperengage/identify/generated-types.d.ts +36 -0
- package/dist/destinations/hyperengage/identify/generated-types.js +3 -0
- package/dist/destinations/hyperengage/identify/generated-types.js.map +1 -0
- package/dist/destinations/hyperengage/identify/index.d.ts +5 -0
- package/dist/destinations/hyperengage/identify/index.js +110 -0
- package/dist/destinations/hyperengage/identify/index.js.map +1 -0
- package/dist/destinations/hyperengage/index.d.ts +4 -0
- package/dist/destinations/hyperengage/index.js +72 -0
- package/dist/destinations/hyperengage/index.js.map +1 -0
- package/dist/destinations/hyperengage/track/generated-types.d.ts +32 -0
- package/dist/destinations/hyperengage/track/generated-types.js +3 -0
- package/dist/destinations/hyperengage/track/generated-types.js.map +1 -0
- package/dist/destinations/hyperengage/track/index.d.ts +5 -0
- package/dist/destinations/hyperengage/track/index.js +54 -0
- package/dist/destinations/hyperengage/track/index.js.map +1 -0
- package/dist/destinations/hyperengage/validateInput.d.ts +2 -0
- package/dist/destinations/hyperengage/validateInput.js +90 -0
- package/dist/destinations/hyperengage/validateInput.js.map +1 -0
- package/dist/destinations/index.js +3 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/launchdarkly-audiences/syncAudience/index.js +12 -6
- package/dist/destinations/launchdarkly-audiences/syncAudience/index.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateAudience/index.js +8 -4
- package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -1
- package/dist/destinations/livelike-cloud/trackEvent/index.js +2 -1
- package/dist/destinations/livelike-cloud/trackEvent/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredS3/index.js.map +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js +1 -1
- package/dist/destinations/liveramp-audiences/audienceEnteredSftp/index.js.map +1 -1
- package/dist/destinations/loops/createOrUpdateContact/generated-types.d.ts +1 -1
- package/dist/destinations/loops/createOrUpdateContact/index.js +2 -2
- package/dist/destinations/loops/createOrUpdateContact/index.js.map +1 -1
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js +8 -4
- package/dist/destinations/optimizely-advanced-audience-targeting/syncAudience/index.js.map +1 -1
- package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/index.js +2 -1
- package/dist/destinations/optimizely-feature-experimentation-actions/trackEvent/index.js.map +1 -1
- package/dist/destinations/outfunnel/forwardGroupEvent/index.js +10 -5
- package/dist/destinations/outfunnel/forwardGroupEvent/index.js.map +1 -1
- package/dist/destinations/outfunnel/forwardIdentifyEvent/index.js +8 -4
- package/dist/destinations/outfunnel/forwardIdentifyEvent/index.js.map +1 -1
- package/dist/destinations/outfunnel/forwardTrackEvent/index.js +8 -4
- package/dist/destinations/outfunnel/forwardTrackEvent/index.js.map +1 -1
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.js +1 -1
- package/dist/destinations/pinterest-conversions/pinterest-capi-custom-data.js.map +1 -1
- package/dist/destinations/pinterest-conversions/reportConversionEvent/generated-types.d.ts +1 -1
- package/dist/destinations/segment-profiles/segment-properties.d.ts +1 -0
- package/dist/destinations/segment-profiles/segment-properties.js +9 -1
- package/dist/destinations/segment-profiles/segment-properties.js.map +1 -1
- package/dist/destinations/segment-profiles/sendGroup/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendGroup/index.js +3 -1
- package/dist/destinations/segment-profiles/sendGroup/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendIdentify/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendIdentify/index.js +3 -1
- package/dist/destinations/segment-profiles/sendIdentify/index.js.map +1 -1
- package/dist/destinations/segment-profiles/sendSubscription/generated-types.d.ts +1 -0
- package/dist/destinations/segment-profiles/sendSubscription/index.js +4 -1
- package/dist/destinations/segment-profiles/sendSubscription/index.js.map +1 -1
- package/dist/destinations/snap-conversions-api/_tests_/index.test.js.map +1 -1
- package/dist/destinations/tiktok-audiences/properties.js +8 -4
- package/dist/destinations/tiktok-audiences/properties.js.map +1 -1
- package/dist/destinations/trackey/generated-types.d.ts +3 -0
- package/dist/destinations/trackey/generated-types.js +3 -0
- package/dist/destinations/trackey/generated-types.js.map +1 -0
- package/dist/destinations/trackey/group.types.d.ts +11 -0
- package/dist/destinations/trackey/group.types.js +3 -0
- package/dist/destinations/trackey/group.types.js.map +1 -0
- package/dist/destinations/trackey/identify.types.d.ts +11 -0
- package/dist/destinations/trackey/identify.types.js +3 -0
- package/dist/destinations/trackey/identify.types.js.map +1 -0
- package/dist/destinations/trackey/index.d.ts +4 -0
- package/dist/destinations/trackey/index.js +206 -0
- package/dist/destinations/trackey/index.js.map +1 -0
- package/dist/destinations/trackey/track.types.d.ts +12 -0
- package/dist/destinations/trackey/track.types.js +3 -0
- package/dist/destinations/trackey/track.types.js.map +1 -0
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js +6 -3
- package/dist/destinations/twilio-studio/triggerStudioFlow/index.js.map +1 -1
- package/dist/destinations/webhook/send/index.js +3 -1
- package/dist/destinations/webhook/send/index.js.map +1 -1
- package/dist/destinations/yahoo-audiences/constants.d.ts +2 -0
- package/dist/destinations/yahoo-audiences/constants.js +6 -0
- package/dist/destinations/yahoo-audiences/constants.js.map +1 -0
- package/dist/destinations/yahoo-audiences/generated-types.d.ts +10 -0
- package/dist/destinations/yahoo-audiences/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/index.d.ts +4 -0
- package/dist/destinations/yahoo-audiences/index.js +150 -0
- package/dist/destinations/yahoo-audiences/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/types.d.ts +31 -0
- package/dist/destinations/yahoo-audiences/types.js +3 -0
- package/dist/destinations/yahoo-audiences/types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/updateSegment/generated-types.d.ts +16 -0
- package/dist/destinations/yahoo-audiences/updateSegment/generated-types.js +3 -0
- package/dist/destinations/yahoo-audiences/updateSegment/generated-types.js.map +1 -0
- package/dist/destinations/yahoo-audiences/updateSegment/index.d.ts +5 -0
- package/dist/destinations/yahoo-audiences/updateSegment/index.js +169 -0
- package/dist/destinations/yahoo-audiences/updateSegment/index.js.map +1 -0
- package/dist/destinations/yahoo-audiences/utils-rt.d.ts +10 -0
- package/dist/destinations/yahoo-audiences/utils-rt.js +103 -0
- package/dist/destinations/yahoo-audiences/utils-rt.js.map +1 -0
- package/dist/destinations/yahoo-audiences/utils-tax.d.ts +8 -0
- package/dist/destinations/yahoo-audiences/utils-tax.js +78 -0
- package/dist/destinations/yahoo-audiences/utils-tax.js.map +1 -0
- package/package.json +2 -2
- package/dist/destinations/liveramp-audiences/audienceEnteredSFTP.types.d.ts +0 -16
- package/dist/destinations/liveramp-audiences/audienceEnteredSFTP.types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-sheets/postSheet/index.ts"],"names":[],"mappings":";;AAIA,6CAA0C;AAE1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,8CAA8C;IAC3D,mBAAmB,EAAE,oCAAoC;IAEzD,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,iEAAiE;YAC9E,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;SACvC;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,uGAAuG;YACzG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SAChC;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,6JAA6J;YAC/J,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;SACZ;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,kBAAkB;YACzB,WAAW,EACT,+JAA+J;YACjK,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,QAAQ;SAClB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EACT,wXAAwX;YAC1X,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;gBAC9B,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;aACjD;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE;;;;;;;;;GAShB;YACG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;SACjC;QACD,eAAe,EAAE;YACf,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,6BAA6B;YACpC,WAAW,EAAE,mGAAmG;YAChH,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,wBAAW,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACrC,OAAO,wBAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACtC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/google-sheets/postSheet/index.ts"],"names":[],"mappings":";;AAIA,6CAA0C;AAE1C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,8CAA8C;IAC3D,mBAAmB,EAAE,oCAAoC;IAEzD,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EAAE,iEAAiE;YAC9E,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;SACvC;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,uGAAuG;YACzG,IAAI,EAAE,QAAQ;YACd,aAAa,EAAE,IAAI;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;SAChC;QACD,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,6JAA6J;YAC/J,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,EAAE;SACZ;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,kBAAkB;YACzB,WAAW,EACT,+JAA+J;YACjK,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,QAAQ;SAClB;QACD,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EACT,wXAAwX;YAC1X,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,KAAK;YACd,OAAO,EAAE;gBACP,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;gBAC9B,EAAE,KAAK,EAAE,cAAc,EAAE,KAAK,EAAE,cAAc,EAAE;aACjD;SACF;QACD,MAAM,EAAE;YACN,KAAK,EAAE,QAAQ;YACf,WAAW,EAAE;;;;;;;;;GAShB;YACG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,eAAe,EAAE,eAAe;SACjC;QACD,eAAe,EAAE;YACf,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,6BAA6B;YACpC,WAAW,EAAE,mGAAmG;YAChH,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QAChC,OAAO,wBAAW,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,CAAC,CAAA;IACxC,CAAC;IACD,YAAY,EAAE,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;QACrC,OAAO,wBAAW,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IACtC,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -3,7 +3,7 @@ import type { Settings } from '../generated-types';
|
|
|
3
3
|
import type { Payload } from './generated-types';
|
|
4
4
|
interface ContactSuccessResponse {
|
|
5
5
|
id: string;
|
|
6
|
-
properties: Record<string, string>;
|
|
6
|
+
properties: Record<string, string | null>;
|
|
7
7
|
}
|
|
8
8
|
interface ContactErrorResponse {
|
|
9
9
|
status: string;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
const actions_core_1 = require("@segment/actions-core");
|
|
4
7
|
const properties_1 = require("../properties");
|
|
5
8
|
const utils_1 = require("../utils");
|
|
9
|
+
const split_1 = __importDefault(require("lodash/split"));
|
|
6
10
|
const action = {
|
|
7
11
|
title: 'Upsert Contact',
|
|
8
12
|
description: 'Create or update a contact in HubSpot.',
|
|
@@ -177,6 +181,7 @@ const action = {
|
|
|
177
181
|
createList.push(payload);
|
|
178
182
|
}
|
|
179
183
|
else if (action === 'update') {
|
|
184
|
+
delete payload['properties']['email'];
|
|
180
185
|
updateList.push({
|
|
181
186
|
id: payload.id,
|
|
182
187
|
properties: payload.properties
|
|
@@ -210,7 +215,7 @@ async function updateContact(request, email, properties) {
|
|
|
210
215
|
}
|
|
211
216
|
async function readContactsBatch(request, emails) {
|
|
212
217
|
const requestPayload = {
|
|
213
|
-
properties: ['email', 'lifecyclestage'],
|
|
218
|
+
properties: ['email', 'lifecyclestage', 'hs_additional_emails'],
|
|
214
219
|
idProperty: 'email',
|
|
215
220
|
inputs: emails.map((email) => ({
|
|
216
221
|
id: email
|
|
@@ -265,12 +270,7 @@ function mapUpsertContactPayload(payload) {
|
|
|
265
270
|
}
|
|
266
271
|
function updateActionsForBatchedContacts(readResponse, contactsUpsertMap) {
|
|
267
272
|
if (readResponse.data?.results && readResponse.data.results.length > 0) {
|
|
268
|
-
|
|
269
|
-
contactsUpsertMap[result.properties.email].action = 'update';
|
|
270
|
-
contactsUpsertMap[result.properties.email].payload.id = result.id;
|
|
271
|
-
contactsUpsertMap[result.id] = { ...contactsUpsertMap[result.properties.email] };
|
|
272
|
-
delete contactsUpsertMap[result.properties.email];
|
|
273
|
-
}
|
|
273
|
+
contactsUpsertMap = createPayloadToUpdateContact(readResponse, contactsUpsertMap);
|
|
274
274
|
}
|
|
275
275
|
if (readResponse.data?.numErrors && readResponse.data.errors) {
|
|
276
276
|
for (const error of readResponse.data.errors) {
|
|
@@ -290,7 +290,8 @@ async function checkAndRetryUpdatingLifecycleStage(request, updateContactRespons
|
|
|
290
290
|
const resetLifeCycleStagePayload = [];
|
|
291
291
|
const retryLifeCycleStagePayload = [];
|
|
292
292
|
for (const result of updateContactResponse.data.results) {
|
|
293
|
-
const
|
|
293
|
+
const key = Object.keys(contactsUpsertMap).find((key) => contactsUpsertMap[key].payload.id == result.id);
|
|
294
|
+
const desiredLifeCycleStage = key ? contactsUpsertMap[key]?.payload?.properties?.lifecyclestage : null;
|
|
294
295
|
const currentLifeCycleStage = result.properties.lifecyclestage;
|
|
295
296
|
if (desiredLifeCycleStage && desiredLifeCycleStage !== currentLifeCycleStage) {
|
|
296
297
|
resetLifeCycleStagePayload.push({
|
|
@@ -312,5 +313,24 @@ async function checkAndRetryUpdatingLifecycleStage(request, updateContactRespons
|
|
|
312
313
|
await updateContactsBatch(request, retryLifeCycleStagePayload);
|
|
313
314
|
}
|
|
314
315
|
}
|
|
316
|
+
function createPayloadToUpdateContact(readResponse, contactsUpsertMap) {
|
|
317
|
+
for (const result of readResponse.data.results) {
|
|
318
|
+
let email;
|
|
319
|
+
if (!contactsUpsertMap[`${result.properties.email}`]) {
|
|
320
|
+
if (result.properties.hs_additional_emails) {
|
|
321
|
+
const secondaryEmails = split_1.default(result.properties.hs_additional_emails, ';');
|
|
322
|
+
email = Object.keys(contactsUpsertMap).find((key) => secondaryEmails.includes(key));
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
email = result.properties.email;
|
|
327
|
+
}
|
|
328
|
+
if (email) {
|
|
329
|
+
contactsUpsertMap[email].action = 'update';
|
|
330
|
+
contactsUpsertMap[email].payload.id = result.id;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return contactsUpsertMap;
|
|
334
|
+
}
|
|
315
335
|
exports.default = action;
|
|
316
336
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/hubspot/upsertContact/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/hubspot/upsertContact/index.ts"],"names":[],"mappings":";;;;;AACA,wDAAyF;AAGzF,8CAAgD;AAChD,oCAAwC;AACxC,yDAAgC;AA4DhC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,gBAAgB;IACvB,WAAW,EAAE,wCAAwC;IACrD,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,OAAO;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2NAA2N;YAC7N,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,OAAO;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,cAAc;YACrB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wBAAwB;YACrC,OAAO,EAAE;gBACP,OAAO,EAAE,kBAAkB;aAC5B;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,2BAA2B;YACxC,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;oBAC1C,IAAI,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;oBACxC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;iBACxC;aACF;SACF;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9D,MAAM,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAA;KAC/D;AACH,CAAC;AAED,SAAS,4BAA4B,CACnC,YAAkC,EAClC,iBAAwD;IAExD,KAAK,MAAM,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE;QAC9C,IAAI,KAAgC,CAAA;QAEpC,IAAI,CAAC,iBAAiB,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE;YAEpD,IAAI,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAAE;gBAC1C,MAAM,eAAe,GAAG,eAAK,CAAC,MAAM,CAAC,UAAU,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAA;gBAC1E,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAA;aACpF;SACF;aAAM;YACL,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAA;SAChC;QACD,IAAI,KAAK,EAAE;YAET,iBAAiB,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,QAAQ,CAAA;YAE1C,iBAAiB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAA;SAChD;KACF;IACD,OAAO,iBAAiB,CAAA;AAC1B,CAAC;AACD,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.commonFields = void 0;
|
|
4
|
+
exports.commonFields = {
|
|
5
|
+
anonymous_id: {
|
|
6
|
+
type: 'string',
|
|
7
|
+
allowNull: true,
|
|
8
|
+
required: false,
|
|
9
|
+
description: 'User Anonymous id',
|
|
10
|
+
label: 'Anonymous ID',
|
|
11
|
+
default: { '@path': '$.anonymousId' }
|
|
12
|
+
},
|
|
13
|
+
event_id: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
required: false,
|
|
16
|
+
description: 'The ID of the event.',
|
|
17
|
+
label: 'Event ID',
|
|
18
|
+
default: { '@path': '$.messageId' }
|
|
19
|
+
},
|
|
20
|
+
doc_path: {
|
|
21
|
+
type: 'string',
|
|
22
|
+
required: false,
|
|
23
|
+
description: 'The path of the document.',
|
|
24
|
+
label: 'Document Path',
|
|
25
|
+
default: { '@path': '$.context.page.path' }
|
|
26
|
+
},
|
|
27
|
+
doc_search: {
|
|
28
|
+
type: 'string',
|
|
29
|
+
required: false,
|
|
30
|
+
description: 'The search query of the document.',
|
|
31
|
+
label: 'Document Search',
|
|
32
|
+
default: { '@path': '$.context.page.search' }
|
|
33
|
+
},
|
|
34
|
+
doc_title: {
|
|
35
|
+
type: 'string',
|
|
36
|
+
required: false,
|
|
37
|
+
description: 'The title of the page where the event occurred.',
|
|
38
|
+
label: 'Page Title',
|
|
39
|
+
default: { '@path': '$.context.page.title' }
|
|
40
|
+
},
|
|
41
|
+
url: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
required: false,
|
|
44
|
+
description: 'The URL of the page where the event occurred.',
|
|
45
|
+
label: 'URL',
|
|
46
|
+
default: { '@path': '$.context.page.url' }
|
|
47
|
+
},
|
|
48
|
+
referer: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
required: false,
|
|
51
|
+
description: 'The referrer of the page where the event occurred.',
|
|
52
|
+
label: 'Referrer',
|
|
53
|
+
default: { '@path': '$.context.page.referrer' }
|
|
54
|
+
},
|
|
55
|
+
user_agent: {
|
|
56
|
+
type: 'string',
|
|
57
|
+
required: false,
|
|
58
|
+
description: 'The user agent of the browser.',
|
|
59
|
+
label: 'User Agent',
|
|
60
|
+
default: { '@path': '$.context.userAgent' }
|
|
61
|
+
},
|
|
62
|
+
user_language: {
|
|
63
|
+
type: 'string',
|
|
64
|
+
required: false,
|
|
65
|
+
description: 'The language of the browser.',
|
|
66
|
+
label: 'User Language',
|
|
67
|
+
default: { '@path': '$.context.locale' }
|
|
68
|
+
},
|
|
69
|
+
utc_time: {
|
|
70
|
+
type: 'string',
|
|
71
|
+
required: false,
|
|
72
|
+
description: 'The time of the event in UTC.',
|
|
73
|
+
label: 'UTC Time',
|
|
74
|
+
default: { '@path': '$.timestamp' }
|
|
75
|
+
},
|
|
76
|
+
utm: {
|
|
77
|
+
type: 'object',
|
|
78
|
+
required: false,
|
|
79
|
+
description: 'Information about the UTM parameters.',
|
|
80
|
+
label: 'UTM',
|
|
81
|
+
properties: {
|
|
82
|
+
source: {
|
|
83
|
+
label: 'Source',
|
|
84
|
+
description: 'The source of the campaign.',
|
|
85
|
+
type: 'string'
|
|
86
|
+
},
|
|
87
|
+
medium: {
|
|
88
|
+
label: 'Medium',
|
|
89
|
+
description: 'The medium of the campaign.',
|
|
90
|
+
type: 'string'
|
|
91
|
+
},
|
|
92
|
+
name: {
|
|
93
|
+
label: 'Name',
|
|
94
|
+
description: 'The name of the campaign.',
|
|
95
|
+
type: 'string'
|
|
96
|
+
},
|
|
97
|
+
term: {
|
|
98
|
+
label: 'Term',
|
|
99
|
+
description: 'The term of the campaign.',
|
|
100
|
+
type: 'string'
|
|
101
|
+
},
|
|
102
|
+
content: {
|
|
103
|
+
label: 'Content',
|
|
104
|
+
description: 'The content of the campaign.',
|
|
105
|
+
type: 'string'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
default: {
|
|
109
|
+
source: { '@path': '$.context.campaign.source' },
|
|
110
|
+
medium: { '@path': '$.context.campaign.medium' },
|
|
111
|
+
name: { '@path': '$.context.campaign.name' },
|
|
112
|
+
term: { '@path': '$.context.campaign.term' },
|
|
113
|
+
content: { '@path': '$.context.campaign.content' }
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
screen: {
|
|
117
|
+
type: 'object',
|
|
118
|
+
required: false,
|
|
119
|
+
description: 'Information about the screen.',
|
|
120
|
+
label: 'Screen',
|
|
121
|
+
properties: {
|
|
122
|
+
height: {
|
|
123
|
+
label: 'Height',
|
|
124
|
+
description: 'The height of the screen.',
|
|
125
|
+
type: 'integer'
|
|
126
|
+
},
|
|
127
|
+
width: {
|
|
128
|
+
label: 'Width',
|
|
129
|
+
description: 'The width of the screen.',
|
|
130
|
+
type: 'integer'
|
|
131
|
+
},
|
|
132
|
+
density: {
|
|
133
|
+
label: 'Density',
|
|
134
|
+
description: 'The density of the screen.',
|
|
135
|
+
type: 'number'
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
default: {
|
|
139
|
+
height: { '@path': '$.context.screen.height' },
|
|
140
|
+
width: { '@path': '$.context.screen.width' },
|
|
141
|
+
density: { '@path': '$.context.screen.density' }
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
timezone: {
|
|
145
|
+
type: 'string',
|
|
146
|
+
required: false,
|
|
147
|
+
description: 'The timezone of the browser.',
|
|
148
|
+
label: 'Timezone',
|
|
149
|
+
default: {
|
|
150
|
+
'@if': {
|
|
151
|
+
exists: { '@path': '$.context.timezone' },
|
|
152
|
+
then: { '@path': '$.context.timezone' },
|
|
153
|
+
else: { '@path': '$.properties.timezone' }
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
source_ip: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
required: false,
|
|
160
|
+
description: 'The IP address of the user.',
|
|
161
|
+
label: 'IP Address',
|
|
162
|
+
default: { '@path': '$.context.ip' }
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=commonFields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonFields.js","sourceRoot":"","sources":["../../../src/destinations/hyperengage/commonFields.ts"],"names":[],"mappings":";;;AAGa,QAAA,YAAY,GAAyC;IAChE,YAAY,EAAE;QACZ,IAAI,EAAE,QAAQ;QACd,SAAS,EAAE,IAAI;QACf,QAAQ,EAAE,KAAK;QACf,WAAW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 -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/hyperengage/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
account_id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
created_at?: string;
|
|
5
|
+
traits?: {
|
|
6
|
+
[k: string]: unknown;
|
|
7
|
+
};
|
|
8
|
+
plan?: string;
|
|
9
|
+
industry?: string;
|
|
10
|
+
website?: string;
|
|
11
|
+
anonymous_id?: string | null;
|
|
12
|
+
event_id?: string;
|
|
13
|
+
doc_path?: string;
|
|
14
|
+
doc_search?: string;
|
|
15
|
+
doc_title?: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
referer?: string;
|
|
18
|
+
user_agent?: string;
|
|
19
|
+
user_language?: string;
|
|
20
|
+
utc_time?: string;
|
|
21
|
+
utm?: {
|
|
22
|
+
source?: string;
|
|
23
|
+
medium?: string;
|
|
24
|
+
name?: string;
|
|
25
|
+
term?: string;
|
|
26
|
+
content?: string;
|
|
27
|
+
};
|
|
28
|
+
screen?: {
|
|
29
|
+
height?: number;
|
|
30
|
+
width?: number;
|
|
31
|
+
density?: number;
|
|
32
|
+
};
|
|
33
|
+
timezone?: string;
|
|
34
|
+
source_ip?: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/hyperengage/group/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const validateInput_1 = require("../validateInput");
|
|
4
|
+
const commonFields_1 = require("../commonFields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Group',
|
|
7
|
+
description: 'Send group calls to Hyperengage.',
|
|
8
|
+
defaultSubscription: 'type = "group"',
|
|
9
|
+
fields: {
|
|
10
|
+
account_id: {
|
|
11
|
+
type: 'string',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'The External ID of the account to send properties for',
|
|
14
|
+
label: 'Account id',
|
|
15
|
+
default: {
|
|
16
|
+
'@if': {
|
|
17
|
+
exists: { '@path': '$.context.group_id' },
|
|
18
|
+
then: { '@path': '$.context.group_id' },
|
|
19
|
+
else: { '@path': '$.groupId' }
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
name: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
required: true,
|
|
26
|
+
description: 'The Account name',
|
|
27
|
+
label: 'Account name',
|
|
28
|
+
default: {
|
|
29
|
+
'@if': {
|
|
30
|
+
exists: { '@path': '$.traits.name' },
|
|
31
|
+
then: { '@path': '$.traits.name' },
|
|
32
|
+
else: { '@path': '$.properties.name' }
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
created_at: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
required: false,
|
|
39
|
+
description: 'The timestamp when the account was created, represented in the ISO-8601 date format. For instance, "2023-09-26T15:30:00Z".',
|
|
40
|
+
label: 'Account created at',
|
|
41
|
+
default: { '@path': '$.traits.created_at' }
|
|
42
|
+
},
|
|
43
|
+
traits: {
|
|
44
|
+
type: 'object',
|
|
45
|
+
required: false,
|
|
46
|
+
description: 'The properties of the account',
|
|
47
|
+
label: 'Account properties',
|
|
48
|
+
default: { '@path': '$.traits' }
|
|
49
|
+
},
|
|
50
|
+
plan: {
|
|
51
|
+
type: 'string',
|
|
52
|
+
required: false,
|
|
53
|
+
description: 'Subscription plan the account is associated with',
|
|
54
|
+
label: 'Account subscription plan',
|
|
55
|
+
default: { '@path': '$.traits.plan' }
|
|
56
|
+
},
|
|
57
|
+
industry: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
required: false,
|
|
60
|
+
description: 'The account industry',
|
|
61
|
+
label: 'Account industry',
|
|
62
|
+
default: { '@path': '$.traits.industry' }
|
|
63
|
+
},
|
|
64
|
+
website: {
|
|
65
|
+
type: 'string',
|
|
66
|
+
required: false,
|
|
67
|
+
description: 'The account website',
|
|
68
|
+
label: 'Account website',
|
|
69
|
+
default: { '@path': '$.traits.website' }
|
|
70
|
+
},
|
|
71
|
+
...commonFields_1.commonFields
|
|
72
|
+
},
|
|
73
|
+
perform: (request, data) => {
|
|
74
|
+
return request(`https://events.hyperengage.io/api/v1/s2s/event?token=${data.settings.apiKey}`, {
|
|
75
|
+
method: 'post',
|
|
76
|
+
json: validateInput_1.validateInput(data.settings, data.payload, 'account_identify')
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
exports.default = action;
|
|
81
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/hyperengage/group/index.ts"],"names":[],"mappings":";;AAGA,oDAAgD;AAChD,kDAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,kCAAkC;IAC/C,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,uDAAuD;YACpE,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE;iBAC/B;aACF;SACF;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kBAAkB;YAC/B,KAAK,EAAE,cAAc;YACrB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,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,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,kBAAkB,CAAC;SACrE,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
user_id: string;
|
|
3
|
+
name?: string | null;
|
|
4
|
+
first_name?: string | null;
|
|
5
|
+
last_name?: string | null;
|
|
6
|
+
email?: string;
|
|
7
|
+
account_id?: string;
|
|
8
|
+
created_at?: string;
|
|
9
|
+
traits?: {
|
|
10
|
+
[k: string]: unknown;
|
|
11
|
+
};
|
|
12
|
+
anonymous_id?: string | null;
|
|
13
|
+
event_id?: string;
|
|
14
|
+
doc_path?: string;
|
|
15
|
+
doc_search?: string;
|
|
16
|
+
doc_title?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
referer?: string;
|
|
19
|
+
user_agent?: string;
|
|
20
|
+
user_language?: string;
|
|
21
|
+
utc_time?: string;
|
|
22
|
+
utm?: {
|
|
23
|
+
source?: string;
|
|
24
|
+
medium?: string;
|
|
25
|
+
name?: string;
|
|
26
|
+
term?: string;
|
|
27
|
+
content?: string;
|
|
28
|
+
};
|
|
29
|
+
screen?: {
|
|
30
|
+
height?: number;
|
|
31
|
+
width?: number;
|
|
32
|
+
density?: number;
|
|
33
|
+
};
|
|
34
|
+
timezone?: string;
|
|
35
|
+
source_ip?: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/hyperengage/identify/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const validateInput_1 = require("../validateInput");
|
|
4
|
+
const commonFields_1 = require("../commonFields");
|
|
5
|
+
const action = {
|
|
6
|
+
title: 'Identify',
|
|
7
|
+
description: 'Send identify calls to Hyperengage.',
|
|
8
|
+
defaultSubscription: 'type = "identify"',
|
|
9
|
+
platform: 'cloud',
|
|
10
|
+
fields: {
|
|
11
|
+
user_id: {
|
|
12
|
+
type: 'string',
|
|
13
|
+
required: true,
|
|
14
|
+
description: 'The External ID of the user',
|
|
15
|
+
label: 'User ID',
|
|
16
|
+
default: { '@path': '$.userId' }
|
|
17
|
+
},
|
|
18
|
+
name: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
required: false,
|
|
21
|
+
description: "The user's name",
|
|
22
|
+
allowNull: true,
|
|
23
|
+
label: 'Name',
|
|
24
|
+
default: {
|
|
25
|
+
'@if': {
|
|
26
|
+
exists: { '@path': '$.traits.name' },
|
|
27
|
+
then: { '@path': '$.traits.name' },
|
|
28
|
+
else: { '@path': '$.properties.name' }
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
first_name: {
|
|
33
|
+
type: 'string',
|
|
34
|
+
required: false,
|
|
35
|
+
allowNull: true,
|
|
36
|
+
description: "The user's first name. This field is mandatory if you're not providing a name field",
|
|
37
|
+
label: 'First name',
|
|
38
|
+
default: {
|
|
39
|
+
'@if': {
|
|
40
|
+
exists: { '@path': '$.traits.first_name' },
|
|
41
|
+
then: { '@path': '$.traits.first_name' },
|
|
42
|
+
else: { '@path': '$.properties.first_name' }
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
last_name: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
required: false,
|
|
49
|
+
allowNull: true,
|
|
50
|
+
description: "The user's last name. This field is mandatory if you're not providing a name field",
|
|
51
|
+
label: 'Last name',
|
|
52
|
+
default: {
|
|
53
|
+
'@if': {
|
|
54
|
+
exists: { '@path': '$.traits.last_name' },
|
|
55
|
+
then: { '@path': '$.traits.last_name' },
|
|
56
|
+
else: { '@path': '$.properties.last_name' }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
email: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
required: false,
|
|
63
|
+
description: "The user's email address",
|
|
64
|
+
label: 'Email address',
|
|
65
|
+
default: {
|
|
66
|
+
'@if': {
|
|
67
|
+
exists: { '@path': '$.traits.email' },
|
|
68
|
+
then: { '@path': '$.traits.email' },
|
|
69
|
+
else: { '@path': '$.properties.email' }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
account_id: {
|
|
74
|
+
type: 'string',
|
|
75
|
+
required: false,
|
|
76
|
+
description: 'The account id, to uniquely identify the account associated with the user',
|
|
77
|
+
label: 'Account id',
|
|
78
|
+
default: {
|
|
79
|
+
'@if': {
|
|
80
|
+
exists: { '@path': '$.context.group_id' },
|
|
81
|
+
then: { '@path': '$.context.group_id' },
|
|
82
|
+
else: { '@path': '$.groupId' }
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
created_at: {
|
|
87
|
+
type: 'string',
|
|
88
|
+
required: false,
|
|
89
|
+
description: 'The timestamp when the user was created, represented in the ISO-8601 date format. For instance, "2023-09-26T15:30:00Z".',
|
|
90
|
+
label: 'Created at',
|
|
91
|
+
default: { '@path': '$.traits.created_at' }
|
|
92
|
+
},
|
|
93
|
+
traits: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
label: 'Traits',
|
|
96
|
+
description: 'Properties to associate with the user',
|
|
97
|
+
required: false,
|
|
98
|
+
default: { '@path': '$.traits' }
|
|
99
|
+
},
|
|
100
|
+
...commonFields_1.commonFields
|
|
101
|
+
},
|
|
102
|
+
perform: (request, data) => {
|
|
103
|
+
return request(`https://events.hyperengage.io/api/v1/s2s/event?token=${data.settings.apiKey}`, {
|
|
104
|
+
method: 'post',
|
|
105
|
+
json: validateInput_1.validateInput(data.settings, data.payload, 'user_identify')
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
exports.default = action;
|
|
110
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/hyperengage/identify/index.ts"],"names":[],"mappings":";;AAGA,oDAAgD;AAChD,kDAA8C;AAE9C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,qCAAqC;IAClD,mBAAmB,EAAE,mBAAmB;IACxC,QAAQ,EAAE,OAAO;IACjB,MAAM,EAAE;QACN,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,6BAA6B;YAC1C,KAAK,EAAE,SAAS;YAChB,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;SACjC;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,WAAW,EAAE,iBAAiB;YAC9B,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,MAAM;YACb,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;oBACpC,IAAI,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE;oBAClC,IAAI,EAAE,EAAE,OAAO,EAAE,mBAAmB,EAAE;iBACvC;aACF;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,qFAAqF;YAClG,KAAK,EAAE,YAAY;YACnB,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;oBAC1C,IAAI,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;oBACxC,IAAI,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;iBAC7C;aACF;SACF;QACD,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,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