@segment/action-destinations 3.113.1-alpha.0 → 3.113.1-alpha.11
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/clevertap/index.js +1 -1
- package/dist/destinations/criteo-audiences/addUserToAudience/index.js +5 -5
- package/dist/destinations/criteo-audiences/addUserToAudience/index.js.map +1 -1
- package/dist/destinations/criteo-audiences/criteo-audiences.d.ts +2 -2
- package/dist/destinations/criteo-audiences/criteo-audiences.js +10 -5
- package/dist/destinations/criteo-audiences/criteo-audiences.js.map +1 -1
- package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js +5 -5
- package/dist/destinations/criteo-audiences/removeUserFromAudience/index.js.map +1 -1
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js +3 -3
- package/dist/destinations/engage-messaging-sendgrid/sendEmail/index.js.map +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js +1 -1
- package/dist/destinations/engage-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/generated-types.d.ts +1 -1
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js +5 -3
- package/dist/destinations/google-enhanced-conversions/uploadConversionAdjustment/index.js.map +1 -1
- package/dist/destinations/hubspot/index.js +3 -5
- package/dist/destinations/hubspot/index.js.map +1 -1
- package/dist/destinations/hubspot/properties.d.ts +1 -3
- package/dist/destinations/hubspot/properties.js +2 -4
- package/dist/destinations/hubspot/properties.js.map +1 -1
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js +1 -1
- package/dist/destinations/hubspot/sendCustomBehavioralEvent/index.js.map +1 -1
- package/dist/destinations/hubspot/testHelper.d.ts +7 -0
- package/dist/destinations/hubspot/testHelper.js +24 -0
- package/dist/destinations/hubspot/testHelper.js.map +1 -0
- package/dist/destinations/hubspot/upsertContact/index.js +2 -2
- package/dist/destinations/hubspot/upsertContact/index.js.map +1 -1
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js +8 -37
- package/dist/destinations/hubspot/upsertCustomObjectRecord/index.js.map +1 -1
- package/dist/destinations/index.js +2 -0
- package/dist/destinations/index.js.map +1 -1
- package/dist/destinations/linkedin-audiences/updateAudience/index.js +5 -3
- package/dist/destinations/linkedin-audiences/updateAudience/index.js.map +1 -1
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js +1 -1
- package/dist/destinations/mixpanel/groupIdentifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/identifyUser/generated-types.d.ts +0 -1
- package/dist/destinations/mixpanel/identifyUser/index.js +0 -9
- package/dist/destinations/mixpanel/identifyUser/index.js.map +1 -1
- package/dist/destinations/mixpanel/index.js +1 -1
- package/dist/destinations/mixpanel/mixpanel-properties.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/functions.js.map +1 -1
- package/dist/destinations/mixpanel/trackEvent/index.js.map +1 -1
- package/dist/destinations/mixpanel/trackPurchase/index.js +3 -1
- package/dist/destinations/mixpanel/trackPurchase/index.js.map +1 -1
- package/dist/destinations/qualtrics/qualtricsApiClient.js +1 -2
- package/dist/destinations/qualtrics/qualtricsApiClient.js.map +1 -1
- package/dist/destinations/salesforce-marketing-cloud/apiEvent/generated-types.d.ts +7 -0
- package/dist/destinations/{hubspot/upsertCompany → salesforce-marketing-cloud/apiEvent}/generated-types.js +0 -0
- package/dist/destinations/salesforce-marketing-cloud/apiEvent/generated-types.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/apiEvent/index.d.ts +5 -0
- package/dist/destinations/salesforce-marketing-cloud/apiEvent/index.js +20 -0
- package/dist/destinations/salesforce-marketing-cloud/apiEvent/index.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.d.ts +3 -0
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js +3 -0
- package/dist/destinations/salesforce-marketing-cloud/contact/generated-types.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/contact/index.d.ts +5 -0
- package/dist/destinations/salesforce-marketing-cloud/contact/index.js +23 -0
- package/dist/destinations/salesforce-marketing-cloud/contact/index.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/generated-types.d.ts +12 -0
- package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/generated-types.js +3 -0
- package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/generated-types.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/index.d.ts +5 -0
- package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/index.js +35 -0
- package/dist/destinations/salesforce-marketing-cloud/contactDataExtension/index.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/dataExtension/generated-types.d.ts +11 -0
- package/dist/destinations/salesforce-marketing-cloud/dataExtension/generated-types.js +3 -0
- package/dist/destinations/salesforce-marketing-cloud/dataExtension/generated-types.js.map +1 -0
- package/dist/destinations/{hubspot/upsertCompany → salesforce-marketing-cloud/dataExtension}/index.d.ts +0 -0
- package/dist/destinations/salesforce-marketing-cloud/dataExtension/index.js +23 -0
- package/dist/destinations/salesforce-marketing-cloud/dataExtension/index.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/generated-types.d.ts +7 -0
- package/dist/destinations/salesforce-marketing-cloud/generated-types.js +3 -0
- package/dist/destinations/salesforce-marketing-cloud/generated-types.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/index.d.ts +4 -0
- package/dist/destinations/salesforce-marketing-cloud/index.js +77 -0
- package/dist/destinations/salesforce-marketing-cloud/index.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.d.ts +3 -0
- package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.js +31 -0
- package/dist/destinations/salesforce-marketing-cloud/sfmc-operations.js.map +1 -0
- package/dist/destinations/salesforce-marketing-cloud/sfmc-properties.d.ts +10 -0
- package/dist/destinations/salesforce-marketing-cloud/sfmc-properties.js +59 -0
- package/dist/destinations/salesforce-marketing-cloud/sfmc-properties.js.map +1 -0
- package/dist/destinations/sendgrid/sendgrid-properties.js +1 -2
- package/dist/destinations/sendgrid/sendgrid-properties.js.map +1 -1
- package/package.json +4 -4
- package/dist/destinations/hubspot/errors.d.ts +0 -17
- package/dist/destinations/hubspot/errors.js +0 -30
- package/dist/destinations/hubspot/errors.js.map +0 -1
- package/dist/destinations/hubspot/upsertCompany/generated-types.d.ts +0 -21
- package/dist/destinations/hubspot/upsertCompany/generated-types.js.map +0 -1
- package/dist/destinations/hubspot/upsertCompany/index.js +0 -321
- package/dist/destinations/hubspot/upsertCompany/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/salesforce-marketing-cloud/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
const contact_1 = __importDefault(require("./contact"));
|
|
7
|
+
const dataExtension_1 = __importDefault(require("./dataExtension"));
|
|
8
|
+
const contactDataExtension_1 = __importDefault(require("./contactDataExtension"));
|
|
9
|
+
const apiEvent_1 = __importDefault(require("./apiEvent"));
|
|
10
|
+
const destination = {
|
|
11
|
+
name: 'Salesforce Marketing Cloud (Actions)',
|
|
12
|
+
slug: 'actions-salesforce-marketing-cloud',
|
|
13
|
+
mode: 'cloud',
|
|
14
|
+
authentication: {
|
|
15
|
+
scheme: 'oauth2',
|
|
16
|
+
fields: {
|
|
17
|
+
subdomain: {
|
|
18
|
+
label: 'Subdomain',
|
|
19
|
+
description: 'The unique subdomain Salesforce Marketing Cloud assigned to your account. Subdomains are tenant specific and should be a 28-character string starting with the letters "mc". Do not include the .rest.marketingcloudapis.com part of your subdomain URL. See more information on how to find your subdomain [here](https://developer.salesforce.com/docs/marketing/marketing-cloud/guide/your-subdomain-tenant-specific-endpoints.html).',
|
|
20
|
+
type: 'string',
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
token: {
|
|
24
|
+
label: 'Token',
|
|
25
|
+
description: 'STAGE TESTING',
|
|
26
|
+
type: 'string',
|
|
27
|
+
required: true
|
|
28
|
+
},
|
|
29
|
+
account_id: {
|
|
30
|
+
label: 'account id',
|
|
31
|
+
description: 'STAGE TESTING',
|
|
32
|
+
type: 'string',
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
client_id: {
|
|
36
|
+
label: 'client_id',
|
|
37
|
+
description: 'STAGE TESTING',
|
|
38
|
+
type: 'string',
|
|
39
|
+
required: true
|
|
40
|
+
},
|
|
41
|
+
client_secret: {
|
|
42
|
+
label: 'client_secret',
|
|
43
|
+
description: 'STAGE TESTING',
|
|
44
|
+
type: 'string',
|
|
45
|
+
required: true
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
refreshAccessToken: async (request, { settings }) => {
|
|
49
|
+
const baseUrl = `https://${settings.subdomain}.auth.marketingcloudapis.com/v2/token`;
|
|
50
|
+
const res = await request(`${baseUrl}`, {
|
|
51
|
+
method: 'POST',
|
|
52
|
+
body: new URLSearchParams({
|
|
53
|
+
account_id: settings.account_id,
|
|
54
|
+
client_id: settings.client_id,
|
|
55
|
+
client_secret: settings.client_secret,
|
|
56
|
+
grant_type: 'client_credentials'
|
|
57
|
+
})
|
|
58
|
+
});
|
|
59
|
+
return { accessToken: res.data.access_token };
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
extendRequest({ auth }) {
|
|
63
|
+
return {
|
|
64
|
+
headers: {
|
|
65
|
+
authorization: `Bearer ${auth?.accessToken}`
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
},
|
|
69
|
+
actions: {
|
|
70
|
+
contact: contact_1.default,
|
|
71
|
+
dataExtension: dataExtension_1.default,
|
|
72
|
+
contactDataExtension: contactDataExtension_1.default,
|
|
73
|
+
apiEvent: apiEvent_1.default
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
exports.default = destination;
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/salesforce-marketing-cloud/index.ts"],"names":[],"mappings":";;;;;AAEA,wDAA+B;AAC/B,oEAA2C;AAC3C,kFAAyD;AACzD,0DAAiC;AAMjC,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sCAAsC;IAC5C,IAAI,EAAE,oCAAoC;IAC1C,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EACT,0aAA0a;gBAC5a,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,KAAK,EAAE;gBACL,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,UAAU,EAAE;gBACV,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,SAAS,EAAE;gBACT,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;YACD,aAAa,EAAE;gBACb,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,eAAe;gBAC5B,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;YAClD,MAAM,OAAO,GAAG,WAAW,QAAQ,CAAC,SAAS,uCAAuC,CAAA;YACpF,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,GAAG,OAAO,EAAE,EAAE;gBAC5D,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,IAAI,eAAe,CAAC;oBACxB,UAAU,EAAE,QAAQ,CAAC,UAAU;oBAC/B,SAAS,EAAE,QAAQ,CAAC,SAAS;oBAC7B,aAAa,EAAE,QAAQ,CAAC,aAAa;oBACrC,UAAU,EAAE,oBAAoB;iBACjC,CAAC;aACH,CAAC,CAAA;YACF,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,OAAO,EAAP,iBAAO;QACP,aAAa,EAAb,uBAAa;QACb,oBAAoB,EAApB,8BAAoB;QACpB,QAAQ,EAAR,kBAAQ;KACT;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RequestClient } from '@segment/actions-core';
|
|
2
|
+
import { Payload } from './dataExtension/generated-types';
|
|
3
|
+
export declare function upsertRows(request: RequestClient, subdomain: String, payloads: Payload[]): Promise<import("@segment/actions-core").ModifiedResponse<unknown>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.upsertRows = void 0;
|
|
4
|
+
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
+
function upsertRows(request, subdomain, payloads) {
|
|
6
|
+
const { key, id } = payloads[0];
|
|
7
|
+
if (!key && !id) {
|
|
8
|
+
throw new actions_core_1.IntegrationError(`In order to send an event to a data extension either Data Extension ID or Data Extension Key must be defined.`, 'Misconfigured required field', 400);
|
|
9
|
+
}
|
|
10
|
+
const rows = [];
|
|
11
|
+
payloads.forEach((payload) => {
|
|
12
|
+
rows.push({
|
|
13
|
+
keys: payload.keys,
|
|
14
|
+
values: payload.values
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
if (key) {
|
|
18
|
+
return request(`https://${subdomain}.rest.marketingcloudapis.com/hub/v1/dataevents/key:${key}/rowset`, {
|
|
19
|
+
method: 'post',
|
|
20
|
+
json: rows
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return request(`https://${subdomain}.rest.marketingcloudapis.com/hub/v1/dataevents/${id}/rowset`, {
|
|
25
|
+
method: 'post',
|
|
26
|
+
json: rows
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.upsertRows = upsertRows;
|
|
31
|
+
//# sourceMappingURL=sfmc-operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sfmc-operations.js","sourceRoot":"","sources":["../../../src/destinations/salesforce-marketing-cloud/sfmc-operations.ts"],"names":[],"mappings":";;;AAAA,wDAAuE;AAGvE,SAAgB,UAAU,CAAC,OAAsB,EAAE,SAAiB,EAAE,QAAmB;IACvF,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAE/B,IAAI,CAAC,GAAG,IAAI,CAAC,EAAE,EAAE;QACf,MAAM,IAAI,+BAAgB,CACxB,+GAA+G,EAC/G,8BAA8B,EAC9B,GAAG,CACJ,CAAA;KACF;IACD,MAAM,IAAI,GAA0B,EAAE,CAAA;IACtC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAgB,EAAE,EAAE;QACpC,IAAI,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,MAAM,EAAE,OAAO,CAAC,MAAM;SACvB,CAAC,CAAA;IACJ,CAAC,CAAC,CAAA;IACF,IAAI,GAAG,EAAE;QACP,OAAO,OAAO,CAAC,WAAW,SAAS,sDAAsD,GAAG,SAAS,EAAE;YACrG,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;KACH;SAAM;QACL,OAAO,OAAO,CAAC,WAAW,SAAS,kDAAkD,EAAE,SAAS,EAAE;YAChG,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;KACH;AACH,CAAC;AA5BD,gCA4BC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputField } from '@segment/actions-core/src/destination-kit/types';
|
|
2
|
+
export declare const contactKey: InputField;
|
|
3
|
+
export declare const contactKeyAPIEvent: InputField;
|
|
4
|
+
export declare const key: InputField;
|
|
5
|
+
export declare const id: InputField;
|
|
6
|
+
export declare const keys: InputField;
|
|
7
|
+
export declare const values: InputField;
|
|
8
|
+
export declare const eventDefinitionKey: InputField;
|
|
9
|
+
export declare const eventData: InputField;
|
|
10
|
+
export declare const enable_batching: InputField;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enable_batching = exports.eventData = exports.eventDefinitionKey = exports.values = exports.keys = exports.id = exports.key = exports.contactKeyAPIEvent = exports.contactKey = void 0;
|
|
4
|
+
exports.contactKey = {
|
|
5
|
+
label: 'Contact Key',
|
|
6
|
+
description: 'The unique identifier that you assign to a contact. This will be used to create a contact if one does not already exist with this Contact Key.',
|
|
7
|
+
type: 'string',
|
|
8
|
+
default: { '@path': '$.userId' }
|
|
9
|
+
};
|
|
10
|
+
exports.contactKeyAPIEvent = {
|
|
11
|
+
label: 'Contact Key',
|
|
12
|
+
description: 'The unique identifier that identifies a subscriber or a contact.',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: { '@path': '$.userId' },
|
|
15
|
+
required: true
|
|
16
|
+
};
|
|
17
|
+
exports.key = {
|
|
18
|
+
label: 'Data Extension Key',
|
|
19
|
+
description: 'The key of the data extension that you want to store contact information in. The data extension must be predefined in SFMC. Segment recommends storing all contact information in a single data extension. The key is required if a Data Extension ID is not provided.',
|
|
20
|
+
type: 'string'
|
|
21
|
+
};
|
|
22
|
+
exports.id = {
|
|
23
|
+
label: 'Data Extension ID',
|
|
24
|
+
description: 'The ID of the data extension that you want to store contact information in. The data extension must be predefined in SFMC. Segment recommends storing all contact information in a single data extension. The ID is required if a Data Extension Key is not provided.',
|
|
25
|
+
type: 'string'
|
|
26
|
+
};
|
|
27
|
+
exports.keys = {
|
|
28
|
+
label: 'Data Extension Primary Keys',
|
|
29
|
+
description: 'The primary key(s) that uniquely identify a contact in the data extension. At a minimum, Contact Key must exist in your data extension as a Primary Key. On the left-hand side, input the SFMC key name. On the right-hand side, map the Segment field that contains the corresponding value. When multiple primary keys are provided, SFMC will update an existing row if all primary keys match, otherwise a new row will be created.',
|
|
30
|
+
type: 'object',
|
|
31
|
+
required: true,
|
|
32
|
+
defaultObjectUI: 'keyvalue:only',
|
|
33
|
+
additionalProperties: true
|
|
34
|
+
};
|
|
35
|
+
exports.values = {
|
|
36
|
+
label: 'Contact Fields',
|
|
37
|
+
description: 'The fields in the data extension that contain data about a contact, such as Email, Last Name, etc. Fields must be created in the data extension before sending data for it. On the left-hand side, input the SFMC field name exactly how it appears in the data extension. On the right-hand side, map the Segment field that contains the corresponding value.',
|
|
38
|
+
type: 'object',
|
|
39
|
+
defaultObjectUI: 'keyvalue:only'
|
|
40
|
+
};
|
|
41
|
+
exports.eventDefinitionKey = {
|
|
42
|
+
label: 'Event Definition Key',
|
|
43
|
+
description: 'The unique key for an event definition in Salesforce Marketing Cloud. The event defintion must be predefined in SFMC. ',
|
|
44
|
+
type: 'string',
|
|
45
|
+
required: true
|
|
46
|
+
};
|
|
47
|
+
exports.eventData = {
|
|
48
|
+
label: 'Event Data',
|
|
49
|
+
description: 'The properties of the event. Fields must be created in the event definition schema before sending data for it. On the left-hand side, input the SFMC field name exactly how it appears in the event definition schema. On the right-hand side, map the Segment field that contains the corresponding value.',
|
|
50
|
+
type: 'object',
|
|
51
|
+
defaultObjectUI: 'keyvalue:only'
|
|
52
|
+
};
|
|
53
|
+
exports.enable_batching = {
|
|
54
|
+
label: 'Batch data to SFMC',
|
|
55
|
+
description: 'If true, data is batched before sending to the SFMC Data Extension.',
|
|
56
|
+
type: 'boolean',
|
|
57
|
+
default: false
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=sfmc-properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sfmc-properties.js","sourceRoot":"","sources":["../../../src/destinations/salesforce-marketing-cloud/sfmc-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAe;IACpC,KAAK,EAAE,aAAa;IACpB,WAAW,EACT,gJAAgJ;IAClJ,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;CACjC,CAAA;AAEY,QAAA,kBAAkB,GAAe;IAC5C,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,kEAAkE;IAC/E,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE;IAChC,QAAQ,EAAE,IAAI;CACf,CAAA;AAEY,QAAA,GAAG,GAAe;IAC7B,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EACT,wQAAwQ;IAC1Q,IAAI,EAAE,QAAQ;CACf,CAAA;AACY,QAAA,EAAE,GAAe;IAC5B,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EACT,uQAAuQ;IACzQ,IAAI,EAAE,QAAQ;CACf,CAAA;AACY,QAAA,IAAI,GAAe;IAC9B,KAAK,EAAE,6BAA6B;IACpC,WAAW,EACT,yaAAya;IAC3a,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;IACd,eAAe,EAAE,eAAe;IAChC,oBAAoB,EAAE,IAAI;CAC3B,CAAA;AACY,QAAA,MAAM,GAAe;IAChC,KAAK,EAAE,gBAAgB;IACvB,WAAW,EACT,iWAAiW;IACnW,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,eAAe;CACjC,CAAA;AACY,QAAA,kBAAkB,GAAe;IAC5C,KAAK,EAAE,sBAAsB;IAC7B,WAAW,EACT,wHAAwH;IAC1H,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,IAAI;CACf,CAAA;AACY,QAAA,SAAS,GAAe;IACnC,KAAK,EAAE,YAAY;IACnB,WAAW,EACT,6SAA6S;IAC/S,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,eAAe;CACjC,CAAA;AAEY,QAAA,eAAe,GAAe;IACzC,KAAK,EAAE,oBAAoB;IAC3B,WAAW,EAAE,qEAAqE;IAClF,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,KAAK;CACf,CAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertPayload = exports.fetchAccountCustomFields = exports.customFields = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
4
|
exports.customFields = {
|
|
6
5
|
label: 'Other Fields',
|
|
7
6
|
description: `
|
|
@@ -41,7 +40,7 @@ const convertCustomFieldNamesToIds = (customFields, accountCustomFields) => {
|
|
|
41
40
|
actualKey = matchingCustomField.id;
|
|
42
41
|
}
|
|
43
42
|
else {
|
|
44
|
-
throw new
|
|
43
|
+
throw new Error(`Unknown custom field '${key}'. To see your defined custom fields, visit https://mc.sendgrid.com/custom-fields`);
|
|
45
44
|
}
|
|
46
45
|
result[actualKey] = customFields[key];
|
|
47
46
|
return result;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sendgrid-properties.js","sourceRoot":"","sources":["../../../src/destinations/sendgrid/sendgrid-properties.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sendgrid-properties.js","sourceRoot":"","sources":["../../../src/destinations/sendgrid/sendgrid-properties.ts"],"names":[],"mappings":";;;AAGa,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE;;;;;;;;GAQZ;IACD,IAAI,EAAE,QAAQ;IACd,eAAe,EAAE,UAAU;CAC5B,CAAA;AAaM,MAAM,wBAAwB,GAAG,KAAK,EAAE,OAAsB,EAA0B,EAAE;IAC/F,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,yDAAyD,CAAC,CAAA;IACzF,MAAM,IAAI,GAAY,QAAQ,CAAC,IAAe,CAAA;IAC9C,MAAM,YAAY,GAAkB,IAAI,CAAC,aAA8B,CAAA;IAGvE,IAAI,YAAY,KAAK,SAAS,EAAE;QAC9B,OAAO,EAAE,CAAA;KACV;IAED,OAAO,YAAY,CAAC,GAAG,CAErB,CAAC,EAAE,EAAE,EAAE,IAAI,EAAe,EAAe,EAAE;QACzC,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,CAAA;IACrB,CAAC,CACF,CAAA;AACH,CAAC,CAAA;AAhBY,QAAA,wBAAwB,4BAgBpC;AAKD,MAAM,4BAA4B,GAAG,CAAC,YAAiB,EAAE,mBAAkC,EAAO,EAAE;IAClG,MAAM,SAAS,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAC9D,MAAM,WAAW,GAAG,mBAAmB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAA;IAEhF,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC,MAAW,EAAE,GAAW,EAAE,EAAE;QACnE,IAAI,SAAS,GAAW,GAAG,CAAA;QAC3B,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;YAC3B,SAAS,GAAG,GAAG,CAAA;SAChB;aAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,EAAE;YAClD,MAAM,mBAAmB,GAAgB,mBAAmB,CAAC,MAAM,CACjE,CAAC,KAAkB,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,WAAW,EAAE,CACvE,CAAC,CAAC,CAAC,CAAA;YACJ,SAAS,GAAG,mBAAmB,CAAC,EAAE,CAAA;SACnC;aAAM;YACL,MAAM,IAAI,KAAK,CACb,yBAAyB,GAAG,mFAAmF,CAChH,CAAA;SACF;QACD,MAAM,CAAC,SAAS,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;QACrC,OAAO,MAAM,CAAA;IACf,CAAC,EAAE,EAAE,CAAC,CAAA;AACR,CAAC,CAAA;AAEM,MAAM,cAAc,GAAG,CAAC,OAAgB,EAAE,mBAAkC,EAAE,EAAE;IACrF,MAAM,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAA;IAGhF,MAAM,mBAAmB,GAAG,YAAY;QACtC,CAAC,CAAC,4BAA4B,CAAC,YAAY,EAAE,mBAAmB,CAAC;QACjE,CAAC,CAAC,YAAY,CAAA;IAEhB,OAAO,EAAE,GAAG,IAAI,EAAE,qBAAqB,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,CAAA;AAC5G,CAAC,CAAA;AATY,QAAA,cAAc,kBAS1B"}
|
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.113.1-alpha.
|
|
4
|
+
"version": "3.113.1-alpha.11",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@amplitude/ua-parser-js": "^0.7.25",
|
|
40
40
|
"@segment/a1-notation": "^2.1.4",
|
|
41
|
-
"@segment/actions-core": "^3.41.1-alpha.
|
|
42
|
-
"@segment/actions-shared": "^1.24.1-alpha.
|
|
41
|
+
"@segment/actions-core": "^3.41.1-alpha.11",
|
|
42
|
+
"@segment/actions-shared": "^1.24.1-alpha.11",
|
|
43
43
|
"cheerio": "^1.0.0-rc.10",
|
|
44
44
|
"dayjs": "^1.10.7",
|
|
45
45
|
"escape-goat": "^3",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"lcov"
|
|
66
66
|
]
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "0cd70e782e8e4f35e8e918bfb5928c1dc7e9e2fb"
|
|
69
69
|
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { IntegrationError, RetryableError, HTTPError } from '@segment/actions-core';
|
|
2
|
-
export declare class HubSpotError extends HTTPError {
|
|
3
|
-
response: Response & {
|
|
4
|
-
data: {
|
|
5
|
-
status: string;
|
|
6
|
-
message: string;
|
|
7
|
-
correlationId: string;
|
|
8
|
-
category: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
export declare const MissingIdentityCallThrowableError: IntegrationError;
|
|
13
|
-
export declare const CompanySearchThrowableError: IntegrationError;
|
|
14
|
-
export declare const RestrictedPropertyThrowableError: IntegrationError;
|
|
15
|
-
export declare const MultipleCompaniesInSearchResultThrowableError: IntegrationError;
|
|
16
|
-
export declare const SegmentUniqueIdentifierMissingRetryableError: RetryableError;
|
|
17
|
-
export declare function isSegmentUniqueIdentifierPropertyError(error: HubSpotError, segmentUniqueIdentifierProperty: string): boolean;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSegmentUniqueIdentifierPropertyError = exports.SegmentUniqueIdentifierMissingRetryableError = exports.MultipleCompaniesInSearchResultThrowableError = exports.RestrictedPropertyThrowableError = exports.CompanySearchThrowableError = exports.MissingIdentityCallThrowableError = exports.HubSpotError = void 0;
|
|
4
|
-
const actions_core_1 = require("@segment/actions-core");
|
|
5
|
-
const properties_1 = require("./properties");
|
|
6
|
-
class HubSpotError extends actions_core_1.HTTPError {
|
|
7
|
-
}
|
|
8
|
-
exports.HubSpotError = HubSpotError;
|
|
9
|
-
exports.MissingIdentityCallThrowableError = new actions_core_1.IntegrationError('Identify (Upsert Contact) must be called before Group (Upsert Company) for the HubSpot Cloud (Actions) destination.', 'Missing Identity Call', 400);
|
|
10
|
-
exports.CompanySearchThrowableError = new actions_core_1.IntegrationError('HubSpot returned 400 error while performing a company search. Please check if ’Company Search Fields’ contains valid properties defined in HubSpot.', 'Company Search Failed', 400);
|
|
11
|
-
exports.RestrictedPropertyThrowableError = new actions_core_1.IntegrationError(`Segment uses ’${properties_1.SEGMENT_UNIQUE_IDENTIFIER}’ property internally to map Segment Groups to HubSpot Companies. This property shouldn’t be defined explicitly.`, 'Payload Validation Failed', 400);
|
|
12
|
-
exports.MultipleCompaniesInSearchResultThrowableError = new actions_core_1.IntegrationError(`The search criteria defined by Company Search Fields returned more than one companies. The update request will be rejected.`, 'Search Criteria Not Unique', 400);
|
|
13
|
-
exports.SegmentUniqueIdentifierMissingRetryableError = new actions_core_1.RetryableError(`The ’${properties_1.SEGMENT_UNIQUE_IDENTIFIER}’ property doesn't exist in HubSpot. Segment will attempt to create the property and retry the action.`);
|
|
14
|
-
function isSegmentUniqueIdentifierPropertyError(error, segmentUniqueIdentifierProperty) {
|
|
15
|
-
if (error?.response?.status !== 400) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
try {
|
|
19
|
-
const errorMessage = error?.response?.data?.message?.replace('Property values were not valid: ', '');
|
|
20
|
-
const errorList = JSON.parse(errorMessage);
|
|
21
|
-
return (errorList.length === 1 &&
|
|
22
|
-
errorList[0].name === segmentUniqueIdentifierProperty &&
|
|
23
|
-
errorList[0].error === 'PROPERTY_DOESNT_EXIST');
|
|
24
|
-
}
|
|
25
|
-
catch (e) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.isSegmentUniqueIdentifierPropertyError = isSegmentUniqueIdentifierPropertyError;
|
|
30
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../src/destinations/hubspot/errors.ts"],"names":[],"mappings":";;;AAAA,wDAAmF;AACnF,6CAAwD;AAExD,MAAa,YAAa,SAAQ,wBAAS;CAS1C;AATD,oCASC;AACY,QAAA,iCAAiC,GAAG,IAAI,+BAAgB,CACnE,qHAAqH,EACrH,uBAAuB,EACvB,GAAG,CACJ,CAAA;AAEY,QAAA,2BAA2B,GAAG,IAAI,+BAAgB,CAC7D,qJAAqJ,EACrJ,uBAAuB,EACvB,GAAG,CACJ,CAAA;AAEY,QAAA,gCAAgC,GAAG,IAAI,+BAAgB,CAClE,iBAAiB,sCAAyB,kHAAkH,EAC5J,2BAA2B,EAC3B,GAAG,CACJ,CAAA;AAEY,QAAA,6CAA6C,GAAG,IAAI,+BAAgB,CAC/E,6HAA6H,EAC7H,4BAA4B,EAC5B,GAAG,CACJ,CAAA;AAEY,QAAA,4CAA4C,GAAG,IAAI,6BAAc,CAC5E,QAAQ,sCAAyB,wGAAwG,CAC1I,CAAA;AAED,SAAgB,sCAAsC,CACpD,KAAmB,EACnB,+BAAuC;IAEvC,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE;QACnC,OAAO,KAAK,CAAA;KACb;IAED,IAAI;QACF,MAAM,YAAY,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,kCAAkC,EAAE,EAAE,CAAC,CAAA;QACpG,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;QAE1C,OAAO,CACL,SAAS,CAAC,MAAM,KAAK,CAAC;YACtB,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,+BAA+B;YACrD,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,uBAAuB,CAC/C,CAAA;KACF;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,KAAK,CAAA;KACb;AACH,CAAC;AApBD,wFAoBC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface Payload {
|
|
2
|
-
groupid: string;
|
|
3
|
-
companysearchfields: {
|
|
4
|
-
[k: string]: unknown;
|
|
5
|
-
};
|
|
6
|
-
name: string;
|
|
7
|
-
description?: string;
|
|
8
|
-
createdate?: string;
|
|
9
|
-
address?: string;
|
|
10
|
-
city?: string;
|
|
11
|
-
state?: string;
|
|
12
|
-
zip?: string;
|
|
13
|
-
domain?: string;
|
|
14
|
-
phone?: string;
|
|
15
|
-
numberofemployees?: number;
|
|
16
|
-
industry?: string;
|
|
17
|
-
lifecyclestage?: string;
|
|
18
|
-
properties?: {
|
|
19
|
-
[k: string]: unknown;
|
|
20
|
-
};
|
|
21
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/hubspot/upsertCompany/generated-types.ts"],"names":[],"mappings":""}
|