Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import app from "../../basecamp.app.mjs";
import common from "../../common/common.mjs";

export default {
key: "basecamp-create-campfire-chatbot-message",
name: "Create Campfire Chatbot Message",
description: "Creates a line in the Campfire for a Basecamp Chatbot. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/chatbots.md#create-a-line)",
description: "Creates a message in a Campfire for a Basecamp Chatbot. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/chatbots.md#create-a-line)",
type: "action",
version: "0.0.3",
version: "0.0.4",
props: {
app,
accountId: {
propDefinition: [
app,
"accountId",
],
},
projectId: {
propDefinition: [
app,
"projectId",
({ accountId }) => ({
accountId,
}),
],
},
...common.props,
campfireId: {
propDefinition: [
app,
Expand Down Expand Up @@ -54,7 +40,7 @@ export default {
content: {
type: "string",
label: "Content",
description: "The plain text body for the Campfire line.",
description: "The plain text body for the Campfire message.",
},
},
async run({ $ }) {
Expand Down Expand Up @@ -84,7 +70,9 @@ export default {
},
});

$.export("$summary", "Successfully posted campfire chatbot message.");
return message;
$.export("$summary", "Successfully posted campfire chatbot message");
return message ?? {
content,
};
},
};
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import app from "../../basecamp.app.mjs";
import common from "../../common/common.mjs";

export default {
key: "basecamp-create-campfire-message",
name: "Create Campfire Message",
description: "Creates a line in the Campfire for the selected project. [See the docs here](https://github.com/basecamp/bc3-api/blob/master/sections/campfires.md#create-a-campfire-line)",
description: "Creates a message in a selected Campfire. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/campfires.md#create-a-campfire-line)",
type: "action",
version: "0.0.7",
version: "0.0.8",
props: {
app,
accountId: {
propDefinition: [
app,
"accountId",
],
},
projectId: {
propDefinition: [
app,
"projectId",
({ accountId }) => ({
accountId,
}),
],
},
...common.props,
campfireId: {
propDefinition: [
app,
Expand All @@ -39,7 +25,7 @@ export default {
content: {
type: "string",
label: "Content",
description: "The plain text body for the Campfire line.",
description: "The plain text body for the Campfire message.",
},
},
async run({ $ }) {
Expand All @@ -60,7 +46,7 @@ export default {
},
});

$.export("$summary", `Successfully posted campfire message with ID ${message.id}`);
$.export("$summary", `Successfully created campfire message (ID: ${message.id})`);
return message;
},
};
37 changes: 12 additions & 25 deletions components/basecamp/actions/create-card/create-card.mjs
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import app from "../../basecamp.app.mjs";
import common from "../../common/common.mjs";

export default {
key: "basecamp-create-card",
name: "Create a Card",
description: "Creates a card in the select column. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/card_table_cards.md#create-a-card)",
description: "Creates a card in a selected column. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/card_table_cards.md#create-a-card)",
type: "action",
version: "0.1.0",
version: "0.1.1",
props: {
app,
accountId: {
propDefinition: [
app,
"accountId",
],
},
projectId: {
propDefinition: [
app,
"projectId",
({ accountId }) => ({
accountId,
}),
],
},
...common.props,
cardTableId: {
propDefinition: [
app,
Expand Down Expand Up @@ -51,25 +37,26 @@ export default {
title: {
type: "string",
label: "Title",
description: "Title of the card",
description: "The title of the new card.",
},
content: {
type: "string",
label: "Content",
description: "Content of the card",
description: "The content of the card. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/card_table_cards.md#create-a-card) for information on using HTML tags.",
optional: true,
},
dueOn: {
type: "string",
label: "Due on",
description: "Due date (ISO 8601) of the card, e.g.: `2023-12-12`",
label: "Due On",
description: "The due date of the card, in `YYYY-MM-DD` format.",
optional: true,
},
notify: {
type: "boolean",
label: "Notify",
description: "Whether to notify assignees. Defaults to false",
label: "Notify Assignees",
description: "Whether to notify assignees.",
optional: true,
default: false,
},
},
async run({ $ }) {
Expand All @@ -96,7 +83,7 @@ export default {
},
});

$.export("$summary", `Successfully created card with ID ${card.id}`);
$.export("$summary", `Successfully created card (ID: ${card.id})`);
return card;
},
};
72 changes: 54 additions & 18 deletions components/basecamp/actions/create-comment/create-comment.mjs
Original file line number Diff line number Diff line change
@@ -1,74 +1,110 @@
import app from "../../basecamp.app.mjs";
import common from "../../common/common.mjs";

export default {
key: "basecamp-create-comment",
name: "Create a Comment",
description: "Publishes a comment to the select recording. [See the docs here](https://github.com/basecamp/bc3-api/blob/master/sections/comments.md#create-a-comment)",
description: "Creates a comment in a selected recording. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/comments.md#create-a-comment)",
type: "action",
version: "0.0.7",
version: "0.1.0",
props: {
app,
accountId: {
...common.props,
recordingTypeAlert: {

Check warning on line 12 in components/basecamp/actions/create-comment/create-comment.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop recordingTypeAlert must have a label. See https://pipedream.com/docs/components/guidelines/#props

Check warning on line 12 in components/basecamp/actions/create-comment/create-comment.mjs

View workflow job for this annotation

GitHub Actions / Lint Code Base

Component prop recordingTypeAlert must have a description. See https://pipedream.com/docs/components/guidelines/#props
type: "alert",
alertType: "info",
content: `You can select either a **Recording** (by selecting the recording type) or a **Card** (by selecting the card table and column) to create the comment on.
\\
If both are specified, the **Card** will take precedence.`,
},
recordingType: {
propDefinition: [
app,
"accountId",
"recordingType",
],
optional: true,
},
projectId: {
recordingId: {
propDefinition: [
app,
"projectId",
({ accountId }) => ({
"recordingId",
({
accountId,
projectId,
recordingType,
}) => ({
accountId,
projectId,
recordingType,
}),
],
optional: true,
},
recordingType: {
cardTableId: {
propDefinition: [
app,
"recordingType",
"cardTableId",
({
accountId, projectId,
}) => ({
accountId,
projectId,
}),
],
optional: true,
},
recordingId: {
columnId: {
propDefinition: [
app,
"recordingId",
"columnId",
({
accountId, projectId, cardTableId,
}) => ({
accountId,
projectId,
recordingType,
cardTableId,
}),
],
optional: true,
},
cardId: {
propDefinition: [
app,
"cardId",
({
accountId, projectId, cardTableId, columnId,
}) => ({
accountId,
projectId,
recordingType,
cardTableId,
columnId,
}),
],
optional: true,
},
content: {
type: "string",
label: "Content",
description: "The body of the comment. See [Rich text guide](https://github.com/basecamp/bc3-api/blob/master/sections/rich_text.md) for what HTML tags are allowed.",
description: "The body of the comment. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/comments.md#create-a-comment) for information on using HTML tags.",
},
},
async run({ $ }) {
const {
accountId,
projectId,
recordingId,
content,
} = this;

const comment = await this.app.createComment({
$,
accountId,
projectId,
recordingId,
recordingId: this.cardId ?? this.recordingId,
data: {
content,
},
});

$.export("$summary", `Successfully posted comment with ID ${comment.id}`);
$.export("$summary", `Successfully posted comment (ID: ${comment.id})`);
return comment;
},
};
26 changes: 6 additions & 20 deletions components/basecamp/actions/create-message/create-message.mjs
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import app from "../../basecamp.app.mjs";
import common from "../../common/common.mjs";

export default {
key: "basecamp-create-message",
name: "Create Message",
description: "Publishes a message in the project and message board selected. [See the docs here](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md#create-a-message)",
description: "Creates a message in a selected message board. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md#create-a-message)",
type: "action",
version: "0.0.7",
version: "0.0.8",
props: {
app,
accountId: {
propDefinition: [
app,
"accountId",
],
},
projectId: {
propDefinition: [
app,
"projectId",
({ accountId }) => ({
accountId,
}),
],
},
...common.props,
messageBoardId: {
propDefinition: [
app,
Expand All @@ -44,7 +30,7 @@ export default {
content: {
type: "string",
label: "Content",
description: "The body of the message. See [Rich text guide](https://github.com/basecamp/bc3-api/blob/master/sections/rich_text.md) for what HTML tags are allowed.",
description: "The body of the message. [See the documentation](https://github.com/basecamp/bc3-api/blob/master/sections/messages.md#create-a-message) for information on using HTML tags.",
optional: true,
},
messageTypeId: {
Expand Down Expand Up @@ -85,7 +71,7 @@ export default {
},
});

$.export("$summary", `Successfully posted message with ID ${message.id}`);
$.export("$summary", `Successfully posted message (ID: ${message.id})`);
return message;
},
};
Loading
Loading