Skip to content

Commit e5cf122

Browse files
committed
Merge remote-tracking branch 'origin/master' into issue-13226
2 parents 31ba835 + 96293e3 commit e5cf122

File tree

113 files changed

+4627
-354
lines changed

Some content is hidden

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

113 files changed

+4627
-354
lines changed

.github/workflows/scheduled-package-validation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
continue-on-error: true
4141

4242
- name: Upload Validation Report
43-
uses: actions/upload-artifact@v4
43+
uses: actions/upload-artifact@v5
4444
with:
4545
name: package-validation-report-${{ github.run_number }}
4646
path: |
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
import breeze from "../../breeze.app.mjs";
2+
3+
export default {
4+
key: "breeze-create-project",
5+
name: "Create Project",
6+
description: "Establishes a new project in breeze. [See documentation](https://www.breeze.pm/api#:~:text=Create%20a%20project)",
7+
version: "0.0.2",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: false,
13+
},
14+
props: {
15+
breeze,
16+
workspaceId: {
17+
propDefinition: [
18+
breeze,
19+
"workspaceId",
20+
],
21+
},
22+
projectName: {
23+
type: "string",
24+
label: "Project Name",
25+
description: "The name of the project to create",
26+
},
27+
projectDescription: {
28+
type: "string",
29+
label: "Project Description",
30+
description: "The description of the project",
31+
optional: true,
32+
},
33+
startDate: {
34+
type: "string",
35+
label: "Start Date",
36+
description: "The start date for the project (format: `YYYY-MM-DD`)",
37+
optional: true,
38+
},
39+
endDate: {
40+
type: "string",
41+
label: "End Date",
42+
description: "The end date for the project (format: `YYYY-MM-DD`)",
43+
optional: true,
44+
},
45+
},
46+
async run({ $ }) {
47+
const data = {
48+
workspace_id: this.workspaceId,
49+
name: this.projectName,
50+
description: this.projectDescription,
51+
start_date: this.startDate,
52+
end_date: this.endDate,
53+
};
54+
55+
const response = await this.breeze.createProject({
56+
$,
57+
data,
58+
});
59+
60+
$.export("$summary", `Successfully created project "${this.projectName}"`);
61+
62+
return response;
63+
},
64+
};
65+
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
import breeze from "../../breeze.app.mjs";
2+
3+
export default {
4+
key: "breeze-create-task",
5+
name: "Create Task",
6+
description: "Generates a new task within an existing project in breeze. [See documentation](https://www.breeze.pm/api#:~:text=Create%20a%20card)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: false,
13+
},
14+
props: {
15+
breeze,
16+
projectId: {
17+
propDefinition: [
18+
breeze,
19+
"projectId",
20+
],
21+
},
22+
stageId: {
23+
propDefinition: [
24+
breeze,
25+
"stageId",
26+
(c) => ({
27+
projectId: c.projectId,
28+
}),
29+
],
30+
},
31+
swimlaneId: {
32+
propDefinition: [
33+
breeze,
34+
"swimlaneId",
35+
(c) => ({
36+
projectId: c.projectId,
37+
}),
38+
],
39+
optional: true,
40+
},
41+
taskName: {
42+
type: "string",
43+
label: "Task Name",
44+
description: "The name of the task to create",
45+
},
46+
taskDescription: {
47+
type: "string",
48+
label: "Task Description",
49+
description: "The description of the task",
50+
optional: true,
51+
},
52+
dueDate: {
53+
type: "string",
54+
label: "Due Date",
55+
description: "The due date for the task (format: `YYYY-MM-DD`)",
56+
optional: true,
57+
},
58+
},
59+
async run({ $ }) {
60+
const data = {
61+
stage_id: this.stageId,
62+
swimlane_id: this.swimlaneId,
63+
name: this.taskName,
64+
description: this.taskDescription,
65+
due_date: this.dueDate,
66+
};
67+
68+
const response = await this.breeze.createTask({
69+
$,
70+
projectId: this.projectId,
71+
data,
72+
});
73+
74+
$.export("$summary", `Successfully created task "${this.taskName}"`);
75+
76+
return response;
77+
},
78+
};
79+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import breeze from "../../breeze.app.mjs";
2+
3+
export default {
4+
key: "breeze-find-project",
5+
name: "Find Project",
6+
description: "Searches for a specific project in breeze using the name. [See documentation](https://www.breeze.pm/api#:~:text=Get%20Projects)",
7+
version: "0.0.1",
8+
type: "action",
9+
annotations: {
10+
destructiveHint: false,
11+
openWorldHint: true,
12+
readOnlyHint: true,
13+
},
14+
props: {
15+
breeze,
16+
projectName: {
17+
type: "string",
18+
label: "Project Name",
19+
description: "The name of the project to search for",
20+
},
21+
},
22+
async run({ $ }) {
23+
const projects = await this.breeze.getProjects({
24+
$,
25+
});
26+
27+
const matchingProjects = projects.filter((project) =>
28+
project.name?.toLowerCase().includes(this.projectName.toLowerCase()));
29+
30+
$.export("$summary", `Found ${matchingProjects.length} project(s) matching "${this.projectName}"`);
31+
32+
return matchingProjects;
33+
},
34+
};
35+

components/breeze/breeze.app.mjs

Lines changed: 143 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,150 @@
1+
import { axios } from "@pipedream/platform";
2+
13
export default {
24
type: "app",
35
app: "breeze",
4-
propDefinitions: {},
6+
propDefinitions: {
7+
workspaceId: {
8+
type: "string",
9+
label: "Workspace ID",
10+
description: "The workspace to associate the project with",
11+
optional: true,
12+
async options() {
13+
const workspaces = await this.getWorkspaces();
14+
return workspaces.map((workspace) => ({
15+
label: workspace.name || workspace.id,
16+
value: workspace.id,
17+
}));
18+
},
19+
},
20+
projectId: {
21+
type: "string",
22+
label: "Project ID",
23+
description: "The project to associate the task with",
24+
async options() {
25+
const projects = await this.getProjects();
26+
return projects.map((project) => ({
27+
label: project.name || project.id,
28+
value: project.id,
29+
}));
30+
},
31+
},
32+
stageId: {
33+
type: "string",
34+
label: "Stage ID",
35+
description: "The stage (list) to associate the task with",
36+
async options({ projectId }) {
37+
if (!projectId) return [];
38+
const lists = await this.getLists({
39+
projectId,
40+
});
41+
return lists.map((list) => ({
42+
label: list.name || list.id,
43+
value: list.id,
44+
}));
45+
},
46+
},
47+
swimlaneId: {
48+
type: "string",
49+
label: "Swimlane ID",
50+
description: "The swimlane to associate the task with",
51+
async options({ projectId }) {
52+
if (!projectId) return [];
53+
const swimlanes = await this.getSwimlanes({
54+
projectId,
55+
});
56+
return swimlanes.map((swimlane) => ({
57+
label: swimlane.name || swimlane.id,
58+
value: swimlane.id,
59+
}));
60+
},
61+
},
62+
taskId: {
63+
type: "string",
64+
label: "Task ID",
65+
description: "The task to monitor",
66+
async options({ projectId }) {
67+
if (!projectId) return [];
68+
const tasks = await this.getTasks({
69+
projectId,
70+
});
71+
return tasks.map((task) => ({
72+
label: task.name || task.id,
73+
value: task.id,
74+
}));
75+
},
76+
},
77+
},
578
methods: {
6-
// this.$auth contains connected account data
7-
authKeys() {
8-
console.log(Object.keys(this.$auth));
79+
_baseUrl() {
80+
return "https://api.breeze.pm";
81+
},
82+
async _makeRequest(opts = {}) {
83+
const {
84+
$ = this,
85+
path,
86+
...otherOpts
87+
} = opts;
88+
return axios($, {
89+
...otherOpts,
90+
url: this._baseUrl() + path,
91+
params: {
92+
api_token: this.$auth.api_token,
93+
...otherOpts.params,
94+
},
95+
});
96+
},
97+
async getWorkspaces(args = {}) {
98+
return this._makeRequest({
99+
path: "/workspaces.json",
100+
...args,
101+
});
102+
},
103+
async getProjects(args = {}) {
104+
return this._makeRequest({
105+
path: "/projects.json",
106+
...args,
107+
});
108+
},
109+
async getLists({
110+
projectId, ...args
111+
} = {}) {
112+
return this._makeRequest({
113+
path: `/projects/${projectId}/stages.json`,
114+
...args,
115+
});
116+
},
117+
async getSwimlanes({
118+
projectId, ...args
119+
} = {}) {
120+
return this._makeRequest({
121+
path: `/projects/${projectId}/swimlanes.json`,
122+
...args,
123+
});
124+
},
125+
async getTasks({
126+
projectId, ...args
127+
} = {}) {
128+
return this._makeRequest({
129+
path: `/V2/projects/${projectId}/cards.json`,
130+
...args,
131+
});
132+
},
133+
async createTask({
134+
projectId, ...args
135+
} = {}) {
136+
return this._makeRequest({
137+
path: `/projects/${projectId}/cards.json`,
138+
method: "post",
139+
...args,
140+
});
141+
},
142+
async createProject(args = {}) {
143+
return this._makeRequest({
144+
path: "/projects.json",
145+
method: "post",
146+
...args,
147+
});
9148
},
10149
},
11150
};

components/breeze/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{
1+
{
22
"name": "@pipedream/breeze",
3-
"version": "0.6.1",
3+
"version": "0.1.1",
44
"description": "Pipedream breeze Components",
55
"main": "breeze.app.mjs",
66
"keywords": [

0 commit comments

Comments
 (0)