@segment/action-destinations 3.127.2-CHANNELS-329.3 → 3.127.3-brackets-stuff.18
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/braze-cohorts/syncAudiences/index.js +3 -3
- package/dist/destinations/braze-cohorts/syncAudiences/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdateObject/generated-types.d.ts +1 -1
- package/dist/destinations/customerio/createUpdateObject/index.js +5 -5
- package/dist/destinations/customerio/createUpdateObject/index.js.map +1 -1
- package/dist/destinations/customerio/createUpdatePerson/index.js +2 -2
- package/dist/destinations/customerio/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/index.js +1 -3
- package/dist/destinations/engage-messaging-twilio/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +104 -2
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/index.js +1 -1
- package/dist/destinations/google-enhanced-conversions/index.js.map +1 -1
- package/dist/destinations/heap/constants.d.ts +1 -1
- package/dist/destinations/heap/constants.js +2 -2
- package/dist/destinations/heap/constants.js.map +1 -1
- package/dist/destinations/heap/index.js +1 -1
- package/dist/destinations/heap/index.js.map +1 -1
- package/dist/destinations/heap/trackEvent/generated-types.d.ts +4 -2
- package/dist/destinations/heap/trackEvent/index.js +44 -15
- package/dist/destinations/heap/trackEvent/index.js.map +1 -1
- package/dist/destinations/index.js +1 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateActivity/index.js +44 -17
- package/dist/destinations/pipedrive/createUpdateActivity/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateDeal/index.js +35 -11
- package/dist/destinations/pipedrive/createUpdateDeal/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateLead/generated-types.d.ts +3 -8
- package/dist/destinations/pipedrive/createUpdateLead/index.js +54 -27
- package/dist/destinations/pipedrive/createUpdateLead/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateNote/generated-types.d.ts +1 -1
- package/dist/destinations/pipedrive/createUpdateNote/index.js +22 -13
- package/dist/destinations/pipedrive/createUpdateNote/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdateOrganization/index.js +8 -2
- package/dist/destinations/pipedrive/createUpdateOrganization/index.js.map +1 -1
- package/dist/destinations/pipedrive/createUpdatePerson/index.js +15 -3
- package/dist/destinations/pipedrive/createUpdatePerson/index.js.map +1 -1
- package/dist/destinations/pipedrive/index.d.ts +1 -1
- package/dist/destinations/pipedrive/index.js +22 -1
- package/dist/destinations/pipedrive/index.js.map +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/leads.d.ts +5 -1
- package/dist/destinations/pipedrive/pipedriveApi/leads.js.map +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/notes.d.ts +1 -1
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.d.ts +2 -1
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js +7 -1
- package/dist/destinations/pipedrive/pipedriveApi/pipedrive-client.js.map +1 -1
- package/dist/destinations/saleswings/api.d.ts +35 -0
- package/dist/destinations/saleswings/api.js +19 -0
- package/dist/destinations/saleswings/api.js.map +1 -0
- package/dist/destinations/saleswings/common.d.ts +5 -0
- package/dist/destinations/saleswings/common.js +37 -0
- package/dist/destinations/saleswings/common.js.map +1 -0
- package/dist/destinations/saleswings/converter.d.ts +12 -0
- package/dist/destinations/saleswings/converter.js +34 -0
- package/dist/destinations/saleswings/converter.js.map +1 -0
- package/dist/destinations/saleswings/fields.d.ts +12 -0
- package/dist/destinations/saleswings/fields.js +102 -0
- package/dist/destinations/saleswings/fields.js.map +1 -0
- package/dist/destinations/saleswings/generated-types.d.ts +3 -0
- package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → saleswings}/generated-types.js +0 -0
- package/dist/destinations/saleswings/generated-types.js.map +1 -0
- package/dist/destinations/saleswings/index.d.ts +4 -0
- package/dist/destinations/saleswings/index.js +67 -0
- package/dist/destinations/saleswings/index.js.map +1 -0
- package/dist/destinations/saleswings/submitIdentifyEvent/generated-types.d.ts +14 -0
- package/dist/destinations/saleswings/submitIdentifyEvent/generated-types.js +3 -0
- package/dist/destinations/saleswings/submitIdentifyEvent/generated-types.js.map +1 -0
- package/dist/destinations/{engage-messaging-twilio/sendWhatsApp → saleswings/submitIdentifyEvent}/index.d.ts +0 -0
- package/dist/destinations/saleswings/submitIdentifyEvent/index.js +39 -0
- package/dist/destinations/saleswings/submitIdentifyEvent/index.js.map +1 -0
- package/dist/destinations/saleswings/submitPageEvent/generated-types.d.ts +8 -0
- package/dist/destinations/saleswings/submitPageEvent/generated-types.js +3 -0
- package/dist/destinations/saleswings/submitPageEvent/generated-types.js.map +1 -0
- package/dist/destinations/saleswings/submitPageEvent/index.d.ts +5 -0
- package/dist/destinations/saleswings/submitPageEvent/index.js +35 -0
- package/dist/destinations/saleswings/submitPageEvent/index.js.map +1 -0
- package/dist/destinations/saleswings/submitScreenEvent/generated-types.d.ts +14 -0
- package/dist/destinations/saleswings/submitScreenEvent/generated-types.js +3 -0
- package/dist/destinations/saleswings/submitScreenEvent/generated-types.js.map +1 -0
- package/dist/destinations/saleswings/submitScreenEvent/index.d.ts +5 -0
- package/dist/destinations/saleswings/submitScreenEvent/index.js +42 -0
- package/dist/destinations/saleswings/submitScreenEvent/index.js.map +1 -0
- package/dist/destinations/saleswings/submitTrackEvent/generated-types.d.ts +14 -0
- package/dist/destinations/saleswings/submitTrackEvent/generated-types.js +3 -0
- package/dist/destinations/saleswings/submitTrackEvent/generated-types.js.map +1 -0
- package/dist/destinations/saleswings/submitTrackEvent/index.d.ts +5 -0
- package/dist/destinations/saleswings/submitTrackEvent/index.js +42 -0
- package/dist/destinations/saleswings/submitTrackEvent/index.js.map +1 -0
- package/dist/destinations/saleswings/testing.d.ts +10 -0
- package/dist/destinations/saleswings/testing.js +55 -0
- package/dist/destinations/saleswings/testing.js.map +1 -0
- package/package.json +4 -6
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.d.ts +0 -15
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js +0 -66
- package/dist/destinations/engage-messaging-twilio/sendSms/sms-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.d.ts +0 -23
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js +0 -122
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/index.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.d.ts +0 -15
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js +0 -66
- package/dist/destinations/engage-messaging-twilio/sendWhatsApp/whatsapp-sender.js.map +0 -1
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.d.ts +0 -23
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js +0 -97
- package/dist/destinations/engage-messaging-twilio/utils/message-sender.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/saleswings/submitIdentifyEvent/index.ts"],"names":[],"mappings":";;AAGA,gCAA6C;AAC7C,sCAAkH;AAClH,4CAA+E;AAC/E,sCAAiD;AAEjD,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAqB,EAAE;IAC3D,OAAO,IAAI,mBAAa,CAAC;QACvB,QAAQ,EAAE,2BAAe,CAAC,OAAO,CAAC;QAClC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,4BAAgB,CAAC,OAAO,CAAC,SAAS,CAAC;QAC9C,MAAM,EAAE,yBAAa,CAAC,OAAO,CAAC,MAAM,CAAC;KACtC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,uBAAuB;IAC9B,WAAW,EACT,+GAA+G;IACjH,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,IAAI,EAAE,aAAI,CAAC,UAAU,CAAC;QACtB,IAAI,EAAE,aAAI,CAAC,EAAE,OAAO,EAAE,gBAAgB,EAAE,CAAC;QACzC,MAAM,EAAN,eAAM;QACN,WAAW,EAAX,oBAAW;QACX,KAAK,EAAE,EAAE,GAAG,cAAK,EAAE,QAAQ,EAAE,IAAI,EAAE;QACnC,GAAG,EAAH,YAAG;QACH,WAAW,EAAX,oBAAW;QACX,SAAS,EAAT,kBAAS;QACT,SAAS,EAAT,kBAAS;QACT,MAAM,EAAE,eAAM,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;KACxC;IACD,OAAO,EAAE,gBAAO,CAAC,YAAY,CAAC;IAC9B,YAAY,EAAE,qBAAY,CAAC,YAAY,CAAC;CACzC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/saleswings/submitPageEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_1 = require("../api");
|
|
4
|
+
const fields_1 = require("../fields");
|
|
5
|
+
const converter_1 = require("../converter");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const convertEvent = (payload) => {
|
|
8
|
+
const leadRefs = converter_1.convertLeadRefs(payload);
|
|
9
|
+
if (leadRefs.length == 0)
|
|
10
|
+
return undefined;
|
|
11
|
+
return new api_1.PageVisitEvent({
|
|
12
|
+
leadRefs,
|
|
13
|
+
url: payload.url,
|
|
14
|
+
referrerUrl: payload.referrerUrl,
|
|
15
|
+
userAgent: payload.userAgent,
|
|
16
|
+
timestamp: converter_1.convertTimestamp(payload.timestamp)
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
const action = {
|
|
20
|
+
title: 'Submit Page Event',
|
|
21
|
+
description: 'Send your Segment Page events to SalesWings to use them for tagging, scoring and prioritising your leads.',
|
|
22
|
+
defaultSubscription: 'type = "page"',
|
|
23
|
+
fields: {
|
|
24
|
+
userId: fields_1.userId,
|
|
25
|
+
anonymousId: fields_1.anonymousId,
|
|
26
|
+
url: { ...fields_1.url, required: true },
|
|
27
|
+
referrerUrl: fields_1.referrerUrl,
|
|
28
|
+
userAgent: fields_1.userAgent,
|
|
29
|
+
timestamp: fields_1.timestamp
|
|
30
|
+
},
|
|
31
|
+
perform: common_1.perform(convertEvent),
|
|
32
|
+
performBatch: common_1.performBatch(convertEvent)
|
|
33
|
+
};
|
|
34
|
+
exports.default = action;
|
|
35
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/saleswings/submitPageEvent/index.ts"],"names":[],"mappings":";;AAGA,gCAA8C;AAC9C,sCAAuF;AACvF,4CAAgE;AAChE,sCAAiD;AAEjD,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAqB,EAAE;IAC3D,MAAM,QAAQ,GAAG,2BAAe,CAAC,OAAO,CAAC,CAAA;IACzC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IAC1C,OAAO,IAAI,oBAAc,CAAC;QACxB,QAAQ;QACR,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,4BAAgB,CAAC,OAAO,CAAC,SAAS,CAAC;KAC/C,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,2GAA2G;IAC7G,mBAAmB,EAAE,eAAe;IACpC,MAAM,EAAE;QACN,MAAM,EAAN,eAAM;QACN,WAAW,EAAX,oBAAW;QACX,GAAG,EAAE,EAAE,GAAG,YAAG,EAAE,QAAQ,EAAE,IAAI,EAAE;QAC/B,WAAW,EAAX,oBAAW;QACX,SAAS,EAAT,kBAAS;QACT,SAAS,EAAT,kBAAS;KACV;IACD,OAAO,EAAE,gBAAO,CAAC,YAAY,CAAC;IAC9B,YAAY,EAAE,qBAAY,CAAC,YAAY,CAAC;CACzC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
kind: string;
|
|
3
|
+
data: string;
|
|
4
|
+
userId?: string;
|
|
5
|
+
anonymousId?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
referrerUrl?: string;
|
|
9
|
+
userAgent?: string;
|
|
10
|
+
timestamp?: string | number;
|
|
11
|
+
values?: {
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/saleswings/submitScreenEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_1 = require("../api");
|
|
4
|
+
const fields_1 = require("../fields");
|
|
5
|
+
const converter_1 = require("../converter");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const convertEvent = (payload) => {
|
|
8
|
+
const leadRefs = converter_1.convertLeadRefs(payload);
|
|
9
|
+
if (leadRefs.length == 0)
|
|
10
|
+
return undefined;
|
|
11
|
+
return new api_1.TrackingEvent({
|
|
12
|
+
leadRefs,
|
|
13
|
+
kind: payload.kind,
|
|
14
|
+
data: payload.data,
|
|
15
|
+
url: payload.url,
|
|
16
|
+
referrerUrl: payload.referrerUrl,
|
|
17
|
+
userAgent: payload.userAgent,
|
|
18
|
+
timestamp: converter_1.convertTimestamp(payload.timestamp),
|
|
19
|
+
values: converter_1.convertValues(payload.values)
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const action = {
|
|
23
|
+
title: 'Submit Screen Event',
|
|
24
|
+
description: 'Send your Segment Screen events to SalesWings to use them for tagging, scoring and prioritising your leads.',
|
|
25
|
+
defaultSubscription: 'type = "screen"',
|
|
26
|
+
fields: {
|
|
27
|
+
kind: fields_1.kind('Screen'),
|
|
28
|
+
data: fields_1.data({ '@path': '$.name' }),
|
|
29
|
+
userId: fields_1.userId,
|
|
30
|
+
anonymousId: fields_1.anonymousId,
|
|
31
|
+
email: fields_1.email,
|
|
32
|
+
url: fields_1.url,
|
|
33
|
+
referrerUrl: fields_1.referrerUrl,
|
|
34
|
+
userAgent: fields_1.userAgent,
|
|
35
|
+
timestamp: fields_1.timestamp,
|
|
36
|
+
values: fields_1.values({ '@path': '$.properties' })
|
|
37
|
+
},
|
|
38
|
+
perform: common_1.perform(convertEvent),
|
|
39
|
+
performBatch: common_1.performBatch(convertEvent)
|
|
40
|
+
};
|
|
41
|
+
exports.default = action;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/saleswings/submitScreenEvent/index.ts"],"names":[],"mappings":";;AAGA,gCAA6C;AAC7C,sCAAkH;AAClH,4CAA+E;AAC/E,sCAAiD;AAEjD,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAqB,EAAE;IAC3D,MAAM,QAAQ,GAAG,2BAAe,CAAC,OAAO,CAAC,CAAA;IACzC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IAC1C,OAAO,IAAI,mBAAa,CAAC;QACvB,QAAQ;QACR,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,4BAAgB,CAAC,OAAO,CAAC,SAAS,CAAC;QAC9C,MAAM,EAAE,yBAAa,CAAC,OAAO,CAAC,MAAM,CAAC;KACtC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,qBAAqB;IAC5B,WAAW,EACT,6GAA6G;IAC/G,mBAAmB,EAAE,iBAAiB;IACtC,MAAM,EAAE;QACN,IAAI,EAAE,aAAI,CAAC,QAAQ,CAAC;QACpB,IAAI,EAAE,aAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;QACjC,MAAM,EAAN,eAAM;QACN,WAAW,EAAX,oBAAW;QACX,KAAK,EAAL,cAAK;QACL,GAAG,EAAH,YAAG;QACH,WAAW,EAAX,oBAAW;QACX,SAAS,EAAT,kBAAS;QACT,SAAS,EAAT,kBAAS;QACT,MAAM,EAAE,eAAM,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;KAC5C;IACD,OAAO,EAAE,gBAAO,CAAC,YAAY,CAAC;IAC9B,YAAY,EAAE,qBAAY,CAAC,YAAY,CAAC;CACzC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
kind: string;
|
|
3
|
+
data: string;
|
|
4
|
+
userId?: string;
|
|
5
|
+
anonymousId?: string;
|
|
6
|
+
email?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
referrerUrl?: string;
|
|
9
|
+
userAgent?: string;
|
|
10
|
+
timestamp?: string | number;
|
|
11
|
+
values?: {
|
|
12
|
+
[k: string]: unknown;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/saleswings/submitTrackEvent/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const api_1 = require("../api");
|
|
4
|
+
const fields_1 = require("../fields");
|
|
5
|
+
const converter_1 = require("../converter");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const convertEvent = (payload) => {
|
|
8
|
+
const leadRefs = converter_1.convertLeadRefs(payload);
|
|
9
|
+
if (leadRefs.length == 0)
|
|
10
|
+
return undefined;
|
|
11
|
+
return new api_1.TrackingEvent({
|
|
12
|
+
leadRefs,
|
|
13
|
+
kind: payload.kind,
|
|
14
|
+
data: payload.data,
|
|
15
|
+
url: payload.url,
|
|
16
|
+
referrerUrl: payload.referrerUrl,
|
|
17
|
+
userAgent: payload.userAgent,
|
|
18
|
+
timestamp: converter_1.convertTimestamp(payload.timestamp),
|
|
19
|
+
values: converter_1.convertValues(payload.values)
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
const action = {
|
|
23
|
+
title: 'Submit Track Event',
|
|
24
|
+
description: 'Send your Segment Track events to SalesWings to use them for tagging, scoring and prioritising your leads.',
|
|
25
|
+
defaultSubscription: 'type = "track"',
|
|
26
|
+
fields: {
|
|
27
|
+
kind: fields_1.kind('Track'),
|
|
28
|
+
data: fields_1.data({ '@path': '$.event' }),
|
|
29
|
+
userId: fields_1.userId,
|
|
30
|
+
anonymousId: fields_1.anonymousId,
|
|
31
|
+
email: fields_1.email,
|
|
32
|
+
url: fields_1.url,
|
|
33
|
+
referrerUrl: fields_1.referrerUrl,
|
|
34
|
+
userAgent: fields_1.userAgent,
|
|
35
|
+
timestamp: fields_1.timestamp,
|
|
36
|
+
values: fields_1.values({ '@path': '$.properties' })
|
|
37
|
+
},
|
|
38
|
+
perform: common_1.perform(convertEvent),
|
|
39
|
+
performBatch: common_1.performBatch(convertEvent)
|
|
40
|
+
};
|
|
41
|
+
exports.default = action;
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/saleswings/submitTrackEvent/index.ts"],"names":[],"mappings":";;AAGA,gCAA6C;AAC7C,sCAAkH;AAClH,4CAA+E;AAC/E,sCAAiD;AAEjD,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAqB,EAAE;IAC3D,MAAM,QAAQ,GAAG,2BAAe,CAAC,OAAO,CAAC,CAAA;IACzC,IAAI,QAAQ,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,SAAS,CAAA;IAC1C,OAAO,IAAI,mBAAa,CAAC;QACvB,QAAQ;QACR,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,SAAS,EAAE,4BAAgB,CAAC,OAAO,CAAC,SAAS,CAAC;QAC9C,MAAM,EAAE,yBAAa,CAAC,OAAO,CAAC,MAAM,CAAC;KACtC,CAAC,CAAA;AACJ,CAAC,CAAA;AAED,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,4GAA4G;IAC9G,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,IAAI,EAAE,aAAI,CAAC,OAAO,CAAC;QACnB,IAAI,EAAE,aAAI,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;QAClC,MAAM,EAAN,eAAM;QACN,WAAW,EAAX,oBAAW;QACX,KAAK,EAAL,cAAK;QACL,GAAG,EAAH,YAAG;QACH,WAAW,EAAX,oBAAW;QACX,SAAS,EAAT,kBAAS;QACT,SAAS,EAAT,kBAAS;QACT,MAAM,EAAE,eAAM,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC;KAC5C;IACD,OAAO,EAAE,gBAAO,CAAC,YAAY,CAAC;IAC9B,YAAY,EAAE,qBAAY,CAAC,YAAY,CAAC;CACzC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SegmentEvent } from '@segment/actions-core';
|
|
2
|
+
export declare const settings: {
|
|
3
|
+
apiKey: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const testAction: (actionName: string, event: SegmentEvent) => Promise<any>;
|
|
6
|
+
export declare const testBatchAction: (actionName: string, events: SegmentEvent[]) => Promise<any>;
|
|
7
|
+
export declare const testActionWithSkippedEvent: (actionName: string, event: SegmentEvent) => Promise<void>;
|
|
8
|
+
export declare const testBatchActionSkippedEvents: (actionName: string, events: SegmentEvent[]) => Promise<void>;
|
|
9
|
+
export declare const expectedTs: (segmentEventTs: string | Date | undefined) => number;
|
|
10
|
+
export declare const userAgent = "\"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.userAgent = exports.expectedTs = exports.testBatchActionSkippedEvents = exports.testActionWithSkippedEvent = exports.testBatchAction = exports.testAction = exports.settings = void 0;
|
|
7
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
8
|
+
const nock_1 = __importDefault(require("nock"));
|
|
9
|
+
const api_1 = require("./api");
|
|
10
|
+
const index_1 = __importDefault(require("./index"));
|
|
11
|
+
const testDestination = actions_core_1.createTestIntegration(index_1.default);
|
|
12
|
+
exports.settings = { apiKey: 'TEST_API_KEY' };
|
|
13
|
+
const testAction = async (actionName, event) => {
|
|
14
|
+
nock_1.default(api_1.apiBaseUrl).post('/events').reply(200, {});
|
|
15
|
+
const input = { event, settings: exports.settings, useDefaultMappings: true };
|
|
16
|
+
const responses = await testDestination.testAction(actionName, input);
|
|
17
|
+
expect(responses.length).toBe(1);
|
|
18
|
+
const request = responses[0].request;
|
|
19
|
+
expect(request.headers.get('Authorization')).toBe(`Bearer ${exports.settings.apiKey}`);
|
|
20
|
+
const rawBody = await request.text();
|
|
21
|
+
return JSON.parse(rawBody);
|
|
22
|
+
};
|
|
23
|
+
exports.testAction = testAction;
|
|
24
|
+
const testBatchAction = async (actionName, events) => {
|
|
25
|
+
nock_1.default(api_1.apiBaseUrl).post('/events/batches').reply(200, {});
|
|
26
|
+
const input = { events, settings: exports.settings, useDefaultMappings: true };
|
|
27
|
+
const responses = await testDestination.testBatchAction(actionName, input);
|
|
28
|
+
expect(responses.length).toBe(1);
|
|
29
|
+
const request = responses[0].request;
|
|
30
|
+
expect(request.headers.get('Authorization')).toBe(`Bearer ${exports.settings.apiKey}`);
|
|
31
|
+
const rawBody = await request.text();
|
|
32
|
+
return JSON.parse(rawBody);
|
|
33
|
+
};
|
|
34
|
+
exports.testBatchAction = testBatchAction;
|
|
35
|
+
const testActionWithSkippedEvent = async (actionName, event) => {
|
|
36
|
+
const responses = await testDestination.testAction(actionName, { event, settings: exports.settings, useDefaultMappings: true });
|
|
37
|
+
expect(responses.length).toBe(0);
|
|
38
|
+
};
|
|
39
|
+
exports.testActionWithSkippedEvent = testActionWithSkippedEvent;
|
|
40
|
+
const testBatchActionSkippedEvents = async (actionName, events) => {
|
|
41
|
+
const responses = await testDestination.testBatchAction(actionName, { events, settings: exports.settings, useDefaultMappings: true });
|
|
42
|
+
expect(responses.length).toBe(0);
|
|
43
|
+
};
|
|
44
|
+
exports.testBatchActionSkippedEvents = testBatchActionSkippedEvents;
|
|
45
|
+
const expectedTs = (segmentEventTs) => {
|
|
46
|
+
if (segmentEventTs === undefined)
|
|
47
|
+
throw new Error('Unexpected state: test event created without a timestamp');
|
|
48
|
+
else if (typeof segmentEventTs === 'string')
|
|
49
|
+
return Date.parse(segmentEventTs);
|
|
50
|
+
else
|
|
51
|
+
return segmentEventTs.valueOf();
|
|
52
|
+
};
|
|
53
|
+
exports.expectedTs = expectedTs;
|
|
54
|
+
exports.userAgent = '"Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1';
|
|
55
|
+
//# sourceMappingURL=testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.js","sourceRoot":"","sources":["../../../src/destinations/saleswings/testing.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA2E;AAC3E,gDAAuB;AACvB,+BAAkC;AAClC,oDAAiC;AAEjC,MAAM,eAAe,GAAG,oCAAqB,CAAC,eAAW,CAAC,CAAA;AAE7C,QAAA,QAAQ,GAAG,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA;AAE3C,MAAM,UAAU,GAAG,KAAK,EAAE,UAAkB,EAAE,KAAmB,EAAgB,EAAE;IACxF,cAAI,CAAC,gBAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;IAC/C,MAAM,KAAK,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAR,gBAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAA;IAC3D,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;IACrE,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CA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kB,EAAE,KAAmB,EAAiB,EAAE;IACzG,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,UAAU,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAR,gBAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7G,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAClC,CAAC,CAAA;AAHY,QAAA,0BAA0B,8BAGtC;AAEM,MAAM,4BAA4B,GAAG,KAAK,EAAE,UAAkB,EAAE,MAAsB,EAAiB,EAAE;IAC9G,MAAM,SAAS,GAAG,MAAM,eAAe,CAAC,eAAe,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAR,gBAAQ,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAA;IACnH,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;AAClC,CAAC,CAAA;AAHY,QAAA,4BAA4B,gCAGxC;AAEM,MAAM,UAAU,GAAG,CAAC,cAAyC,EAAU,EAAE;IAC9E,IAAI,cAAc,KAAK,SAAS;QAAE,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAA;SACxG,IAAI,OAAO,cAAc,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;;QACzE,OAAO,cAAc,CAAC,OAAO,EAAE,CAAA;AACtC,CAAC,CAAA;AAJY,QAAA,UAAU,cAItB;AAEY,QAAA,SAAS,GACpB,wIAAwI,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@segment/action-destinations",
|
|
3
3
|
"description": "Destination Actions engine and definitions.",
|
|
4
|
-
"version": "3.127.
|
|
4
|
+
"version": "3.127.3-brackets-stuff.18+511f78fc",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -31,7 +31,6 @@
|
|
|
31
31
|
"typecheck": "tsc -p tsconfig.build.json --noEmit"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@types/google-libphonenumber": "^7.4.23",
|
|
35
34
|
"@types/jest": "^27.0.0",
|
|
36
35
|
"jest": "^27.3.1",
|
|
37
36
|
"nock": "^13.1.4"
|
|
@@ -39,12 +38,11 @@
|
|
|
39
38
|
"dependencies": {
|
|
40
39
|
"@amplitude/ua-parser-js": "^0.7.25",
|
|
41
40
|
"@segment/a1-notation": "^2.1.4",
|
|
42
|
-
"@segment/actions-core": "^3.49.
|
|
43
|
-
"@segment/actions-shared": "^1.31.
|
|
41
|
+
"@segment/actions-core": "^3.49.1-brackets-stuff.22+511f78fc",
|
|
42
|
+
"@segment/actions-shared": "^1.31.1-brackets-stuff.22+511f78fc",
|
|
44
43
|
"cheerio": "^1.0.0-rc.10",
|
|
45
44
|
"dayjs": "^1.10.7",
|
|
46
45
|
"escape-goat": "^3",
|
|
47
|
-
"google-libphonenumber": "^3.2.31",
|
|
48
46
|
"liquidjs": "^9.37.0",
|
|
49
47
|
"lodash": "^4.17.21"
|
|
50
48
|
},
|
|
@@ -67,5 +65,5 @@
|
|
|
67
65
|
"lcov"
|
|
68
66
|
]
|
|
69
67
|
},
|
|
70
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "511f78fc62f25623fbe7cab6fb23171146b4e83f"
|
|
71
69
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Settings } from '../generated-types';
|
|
2
|
-
import type { Payload } from './generated-types';
|
|
3
|
-
import { StatsClient, StatsContext } from '@segment/actions-core/src/destination-kit';
|
|
4
|
-
import { MessageSender, RequestFn } from '../utils/message-sender';
|
|
5
|
-
export declare class SmsMessageSender extends MessageSender<Payload> {
|
|
6
|
-
readonly request: RequestFn;
|
|
7
|
-
readonly payload: Payload;
|
|
8
|
-
readonly settings: Settings;
|
|
9
|
-
readonly statsClient: StatsClient | undefined;
|
|
10
|
-
readonly tags: StatsContext['tags'] | undefined;
|
|
11
|
-
constructor(request: RequestFn, payload: Payload, settings: Settings, statsClient: StatsClient | undefined, tags: StatsContext['tags'] | undefined);
|
|
12
|
-
getBody: (phone: string) => Promise<URLSearchParams>;
|
|
13
|
-
getTwilioBase64Token: () => string;
|
|
14
|
-
private getProfileTraits;
|
|
15
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SmsMessageSender = void 0;
|
|
4
|
-
const liquidjs_1 = require("liquidjs");
|
|
5
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
6
|
-
const message_sender_1 = require("../utils/message-sender");
|
|
7
|
-
const Liquid = new liquidjs_1.Liquid();
|
|
8
|
-
class SmsMessageSender extends message_sender_1.MessageSender {
|
|
9
|
-
constructor(request, payload, settings, statsClient, tags) {
|
|
10
|
-
super(request, payload, settings, statsClient, tags);
|
|
11
|
-
this.request = request;
|
|
12
|
-
this.payload = payload;
|
|
13
|
-
this.settings = settings;
|
|
14
|
-
this.statsClient = statsClient;
|
|
15
|
-
this.tags = tags;
|
|
16
|
-
this.getBody = async (phone) => {
|
|
17
|
-
let traits;
|
|
18
|
-
if (this.payload.traitEnrichment) {
|
|
19
|
-
traits = this.payload?.traits ? this.payload?.traits : {};
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
traits = await this.getProfileTraits();
|
|
23
|
-
}
|
|
24
|
-
const profile = {
|
|
25
|
-
user_id: this.payload.userId,
|
|
26
|
-
phone,
|
|
27
|
-
traits
|
|
28
|
-
};
|
|
29
|
-
let parsedBody;
|
|
30
|
-
try {
|
|
31
|
-
parsedBody = await Liquid.parseAndRender(this.payload.body, { profile });
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
throw new actions_core_1.IntegrationError(`Unable to parse templating in SMS`, `SMS templating parse failure`, 400);
|
|
35
|
-
}
|
|
36
|
-
const body = new URLSearchParams({
|
|
37
|
-
Body: parsedBody,
|
|
38
|
-
From: this.payload.from,
|
|
39
|
-
To: phone
|
|
40
|
-
});
|
|
41
|
-
return body;
|
|
42
|
-
};
|
|
43
|
-
this.getTwilioBase64Token = () => Buffer.from(`${this.settings.twilioApiKeySID}:${this.settings.twilioApiKeySecret}`).toString('base64');
|
|
44
|
-
this.getProfileTraits = async () => {
|
|
45
|
-
try {
|
|
46
|
-
const endpoint = `https://profiles.segment.${this.settings.profileApiEnvironment === 'production' ? 'com' : 'build'}`;
|
|
47
|
-
const response = await this.request(`${endpoint}/v1/spaces/${this.settings.spaceId}/collections/users/profiles/user_id:${this.payload.userId}/traits?limit=200`, {
|
|
48
|
-
headers: {
|
|
49
|
-
authorization: `Basic ${Buffer.from(this.settings.profileApiAccessToken + ':').toString('base64')}`,
|
|
50
|
-
'content-type': 'application/json'
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
this.tags?.push(`profile_status_code:${response.status}`);
|
|
54
|
-
this.statsClient?.incr('actions-personas-messaging-twilio.profile_invoked', 1, this.tags);
|
|
55
|
-
const body = await response.json();
|
|
56
|
-
return body.traits;
|
|
57
|
-
}
|
|
58
|
-
catch (error) {
|
|
59
|
-
this.statsClient?.incr('actions-personas-messaging-twilio.profile_error', 1, this.tags);
|
|
60
|
-
throw new actions_core_1.IntegrationError('Unable to get profile traits for SMS message', 'SMS trait fetch failure', 500);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.SmsMessageSender = SmsMessageSender;
|
|
66
|
-
//# sourceMappingURL=sms-sender.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sms-sender.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/sendSms/sms-sender.ts"],"names":[],"mappings":";;;AACA,uCAA6C;AAG7C,wDAAw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AAC,IAAI,CAAC,CAAA;gBACvF,MAAM,IAAI,+BAAgB,CAAC,8CAA8C,EAAE,yBAAyB,EAAE,GAAG,CAAC,CAAA;aAC3G;QACH,CAAC,CAAA;IA5DD,CAAC;CA6DF;AAtED,4CAsEC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
contentSid: string;
|
|
3
|
-
contentVariables?: {
|
|
4
|
-
[k: string]: unknown;
|
|
5
|
-
};
|
|
6
|
-
toNumber?: string;
|
|
7
|
-
from: string;
|
|
8
|
-
customArgs?: {
|
|
9
|
-
[k: string]: unknown;
|
|
10
|
-
};
|
|
11
|
-
connectionOverrides?: string;
|
|
12
|
-
send?: boolean;
|
|
13
|
-
traitEnrichment?: boolean;
|
|
14
|
-
externalIds?: {
|
|
15
|
-
id?: string;
|
|
16
|
-
type?: string;
|
|
17
|
-
subscriptionStatus?: string;
|
|
18
|
-
}[];
|
|
19
|
-
traits?: {
|
|
20
|
-
[k: string]: unknown;
|
|
21
|
-
};
|
|
22
|
-
eventOccurredTS?: string;
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/sendWhatsApp/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const whatsapp_sender_1 = require("./whatsapp-sender");
|
|
4
|
-
const action = {
|
|
5
|
-
title: 'Send WhatsApp',
|
|
6
|
-
description: 'Send WhatsApp using Twilio',
|
|
7
|
-
defaultSubscription: 'type = "track" and event = "Audience Entered"',
|
|
8
|
-
fields: {
|
|
9
|
-
contentSid: {
|
|
10
|
-
label: 'WhatsApp template Content Sid',
|
|
11
|
-
description: 'The template you sending through WhatsApp',
|
|
12
|
-
type: 'string',
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
contentVariables: {
|
|
16
|
-
label: 'WhatsApp template variables',
|
|
17
|
-
description: 'Content personalization variables/merge tags for your WhatsApp message',
|
|
18
|
-
type: 'object',
|
|
19
|
-
required: false
|
|
20
|
-
},
|
|
21
|
-
toNumber: {
|
|
22
|
-
label: 'Test Number',
|
|
23
|
-
description: 'Number to send WhatsApp to when testing',
|
|
24
|
-
type: 'string'
|
|
25
|
-
},
|
|
26
|
-
from: {
|
|
27
|
-
label: 'From',
|
|
28
|
-
description: 'The Twilio Phone Number, Short Code, or Messaging Service to send WhatsApp from.',
|
|
29
|
-
type: 'string',
|
|
30
|
-
required: true
|
|
31
|
-
},
|
|
32
|
-
customArgs: {
|
|
33
|
-
label: 'Custom Arguments',
|
|
34
|
-
description: 'Additional custom arguments that will be opaquely sent back on webhook events',
|
|
35
|
-
type: 'object',
|
|
36
|
-
required: false
|
|
37
|
-
},
|
|
38
|
-
connectionOverrides: {
|
|
39
|
-
label: 'Connection Overrides',
|
|
40
|
-
description: 'Connection overrides are configuration supported by twilio webhook services. Must be passed as fragments on the callback url',
|
|
41
|
-
type: 'string',
|
|
42
|
-
required: false
|
|
43
|
-
},
|
|
44
|
-
send: {
|
|
45
|
-
label: 'Send Message',
|
|
46
|
-
description: 'Whether or not the message should actually get sent.',
|
|
47
|
-
type: 'boolean',
|
|
48
|
-
required: false,
|
|
49
|
-
default: false
|
|
50
|
-
},
|
|
51
|
-
traitEnrichment: {
|
|
52
|
-
label: 'Trait Enrich',
|
|
53
|
-
description: 'Whether or not trait enrich from event (i.e without profile api call)',
|
|
54
|
-
type: 'boolean',
|
|
55
|
-
required: false,
|
|
56
|
-
default: true
|
|
57
|
-
},
|
|
58
|
-
externalIds: {
|
|
59
|
-
label: 'External IDs',
|
|
60
|
-
description: 'An array of user profile identity information.',
|
|
61
|
-
type: 'object',
|
|
62
|
-
multiple: true,
|
|
63
|
-
properties: {
|
|
64
|
-
id: {
|
|
65
|
-
label: 'ID',
|
|
66
|
-
description: 'A unique identifier for the collection.',
|
|
67
|
-
type: 'string'
|
|
68
|
-
},
|
|
69
|
-
type: {
|
|
70
|
-
label: 'type',
|
|
71
|
-
description: 'The external ID contact type.',
|
|
72
|
-
type: 'string'
|
|
73
|
-
},
|
|
74
|
-
subscriptionStatus: {
|
|
75
|
-
label: 'ID',
|
|
76
|
-
description: 'The subscription status for the identity.',
|
|
77
|
-
type: 'string'
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
default: {
|
|
81
|
-
'@arrayPath': [
|
|
82
|
-
'$.external_ids',
|
|
83
|
-
{
|
|
84
|
-
id: {
|
|
85
|
-
'@path': '$.id'
|
|
86
|
-
},
|
|
87
|
-
type: {
|
|
88
|
-
'@path': '$.type'
|
|
89
|
-
},
|
|
90
|
-
subscriptionStatus: {
|
|
91
|
-
'@path': '$.isSubscribed'
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
traits: {
|
|
98
|
-
label: 'Traits',
|
|
99
|
-
description: "A user profile's traits",
|
|
100
|
-
type: 'object',
|
|
101
|
-
required: false,
|
|
102
|
-
default: { '@path': '$.properties' }
|
|
103
|
-
},
|
|
104
|
-
eventOccurredTS: {
|
|
105
|
-
label: 'Event Timestamp',
|
|
106
|
-
description: 'Time of when the actual event happened.',
|
|
107
|
-
type: 'string',
|
|
108
|
-
required: false,
|
|
109
|
-
default: {
|
|
110
|
-
'@path': '$.timestamp'
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
perform: async (request, { settings, payload, statsContext }) => {
|
|
115
|
-
const statsClient = statsContext?.statsClient;
|
|
116
|
-
const tags = statsContext?.tags;
|
|
117
|
-
tags?.push(`space_id:${settings.spaceId}`, `projectid:${settings.sourceId}`);
|
|
118
|
-
return new whatsapp_sender_1.WhatsAppMessageSender(request, payload, settings, statsClient, tags).send();
|
|
119
|
-
}
|
|
120
|
-
};
|
|
121
|
-
exports.default = action;
|
|
122
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/engage-messaging-twilio/sendWhatsApp/index.ts"],"names":[],"mappings":";;AAIA,uDAAyD;AAEzD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,4BAA4B;IACzC,mBAAmB,EAAE,+CAA+C;IACpE,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,+BAA+B;YACtC,WAAW,EAAE,2CAA2C;YACxD,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,gBAAgB,EAAE;YAChB,KAAK,EAAE,6BAA6B;YACpC,WAAW,EAAE,wEAAwE;YACrF,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,QAAQ;SACf;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,MAAM;YACb,WAAW,EAAE,kFAAkF;YAC/F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;SACf;QACD,UAAU,EAAE;YACV,KAAK,EAAE,kBAAkB;YACzB,WAAW,EAAE,+EAA+E;YAC5F,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,mBAAmB,EAAE;YACnB,KAAK,EAAE,sBAAsB;YAC7B,WAAW,EACT,8HAA8H;YAChI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;SAChB;QACD,IAAI,EAAE;YACJ,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,sDAAsD;YACnE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;QACD,eAAe,EAAE;YACf,KAAK,EAAE,cAAc;YACrB,WAAW,EAAE,uEAAuE;Y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AE,WAAW,CAAA;QAC7C,MAAM,IAAI,GAAG,YAAY,EAAE,IAAI,CAAA;QAC/B,IAAI,EAAE,IAAI,CAAC,YAAY,QAAQ,CAAC,OAAO,EAAE,EAAE,aAAa,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;QAE5E,OAAO,IAAI,uCAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IACxF,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Settings } from '../generated-types';
|
|
2
|
-
import type { Payload } from './generated-types';
|
|
3
|
-
import { RequestFn, MessageSender } from '../utils/message-sender';
|
|
4
|
-
import { StatsClient, StatsContext } from '@segment/actions-core/src/destination-kit';
|
|
5
|
-
export declare class WhatsAppMessageSender extends MessageSender<Payload> {
|
|
6
|
-
readonly request: RequestFn;
|
|
7
|
-
readonly payload: Payload;
|
|
8
|
-
readonly settings: Settings;
|
|
9
|
-
readonly statsClient: StatsClient | undefined;
|
|
10
|
-
readonly tags: StatsContext['tags'] | undefined;
|
|
11
|
-
constructor(request: RequestFn, payload: Payload, settings: Settings, statsClient: StatsClient | undefined, tags: StatsContext['tags'] | undefined);
|
|
12
|
-
getBody: (phone: string) => Promise<URLSearchParams>;
|
|
13
|
-
getTwilioBase64Token: () => string;
|
|
14
|
-
private getVariables;
|
|
15
|
-
}
|