@segment/action-destinations 3.90.1-alpha.6 → 3.93.0

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.
Files changed (69) hide show
  1. package/dist/destinations/cordial/addProductToCart/index.js +1 -1
  2. package/dist/destinations/cordial/addProductToCart/index.js.map +1 -1
  3. package/dist/destinations/cordial/index.js +1 -1
  4. package/dist/destinations/cordial/index.js.map +1 -1
  5. package/dist/destinations/cordial/removeProductFromCart/index.js.map +1 -1
  6. package/dist/destinations/cordial/upsertOrder/index.js +8 -8
  7. package/dist/destinations/cordial/upsertOrder/index.js.map +1 -1
  8. package/dist/destinations/customerio/trackEvent/index.js.map +1 -1
  9. package/dist/destinations/facebook-conversions-api/constants.d.ts +1 -1
  10. package/dist/destinations/facebook-conversions-api/constants.js +1 -1
  11. package/dist/destinations/google-enhanced-conversions/postConversion/index.js +2 -3
  12. package/dist/destinations/google-enhanced-conversions/postConversion/index.js.map +1 -1
  13. package/dist/destinations/heap/trackEvent/index.js +0 -1
  14. package/dist/destinations/heap/trackEvent/index.js.map +1 -1
  15. package/dist/destinations/index.js +0 -2
  16. package/dist/destinations/index.js.map +1 -1
  17. package/dist/destinations/personas-messaging-sendgrid/sendEmail/generated-types.d.ts +0 -5
  18. package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js +3 -39
  19. package/dist/destinations/personas-messaging-sendgrid/sendEmail/index.js.map +1 -1
  20. package/dist/destinations/personas-messaging-twilio/sendSms/index.js +3 -3
  21. package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -1
  22. package/dist/destinations/talon-one/index.js +0 -2
  23. package/dist/destinations/talon-one/index.js.map +1 -1
  24. package/package.json +4 -4
  25. package/dist/destinations/actions-pardot/generated-types.d.ts +0 -5
  26. package/dist/destinations/actions-pardot/generated-types.js +0 -3
  27. package/dist/destinations/actions-pardot/generated-types.js.map +0 -1
  28. package/dist/destinations/actions-pardot/index.d.ts +0 -4
  29. package/dist/destinations/actions-pardot/index.js +0 -62
  30. package/dist/destinations/actions-pardot/index.js.map +0 -1
  31. package/dist/destinations/actions-pardot/pa-operations.d.ts +0 -17
  32. package/dist/destinations/actions-pardot/pa-operations.js +0 -51
  33. package/dist/destinations/actions-pardot/pa-operations.js.map +0 -1
  34. package/dist/destinations/actions-pardot/pa-properties.d.ts +0 -2
  35. package/dist/destinations/actions-pardot/pa-properties.js +0 -13
  36. package/dist/destinations/actions-pardot/pa-properties.js.map +0 -1
  37. package/dist/destinations/actions-pardot/pa-type.d.ts +0 -15
  38. package/dist/destinations/actions-pardot/pa-type.js +0 -3
  39. package/dist/destinations/actions-pardot/pa-type.js.map +0 -1
  40. package/dist/destinations/actions-pardot/prospects/generated-types.d.ts +0 -19
  41. package/dist/destinations/actions-pardot/prospects/generated-types.js +0 -3
  42. package/dist/destinations/actions-pardot/prospects/generated-types.js.map +0 -1
  43. package/dist/destinations/actions-pardot/prospects/index.d.ts +0 -5
  44. package/dist/destinations/actions-pardot/prospects/index.js +0 -204
  45. package/dist/destinations/actions-pardot/prospects/index.js.map +0 -1
  46. package/dist/destinations/intercom/generated-types.d.ts +0 -2
  47. package/dist/destinations/intercom/generated-types.js +0 -3
  48. package/dist/destinations/intercom/generated-types.js.map +0 -1
  49. package/dist/destinations/intercom/groupIdentifyContact/generated-types.d.ts +0 -14
  50. package/dist/destinations/intercom/groupIdentifyContact/generated-types.js +0 -3
  51. package/dist/destinations/intercom/groupIdentifyContact/generated-types.js.map +0 -1
  52. package/dist/destinations/intercom/groupIdentifyContact/index.d.ts +0 -5
  53. package/dist/destinations/intercom/groupIdentifyContact/index.js +0 -122
  54. package/dist/destinations/intercom/groupIdentifyContact/index.js.map +0 -1
  55. package/dist/destinations/intercom/identifyContact/generated-types.d.ts +0 -15
  56. package/dist/destinations/intercom/identifyContact/generated-types.js +0 -3
  57. package/dist/destinations/intercom/identifyContact/generated-types.js.map +0 -1
  58. package/dist/destinations/intercom/identifyContact/index.d.ts +0 -5
  59. package/dist/destinations/intercom/identifyContact/index.js +0 -153
  60. package/dist/destinations/intercom/identifyContact/index.js.map +0 -1
  61. package/dist/destinations/intercom/index.d.ts +0 -4
  62. package/dist/destinations/intercom/index.js +0 -37
  63. package/dist/destinations/intercom/index.js.map +0 -1
  64. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.d.ts +0 -15
  65. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.js +0 -3
  66. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/generated-types.js.map +0 -1
  67. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.d.ts +0 -5
  68. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js +0 -71
  69. package/dist/destinations/talon-one/updateCustomerProfilesAttributes/index.js.map +0 -1
