@pipedream/prodpad 0.0.1 → 0.0.3
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.
|
@@ -1,25 +1,53 @@
|
|
|
1
1
|
import app from "../../prodpad.app.mjs";
|
|
2
2
|
import utils from "../../common/utils.mjs";
|
|
3
|
+
import { ConfigurationError } from "@pipedream/platform";
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
key: "prodpad-create-feedback",
|
|
6
7
|
name: "Create Feedback",
|
|
7
|
-
description: "Creates
|
|
8
|
+
description: "Creates feedback. [See the documentation](https://app.swaggerhub.com/apis-docs/ProdPad/prodpad/1.0#/Feedback/PostFeedbacks).",
|
|
8
9
|
type: "action",
|
|
9
|
-
version: "0.0.
|
|
10
|
+
version: "0.0.2",
|
|
10
11
|
props: {
|
|
11
12
|
app,
|
|
13
|
+
feedback: {
|
|
14
|
+
propDefinition: [
|
|
15
|
+
app,
|
|
16
|
+
"feedback",
|
|
17
|
+
],
|
|
18
|
+
},
|
|
12
19
|
contactId: {
|
|
13
|
-
description: "ID of the contact providing the feedback.",
|
|
20
|
+
description: "The ID of the contact providing the feedback. Either `Contact ID` or `Contact Name` is required.",
|
|
21
|
+
optional: true,
|
|
14
22
|
propDefinition: [
|
|
15
23
|
app,
|
|
16
24
|
"contactId",
|
|
17
25
|
],
|
|
18
26
|
},
|
|
19
|
-
|
|
27
|
+
contactName: {
|
|
28
|
+
label: "Contact Name",
|
|
29
|
+
description: "The name of the contact. Either `Contact ID` or `Contact Name` is required.",
|
|
30
|
+
optional: true,
|
|
20
31
|
propDefinition: [
|
|
21
32
|
app,
|
|
22
|
-
"
|
|
33
|
+
"name",
|
|
34
|
+
],
|
|
35
|
+
},
|
|
36
|
+
contactEmail: {
|
|
37
|
+
description: "The email of the contact. It is also used to avoid duplication of contacts and can only be filled in with `Contact Name`.",
|
|
38
|
+
optional: true,
|
|
39
|
+
propDefinition: [
|
|
40
|
+
app,
|
|
41
|
+
"email",
|
|
42
|
+
],
|
|
43
|
+
},
|
|
44
|
+
company: {
|
|
45
|
+
label: "Company",
|
|
46
|
+
description: "The ID of the company to link the contact to. It can only be filled in with `Contact Name`.",
|
|
47
|
+
optional: true,
|
|
48
|
+
propDefinition: [
|
|
49
|
+
app,
|
|
50
|
+
"companyId",
|
|
23
51
|
],
|
|
24
52
|
},
|
|
25
53
|
tagIds: {
|
|
@@ -60,12 +88,31 @@ export default {
|
|
|
60
88
|
tagIds,
|
|
61
89
|
personaIds,
|
|
62
90
|
productIds,
|
|
91
|
+
company,
|
|
92
|
+
contactName,
|
|
93
|
+
contactEmail,
|
|
63
94
|
} = this;
|
|
64
95
|
|
|
96
|
+
if ((!contactId && !contactName) || (contactId && contactName)) {
|
|
97
|
+
throw new ConfigurationError("Either `Contact ID` or `Contact Name` is required.");
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
if (!contactName) {
|
|
101
|
+
if (contactEmail) {
|
|
102
|
+
throw new ConfigurationError("`Contact Email` can only be provided when using `Contact Name`.");
|
|
103
|
+
}
|
|
104
|
+
if (company) {
|
|
105
|
+
throw new ConfigurationError("`Company` can only be provided when using `Contact Name`.");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
65
109
|
const response = await this.app.createFeedback({
|
|
66
110
|
step,
|
|
67
111
|
data: {
|
|
68
112
|
contact_id: contactId,
|
|
113
|
+
company_id: company,
|
|
114
|
+
name: contactName,
|
|
115
|
+
email: contactEmail,
|
|
69
116
|
feedback,
|
|
70
117
|
tags: utils.mapOrParse(tagIds, (id) => ({
|
|
71
118
|
id,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pipedream/prodpad",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Pipedream ProdPad Components",
|
|
5
5
|
"main": "prodpad.app.mjs",
|
|
6
6
|
"keywords": [
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
],
|
|
10
10
|
"homepage": "https://pipedream.com/apps/prodpad",
|
|
11
11
|
"author": "Pipedream <support@pipedream.com> (https://pipedream.com/)",
|
|
12
|
-
"license": "MIT",
|
|
13
12
|
"dependencies": {
|
|
14
13
|
"@pipedream/platform": "^1.2.1"
|
|
15
14
|
},
|