Skip to content

Commit f2836ae

Browse files
Merge branch 'master' into danny/connect-proxy-docs
2 parents 6c6683e + e7dd5ab commit f2836ae

File tree

106 files changed

+4938
-212
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+4938
-212
lines changed

components/adobe_document_generation_api/adobe_document_generation_api.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};

components/browserbase/browserbase.app.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export default {
88
console.log(Object.keys(this.$auth));
99
},
1010
},
11-
};
11+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
export default {
2+
type: "app",
3+
app: "buysellads",
4+
propDefinitions: {},
5+
methods: {
6+
// this.$auth contains connected account data
7+
authKeys() {
8+
console.log(Object.keys(this.$auth));
9+
},
10+
},
11+
};

components/buysellads/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "@pipedream/buysellads",
3+
"version": "0.0.1",
4+
"description": "Pipedream BuySellAds Components",
5+
"main": "buysellads.app.mjs",
6+
"keywords": [
7+
"pipedream",
8+
"buysellads"
9+
],
10+
"homepage": "https://pipedream.com/apps/buysellads",
11+
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
12+
"publishConfig": {
13+
"access": "public"
14+
}
15+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import emailVerifierApi from "../../email_verifier_api.app.mjs";
2+
3+
export default {
4+
key: "email_verifier_api-verify-email",
5+
name: "Verify Email",
6+
description: "Verify an email address with Email Verifier API. [See the documentation](https://www.emailverifierapi.com/app/v2-api-documentation/)",
7+
version: "0.0.1",
8+
type: "action",
9+
props: {
10+
emailVerifierApi,
11+
email: {
12+
type: "string",
13+
label: "Email",
14+
description: "The email address to verify",
15+
},
16+
},
17+
async run({ $ }) {
18+
const response = await this.emailVerifierApi.verifyEmail({
19+
$,
20+
email: this.email,
21+
});
22+
$.export("$summary", `Successfully retrieved verification data for email address \`${this.email}\``);
23+
return response;
24+
},
25+
};
Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,36 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "email_verifier_api",
46
propDefinitions: {},
57
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
8+
_baseUrl() {
9+
return "https://emailverifierapi.com/v2/";
10+
},
11+
_makeRequest({
12+
$ = this,
13+
params,
14+
...opts
15+
}) {
16+
return axios($, {
17+
url: this._baseUrl(),
18+
params: {
19+
...params,
20+
apiKey: this.$auth.api_key,
21+
},
22+
...opts,
23+
});
24+
},
25+
verifyEmail({
26+
$, email,
27+
}) {
28+
return this._makeRequest({
29+
$,
30+
params: {
31+
email,
32+
},
33+
});
934
},
1035
},
11-
};
36+
};

components/email_verifier_api/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/email_verifier_api",
3-
"version": "0.0.1",
3+
"version": "0.1.0",
44
"description": "Pipedream Email Verifier Api Components",
55
"main": "email_verifier_api.app.mjs",
66
"keywords": [
@@ -11,5 +11,8 @@
1111
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
1212
"publishConfig": {
1313
"access": "public"
14+
},
15+
"dependencies": {
16+
"@pipedream/platform": "^3.0.3"
1417
}
15-
}
18+
}