@@ -1,17 +0,0 @@
1
- import { RequestClient } from '@segment/actions-core';
2
- import type { Payload as ProspectsPayload } from './prospects/generated-types';
3
- export declare const API_VERSION = "v5";
4
- interface ProspectUpsertResponseData {
5
- id: string;
6
- email: string;
7
- }
8
- export default class Pardot {
9
- businessUnitID: string;
10
- baseUrl: string;
11
- request: RequestClient;
12
- constructor(businessUnitID: string, baseUrl: string, request: RequestClient);
13
- upsertRecord: (payload: ProspectsPayload) => Promise<import("@segment/actions-core").ModifiedResponse<ProspectUpsertResponseData>>;
14
- private ProspectsShape;
15
- private buildProspectJSON;
16
- }
17
- export {};
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.API_VERSION = void 0;
4
- exports.API_VERSION = 'v5';
5
- class Pardot {
6
- constructor(businessUnitID, baseUrl, request) {
7
- this.upsertRecord = async (payload) => {
8
- const prospect = this.buildProspectJSON(payload);
9
- return this.request(`${this.baseUrl}/api/${exports.API_VERSION}/objects/prospects/do/upsertLatestByEmail`, {
10
- method: 'post',
11
- headers: {
12
- 'Content-Type': 'application/json'
13
- },
14
- json: {
15
- matchEmail: payload.email,
16
- prospect: prospect,
17
- secondaryDeletedSearch: payload.secondaryDeletedSearch
18
- }
19
- });
20
- };
21
- this.ProspectsShape = (payload) => {
22
- return {
23
- email: payload.email,
24
- firstName: payload.firstName,
25
- lastName: payload.lastName,
26
- salutation: payload.salutation,
27
- phone: payload.phone,
28
- company: payload.company,
29
- jobTitle: payload.jobTitle,
30
- industry: payload.industry,
31
- city: payload.city,
32
- state: payload.state,
33
- zip: payload.zip,
34
- country: payload.country,
35
- website: payload.website
36
- };
37
- };
38
- this.buildProspectJSON = (payload) => {
39
- let baseShape = this.ProspectsShape(payload);
40
- if (payload.customFields) {
41
- baseShape = { ...baseShape, ...payload.customFields };
42
- }
43
- return baseShape;
44
- };
45
- this.businessUnitID = businessUnitID;
46
- this.baseUrl = baseUrl;
47
- this.request = request;
48
- }
49
- }
50
- exports.default = Pardot;
51
- //# sourceMappingURL=pa-operations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pa-operations.js","sourceRoot":"","sources":["../../../src/destinations/actions-pardot/pa-operations.ts"],"names":[],"mappings":";;;AAIa,QAAA,WAAW,GAAG,IAAI,CAAA;AAO/B,MAAqB,MAAM;IAKzB,YAAY,cAAsB,EAAE,OAAe,EAAE,OAAsB;QAM3E,iBAAY,GAAG,KAAK,EAAE,OAAyB,EAAE,EAAE;YACjD,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;YAEhD,OAAO,IAAI,CAAC,OAAO,CACjB,GAAG,IAAI,CAAC,OAAO,QAAQ,mBAAW,2CAA2C,EAC7E;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO,EAAE;oBACP,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAE;oBACJ,UAAU,EAAE,OAAO,CAAC,KAAK;oBACzB,QAAQ,EAAE,QAAQ;oBAClB,sBAAsB,EAAE,OAAO,CAAC,sBAAsB;iBACvD;aACF,CACF,CAAA;QACH,CAAC,CAAA;QAEO,mBAAc,GAAG,CAAC,OAAyB,EAAiB,EAAE;YACpE,OAAO;gBACL,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,UAAU,EAAE,OAAO,CAAC,UAAU;gBAC9B,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,IAAI,EAAE,OAAO,CAAC,IAAI;gBAClB,KAAK,EAAE,OAAO,CAAC,KAAK;gBACpB,GAAG,EAAE,OAAO,CAAC,GAAG;gBAChB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAA;QACH,CAAC,CAAA;QAEO,sBAAiB,GAAG,CAAC,OAAyB,EAAE,EAAE;YACxD,IAAI,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;YAE5C,IAAI,OAAO,CAAC,YAAY,EAAE;gBACxB,SAAS,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,OAAO,CAAC,YAAY,EAAE,CAAA;aACtD;YAED,OAAO,SAAS,CAAA;QAClB,CAAC,CAAA;QAlDC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAA;QACpC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CAgDF;AAzDD,yBAyDC"}
@@ -1,2 +0,0 @@
1
- import { InputField } from '@segment/actions-core/src/destination-kit/types';
2
- export declare const customFields: InputField;
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.customFields = void 0;
4
- exports.customFields = {
5
- label: 'Other Fields',
6
- description: `
7
- Additional prospect fields to send to Pardot.
8
- Only editable fields are accepted. Please see [Pardot docs](https://developer.salesforce.com/docs/marketing/pardot/guide/prospect-v5.html#fields) for more details. On the left-hand side, input the Pardot field name. On the right-hand side, map the Segment field that contains the value.`,
9
- type: 'object',
10
- required: false,
11
- defaultObjectUI: 'keyvalue'
12
- };
13
- //# sourceMappingURL=pa-properties.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pa-properties.js","sourceRoot":"","sources":["../../../src/destinations/actions-pardot/pa-properties.ts"],"names":[],"mappings":";;;AAEa,QAAA,YAAY,GAAe;IACtC,KAAK,EAAE,cAAc;IACrB,WAAW,EAAE;;iSAEkR;IAC/R,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,eAAe,EAAE,UAAU;CAC5B,CAAA"}
@@ -1,15 +0,0 @@
1
- export declare type ProspectsType = {
2
- email: string;
3
- firstName?: string;
4
- lastName?: string;
5
- salutation?: string;
6
- phone?: string;
7
- company?: string;
8
- jobTitle?: string;
9
- industry?: string;
10
- city?: string;
11
- state?: string;
12
- zip?: string;
13
- country?: string;
14
- website?: string;
15
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=pa-type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pa-type.js","sourceRoot":"","sources":["../../../src/destinations/actions-pardot/pa-type.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- export interface Payload {
2
- email: string;
3
- firstName?: string;
4
- lastName?: string;
5
- salutation?: string;
6
- phone?: string;
7
- company?: string;
8
- jobTitle?: string;
9
- industry?: string;
10
- city?: string;
11
- state?: string;
12
- zip?: string;
13
- country?: string;
14
- website?: string;
15
- secondaryDeletedSearch: boolean;
16
- customFields?: {
17
- [k: string]: unknown;
18
- };
19
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/actions-pardot/prospects/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import { ActionDefinition } from '@segment/actions-core';
2
- import type { Settings } from '../generated-types';
3
- import type { Payload } from './generated-types';
4
- declare const action: ActionDefinition<Settings, Payload>;
5
- export default action;
@@ -1,204 +0,0 @@
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 actions_core_1 = require("@segment/actions-core");
7
- const pa_operations_1 = __importDefault(require("../pa-operations"));
8
- const pa_properties_1 = require("../pa-properties");
9
- const action = {
10
- title: 'Prospect',
11
- description: 'Represents an opportunity, which is a sale or pending deal.',
12
- fields: {
13
- email: {
14
- label: 'Email Address',
15
- description: `The prospect's email address.
16
- Used to upsert prospect. If multiple prospects have the given email, the prospect with the latest activity is updated. If there's no prospect with the given email, a prospect is created. Please note that Pardot treats email address as case sensitive and will create multiple prospects for casing differences.`,
17
- type: 'string',
18
- required: true,
19
- default: {
20
- '@if': {
21
- exists: { '@path': '$.traits.email' },
22
- then: { '@path': '$.traits.email' },
23
- else: { '@path': '$.properties.email' }
24
- }
25
- }
26
- },
27
- firstName: {
28
- label: 'First Name',
29
- description: "The prospect's first name.",
30
- type: 'string',
31
- required: false,
32
- default: {
33
- '@if': {
34
- exists: { '@path': '$.traits.first_name' },
35
- then: { '@path': '$.traits.first_name' },
36
- else: { '@path': '$.properties.first_name' }
37
- }
38
- }
39
- },
40
- lastName: {
41
- label: 'Last Name',
42
- description: "The prospect's last name.",
43
- type: 'string',
44
- required: false,
45
- default: {
46
- '@if': {
47
- exists: { '@path': '$.traits.last_name' },
48
- then: { '@path': '$.traits.last_name' },
49
- else: { '@path': '$.properties.last_name' }
50
- }
51
- }
52
- },
53
- salutation: {
54
- label: 'Salutation',
55
- description: "The prospect's formal prefix.",
56
- type: 'string',
57
- required: false
58
- },
59
- phone: {
60
- label: 'Phone Number',
61
- description: "The prospect's phone number.",
62
- type: 'string',
63
- required: false,
64
- default: {
65
- '@if': {
66
- exists: { '@path': '$.traits.phone' },
67
- then: { '@path': '$.traits.phone' },
68
- else: { '@path': '$.properties.phone' }
69
- }
70
- }
71
- },
72
- company: {
73
- label: 'Company',
74
- description: "The prospect's company.",
75
- type: 'string',
76
- required: false,
77
- default: {
78
- '@if': {
79
- exists: { '@path': '$.traits.company' },
80
- then: { '@path': '$.traits.company' },
81
- else: { '@path': '$.properties.company' }
82
- }
83
- }
84
- },
85
- jobTitle: {
86
- label: 'Job Title',
87
- description: "The prospect's job title.",
88
- type: 'string',
89
- required: false,
90
- default: {
91
- '@if': {
92
- exists: { '@path': '$.traits.title' },
93
- then: { '@path': '$.traits.title' },
94
- else: { '@path': '$.properties.title' }
95
- }
96
- }
97
- },
98
- industry: {
99
- label: 'Industry',
100
- description: "The prospect's industry.",
101
- type: 'string',
102
- required: false
103
- },
104
- city: {
105
- label: 'City',
106
- description: "The prospect's city.",
107
- type: 'string',
108
- required: false,
109
- default: {
110
- '@if': {
111
- exists: { '@path': '$.traits.address.city' },
112
- then: { '@path': '$.traits.address.city' },
113
- else: { '@path': '$.properties.address.city' }
114
- }
115
- }
116
- },
117
- state: {
118
- label: 'State',
119
- description: "The prospect's US state.",
120
- type: 'string',
121
- required: false,
122
- default: {
123
- '@if': {
124
- exists: { '@path': '$.traits.address.state' },
125
- then: { '@path': '$.traits.address.state' },
126
- else: { '@path': '$.properties.address.state' }
127
- }
128
- }
129
- },
130
- zip: {
131
- label: 'Zip Code',
132
- description: "The prospect's postal code.",
133
- type: 'string',
134
- required: false,
135
- default: {
136
- '@if': {
137
- exists: { '@path': '$.traits.address.postal_code' },
138
- then: { '@path': '$.traits.address.postal_code' },
139
- else: { '@path': '$.properties.address.postal_code' }
140
- }
141
- }
142
- },
143
- country: {
144
- label: 'Country',
145
- description: "The prospect's country.",
146
- type: 'string',
147
- required: false,
148
- default: {
149
- '@if': {
150
- exists: { '@path': '$.traits.address.country' },
151
- then: { '@path': '$.traits.address.country' },
152
- else: { '@path': '$.properties.address.country' }
153
- }
154
- }
155
- },
156
- website: {
157
- label: 'Website',
158
- description: "The prospect's website URL.",
159
- type: 'string',
160
- required: false,
161
- default: {
162
- '@if': {
163
- exists: { '@path': '$.traits.website' },
164
- then: { '@path': '$.traits.website' },
165
- else: { '@path': '$.properties.website' }
166
- }
167
- }
168
- },
169
- secondaryDeletedSearch: {
170
- label: 'Search Deleted Prospects',
171
- description: `If true, the request’s search includes deleted records. This property only affects [AMPSEA accounts](https://help.salesforce.com/s/articleView?id=sf.pardot_admin_ampsea_parent.htm&type=5).
172
- If all records with a matching email address are deleted, the one with the latest activity is undeleted and updated. Otherwise, a new prospect is created.`,
173
- type: 'boolean',
174
- required: true,
175
- default: true
176
- },
177
- customFields: pa_properties_1.customFields
178
- },
179
- perform: async (request, { settings, payload }) => {
180
- const baseUrl = settings.isSandbox ? 'https://pi.demo.pardot.com' : 'https://pi.pardot.com';
181
- const pa = new pa_operations_1.default(settings.businessUnitID, baseUrl, request);
182
- try {
183
- return await pa.upsertRecord(payload);
184
- }
185
- catch (err) {
186
- const error = err;
187
- const statusCode = error.response.status;
188
- if (error.response.headers.get('content-type')?.includes('application/json')) {
189
- const data = error.response.data;
190
- throw new actions_core_1.IntegrationError(`Pardot responded witha error code ${data.code}: ${data.message}. This means Pardot has received the call, but consider the payload to be invalid. To identify the exact error, please refer to ` +
191
- `https://developer.salesforce.com/docs/marketing/pardot/guide/error-codes.html?q=error#numerical-list-of-error-codes and search for the error code you received`, 'PARDOT_ERROR', 400);
192
- }
193
- else if (error.response.headers.get('content-type')?.includes('text/xml')) {
194
- if (statusCode === 403 || statusCode === 400) {
195
- throw new actions_core_1.IntegrationError(`The Business Unit ID or access_token is invalid. This error is also returned when you use the wrong instance (Sandbox or Prod). ` +
196
- `If you toggled the Sandbox instance, please disconnect and reconnect with your corresponding username.`, 'PARDOT_ERROR', 403);
197
- }
198
- }
199
- throw err;
200
- }
201
- }
202
- };
203
- exports.default = action;
204
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/actions-pardot/prospects/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAAqF;AAGrF,qEAAqC;AACrC,oDAA+C;AAQ/C,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,UAAU;IACjB,WAAW,EAAE,6DAA6D;IAC1E,MAAM,EAAE;QACN,KAAK,EAAE;YACL,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE;8TAC2S;YACxT,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACrC,IAAI,EAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE;oBACnC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;iBACxC;aACF;SACF;QACD,SAAS,EAAE;YACT,KAAK,EAAE,YAAY;YACnB,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;oBAC1C,IAAI,EAAE,EAAE,OAAO,EAAE,qBAAqB,EAAE;oBACxC,IAAI,EAAE,EAAE,OAAO,EAAE,yBAAyB,EAAE;iBAC7C;aACF;SACF;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,WAAW;YAClB,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE;gBACP,KAAK,EAAE;oBACL,MAAM,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACzC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE;oBACvC,IAAI,EA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K,CAAC,QAA6B,CAAC,IAAmB,CAAA;gBACrE,MAAM,IAAI,+BAAgB,CACxB,qCAAqC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,OAAO,mIAAmI;oBAChM,gKAAgK,EAClK,cAAc,EACd,GAAG,CACJ,CAAA;aACF;iBAGI,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE;gBACzE,IAAI,UAAU,KAAK,GAAG,IAAI,UAAU,KAAK,GAAG,EAAE;oBAC5C,MAAM,IAAI,+BAAgB,CACxB,kIAAkI;wBAChI,wGAAwG,EAC1G,cAAc,EACd,GAAG,CACJ,CAAA;iBACF;aACF;YACD,MAAM,GAAG,CAAA;SACV;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
@@ -1,2 +0,0 @@
1
- export interface Settings {
2
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../src/destinations/intercom/generated-types.ts"],"names":[],"mappings":""}
@@ -1,14 +0,0 @@
1
- export interface Payload {
2
- remote_created_at?: string | number;
3
- company_id: string;
4
- contact_id?: string;
5
- name?: string;
6
- monthly_spend?: number;
7
- plan?: string;
8
- size?: number;
9
- website?: string;
10
- industry?: string;
11
- custom_attributes?: {
12
- [k: string]: unknown;
13
- };
14
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/groupIdentifyContact/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import { ActionDefinition } from '@segment/actions-core';
2
- import type { Settings } from '../generated-types';
3
- import type { Payload } from './generated-types';
4
- declare const action: ActionDefinition<Settings, Payload>;
5
- export default action;
@@ -1,122 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const actions_core_1 = require("@segment/actions-core");
4
- const action = {
5
- title: 'Group Identify Contact',
6
- description: "Create or Update A Company. Note: Companies will be only visible in Intercom's Dashboard when there is at least one associated contact.",
7
- defaultSubscription: 'type = "group"',
8
- platform: 'web',
9
- fields: {
10
- remote_created_at: {
11
- type: 'datetime',
12
- description: 'The time the company was created by you.',
13
- label: 'Remote Created At',
14
- default: {
15
- '@path': '$.traits.createdAt'
16
- }
17
- },
18
- company_id: {
19
- type: 'string',
20
- description: "The unique identifier of the company. Can't be updated.",
21
- label: 'Company ID',
22
- required: true,
23
- default: {
24
- '@path': '$.groupId'
25
- }
26
- },
27
- contact_id: {
28
- type: 'string',
29
- description: 'Attach this contact to the company. This ID is NOT the external_id or email; it is the Intercom unique identifier.',
30
- label: 'Contact ID',
31
- default: {
32
- '@path': '$.userId'
33
- }
34
- },
35
- name: {
36
- type: 'string',
37
- description: 'The name of the company.',
38
- label: 'Name',
39
- default: {
40
- '@path': '$.traits.name'
41
- }
42
- },
43
- monthly_spend: {
44
- type: 'number',
45
- description: 'The monthly spend of the company.',
46
- label: 'Monthly Spend',
47
- default: {
48
- '@path': '$.traits.plan'
49
- }
50
- },
51
- plan: {
52
- type: 'string',
53
- description: 'The plan of the company.',
54
- label: 'Plan',
55
- default: {
56
- '@path': '$.traits.plan'
57
- }
58
- },
59
- size: {
60
- type: 'number',
61
- description: 'The size of the company.',
62
- label: 'Size',
63
- default: {
64
- '@path': '$.traits.employees'
65
- }
66
- },
67
- website: {
68
- type: 'string',
69
- description: 'The website of the company.',
70
- label: 'Website',
71
- default: {
72
- '@path': '$.traits.website'
73
- }
74
- },
75
- industry: {
76
- type: 'string',
77
- description: 'The industry of the company.',
78
- label: 'Industry',
79
- default: {
80
- '@path': '$.traits.industry'
81
- }
82
- },
83
- custom_attributes: {
84
- type: 'object',
85
- description: 'Passing any traits not mapped to individual fields as Custom Attributes. Note: Will throw an error if you pass an attribute that isn`t explicitly defined.',
86
- label: 'Custom Attributes'
87
- }
88
- },
89
- perform: async (request, { payload }) => {
90
- const contactId = payload.contact_id;
91
- delete payload.contact_id;
92
- const response = await createOrUpdateIntercomCompany(request, payload);
93
- if (contactId) {
94
- try {
95
- const companyId = response.data.id;
96
- return await attachContactToIntercomCompany(request, contactId, companyId);
97
- }
98
- catch (error) {
99
- if (error?.response?.status === 404) {
100
- throw new actions_core_1.RetryableError(`Contact doesn't exist, retrying`);
101
- }
102
- throw error;
103
- }
104
- }
105
- }
106
- };
107
- function createOrUpdateIntercomCompany(request, payload) {
108
- return request(`https://api.intercom.io/companies`, {
109
- method: 'POST',
110
- json: payload
111
- });
112
- }
113
- function attachContactToIntercomCompany(request, contactId, companyId) {
114
- return request(`https://api.intercom.io/contacts/${contactId}/companies`, {
115
- method: 'POST',
116
- json: {
117
- id: companyId
118
- }
119
- });
120
- }
121
- exports.default = action;
122
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/groupIdentifyContact/index.ts"],"names":[],"mappings":";;AAAA,wDAAyG;AAQzG,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,yIAAyI;IAC3I,mBAAmB,EAAE,gBAAgB;IACrC,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE;QACN,iBAAiB,EAAE;YACjB,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,0CAA0C;YACvD,KAAK,EAAE,mBAAmB;YAC1B,OAAO,EAAE;gBACP,OAAO,EAAE,oBAAoB;aAC9B;SACF;QACD,UAAU,EAAE;YACV,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,yDAAyD;YACtE,KAAK,EAAE,YAAY;YACnB,QAAQ,EAAE,IAAI;YACd,OAAO,EA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E;QACtC,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAA;QACpC,OAAO,OAAO,CAAC,UAAU,CAAA;QAEzB,MAAM,QAAQ,GAAG,MAAM,6BAA6B,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACtE,IAAI,SAAS,EAAE;YACb,IAAI;gBACF,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAA;gBAClC,OAAO,MAAM,8BAA8B,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC,CAAA;aAC3E;YAAC,OAAO,KAAK,EAAE;gBAEd,IAAI,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,GAAG,EAAE;oBACnC,MAAM,IAAI,6BAAc,CAAC,iCAAiC,CAAC,CAAA;iBAC5D;gBACD,MAAM,KAAK,CAAA;aACZ;SACF;IACH,CAAC;CACF,CAAA;AAED,SAAS,6BAA6B,CACpC,OAAsB,EACtB,OAAgB;IAEhB,OAAO,OAAO,CAAC,mCAAmC,EAAE;QAClD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,OAAO;KACd,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,8BAA8B,CAAC,OAAsB,EAAE,SAAiB,EAAE,SAAiB;IAClG,OAAO,OAAO,CAAC,oCAAoC,SAAS,YAAY,EAAE;QACxE,MAAM,EAAE,MAAM;QACd,IAAI,EAAE;YACJ,EAAE,EAAE,SAAS;SACd;KACF,CAAC,CAAA;AACJ,CAAC;AAED,kBAAe,MAAM,CAAA"}
@@ -1,15 +0,0 @@
1
- export interface Payload {
2
- role: string;
3
- external_id?: string;
4
- email?: string;
5
- phone?: string;
6
- name?: string;
7
- avatar?: string;
8
- signed_up_at?: string | number;
9
- last_seen_at?: string | number;
10
- owner_id?: number;
11
- unsubscribed_from_emails?: boolean;
12
- custom_attributes?: {
13
- [k: string]: unknown;
14
- };
15
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=generated-types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/intercom/identifyContact/generated-types.ts"],"names":[],"mappings":""}
@@ -1,5 +0,0 @@
1
- import { ActionDefinition } from '@segment/actions-core';
2
- import type { Settings } from '../generated-types';
3
- import type { Payload } from './generated-types';
4
- declare const action: ActionDefinition<Settings, Payload>;
5
- export default action;