Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 0 additions & 3 deletions components/upwave/.gitignore

This file was deleted.

52 changes: 52 additions & 0 deletions components/upwave/actions/create-card/create-card.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import app from "../../upwave.app.mjs";

export default {
key: "upwave-create-card",
name: "Create Card",
description: "Create a new card. [See the documentation](https://upwavehq.github.io/api/#creating-a-new-card)",
version: "0.0.1",
type: "action",
props: {
app,
workspaceId: {
propDefinition: [
app,
"workspaceId",
],
},
boardId: {
propDefinition: [
app,
"boardId",
(c) => ({
workspaceId: c.workspaceId,
}),
],
},
dueDt: {
propDefinition: [
app,
"dueDt",
],
},
description: {
propDefinition: [
app,
"description",
],
},
},
async run({ $ }) {
const response = await this.app.createCard({
$,
workspaceId: this.workspaceId,
data: {
board: this.boardId,
due_dt: this.dueDt,
description: this.description,
},
});
$.export("$summary", "Successfully created card with ID: " + response.id);
return response;
},
};
13 changes: 0 additions & 13 deletions components/upwave/app/upwave.app.ts

This file was deleted.

5 changes: 2 additions & 3 deletions components/upwave/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"name": "@pipedream/upwave",
"version": "0.0.2",
"version": "0.1.0",
"description": "Pipedream Upwave Components",
"main": "dist/app/upwave.app.mjs",
"main": "upwave.app.mjs",
"keywords": [
"pipedream",
"upwave"
],
"files": ["dist"],
"homepage": "https://pipedream.com/apps/upwave",
"author": "Pipedream <[email protected]> (https://pipedream.com/)",
"publishConfig": {
Expand Down
95 changes: 95 additions & 0 deletions components/upwave/upwave.app.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { axios } from "@pipedream/platform";

export default {
type: "app",
app: "upwave",
propDefinitions: {
workspaceId: {
type: "string",
label: "Workspace ID",
description: "Description for workspaceId",
async options() {
const response = await this.getWorkspaces();
const workspaces = response.results;
return workspaces.map(({
title, id,
}) => ({
label: title,
value: id,
}));
},
},
boardId: {
type: "string",
label: "Board ID",
description: "Description for boardId",
async options({ workspaceId }) {
const response = await this.getBoards({
workspaceId,
});
const boards = response.results;
return boards.map(({
title, id,
}) => ({
label: title,
value: id,
}));
},
},
dueDt: {
type: "string",
label: "Due Date",
description: "The due date of the card, i.e.: `2025-12-31`",
optional: true,
},
description: {
type: "string",
label: "Description",
description: "Description of the card",
},
},
methods: {
_baseUrl() {
return "https://api.upwave.io";
},
async _makeRequest(opts = {}) {
const {
$ = this,
path,
headers,
...otherOpts
} = opts;
return axios($, {
...otherOpts,
url: this._baseUrl() + path,
headers: {
"Authorization": `Token ${this.$auth.api_key}`,
...headers,
},
});
},
async createCard({
workspaceId, ...args
}) {
return this._makeRequest({
path: `/workspaces/${workspaceId}/cards/`,
method: "post",
...args,
});
},
async getWorkspaces(args = {}) {
return this._makeRequest({
path: "/workspaces",
...args,
});
},
async getBoards({
workspaceId, ...args
}) {
return this._makeRequest({
path: `/workspaces/${workspaceId}/boards`,
...args,
});
},
},
};
6 changes: 2 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading