Skip to content

Commit 8ffb26b

Browse files
committed
require team prop
1 parent 5c61c62 commit 8ffb26b

File tree

6 files changed

+74
-37
lines changed

6 files changed

+74
-37
lines changed

components/vercel_token_auth/actions/cancel-deployment/cancel-deployment.mjs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@ import vercelTokenAuth from "../../vercel_token_auth.app.mjs";
33
export default {
44
key: "vercel_token_auth-cancel-deployment",
55
name: "Cancel Deployment",
6-
description: "Cancel a deployment which is currently building. [See the docs](https://vercel.com/docs/rest-api#endpoints/deployments/cancel-a-deployment)",
7-
version: "0.0.3",
6+
description: "Cancel a deployment which is currently building. [See the documentation](https://vercel.com/docs/rest-api/endpoints/deployments#cancel-a-deployment)",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
vercelTokenAuth,
11-
deployment: {
11+
team: {
1212
propDefinition: [
1313
vercelTokenAuth,
14-
"deployment",
15-
() => ({
16-
state: "BUILDING",
17-
}),
14+
"team",
1815
],
1916
},
20-
team: {
17+
deployment: {
2118
propDefinition: [
2219
vercelTokenAuth,
23-
"team",
20+
"deployment",
21+
(c) => ({
22+
teamId: c.team,
23+
state: "BUILDING",
24+
}),
2425
],
2526
},
2627
},

components/vercel_token_auth/actions/create-deployment/create-deployment.mjs

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import vercelTokenAuth from "../../vercel_token_auth.app.mjs";
33
export default {
44
key: "vercel_token_auth-create-deployment",
55
name: "Create Deployment",
6-
description: "Create a new deployment from a GitHub repository. [See the docs](https://vercel.com/docs/rest-api#endpoints/deployments/create-a-new-deployment)",
7-
version: "0.0.3",
6+
description: "Create a new deployment from a GitHub repository. [See the documentation](https://vercel.com/docs/rest-api/endpoints/deployments#create-a-new-deployment)",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
vercelTokenAuth,
@@ -13,10 +13,19 @@ export default {
1313
label: "Name",
1414
description: "A string with the project name used in the deployment URL",
1515
},
16+
team: {
17+
propDefinition: [
18+
vercelTokenAuth,
19+
"team",
20+
],
21+
},
1622
project: {
1723
propDefinition: [
1824
vercelTokenAuth,
1925
"project",
26+
(c) => ({
27+
teamId: c.team,
28+
}),
2029
],
2130
description: "The target project identifier in which the deployment will be created. When defined, this parameter overrides name",
2231
},
@@ -31,12 +40,6 @@ export default {
3140
description: "Branch of repository to deploy to",
3241
default: "main",
3342
},
34-
team: {
35-
propDefinition: [
36-
vercelTokenAuth,
37-
"team",
38-
],
39-
},
4043
public: {
4144
type: "boolean",
4245
label: "Public",
@@ -56,6 +59,21 @@ export default {
5659
ref: this.branch,
5760
},
5861
};
62+
if (!this.project) {
63+
data.projectSettings = {
64+
buildCommand: null,
65+
commandForIgnoringBuildStep: null,
66+
devCommand: null,
67+
framework: null,
68+
installCommand: null,
69+
nodeVersion: "22.x",
70+
outputDirectory: null,
71+
rootDirectory: null,
72+
serverlessFunctionRegion: null,
73+
skipGitConnectDuringLink: true,
74+
sourceFilesOutsideRootDirectory: true,
75+
};
76+
}
5977
const res = await this.vercelTokenAuth.createDeployment(data, $);
6078
$.export("$summary", "Successfully created new deployment");
6179
return res;

components/vercel_token_auth/actions/list-deployments/list-deployments.mjs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@ import vercelTokenAuth from "../../vercel_token_auth.app.mjs";
33
export default {
44
key: "vercel_token_auth-list-deployments",
55
name: "List Deployments",
6-
description: "List deployments under the account corresponding to the API token. [See the docs](https://vercel.com/docs/rest-api#endpoints/deployments/list-deployments)",
7-
version: "0.0.3",
6+
description: "List deployments under the account corresponding to the API token. [See the documentation](https://vercel.com/docs/rest-api/endpoints/deployments#list-deployments)",
7+
version: "0.0.4",
88
type: "action",
99
props: {
1010
vercelTokenAuth,
11-
project: {
11+
team: {
1212
propDefinition: [
1313
vercelTokenAuth,
14-
"project",
14+
"team",
1515
],
1616
},
17-
team: {
17+
project: {
1818
propDefinition: [
1919
vercelTokenAuth,
20-
"team",
20+
"project",
21+
(c) => ({
22+
teamId: c.teamId,
23+
}),
2124
],
2225
},
2326
state: {

components/vercel_token_auth/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@pipedream/vercel_token_auth",
3-
"version": "0.0.4",
3+
"version": "0.0.5",
44
"description": "Pipedream Vercel (token-based auth) Components",
55
"main": "vercel_token_auth.app.mjs",
66
"keywords": [
@@ -13,6 +13,6 @@
1313
"access": "public"
1414
},
1515
"dependencies": {
16-
"@pipedream/platform": "^1.2.0"
16+
"@pipedream/platform": "^3.0.3"
1717
}
1818
}

components/vercel_token_auth/sources/new-deployment/new-deployment.mjs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default {
55
key: "vercel_token_auth-new-deployment",
66
name: "New Deployment",
77
description: "Emit new event when a deployment is created",
8-
version: "0.0.3",
8+
version: "0.0.4",
99
type: "source",
1010
dedupe: "unique",
1111
props: {
@@ -17,10 +17,19 @@ export default {
1717
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
1818
},
1919
},
20+
team: {
21+
propDefinition: [
22+
vercelTokenAuth,
23+
"team",
24+
],
25+
},
2026
project: {
2127
propDefinition: [
2228
vercelTokenAuth,
2329
"project",
30+
(c) => ({
31+
teamId: c.teamId,
32+
}),
2433
],
2534
},
2635
state: {
@@ -63,6 +72,7 @@ export default {
6372
},
6473
async processEvent(max) {
6574
const params = {
75+
teamId: this.teamId,
6676
projectId: this.project,
6777
state: this.state,
6878
};

components/vercel_token_auth/vercel_token_auth.app.mjs

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ export default {
1010
label: "Project",
1111
description: "Filter deployments from the given projectId",
1212
optional: true,
13-
async options() {
14-
const projects = await this.listProjects();
13+
async options({ teamId }) {
14+
const projects = await this.listProjects({
15+
teamId,
16+
});
1517
return projects?.map((project) => ({
1618
label: project.name,
1719
value: project.id,
@@ -22,12 +24,15 @@ export default {
2224
type: "string",
2325
label: "Deployment",
2426
description: "Select the deployment to cancel",
25-
async options({ state }) {
26-
const params = state
27-
? {
28-
state,
29-
}
30-
: {};
27+
async options({
28+
teamId, state,
29+
}) {
30+
const params = {
31+
teamId,
32+
};
33+
if (state) {
34+
params.state = state;
35+
}
3136
const deployments = await this.listDeployments(params);
3237
return deployments?.map((deployment) => ({
3338
label: deployment.name,
@@ -39,7 +44,6 @@ export default {
3944
type: "string",
4045
label: "Team",
4146
description: "The Team identifier or slug to perform the request on behalf of",
42-
optional: true,
4347
async options() {
4448
try {
4549
const teams = await this.listTeams();
@@ -111,10 +115,11 @@ export default {
111115
}
112116
return allResults;
113117
},
114-
async listProjects(max, $) {
118+
async listProjects(params, max, $) {
115119
const config = {
116120
method: "GET",
117-
endpoint: "v8/projects",
121+
endpoint: "v9/projects",
122+
params,
118123
};
119124
return this.paginate("projects", config, max, $);
120125
},

0 commit comments

Comments
 (0)