@segment/action-destinations 3.127.3-node-18.11 → 3.127.3-sf-regex-instanceURL.15
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/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/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/salesforce/sf-operations.js +2 -1
- package/dist/destinations/salesforce/sf-operations.js.map +1 -1
- package/dist/destinations/salesforce/sf-utils.d.ts +1 -0
- package/dist/destinations/salesforce/sf-utils.js +13 -1
- package/dist/destinations/salesforce/sf-utils.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/saleswings/generated-types.js +3 -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/saleswings/submitIdentifyEvent/index.d.ts +5 -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 +5 -6
|
@@ -21,7 +21,7 @@ const action = {
|
|
|
21
21
|
},
|
|
22
22
|
user_alias: {
|
|
23
23
|
label: 'User Alias Object',
|
|
24
|
-
description: '
|
|
24
|
+
description: 'Alternate unique user identifier, this is required if External User ID or Device ID is not set. Refer [Braze Documentation](https://www.braze.com/docs/api/objects_filters/user_alias_object) for more details.',
|
|
25
25
|
type: 'object',
|
|
26
26
|
properties: {
|
|
27
27
|
alias_name: {
|
|
@@ -38,7 +38,7 @@ const action = {
|
|
|
38
38
|
},
|
|
39
39
|
device_id: {
|
|
40
40
|
label: 'Device ID',
|
|
41
|
-
description: '
|
|
41
|
+
description: 'Device IDs can be used to add and remove only anonymous users to/from a cohort. However, users with an assigned User ID cannot use Device ID to sync to a cohort.',
|
|
42
42
|
type: 'string'
|
|
43
43
|
},
|
|
44
44
|
cohort_id: {
|
|
@@ -73,7 +73,7 @@ const action = {
|
|
|
73
73
|
},
|
|
74
74
|
event_properties: {
|
|
75
75
|
label: 'Event Properties',
|
|
76
|
-
description: '
|
|
76
|
+
description: 'Displays properties of the event to add/remove users to a cohort and the traits of the specific user',
|
|
77
77
|
type: 'object',
|
|
78
78
|
required: true,
|
|
79
79
|
default: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/braze-cohorts/syncAudiences/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAyF;AAGzF,gCAAsC;AAGtC,6DAAoC;AAEpC,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,+BAA+B;IAC5C,mBAAmB,EAAE,yDAAyD;IAC9E,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,kBAAkB;YACzB,WAAW,EACT,6NAA6N;YAC/N,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/dest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AAE,CAAA;IAC7E,MAAM,WAAW,GAAkB,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAA;IAErG,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAgB,EAAE,EAAE;QACpC,MAAM,EAAE,gBAAgB,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,qBAAqB,EAAE,GAAG,OAAO,CAAA;QAC/F,MAAM,oBAAoB,GAAY,gBAAgB,CAAC,GAAG,qBAAqB,EAAE,CAAY,CAAA;QAC7F,MAAM,IAAI,GAAG,oBAAoB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAA;QAE1D,IAAI,WAAW,EAAE;YACf,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;SAClC;aAAM,IAAI,SAAS,EAAE;YACpB,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,CAAA;SAClC;aAAM,IAAI,UAAU,EAAE;YACrB,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAA;SAChC;IACH,CAAC,CAAC,CAAA;IAEF,OAAO;QACL,QAAQ;QACR,WAAW;KACZ,CAAA;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,IAAmB;IAChD,OAAO,CAAC,CAAC,iBAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,iBAAO,CAAC,IAAI,EAAE,UAAU,CAAC,IAAI,iBAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAA;AAC1F,CAAC;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -4,7 +4,7 @@ const utils_1 = require("../utils");
|
|
|
4
4
|
const action = {
|
|
5
5
|
title: 'Create or Update Object',
|
|
6
6
|
description: 'Create an object in Customer.io or update them if they exist.',
|
|
7
|
-
defaultSubscription: 'type = "
|
|
7
|
+
defaultSubscription: 'type = "group"',
|
|
8
8
|
fields: {
|
|
9
9
|
id: {
|
|
10
10
|
label: 'Object ID',
|
|
@@ -47,12 +47,12 @@ const action = {
|
|
|
47
47
|
'@path': '$.anonymousId'
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
|
-
|
|
50
|
+
object_type_id: {
|
|
51
51
|
label: 'Object Type Id',
|
|
52
52
|
description: 'The ID used to uniquely identify a custom object type in Customer.io. [Learn more](https://customer.io/docs/object-relationships).',
|
|
53
53
|
type: 'string',
|
|
54
54
|
default: {
|
|
55
|
-
'@path': '$.
|
|
55
|
+
'@path': '$.objectTypeId'
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
convert_timestamp: {
|
|
@@ -65,7 +65,7 @@ const action = {
|
|
|
65
65
|
perform: (request, { settings, payload }) => {
|
|
66
66
|
let createdAt = payload.created_at;
|
|
67
67
|
let customAttributes = payload.custom_attributes;
|
|
68
|
-
const
|
|
68
|
+
const objectTypeID = payload.object_type_id;
|
|
69
69
|
const userID = payload.user_id;
|
|
70
70
|
const objectID = payload.id;
|
|
71
71
|
const anonymousId = payload.anonymous_id;
|
|
@@ -83,7 +83,7 @@ const action = {
|
|
|
83
83
|
body.created_at = createdAt;
|
|
84
84
|
}
|
|
85
85
|
body.type = 'object';
|
|
86
|
-
body.identifiers = {
|
|
86
|
+
body.identifiers = { object_type_id: objectTypeID ?? '1', object_id: objectID };
|
|
87
87
|
if (userID) {
|
|
88
88
|
body.action = 'identify';
|
|
89
89
|
body.cio_relationships = [{ identifiers: { id: userID } }];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUpdateObject/index.ts"],"names":[],"mappings":";;AAGA,oCAA8F;AAE9F,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,+DAA+D;IAC5E,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUpdateObject/index.ts"],"names":[],"mappings":";;AAGA,oCAA8F;AAE9F,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,+DAA+D;IAC5E,mBAAmB,EAAE,gBAAgB;IACrC,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,yHAAyH;YAC3H,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,WAAW;aACrB;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,6CAA6C;YAC1D,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,WAAW,EAAE,uBAAuB;aACrC;SACF;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,mBAAmB;YAC1B,WAAW,EACT,4GAA4G;YAC9G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,OAAO,EAAE;YACP,KAAK,EAAE,SAAS;YAChB,WAAW,EACT,mIAAmI;YACrI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,UAAU;aACpB;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EACT,4HAA4H;YAC9H,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QAED,cAAc,EAAE;YACd,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,oIAAoI;YACtI,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,gBAAgB;aAC1B;SACF;QACD,iBAAiB,EAAE;YACjB,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,yDAAyD;YACtE,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,IAAI;SACd;KACF;IACD,OAAO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;QAED,OAAO,OAAO,CAAC,GAAG,wBAAgB,CAAC,QAAQ,CAAC,aAAa,CAAC,gBAAgB,EAAE;YAC1E,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -48,7 +48,7 @@ const action = {
|
|
|
48
48
|
description: 'The ID used to uniquely identify an object in Customer.io. [Learn more](https://customer.io/docs/object-relationships).',
|
|
49
49
|
type: 'string',
|
|
50
50
|
default: {
|
|
51
|
-
'@
|
|
51
|
+
'@path': '$.context.groupId'
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
custom_attributes: {
|
|
@@ -98,7 +98,7 @@ const action = {
|
|
|
98
98
|
if (objectId) {
|
|
99
99
|
body.cio_relationships = {
|
|
100
100
|
action: 'add_relationships',
|
|
101
|
-
relationships: [{ identifiers: {
|
|
101
|
+
relationships: [{ identifiers: { object_type_id: objectTypeId ?? '1', object_id: objectId } }]
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
return request(`${utils_1.trackApiEndpoint(settings.accountRegion)}/api/v1/customers/${payload.id}`, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUpdatePerson/index.ts"],"names":[],"mappings":";;AAGA,oCAA8F;AAE9F,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,8DAA8D;IAC3E,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,mIAAmI;YACrI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAAW,EACT,yGAAyG;YAC3G,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,OAAO,EAAE,eAAe;aACzB;SACF;QACD,KAAK,EAAE;YACL,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,WAAW,EAAE,kBAAkB;aAChC;SACF;QACD,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,6CAA6C;YAC1D,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,WAAW,EAAE,uBAAuB;aACrC;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,yHAAyH;YAC3H,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE;gBACP,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/customerio/createUpdatePerson/index.ts"],"names":[],"mappings":";;AAGA,oCAA8F;AAE9F,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,yBAAyB;IAChC,WAAW,EAAE,8DAA8D;IAC3E,mBAAmB,EAAE,mBAAmB;IACxC,MAAM,EAAE;QACN,EAAE,EAAE;YACF,KAAK,EAAE,WAAW;YAClB,WAAW,EACT,mIAAmI;YACrI,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;oBAC7B,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;iBACpC;aACF;SACF;QACD,YAAY,EAAE;YACZ,KAAK,EAAE,cAAc;YACrB,WAA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,cAAc,CAAA;QAE3C,IAAI,OAAO,CAAC,iBAAiB,KAAK,KAAK,EAAE;YACvC,IAAI,SAAS,EAAE;gBACb,SAAS,GAAG,6BAAqB,CAAC,SAAS,CAAC,CAAA;aAC7C;YAED,IAAI,gBAAgB,EAAE;gBACpB,gBAAgB,GAAG,kCAA0B,CAAC,gBAAgB,CAAC,CAAA;aAChE;SACF;QAED,MAAM,IAAI,GAA4B;YACpC,GAAG,gBAAgB;YACnB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,YAAY,EAAE,OAAO,CAAC,YAAY;SACnC,CAAA;QAED,IAAI,SAAS,EAAE;YACb,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;SAC5B;QAGD,IAAI,QAAQ,EAAE;YACZ,IAAI,CAAC,iBAAiB,GAAG;gBACvB,MAAM,EAAE,mBAAmB;gBAC3B,aAAa,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE,cAAc,EAAE,YAAY,IAAI,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,CAAC;aAC/F,CAAA;SACF;QAED,OAAO,OAAO,CAAC,GAAG,wBAAgB,CAAC,QAAQ,CAAC,aAAa,CAAC,qBAAqB,OAAO,CAAC,EAAE,EAAE,EAAE;YAC3F,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -16,7 +16,7 @@ const destination = {
|
|
|
16
16
|
fields: {
|
|
17
17
|
conversionTrackingId: {
|
|
18
18
|
label: 'Conversion ID',
|
|
19
|
-
description: 'You will find this information in the event snippet for your conversion action, for example `send_to: AW-CONVERSION_ID/AW-CONVERSION_LABEL`. In the sample snippet, AW-CONVERSION_ID stands for the conversion ID unique to your account. Enter the conversion
|
|
19
|
+
description: 'You will find this information in the event snippet for your conversion action, for example `send_to: AW-CONVERSION_ID/AW-CONVERSION_LABEL`. In the sample snippet, AW-CONVERSION_ID stands for the conversion ID unique to your account. Enter the conversion ID, without the AW- prefix. **Required if you are using a mapping that sends data to the legacy Google Enhanced Conversions API (i.e. Upload Enhanced Conversion (Legacy) Action).**',
|
|
20
20
|
type: 'string'
|
|
21
21
|
},
|
|
22
22
|
customerId: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/index.ts"],"names":[],"mappings":";;;;;AAEA,sEAA6C;AAC7C,kFAAyD;AACzD,oFAA2D;AAC3D,8FAAqE;AAerE,MAAM,WAAW,GAAoC;IAGnD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,qCAAqC;IAC3C,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,oBAAoB,EAAE;gBACpB,KAAK,EAAE,eAAe;gBACtB,WAAW,EACT,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/google-enhanced-conversions/index.ts"],"names":[],"mappings":";;;;;AAEA,sEAA6C;AAC7C,kFAAyD;AACzD,oFAA2D;AAC3D,8FAAqE;AAerE,MAAM,WAAW,GAAoC;IAGnD,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,qCAAqC;IAC3C,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,oBAAoB,EAAE;gBACpB,KAAK,EAAE,eAAe;gBACtB,WAAW,EACT,qbAAqb;gBACvb,IAAI,EAAE,QAAQ;aACf;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,aAAa;gBACpB,WAAW,EACT,oKAAoK;gBACtK,IAAI,EAAE,QAAQ;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YAQrC,OAAO,IAAI,CAAA;QACb,CAAC;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAC9C,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,4CAA4C,EAAE;gBAC5F,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,SAAS,EAAE,IAAI,CAAC,QAAQ;oBACxB,aAAa,EAAE,IAAI,CAAC,YAAY;oBAChC,UAAU,EAAE,eAAe;iBAC5B,CAAC;aACH,CAAC,CAAA;YAEF,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,CAAA;QAC/C,CAAC;KACF;IACD,aAAa,CAAC,EAAE,IAAI,EAAE;QACpB,OAAO;YACL,OAAO,EAAE;gBACP,aAAa,EAAE,UAAU,IAAI,EAAE,WAAW,EAAE;aAC7C;SACF,CAAA;IACH,CAAC;IACD,OAAO,EAAE;QACP,cAAc,EAAd,wBAAc;QACd,qBAAqB,EAArB,+BAAqB;QACrB,oBAAoB,EAApB,8BAAoB;QACpB,0BAA0B,EAA1B,oCAA0B;KAC3B;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const HEAP_SEGMENT_CLOUD_LIBRARY_NAME = "cloud-mode-destination";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.HEAP_SEGMENT_CLOUD_LIBRARY_NAME = void 0;
|
|
4
|
+
exports.HEAP_SEGMENT_CLOUD_LIBRARY_NAME = 'cloud-mode-destination';
|
|
5
5
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/heap/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/destinations/heap/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,+BAA+B,GAAG,wBAAwB,CAAA"}
|
|
@@ -9,7 +9,7 @@ const identifyUser_1 = __importDefault(require("./identifyUser"));
|
|
|
9
9
|
const presets = [
|
|
10
10
|
{
|
|
11
11
|
name: 'Track Calls',
|
|
12
|
-
subscribe: 'type = "track"',
|
|
12
|
+
subscribe: 'type = "track" or type = "page" or type = "screen"',
|
|
13
13
|
partnerAction: 'trackEvent',
|
|
14
14
|
mapping: actions_core_1.defaultValues(trackEvent_1.default.fields)
|
|
15
15
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/heap/index.ts"],"names":[],"mappings":";;;;;AAEA,8DAAqC;AACrC,wDAAqD;AACrD,kEAAyC;AAGzC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/heap/index.ts"],"names":[],"mappings":";;;;;AAEA,8DAAqC;AACrC,wDAAqD;AACrD,kEAAyC;AAGzC,MAAM,OAAO,GAAqC;IAChD;QACE,IAAI,EAAE,aAAa;QACnB,SAAS,EAAE,oDAAoD;QAC/D,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE,4BAAa,CAAC,oBAAU,CAAC,MAAM,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,mBAAmB;QAC9B,aAAa,EAAE,cAAc;QAC7B,OAAO,EAAE,4BAAa,CAAC,sBAAY,CAAC,MAAM,CAAC;KAC5C;CACF,CAAA;AAED,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IACb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,KAAK,EAAE;gBACL,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mDAAmD;gBAChE,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;KACF;IAED,OAAO;IACP,OAAO,EAAE;QACP,UAAU,EAAV,oBAAU;QACV,YAAY,EAAZ,sBAAY;KACb;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -2,10 +2,12 @@ export interface Payload {
|
|
|
2
2
|
message_id: string;
|
|
3
3
|
identity?: string | null;
|
|
4
4
|
anonymous_id?: string | null;
|
|
5
|
-
event
|
|
5
|
+
event?: string;
|
|
6
6
|
properties?: {
|
|
7
7
|
[k: string]: unknown;
|
|
8
8
|
};
|
|
9
9
|
timestamp?: string | number;
|
|
10
|
-
|
|
10
|
+
session_id?: string;
|
|
11
|
+
type?: string;
|
|
12
|
+
name?: string;
|
|
11
13
|
}
|
|
@@ -11,7 +11,7 @@ const actions_core_1 = require("@segment/actions-core");
|
|
|
11
11
|
const action = {
|
|
12
12
|
title: 'Track Event',
|
|
13
13
|
description: 'Send an event to Heap.',
|
|
14
|
-
defaultSubscription: 'type = "track"',
|
|
14
|
+
defaultSubscription: 'type = "track" or type = "page" or type = "screen"',
|
|
15
15
|
fields: {
|
|
16
16
|
message_id: {
|
|
17
17
|
label: 'Message ID',
|
|
@@ -41,10 +41,9 @@ const action = {
|
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
event: {
|
|
44
|
-
label: 'Event Type',
|
|
44
|
+
label: 'Track Event Type',
|
|
45
45
|
type: 'string',
|
|
46
|
-
description: '
|
|
47
|
-
required: true,
|
|
46
|
+
description: 'Name of the user action. This only exists on track events. Limited to 1024 characters.',
|
|
48
47
|
default: {
|
|
49
48
|
'@path': '$.event'
|
|
50
49
|
}
|
|
@@ -65,12 +64,28 @@ const action = {
|
|
|
65
64
|
'@path': '$.timestamp'
|
|
66
65
|
}
|
|
67
66
|
},
|
|
68
|
-
|
|
69
|
-
label: '
|
|
67
|
+
session_id: {
|
|
68
|
+
label: 'Session ID',
|
|
69
|
+
type: 'string',
|
|
70
|
+
description: 'A Heap session ID. The session ID can be retrived by calling getSessionId() on the heap api. If a session ID is not provided one will be created.',
|
|
71
|
+
default: {
|
|
72
|
+
'@path': '$.session_id'
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
type: {
|
|
76
|
+
label: 'Type',
|
|
77
|
+
type: 'string',
|
|
78
|
+
description: 'The type of call. Can be track, page, or screen.',
|
|
79
|
+
default: {
|
|
80
|
+
'@path': '$.type'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
name: {
|
|
84
|
+
label: 'Page or Screen Name',
|
|
70
85
|
type: 'string',
|
|
71
|
-
description: 'The name of the
|
|
86
|
+
description: 'The name of the page or screen being viewed. This only exists for page and screen events.',
|
|
72
87
|
default: {
|
|
73
|
-
'@path': '$.
|
|
88
|
+
'@path': '$.name'
|
|
74
89
|
}
|
|
75
90
|
}
|
|
76
91
|
},
|
|
@@ -81,29 +96,43 @@ const action = {
|
|
|
81
96
|
if (!payload.anonymous_id && !payload.identity) {
|
|
82
97
|
throw new actions_core_1.IntegrationError('Either anonymous user id or identity should be specified.');
|
|
83
98
|
}
|
|
84
|
-
const defaultEventProperties = { segment_library:
|
|
99
|
+
const defaultEventProperties = { segment_library: constants_1.HEAP_SEGMENT_CLOUD_LIBRARY_NAME };
|
|
85
100
|
const flatten = flat_1.flat(payload.properties || {});
|
|
86
101
|
const eventProperties = Object.assign(defaultEventProperties, flatten);
|
|
87
|
-
const
|
|
102
|
+
const heapPayload = {
|
|
88
103
|
app_id: settings.appId,
|
|
89
|
-
event: payload
|
|
104
|
+
event: getEventName(payload),
|
|
90
105
|
properties: eventProperties,
|
|
91
106
|
idempotency_key: payload.message_id
|
|
92
107
|
};
|
|
93
108
|
if (payload.anonymous_id && !payload.identity) {
|
|
94
|
-
|
|
109
|
+
heapPayload.user_id = userIdHash_1.getHeapUserId(payload.anonymous_id);
|
|
95
110
|
}
|
|
96
111
|
if (payload.identity) {
|
|
97
|
-
|
|
112
|
+
heapPayload.identity = payload.identity;
|
|
98
113
|
}
|
|
99
114
|
if (payload.timestamp && dayjs_1.default.utc(payload.timestamp).isValid()) {
|
|
100
|
-
|
|
115
|
+
heapPayload.timestamp = dayjs_1.default.utc(payload.timestamp).toISOString();
|
|
116
|
+
}
|
|
117
|
+
if (payload.session_id) {
|
|
118
|
+
heapPayload.session_id = payload.session_id;
|
|
101
119
|
}
|
|
102
120
|
return request('https://heapanalytics.com/api/track', {
|
|
103
121
|
method: 'post',
|
|
104
|
-
json:
|
|
122
|
+
json: heapPayload
|
|
105
123
|
});
|
|
106
124
|
}
|
|
107
125
|
};
|
|
126
|
+
const getEventName = (payload) => {
|
|
127
|
+
switch (payload.type) {
|
|
128
|
+
case 'track':
|
|
129
|
+
return payload.event;
|
|
130
|
+
case 'page':
|
|
131
|
+
case 'screen':
|
|
132
|
+
return payload.name;
|
|
133
|
+
default:
|
|
134
|
+
return undefined;
|
|
135
|
+
}
|
|
136
|
+
};
|
|
108
137
|
exports.default = action;
|
|
109
138
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,+DAAsC;AACtC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/heap/trackEvent/index.ts"],"names":[],"mappings":";;;;;AAGA,+DAAsC;AACtC,4CAA8D;AAC9D,8CAA6C;AAC7C,kCAA8B;AAC9B,wDAAwD;AAexD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,wBAAwB;IACrC,mBAAmB,EAAE,oDAAoD;IACzE,MAAM,EAAE;QACN,UAAU,EAAE;YACV,KAAK,EAAE,YAAY;YACnB,IAAI,EAAE,QAAQ;YACd,WAA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,WAAW,EAAE,CAAA;SACnE;QAED,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,WAAW,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAA;SAC5C;QAED,OAAO,OAAO,CAAC,qCAAqC,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,WAAW;SAClB,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,MAAM,YAAY,GAAG,CAAC,OAAgB,EAAE,EAAE;IACxC,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC,KAAK,CAAA;QACtB,KAAK,MAAM,CAAC;QACZ,KAAK,QAAQ;YACX,OAAO,OAAO,CAAC,IAAI,CAAA;QACrB;YACE,OAAO,SAAS,CAAA;KACnB;AACH,CAAC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -9,20 +9,23 @@ const fieldHandler = pipedrive_client_1.default.fieldHandler;
|
|
|
9
9
|
const action = {
|
|
10
10
|
title: 'Create or update an Activity',
|
|
11
11
|
description: "Update an Activity in Pipedrive or create one if it doesn't exist.",
|
|
12
|
-
defaultSubscription: 'type = "track"',
|
|
12
|
+
defaultSubscription: 'type = "track" and event = "Activity Upserted"',
|
|
13
13
|
fields: {
|
|
14
14
|
activity_id: {
|
|
15
15
|
label: 'Activity ID',
|
|
16
16
|
description: 'ID of Activity in Pipedrive to Update. If left empty, a new one will be created',
|
|
17
17
|
type: 'integer',
|
|
18
|
-
required: false
|
|
18
|
+
required: false,
|
|
19
|
+
default: {
|
|
20
|
+
'@path': '$.properties.activity_id'
|
|
21
|
+
}
|
|
19
22
|
},
|
|
20
23
|
person_match_field: {
|
|
21
24
|
label: 'Person match field',
|
|
22
25
|
description: 'If present, used instead of field in settings to find existing person in Pipedrive.',
|
|
23
26
|
type: 'string',
|
|
24
27
|
required: false,
|
|
25
|
-
dynamic: true
|
|
28
|
+
dynamic: true
|
|
26
29
|
},
|
|
27
30
|
person_match_value: {
|
|
28
31
|
label: 'Person match value',
|
|
@@ -38,7 +41,7 @@ const action = {
|
|
|
38
41
|
description: 'If present, used instead of field in settings to find existing organization in Pipedrive.',
|
|
39
42
|
type: 'string',
|
|
40
43
|
required: false,
|
|
41
|
-
dynamic: true
|
|
44
|
+
dynamic: true
|
|
42
45
|
},
|
|
43
46
|
organization_match_value: {
|
|
44
47
|
label: 'Organization match value',
|
|
@@ -46,7 +49,7 @@ const action = {
|
|
|
46
49
|
type: 'string',
|
|
47
50
|
required: false,
|
|
48
51
|
default: {
|
|
49
|
-
'@path': '$.
|
|
52
|
+
'@path': '$.context.groupId'
|
|
50
53
|
}
|
|
51
54
|
},
|
|
52
55
|
deal_match_field: {
|
|
@@ -54,7 +57,7 @@ const action = {
|
|
|
54
57
|
description: 'If present, used instead of field in settings to find existing deal in Pipedrive.',
|
|
55
58
|
type: 'string',
|
|
56
59
|
required: false,
|
|
57
|
-
dynamic: true
|
|
60
|
+
dynamic: true
|
|
58
61
|
},
|
|
59
62
|
deal_match_value: {
|
|
60
63
|
label: 'Deal match value',
|
|
@@ -62,56 +65,80 @@ const action = {
|
|
|
62
65
|
type: 'string',
|
|
63
66
|
required: false,
|
|
64
67
|
default: {
|
|
65
|
-
'@path': '$.
|
|
68
|
+
'@path': '$.properties.deal_id'
|
|
66
69
|
}
|
|
67
70
|
},
|
|
68
71
|
subject: {
|
|
69
72
|
label: 'Activity Subject',
|
|
70
73
|
description: 'Subject of the Activity. When value for subject is not set, it will be given a default value `Call`.',
|
|
71
74
|
type: 'string',
|
|
72
|
-
required: false
|
|
75
|
+
required: false,
|
|
76
|
+
default: {
|
|
77
|
+
'@path': '$.properties.subject'
|
|
78
|
+
}
|
|
73
79
|
},
|
|
74
80
|
type: {
|
|
75
81
|
label: 'Type',
|
|
76
82
|
description: 'Type of the Activity. This is in correlation with the key_string parameter of ActivityTypes. When value for type is not set, it will be given a default value `Call`',
|
|
77
83
|
type: 'string',
|
|
78
|
-
required: false
|
|
84
|
+
required: false,
|
|
85
|
+
default: {
|
|
86
|
+
'@path': '$.properties.type'
|
|
87
|
+
}
|
|
79
88
|
},
|
|
80
89
|
description: {
|
|
81
90
|
label: 'Description',
|
|
82
91
|
description: 'Additional details about the Activity that is synced to your external calendar. Unlike the note added to the Activity, the description is publicly visible to any guests added to the Activity.',
|
|
83
92
|
type: 'string',
|
|
84
|
-
required: false
|
|
93
|
+
required: false,
|
|
94
|
+
default: {
|
|
95
|
+
'@path': '$.properties.description'
|
|
96
|
+
}
|
|
85
97
|
},
|
|
86
98
|
note: {
|
|
87
99
|
label: 'Note',
|
|
88
|
-
description: 'Note of the Activity (HTML
|
|
100
|
+
description: 'Note of the Activity (Accepts plain text and HTML)',
|
|
89
101
|
type: 'string',
|
|
90
|
-
required: false
|
|
102
|
+
required: false,
|
|
103
|
+
default: {
|
|
104
|
+
'@path': '$.properties.note'
|
|
105
|
+
}
|
|
91
106
|
},
|
|
92
107
|
due_date: {
|
|
93
108
|
label: 'Due Date',
|
|
94
109
|
description: 'Due date of the Activity. Format: YYYY-MM-DD',
|
|
95
110
|
type: 'string',
|
|
96
|
-
required: false
|
|
111
|
+
required: false,
|
|
112
|
+
default: {
|
|
113
|
+
'@path': '$.properties.due_date'
|
|
114
|
+
}
|
|
97
115
|
},
|
|
98
116
|
due_time: {
|
|
99
117
|
label: 'Due Time',
|
|
100
|
-
description: 'Due time of the Activity
|
|
118
|
+
description: 'Due time of the Activity. Format: HH:MM',
|
|
101
119
|
type: 'string',
|
|
102
|
-
required: false
|
|
120
|
+
required: false,
|
|
121
|
+
default: {
|
|
122
|
+
'@path': '$.properties.due_time'
|
|
123
|
+
}
|
|
103
124
|
},
|
|
104
125
|
duration: {
|
|
105
126
|
label: 'Duration',
|
|
106
127
|
description: 'Duration of the Activity. Format: HH:MM',
|
|
107
128
|
type: 'string',
|
|
108
|
-
required: false
|
|
129
|
+
required: false,
|
|
130
|
+
default: {
|
|
131
|
+
'@path': '$.properties.duration'
|
|
132
|
+
}
|
|
109
133
|
},
|
|
110
134
|
done: {
|
|
111
135
|
label: 'Done',
|
|
112
136
|
description: 'Whether the Activity is done or not.',
|
|
113
137
|
type: 'boolean',
|
|
114
|
-
required: false
|
|
138
|
+
required: false,
|
|
139
|
+
default: {
|
|
140
|
+
'@path': '$.properties.done'
|
|
141
|
+
}
|
|
115
142
|
}
|
|
116
143
|
},
|
|
117
144
|
dynamicFields: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/pipedrive/createUpdateActivity/index.ts"],"names":[],"mappings":";;;;;AAGA,2DAA2E;AAC3E,wFAA8D;AAE9D,MAAM,YAAY,GAAG,0BAAe,CAAC,YAAY,CAAA;AAEjD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,oEAAoE;IACjF,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/pipedrive/createUpdateActivity/index.ts"],"names":[],"mappings":";;;;;AAGA,2DAA2E;AAC3E,wFAA8D;AAE9D,MAAM,YAAY,GAAG,0BAAe,CAAC,YAAY,CAAA;AAEjD,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,8BAA8B;IACrC,WAAW,EAAE,oEAAoE;IACjF,mBAAmB,EAAE,gDAAgD;IACrE,MAAM,EAAE;QACN,WAAW,EAAE;YACX,KAAK,EAAE,aAAa;YACpB,WAAW,EAAE,iFAAiF;YAC9F,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,OAAO,EAAE,0BAA0B;aACpC;SACF;QACD,kBAAkB,EAAE;YAClB,KAAK,EAAE,oBAAoB;YAC3B,WAAW,EAAE,qFAAqF;YAClG,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,IAAI;SACd;QACD,kBAAkB,EAAE;YAClB,KAAK,EAAE,oBAAoB;YAC3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YAChC,MAAM,EAAE,cAAc,IAAI,SAAS;YACnC,OAAO,EAAE,MAAM,IAAI,SAAS;SAC7B,CAAA;QAED,OAAO,iCAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAC/C,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -9,9 +9,9 @@ const actions_core_1 = require("@segment/actions-core");
|
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
10
|
const fieldHandler = pipedrive_client_1.default.fieldHandler;
|
|
11
11
|
const action = {
|
|
12
|
-
title: 'Create or
|
|
12
|
+
title: 'Create or update a Deal',
|
|
13
13
|
description: "Update a Deal in Pipedrive or create it if it doesn't exist yet.",
|
|
14
|
-
defaultSubscription: 'type = "track"',
|
|
14
|
+
defaultSubscription: 'type = "track" and event = "Deal Upserted"',
|
|
15
15
|
fields: {
|
|
16
16
|
deal_match_field: {
|
|
17
17
|
label: 'Deal match field',
|
|
@@ -26,7 +26,7 @@ const action = {
|
|
|
26
26
|
type: 'string',
|
|
27
27
|
required: false,
|
|
28
28
|
default: {
|
|
29
|
-
'@path': '$.
|
|
29
|
+
'@path': '$.properties.deal_id'
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
person_match_field: {
|
|
@@ -58,32 +58,44 @@ const action = {
|
|
|
58
58
|
type: 'string',
|
|
59
59
|
required: false,
|
|
60
60
|
default: {
|
|
61
|
-
'@path': '$.
|
|
61
|
+
'@path': '$.context.groupId'
|
|
62
62
|
}
|
|
63
63
|
},
|
|
64
64
|
title: {
|
|
65
65
|
label: 'Title',
|
|
66
66
|
description: 'Deal title (required for new Leads)',
|
|
67
67
|
type: 'string',
|
|
68
|
-
required: true
|
|
68
|
+
required: true,
|
|
69
|
+
default: {
|
|
70
|
+
'@path': '$.properties.title'
|
|
71
|
+
}
|
|
69
72
|
},
|
|
70
73
|
value: {
|
|
71
74
|
label: 'Value',
|
|
72
75
|
description: 'Value of the deal. If omitted, value will be set to 0.',
|
|
73
76
|
type: 'string',
|
|
74
|
-
required: false
|
|
77
|
+
required: false,
|
|
78
|
+
default: {
|
|
79
|
+
'@path': '$.properties.value'
|
|
80
|
+
}
|
|
75
81
|
},
|
|
76
82
|
currency: {
|
|
77
83
|
label: 'Currency',
|
|
78
84
|
description: 'Currency of the deal. Accepts a 3-character currency code. If omitted, currency will be set to the default currency of the authorized user.',
|
|
79
85
|
type: 'string',
|
|
80
|
-
required: false
|
|
86
|
+
required: false,
|
|
87
|
+
default: {
|
|
88
|
+
'@path': '$.properties.currency'
|
|
89
|
+
}
|
|
81
90
|
},
|
|
82
91
|
stage_id: {
|
|
83
92
|
label: 'Stage ID',
|
|
84
93
|
description: "The ID of a stage this Deal will be placed in a pipeline (note that you can't supply the ID of the pipeline as this will be assigned automatically based on stage_id). If omitted, the deal will be placed in the first stage of the default pipeline.",
|
|
85
94
|
type: 'number',
|
|
86
|
-
required: false
|
|
95
|
+
required: false,
|
|
96
|
+
default: {
|
|
97
|
+
'@path': '$.properties.stage_id'
|
|
98
|
+
}
|
|
87
99
|
},
|
|
88
100
|
status: {
|
|
89
101
|
label: 'Status',
|
|
@@ -101,19 +113,28 @@ const action = {
|
|
|
101
113
|
label: 'Expected Close Date',
|
|
102
114
|
description: 'The expected close date of the Deal. In ISO 8601 format: YYYY-MM-DD.',
|
|
103
115
|
type: 'string',
|
|
104
|
-
required: false
|
|
116
|
+
required: false,
|
|
117
|
+
default: {
|
|
118
|
+
'@path': '$.properties.expected_close_date'
|
|
119
|
+
}
|
|
105
120
|
},
|
|
106
121
|
probability: {
|
|
107
122
|
label: 'Success Probability',
|
|
108
123
|
description: 'Deal success probability percentage. Used/shown only when deal_probability for the pipeline of the deal is enabled.',
|
|
109
124
|
type: 'number',
|
|
110
|
-
required: false
|
|
125
|
+
required: false,
|
|
126
|
+
default: {
|
|
127
|
+
'@path': '$.properties.success_probability'
|
|
128
|
+
}
|
|
111
129
|
},
|
|
112
130
|
lost_reason: {
|
|
113
131
|
label: 'Lost Reason',
|
|
114
132
|
description: 'Optional message about why the deal was lost (to be used when status=lost)',
|
|
115
133
|
type: 'string',
|
|
116
|
-
required: false
|
|
134
|
+
required: false,
|
|
135
|
+
default: {
|
|
136
|
+
'@path': '$.properties.lost_reason'
|
|
137
|
+
}
|
|
117
138
|
},
|
|
118
139
|
visible_to: {
|
|
119
140
|
label: 'Visible To',
|
|
@@ -171,6 +192,9 @@ const action = {
|
|
|
171
192
|
if (!deal.id && !deal.person_id && !deal.org_id) {
|
|
172
193
|
throw new actions_core_1.IntegrationError('No related organization or person, unable to create deal!', 'INVALID_REQUEST_DATA', 400);
|
|
173
194
|
}
|
|
195
|
+
if (!deal.id)
|
|
196
|
+
if (payload.deal_match_field && payload.deal_match_value)
|
|
197
|
+
Object.assign(deal, { [payload.deal_match_field]: payload.deal_match_value });
|
|
174
198
|
utils_1.addCustomFieldsFromPayloadToEntity(payload, deal);
|
|
175
199
|
return deals_1.createUpdateDeal(client, deal);
|
|
176
200
|
}
|