components/gorgias_oauth/actions/create-customer/create-customer.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "gorgias_oauth-create-customer",
66
name: "Create Customer",
77
description: "Create a new customer. [See the docs](https://developers.gorgias.com/reference/post_api-customers)",
8-
version: "0.0.5",
8+
version: "0.0.6",
99
type: "action",
1010
props: {
1111
gorgias_oauth,

components/gorgias_oauth/actions/create-ticket-message/create-ticket-message.mjs

Lines changed: 89 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import gorgiasOauth from "../../gorgias_oauth.app.mjs";
2-
import constants from "../../common/constants.mjs";
32
import {
43
axios, ConfigurationError,
54
} from "@pipedream/platform";
@@ -8,7 +7,7 @@ export default {
87
key: "gorgias_oauth-create-ticket-message",
98
name: "Create Ticket Message",
109
description: "Create a message for a ticket in the Gorgias system. [See the documentation](https://developers.gorgias.com/reference/create-ticket-message)",
11-
version: "0.0.1",
10+
version: "0.0.2",
1211
type: "action",
1312
props: {
1413
gorgiasOauth,
@@ -19,25 +18,49 @@ export default {
1918
],
2019
description: "The ID of the ticket to add a message to",
2120
},
22-
channel: {
21+
fromAgent: {
22+
type: "boolean",
23+
label: "From Agent",
24+
description: "Whether the message was sent by your company to a customer, or the opposite",
25+
reloadProps: true,
26+
},
27+
fromUser: {
2328
propDefinition: [
2429
gorgiasOauth,
25-
"channel",
30+
"userId",
2631
],
32+
label: "From User",
33+
description: "User who sent the message",
34+
optional: false,
35+
hidden: true,
2736
},
28-
fromAddress: {
37+
toUser: {
2938
propDefinition: [
3039
gorgiasOauth,
31-
"address",
40+
"userId",
3241
],
33-
label: "From Address",
42+
label: "To User",
43+
description: "The user receiving the message",
44+
optional: false,
45+
hidden: true,
3446
},
35-
toAddress: {
47+
fromCustomer: {
3648
propDefinition: [
3749
gorgiasOauth,
38-
"address",
50+
"customerId",
3951
],
40-
label: "To Address",
52+
label: "From Customer",
53+
description: "The customer who sent the message",
54+
hidden: true,
55+
},
56+
toCustomer: {
57+
propDefinition: [
58+
gorgiasOauth,
59+
"customerId",
60+
],
61+
label: "To Customer",
62+
description: "The customer receiving the message",
63+
hidden: true,
4164
},
4265
message: {
4366
type: "string",
@@ -70,37 +93,21 @@ export default {
7093
description: "The name of the file to attach",
7194
optional: true,
7295
},
73-
fromAgent: {
74-
type: "boolean",
75-
label: "From Agent",
76-
description: "Whether the message was sent by your company to a customer, or the opposite",
77-
default: false,
78-
optional: true,
79-
},
8096
sentDatetime: {
8197
type: "string",
8298
label: "Sent Datetime",
8399
description: "When the message was sent. If ommited, the message will be sent by Gorgias. E.g. `2025-01-27T19:38:52.028Z`",
84100
optional: true,
85101
},
86-
sourceType: {
87-
type: "string",
88-
label: "Source Type",
89-
description: "Describes more detailed channel information of how the message is sent/received",
90-
options: constants.sourceTypes,
91-
optional: true,
92-
},
102+
},
103+
additionalProps(props) {
104+
props.toUser.hidden = this.fromAgent;
105+
props.fromCustomer.hidden = this.fromAgent;
106+
props.toCustomer.hidden = !this.fromAgent;
107+
props.fromUser.hidden = !this.fromAgent;
108+
return {};
93109
},
94110
methods: {
95-
createMessage({
96-
ticketId, ...opts
97-
}) {
98-
return this.gorgiasOauth._makeRequest({
99-
method: "POST",
100-
path: `/tickets/${ticketId}/messages`,
101-
...opts,
102-
});
103-
},
104111
async getAttachmentInfo($, url) {
105112
const { headers } = await axios($, {
106113
method: "HEAD",
@@ -112,6 +119,26 @@ export default {
112119
size: headers["content-length"],
113120
};
114121
},
122+
async getEmail($, id, type = "from") {
123+
const {
124+
gorgiasOauth: {
125+
retrieveUser, retrieveCustomer,
126+
},
127+
} = this;
128+
const fn = this.fromAgent
129+
? type === "from"
130+
? retrieveUser
131+
: retrieveCustomer
132+
: type === "from"
133+
? retrieveCustomer
134+
: retrieveUser;
135+
136+
const { email } = await fn({
137+
$,
138+
id,
139+
});
140+
return email;
141+
},
115142
},
116143
async run({ $ }) {
117144
if ((this.attachmentUrl && !this.attachmentName)
@@ -127,19 +154,37 @@ export default {
127154
} = await this.getAttachmentInfo($, this.attachmentUrl));
128155
}
129156

130-
const response = await this.createMessage({
157+
const fromId = this.fromAgent
158+
? this.fromUser
159+
: this.fromCustomer;
160+
161+
const toId = this.fromAgent
162+
? this.toCustomer
163+
: this.toUser;
164+
165+
if (!fromId) {
166+
throw new ConfigurationError(`"${this.fromAgent
167+
? "From User"
168+
: "From Customer"}" is required when "From Agent" is set to \`${this.fromAgent}\``);
169+
}
170+
if (!toId) {
171+
throw new ConfigurationError(`"${this.fromAgent
172+
? "To Customer"
173+
: "To User"}" is required when "From Agent" is set to \`${this.fromAgent}\``);
174+
}
175+
176+
const response = await this.gorgiasOauth.createMessage({
131177
$,
132178
ticketId: this.ticketId,
133179
data: {
134-
channel: this.channel,
180+
channel: "email",
135181
source: {
136-
type: this.sourceType,
137182
from: {
138-
address: this.fromAddress,
183+
address: await this.getEmail($, fromId, "from"),
139184
},
140185
to: [
141186
{
142-
address: this.toAddress,
187+
address: await this.getEmail($, toId, "to"),
143188
},
144189
],
145190
},
@@ -156,6 +201,12 @@ export default {
156201
size,
157202
},
158203
],
204+
sender: {
205+
id: fromId,
206+
},
207+
receiver: {
208+
id: toId,
209+
},
159210
},
160211
});
161212

components/gorgias_oauth/actions/create-ticket/create-ticket.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export default {
44
key: "gorgias_oauth-create-ticket",
55
name: "Create Ticket",
66
description: "Create a new ticket. [See the docs](https://developers.gorgias.com/reference/post_api-tickets)",
7-
version: "0.0.6",
7+
version: "0.0.7",
88
type: "action",
99
props: {
1010
gorgias_oauth,

0 commit comments

Comments
 (0)