@segment/action-destinations 3.51.0 → 3.52.1-alpha.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.
- package/dist/destinations/personas-messaging-twilio/sendSms/generated-types.d.ts +1 -1
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js +4 -4
- package/dist/destinations/personas-messaging-twilio/sendSms/index.js.map +1 -1
- package/dist/destinations/salesforce/account/generated-types.d.ts +25 -0
- package/dist/destinations/salesforce/{cases.types.js → account/generated-types.js} +1 -1
- package/dist/destinations/salesforce/account/generated-types.js.map +1 -0
- package/dist/destinations/salesforce/account/index.d.ts +5 -0
- package/dist/destinations/salesforce/account/index.js +181 -0
- package/dist/destinations/salesforce/account/index.js.map +1 -0
- package/dist/destinations/salesforce/index.js +5 -1
- package/dist/destinations/salesforce/index.js.map +1 -1
- package/dist/destinations/salesforce/{cases.types.d.ts → opportunity/generated-types.d.ts} +4 -0
- package/dist/destinations/salesforce/opportunity/generated-types.js +3 -0
- package/dist/destinations/salesforce/opportunity/generated-types.js.map +1 -0
- package/dist/destinations/salesforce/opportunity/index.d.ts +5 -0
- package/dist/destinations/salesforce/opportunity/index.js +63 -0
- package/dist/destinations/salesforce/opportunity/index.js.map +1 -0
- package/dist/destinations/salesforce/sf-object-to-shape.js +32 -1
- package/dist/destinations/salesforce/sf-object-to-shape.js.map +1 -1
- package/dist/destinations/salesforce/sf-types.d.ts +29 -2
- package/package.json +2 -2
- package/dist/destinations/salesforce/cases.types.js.map +0 -1
|
@@ -52,9 +52,9 @@ const action = {
|
|
|
52
52
|
description: 'Number to send SMS to when testing',
|
|
53
53
|
type: 'string'
|
|
54
54
|
},
|
|
55
|
-
|
|
56
|
-
label: '
|
|
57
|
-
description: '
|
|
55
|
+
messagingServiceId: {
|
|
56
|
+
label: 'Messaging Service ID',
|
|
57
|
+
description: 'The ID of the Twilio Messaging Service to send SMS from',
|
|
58
58
|
type: 'string',
|
|
59
59
|
required: true
|
|
60
60
|
},
|
|
@@ -103,7 +103,7 @@ const action = {
|
|
|
103
103
|
const token = Buffer.from(`${settings.twilioAccountId}:${settings.twilioAuthToken}`).toString('base64');
|
|
104
104
|
const body = new URLSearchParams({
|
|
105
105
|
Body: mustache_1.default.render(payload.body, { profile }),
|
|
106
|
-
From: payload.
|
|
106
|
+
From: payload.messagingServiceId,
|
|
107
107
|
To: phone
|
|
108
108
|
});
|
|
109
109
|
const webhookUrl = settings.webhookUrl;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/personas-messaging-twilio/sendSms/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA+B;AAK/B,MAAM,qBAAqB,GAAG,CAAC,WAAmB,EAAU,EAAE;IAC5D,OAAO,4BAA4B,WAAW,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAA;AACrF,CAAC,CAAA;AAID,MAAM,kBAAkB,GAAG,KAAK,EAC9B,OAAkB,EAClB,QAAkB,EAClB,SAAiB,EACgB,EAAE;IACnC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAA;IACtE,MAAM,QAAQ,GAAG,MAAM,OAAO,CAC5B,GAAG,QAAQ,cAAc,QAAQ,CAAC,OAAO,uCAAuC,SAAS,mBAAmB,EAC5G;QACE,OAAO,EAAE;YACP,aAAa,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,qBAAqB,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;YAC9F,cAAc,EAAE,kBAAkB;SACnC;KACF,CACF,CAAA;IAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAClC,OAAO,IAAI,CAAC,MAAM,CAAA;AACpB,CAAC,CAAA;AAED,MAAM,uBAAuB,GAAG,KAAK,EACnC,OAAkB,EAClB,QAAk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O,CAAC,UAAU;YACrB,oCAAoC,EAAE,eAAe;YACrD,sCAAsC,EAAE,OAAO,CAAC,eAAe,CAAC;SACjE,CAAA;QAED,IAAI,UAAU,IAAI,UAAU,EAAE;YAI5B,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAA;YAChD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;gBACzC,oBAAoB,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;aACvE;YAED,oBAAoB,CAAC,IAAI,GAAG,mBAAmB,IAAI,4BAA4B,CAAA;YAE/E,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,oBAAoB,CAAC,QAAQ,EAAE,CAAC,CAAA;SAC/D;QAED,OAAO,OAAO,CAAC,8CAA8C,QAAQ,CAAC,eAAe,gBAAgB,EAAE;YACrG,MAAM,EAAE,MAAM;YACd,OAAO,EAAE;gBACP,aAAa,EAAE,SAAS,KAAK,EAAE;aAChC;YACD,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Payload {
|
|
2
|
+
operation: string;
|
|
3
|
+
traits?: {
|
|
4
|
+
[k: string]: unknown;
|
|
5
|
+
};
|
|
6
|
+
name?: string;
|
|
7
|
+
account_number?: string;
|
|
8
|
+
number_of_employees?: number;
|
|
9
|
+
billing_city?: string;
|
|
10
|
+
billing_postal_code?: string;
|
|
11
|
+
billing_country?: string;
|
|
12
|
+
billing_street?: string;
|
|
13
|
+
billing_state?: string;
|
|
14
|
+
shipping_city?: string;
|
|
15
|
+
shipping_postal_code?: string;
|
|
16
|
+
shipping_country?: string;
|
|
17
|
+
shipping_street?: string;
|
|
18
|
+
shipping_state?: string;
|
|
19
|
+
phone?: string;
|
|
20
|
+
description?: string;
|
|
21
|
+
website?: string;
|
|
22
|
+
customFields?: {
|
|
23
|
+
[k: string]: unknown;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/salesforce/account/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,181 @@
|
|
|
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 sf_operations_1 = __importDefault(require("../sf-operations"));
|
|
8
|
+
const sf_properties_1 = require("../sf-properties");
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Account',
|
|
11
|
+
description: '',
|
|
12
|
+
fields: {
|
|
13
|
+
operation: sf_properties_1.operation,
|
|
14
|
+
traits: sf_properties_1.traits,
|
|
15
|
+
name: {
|
|
16
|
+
label: 'Name',
|
|
17
|
+
description: 'Name of the account. This is required to create an account.',
|
|
18
|
+
type: 'string'
|
|
19
|
+
},
|
|
20
|
+
account_number: {
|
|
21
|
+
label: 'Account Number',
|
|
22
|
+
description: 'Account number assigned to the account. This is not the unique, system-generated ID assigned during creation.',
|
|
23
|
+
type: 'string'
|
|
24
|
+
},
|
|
25
|
+
number_of_employees: {
|
|
26
|
+
label: 'Number of employees',
|
|
27
|
+
description: 'Number of employees working at the company represented by the account.',
|
|
28
|
+
type: 'integer',
|
|
29
|
+
default: {
|
|
30
|
+
'@if': {
|
|
31
|
+
exists: { '@path': '$.traits.employees' },
|
|
32
|
+
then: { '@path': '$.traits.employees' },
|
|
33
|
+
else: { '@path': '$.properties.employees' }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
billing_city: {
|
|
38
|
+
label: 'Billing City',
|
|
39
|
+
description: 'City for the billing address of the account.',
|
|
40
|
+
type: 'string',
|
|
41
|
+
default: {
|
|
42
|
+
'@if': {
|
|
43
|
+
exists: { '@path': '$.traits.address.city' },
|
|
44
|
+
then: { '@path': '$.traits.address.city' },
|
|
45
|
+
else: { '@path': '$.properties.address.city' }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
billing_postal_code: {
|
|
50
|
+
label: 'Billing Postal Code',
|
|
51
|
+
description: 'Postal code for the billing address of the account.',
|
|
52
|
+
type: 'string',
|
|
53
|
+
default: {
|
|
54
|
+
'@if': {
|
|
55
|
+
exists: { '@path': '$.traits.address.postal_code' },
|
|
56
|
+
then: { '@path': '$.traits.address.postal_code' },
|
|
57
|
+
else: { '@path': '$.properties.address.postal_code' }
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
billing_country: {
|
|
62
|
+
label: 'Billing Country',
|
|
63
|
+
description: 'Country for the billing address of the account.',
|
|
64
|
+
type: 'string',
|
|
65
|
+
default: {
|
|
66
|
+
'@if': {
|
|
67
|
+
exists: { '@path': '$.traits.address.country' },
|
|
68
|
+
then: { '@path': '$.traits.address.country' },
|
|
69
|
+
else: { '@path': '$.properties.address.country' }
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
billing_street: {
|
|
74
|
+
label: 'Billing Street',
|
|
75
|
+
description: 'Street address for the billing address of the account.',
|
|
76
|
+
type: 'string',
|
|
77
|
+
default: {
|
|
78
|
+
'@if': {
|
|
79
|
+
exists: { '@path': '$.traits.address.street' },
|
|
80
|
+
then: { '@path': '$.traits.address.street' },
|
|
81
|
+
else: { '@path': '$.properties.address.street' }
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
billing_state: {
|
|
86
|
+
label: 'Billing State',
|
|
87
|
+
description: 'State for the billing address of the account.',
|
|
88
|
+
type: 'string',
|
|
89
|
+
default: {
|
|
90
|
+
'@if': {
|
|
91
|
+
exists: { '@path': '$.traits.address.state' },
|
|
92
|
+
then: { '@path': '$.traits.address.state' },
|
|
93
|
+
else: { '@path': '$.properties.address.state' }
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
shipping_city: {
|
|
98
|
+
label: 'Shipping City',
|
|
99
|
+
description: 'City for the shipping address of the account.',
|
|
100
|
+
type: 'string'
|
|
101
|
+
},
|
|
102
|
+
shipping_postal_code: {
|
|
103
|
+
label: 'Shipping Postal Code',
|
|
104
|
+
description: 'Postal code for the shipping address of the account.',
|
|
105
|
+
type: 'string'
|
|
106
|
+
},
|
|
107
|
+
shipping_country: {
|
|
108
|
+
label: 'Shipping Country',
|
|
109
|
+
description: 'Country for the shipping address of the account.',
|
|
110
|
+
type: 'string'
|
|
111
|
+
},
|
|
112
|
+
shipping_street: {
|
|
113
|
+
label: 'Shipping Street',
|
|
114
|
+
description: 'Street address for the shipping address of the account.',
|
|
115
|
+
type: 'string'
|
|
116
|
+
},
|
|
117
|
+
shipping_state: {
|
|
118
|
+
label: 'Shipping State',
|
|
119
|
+
description: 'State for the shipping address of the account.',
|
|
120
|
+
type: 'string'
|
|
121
|
+
},
|
|
122
|
+
phone: {
|
|
123
|
+
label: 'Phone',
|
|
124
|
+
description: 'Phone number for the account.',
|
|
125
|
+
type: 'string',
|
|
126
|
+
default: {
|
|
127
|
+
'@if': {
|
|
128
|
+
exists: { '@path': '$.traits.phone' },
|
|
129
|
+
then: { '@path': '$.traits.phone' },
|
|
130
|
+
else: { '@path': '$.properties.phone' }
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
description: {
|
|
135
|
+
label: 'Description',
|
|
136
|
+
description: 'Text description of the account.',
|
|
137
|
+
type: 'string',
|
|
138
|
+
default: {
|
|
139
|
+
'@if': {
|
|
140
|
+
exists: { '@path': '$.traits.description' },
|
|
141
|
+
then: { '@path': '$.traits.description' },
|
|
142
|
+
else: { '@path': '$.properties.description' }
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
website: {
|
|
147
|
+
label: 'Website',
|
|
148
|
+
description: 'The website of the account.',
|
|
149
|
+
type: 'string',
|
|
150
|
+
default: {
|
|
151
|
+
'@if': {
|
|
152
|
+
exists: { '@path': '$.traits.website' },
|
|
153
|
+
then: { '@path': '$.traits.website' },
|
|
154
|
+
else: { '@path': '$.properties.website' }
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
customFields: sf_properties_1.customFields
|
|
159
|
+
},
|
|
160
|
+
perform: async (request, { settings, payload }) => {
|
|
161
|
+
const sf = new sf_operations_1.default(settings.instanceUrl, request);
|
|
162
|
+
if (payload.operation === 'create') {
|
|
163
|
+
if (!payload.name) {
|
|
164
|
+
throw new actions_core_1.IntegrationError('Missing name value', 'Misconfigured required field', 400);
|
|
165
|
+
}
|
|
166
|
+
return await sf.createRecord(payload, 'Account');
|
|
167
|
+
}
|
|
168
|
+
sf_properties_1.validateLookup(payload);
|
|
169
|
+
if (payload.operation === 'update') {
|
|
170
|
+
return await sf.updateRecord(payload, 'Account');
|
|
171
|
+
}
|
|
172
|
+
if (payload.operation === 'upsert') {
|
|
173
|
+
if (!payload.name) {
|
|
174
|
+
throw new actions_core_1.IntegrationError('Missing name value', 'Misconfigured required field', 400);
|
|
175
|
+
}
|
|
176
|
+
return await sf.upsertRecord(payload, 'Account');
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
exports.default = action;
|
|
181
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/salesforce/account/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0E;AAE1E,qEAAyC;AACzC,oDAAkF;AAGlF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,SAAS;IAChB,WAAW,EAAE,EAAE;I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AAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YAClC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;gBACjB,MAAM,IAAI,+BAAgB,CAAC,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;aACtF;YACD,OAAO,MAAM,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;SACjD;QAED,8BAAc,CAAC,OAAO,CAAC,CAAA;QAEvB,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YAClC,OAAO,MAAM,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;SACjD;QAED,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YAClC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;gBACjB,MAAM,IAAI,+BAAgB,CAAC,oBAAoB,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;aACtF;YACD,OAAO,MAAM,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC,CAAA;SACjD;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -5,7 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const case_1 = __importDefault(require("./case"));
|
|
7
7
|
const lead_1 = __importDefault(require("./lead"));
|
|
8
|
+
const opportunity_1 = __importDefault(require("./opportunity"));
|
|
8
9
|
const customObject_1 = __importDefault(require("./customObject"));
|
|
10
|
+
const account_1 = __importDefault(require("./account"));
|
|
9
11
|
const destination = {
|
|
10
12
|
name: 'Salesforce (Actions)',
|
|
11
13
|
slug: 'actions-salesforce',
|
|
@@ -43,7 +45,9 @@ const destination = {
|
|
|
43
45
|
actions: {
|
|
44
46
|
lead: lead_1.default,
|
|
45
47
|
customObject: customObject_1.default,
|
|
46
|
-
cases: case_1.default
|
|
48
|
+
cases: case_1.default,
|
|
49
|
+
opportunity: opportunity_1.default,
|
|
50
|
+
account: account_1.default
|
|
47
51
|
}
|
|
48
52
|
};
|
|
49
53
|
exports.default = destination;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/index.ts"],"names":[],"mappings":";;;;;AAGA,kDAA0B;AAC1B,kDAAyB;AACzB,kEAAyC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/index.ts"],"names":[],"mappings":";;;;;AAGA,kDAA0B;AAC1B,kDAAyB;AACzB,gEAAuC;AACvC,kEAAyC;AAEzC,wDAA+B;AAM/B,MAAM,WAAW,GAAoC;IACnD,IAAI,EAAE,sBAAsB;IAC5B,IAAI,EAAE,oBAAoB;IAC1B,IAAI,EAAE,OAAO;IAEb,cAAc,EAAE;QACd,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE;YACN,WAAW,EAAE;gBACX,KAAK,EAAE,cAAc;gBACrB,WAAW,EACT,2HAA2H;gBAC7H,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,IAAI;aACf;SACF;QACD,kBAAkB,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;YAE9C,MAAM,GAAG,GAAG,MAAM,OAAO,CAAuB,oDAAoD,EAAE;gBACpG,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;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;IAED,OAAO,EAAE;QACP,IAAI,EAAJ,cAAI;QACJ,YAAY,EAAZ,sBAAY;QACZ,KAAK,EAAL,cAAK;QACL,WAAW,EAAX,qBAAW;QACX,OAAO,EAAP,iBAAO;KACR;CACF,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generated-types.js","sourceRoot":"","sources":["../../../../src/destinations/salesforce/opportunity/generated-types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,63 @@
|
|
|
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 sf_operations_1 = __importDefault(require("../sf-operations"));
|
|
8
|
+
const sf_properties_1 = require("../sf-properties");
|
|
9
|
+
const action = {
|
|
10
|
+
title: 'Opportunity',
|
|
11
|
+
description: 'Opportunity action',
|
|
12
|
+
fields: {
|
|
13
|
+
operation: sf_properties_1.operation,
|
|
14
|
+
traits: sf_properties_1.traits,
|
|
15
|
+
amount: {
|
|
16
|
+
label: 'Amount',
|
|
17
|
+
description: 'Estimated total sale amount',
|
|
18
|
+
type: 'string'
|
|
19
|
+
},
|
|
20
|
+
close_date: {
|
|
21
|
+
label: 'Close Date',
|
|
22
|
+
description: 'Date when the opportunity is expected to close. This is required to create an opportunity.',
|
|
23
|
+
type: 'string'
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
label: 'Description',
|
|
27
|
+
description: 'A text description of the opportunity.',
|
|
28
|
+
type: 'string'
|
|
29
|
+
},
|
|
30
|
+
name: {
|
|
31
|
+
label: 'Name',
|
|
32
|
+
description: 'A name for the opportunity. This is required to create an opportunity.',
|
|
33
|
+
type: 'string'
|
|
34
|
+
},
|
|
35
|
+
stage_name: {
|
|
36
|
+
label: 'Stage Name',
|
|
37
|
+
description: 'Current stage of the opportunity. This is required to create an opportunity. The Stage Name value must match available picklist values in the OpportunityStage object.',
|
|
38
|
+
type: 'string'
|
|
39
|
+
},
|
|
40
|
+
customFields: sf_properties_1.customFields
|
|
41
|
+
},
|
|
42
|
+
perform: async (request, { settings, payload }) => {
|
|
43
|
+
const sf = new sf_operations_1.default(settings.instanceUrl, request);
|
|
44
|
+
if (payload.operation === 'create') {
|
|
45
|
+
if (!payload.close_date || !payload.name || !payload.stage_name) {
|
|
46
|
+
throw new actions_core_1.IntegrationError('Missing close_date, name or stage_name value', 'Misconfigured required field', 400);
|
|
47
|
+
}
|
|
48
|
+
return await sf.createRecord(payload, 'Opportunity');
|
|
49
|
+
}
|
|
50
|
+
sf_properties_1.validateLookup(payload);
|
|
51
|
+
if (payload.operation === 'update') {
|
|
52
|
+
return await sf.updateRecord(payload, 'Opportunity');
|
|
53
|
+
}
|
|
54
|
+
if (payload.operation === 'upsert') {
|
|
55
|
+
if (!payload.close_date || !payload.name || !payload.stage_name) {
|
|
56
|
+
throw new actions_core_1.IntegrationError('Missing close_date, name or stage_name value', 'Misconfigured required field', 400);
|
|
57
|
+
}
|
|
58
|
+
return await sf.upsertRecord(payload, 'Opportunity');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
exports.default = action;
|
|
63
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/destinations/salesforce/opportunity/index.ts"],"names":[],"mappings":";;;;;AAAA,wDAA0E;AAE1E,qEAAyC;AACzC,oDAAkF;AAGlF,MAAM,MAAM,GAAwC;IAClD,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,oBAAoB;IACjC,MAAM,EAAE;QACN,SAAS,EAAE,y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,QAAQ,EAAE;YAClC,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;gBAC/D,MAAM,IAAI,+BAAgB,CAAC,8CAA8C,EAAE,8BAA8B,EAAE,GAAG,CAAC,CAAA;aAChH;YACD,OAAO,MAAM,EAAE,CAAC,YAAY,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;SACrD;IACH,CAAC;CACF,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -19,9 +19,40 @@ const CaseShape = (payload) => {
|
|
|
19
19
|
Description: payload.description
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
+
const OpportunityShape = (payload) => {
|
|
23
|
+
return {
|
|
24
|
+
Amount: payload.amount,
|
|
25
|
+
CloseDate: payload.close_date,
|
|
26
|
+
Description: payload.description,
|
|
27
|
+
Name: payload.name,
|
|
28
|
+
StageName: payload.stage_name
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const AccountShape = (payload) => {
|
|
32
|
+
return {
|
|
33
|
+
Name: payload.name,
|
|
34
|
+
AccountNumber: payload.account_number,
|
|
35
|
+
NumberOfEmployees: payload.number_of_employees,
|
|
36
|
+
BillingCity: payload.billing_city,
|
|
37
|
+
BillingPostalCode: payload.billing_postal_code,
|
|
38
|
+
BillingCountry: payload.billing_country,
|
|
39
|
+
BillingStreet: payload.billing_street,
|
|
40
|
+
BillingState: payload.billing_state,
|
|
41
|
+
ShippingCity: payload.shipping_city,
|
|
42
|
+
ShippingPostalCode: payload.shipping_postal_code,
|
|
43
|
+
ShippingCountry: payload.shipping_country,
|
|
44
|
+
ShippingStreet: payload.shipping_street,
|
|
45
|
+
ShippingState: payload.shipping_state,
|
|
46
|
+
Phone: payload.phone,
|
|
47
|
+
Description: payload.description,
|
|
48
|
+
Website: payload.website
|
|
49
|
+
};
|
|
50
|
+
};
|
|
22
51
|
const objectToShape = new Map([
|
|
23
52
|
['lead', LeadShape],
|
|
24
|
-
['case', CaseShape]
|
|
53
|
+
['case', CaseShape],
|
|
54
|
+
['opportunity', OpportunityShape],
|
|
55
|
+
['account', AccountShape]
|
|
25
56
|
]);
|
|
26
57
|
const mapObjectToShape = (payload, sobject) => {
|
|
27
58
|
const shapeFunction = objectToShape.get(sobject.toLowerCase());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sf-object-to-shape.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-object-to-shape.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"sf-object-to-shape.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/sf-object-to-shape.ts"],"names":[],"mappings":";;;AASA,MAAM,SAAS,GAAG,CAAC,OAAuB,EAAqB,EAAE;IAC/D,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,SAAS;QAC3B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,SAAS,EAAE,OAAO,CAAC,UAAU;QAC7B,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,UAAU,EAAE,OAAO,CAAC,WAAW;QAC/B,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,KAAK,EAAE,OAAO,CAAC,KAAK;KACrB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,OAAuB,EAAqB,EAAE;IAC/D,OAAO;QACL,WAAW,EAAE,OAAO,CAAC,WAAW;KACjC,CAAA;AACH,CAAC,CAAA;AAED,MAAM,gBAAgB,GAAG,CAAC,OAAuB,EAA4B,EAAE;IAC7E,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,SAAS,EAAE,OAAO,CAAC,UAAU;QAC7B,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,SAAS,EAAE,OAAO,CAAC,UAAU;K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;AARY,QAAA,gBAAgB,oBAQ5B"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Payload as LeadPayload } from './lead/generated-types';
|
|
2
2
|
import type { Payload as CustomPayload } from './customObject/generated-types';
|
|
3
3
|
import type { Payload as CasePayload } from './case/generated-types';
|
|
4
|
-
|
|
4
|
+
import type { Payload as OpportunityPayload } from './opportunity/generated-types';
|
|
5
|
+
import type { Payload as AccountPayload } from './account/generated-types';
|
|
6
|
+
export declare type GenericPayload = Partial<LeadPayload & CustomPayload & CasePayload & AccountPayload & OpportunityPayload>;
|
|
5
7
|
export declare type LeadBaseShapeType = {
|
|
6
8
|
LastName?: string;
|
|
7
9
|
Company?: string;
|
|
@@ -16,4 +18,29 @@ export declare type LeadBaseShapeType = {
|
|
|
16
18
|
export declare type CaseBaseShapeType = {
|
|
17
19
|
Description?: string;
|
|
18
20
|
};
|
|
19
|
-
export declare type
|
|
21
|
+
export declare type OpportunityBaseShapeType = {
|
|
22
|
+
Amount?: string;
|
|
23
|
+
CloseDate?: string;
|
|
24
|
+
Description?: string;
|
|
25
|
+
Name?: string;
|
|
26
|
+
StageName?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare type AccountBaseShapeType = {
|
|
29
|
+
Name?: string;
|
|
30
|
+
AccountNumber?: string;
|
|
31
|
+
NumberOfEmployees?: number;
|
|
32
|
+
BillingCity?: string;
|
|
33
|
+
BillingPostalCode?: string;
|
|
34
|
+
BillingCountry?: string;
|
|
35
|
+
BillingStreet?: string;
|
|
36
|
+
BillingState?: string;
|
|
37
|
+
ShippingCity?: string;
|
|
38
|
+
ShippingPostalCode?: string;
|
|
39
|
+
ShippingCountry?: string;
|
|
40
|
+
ShippingStreet?: string;
|
|
41
|
+
ShippingState?: string;
|
|
42
|
+
Phone?: string;
|
|
43
|
+
Description?: string;
|
|
44
|
+
Website?: string;
|
|
45
|
+
};
|
|
46
|
+
export declare type GenericBaseShape = Partial<LeadBaseShapeType & CaseBaseShapeType & AccountBaseShapeType & OpportunityBaseShapeType>;
|
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.
|
|
4
|
+
"version": "3.52.1-alpha.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/segmentio/action-destinations",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"<rootDir>/test/setup-after-env.ts"
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "54bab89b74271e81bccfd4b8e1df50494c477455"
|
|
66
66
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cases.types.js","sourceRoot":"","sources":["../../../src/destinations/salesforce/cases.types.ts"],"names":[],"mappings":""}
|