Skip to content

Commit a135d40

Browse files
Adding support for oauthAppId in connect-react
And patching Discord sentViaPipedream prop label and handling
1 parent 8832bfe commit a135d40

File tree

14 files changed

+51
-14
lines changed

14 files changed

+51
-14
lines changed

components/discord/actions/common/common.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,16 @@ export default {
6666
},
6767
getSentViaPipedreamText() {
6868
const workflowId = process.env.PIPEDREAM_WORKFLOW_ID;
69-
return `Sent via [Pipedream](<https://pipedream.com/@/${workflowId}?o=a&a=discord>)`;
69+
const baseLink = "https://pipedream.com";
70+
const linkText = !workflowId
71+
? "Pipedream Connect"
72+
: "Pipedream";
73+
74+
const link = !workflowId
75+
? `${baseLink}/connect`
76+
: `${baseLink}/@/${workflowId}?o=a&a=discord`;
77+
78+
return `Sent via [${linkText}](<${link}>)`;
7079
},
7180
getMessageFlags(suppressNotifications) {
7281
let flags = 0;

components/discord/actions/send-message-advanced/send-message-advanced.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default {
66
key: "discord-send-message-advanced",
77
name: "Send Message (Advanced)",
88
description: "Send a simple or structured message (using embeds) to a Discord channel",
9-
version: "1.0.2",
9+
version: "1.0.3",
1010
type: "action",
1111
props: {
1212
...common.props,

components/discord/actions/send-message-with-file/send-message-with-file.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export default {
88
key: "discord-send-message-with-file",
99
name: "Send Message With File",
1010
description: "Post a message with an attached file",
11-
version: "1.1.1",
11+
version: "1.1.2",
1212
type: "action",
1313
props: {
1414
...common.props,

components/discord/actions/send-message/send-message.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "discord-send-message",
66
name: "Send Message",
77
description: "Send a simple message to a Discord channel",
8-
version: "1.0.2",
8+
version: "1.0.3",
99
type: "action",
1010
async run({ $ }) {
1111
const {

components/discord/discord.app.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export default {
1111
type: "boolean",
1212
optional: true,
1313
default: true,
14-
label: "Include link to workflow",
15-
description: "Defaults to `true`, includes a link to this workflow at the end of your Discord message.",
14+
label: "Include link to Pipedream",
15+
description: "Defaults to `true`, includes a link to Pipedream at the end of your Discord message.",
1616
},
1717
embeds: {
1818
type: "any",

components/discord/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/discord",
3-
"version": "1.2.4",
3+
"version": "1.2.5",
44
"description": "Pipedream Discord Components",
55
"main": "discord.app.mjs",
66
"keywords": [

packages/connect-react/CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

33
# Changelog
44

5+
# [1.3.1] - 2025-06-13
6+
7+
## Added
8+
9+
- Support for `oauthAppId` parameter in `ComponentForm` and `ComponentFormContainer` components
10+
- Pass `oauthAppId` through to `ControlApp` component for OAuth app-specific account connections
11+
12+
## Usage
13+
14+
```typescript
15+
<ComponentForm
16+
externalUserId="user123"
17+
component={component}
18+
oauthAppId="your-oauth-app-id" // New optional prop
19+
// ... other props
20+
/>
21+
```
22+
23+
This allows you to specify which OAuth app to use when connecting accounts, matching the behavior of the SDK's `connectAccount` method.
24+
525
# [1.3.0] - 2025-06-10
626

727
## Added

packages/connect-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/connect-react",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "Pipedream Connect library for React",
55
"files": [
66
"dist"

packages/connect-react/src/components/ComponentForm.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export type ComponentFormProps<T extends ConfigurableProps, U = ConfiguredProps<
2929
hideOptionalProps?: boolean;
3030
sdkResponse?: unknown | undefined;
3131
enableDebugging?: boolean;
32+
/**
33+
* The OAuth app ID to use when connecting accounts for app props.
34+
*/
35+
oauthAppId?: string;
3236
} & (
3337
| { externalUserId: string; userId?: never }
3438
| { userId: string; externalUserId?: never }

packages/connect-react/src/components/Control.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function Control<T extends ConfigurableProps, U extends ConfigurableProp>
7474
// case "any":
7575
// return <ControlAny />
7676
case "app":
77-
return <ControlApp app={app!} />;
77+
return <ControlApp app={app!} oauthAppId={field.extra.oauthAppId} />;
7878
case "boolean":
7979
return <ControlBoolean />;
8080
case "string":

0 commit comments

Comments
 (0)