Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
Expand Up @@ -3,24 +3,25 @@ import vercelTokenAuth from "../../vercel_token_auth.app.mjs";
export default {
key: "vercel_token_auth-cancel-deployment",
name: "Cancel Deployment",
description: "Cancel a deployment which is currently building. [See the docs](https://vercel.com/docs/rest-api#endpoints/deployments/cancel-a-deployment)",
version: "0.0.3",
description: "Cancel a deployment which is currently building. [See the documentation](https://vercel.com/docs/rest-api/endpoints/deployments#cancel-a-deployment)",
version: "0.0.4",
type: "action",
props: {
vercelTokenAuth,
deployment: {
team: {
propDefinition: [
vercelTokenAuth,
"deployment",
() => ({
state: "BUILDING",
}),
"team",
],
},
team: {
deployment: {
propDefinition: [
vercelTokenAuth,
"team",
"deployment",
(c) => ({
teamId: c.team,
state: "BUILDING",
}),
],
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import vercelTokenAuth from "../../vercel_token_auth.app.mjs";
export default {
key: "vercel_token_auth-create-deployment",
name: "Create Deployment",
description: "Create a new deployment from a GitHub repository. [See the docs](https://vercel.com/docs/rest-api#endpoints/deployments/create-a-new-deployment)",
version: "0.0.3",
description: "Create a new deployment from a GitHub repository. [See the documentation](https://vercel.com/docs/rest-api/endpoints/deployments#create-a-new-deployment)",
version: "0.0.4",
type: "action",
props: {
vercelTokenAuth,
Expand All @@ -13,10 +13,19 @@ export default {
label: "Name",
description: "A string with the project name used in the deployment URL",
},
team: {
propDefinition: [
vercelTokenAuth,
"team",
],
},
project: {
propDefinition: [
vercelTokenAuth,
"project",
(c) => ({
teamId: c.team,
}),
],
description: "The target project identifier in which the deployment will be created. When defined, this parameter overrides name",
},
Expand All @@ -31,12 +40,6 @@ export default {
description: "Branch of repository to deploy to",
default: "main",
},
team: {
propDefinition: [
vercelTokenAuth,
"team",
],
},
public: {
type: "boolean",
label: "Public",
Expand All @@ -56,6 +59,21 @@ export default {
ref: this.branch,
},
};
if (!this.project) {
data.projectSettings = {
buildCommand: null,
commandForIgnoringBuildStep: null,
devCommand: null,
framework: null,
installCommand: null,
nodeVersion: "22.x",
outputDirectory: null,
rootDirectory: null,
serverlessFunctionRegion: null,
skipGitConnectDuringLink: true,
sourceFilesOutsideRootDirectory: true,
};
}
const res = await this.vercelTokenAuth.createDeployment(data, $);
$.export("$summary", "Successfully created new deployment");
return res;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,24 @@ import vercelTokenAuth from "../../vercel_token_auth.app.mjs";
export default {
key: "vercel_token_auth-list-deployments",
name: "List Deployments",
description: "List deployments under the account corresponding to the API token. [See the docs](https://vercel.com/docs/rest-api#endpoints/deployments/list-deployments)",
version: "0.0.3",
description: "List deployments under the account corresponding to the API token. [See the documentation](https://vercel.com/docs/rest-api/endpoints/deployments#list-deployments)",
version: "0.0.4",
type: "action",
props: {
vercelTokenAuth,
project: {
team: {
propDefinition: [
vercelTokenAuth,
"project",
"team",
],
},
team: {
project: {
propDefinition: [
vercelTokenAuth,
"team",
"project",
(c) => ({
teamId: c.teamId,
}),
],
},
state: {
Expand Down
4 changes: 2 additions & 2 deletions components/vercel_token_auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/vercel_token_auth",
"version": "0.0.4",
"version": "0.0.5",
"description": "Pipedream Vercel (token-based auth) Components",
"main": "vercel_token_auth.app.mjs",
"keywords": [
Expand All @@ -13,6 +13,6 @@
"access": "public"
},
"dependencies": {
"@pipedream/platform": "^1.2.0"
"@pipedream/platform": "^3.0.3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default {
key: "vercel_token_auth-new-deployment",
name: "New Deployment",
description: "Emit new event when a deployment is created",
version: "0.0.3",
version: "0.0.4",
type: "source",
dedupe: "unique",
props: {
Expand All @@ -17,10 +17,19 @@ export default {
intervalSeconds: DEFAULT_POLLING_SOURCE_TIMER_INTERVAL,
},
},
team: {
propDefinition: [
vercelTokenAuth,
"team",
],
},
project: {
propDefinition: [
vercelTokenAuth,
"project",
(c) => ({
teamId: c.teamId,
}),
],
},
state: {
Expand Down Expand Up @@ -63,6 +72,7 @@ export default {
},
async processEvent(max) {
const params = {
teamId: this.teamId,
projectId: this.project,
state: this.state,
};
Expand Down
27 changes: 16 additions & 11 deletions components/vercel_token_auth/vercel_token_auth.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ export default {
label: "Project",
description: "Filter deployments from the given projectId",
optional: true,
async options() {
const projects = await this.listProjects();
async options({ teamId }) {
const projects = await this.listProjects({
teamId,
});
return projects?.map((project) => ({
label: project.name,
value: project.id,
Expand All @@ -22,12 +24,15 @@ export default {
type: "string",
label: "Deployment",
description: "Select the deployment to cancel",
async options({ state }) {
const params = state
? {
state,
}
: {};
async options({
teamId, state,
}) {
const params = {
teamId,
};
if (state) {
params.state = state;
}
const deployments = await this.listDeployments(params);
return deployments?.map((deployment) => ({
label: deployment.name,
Expand All @@ -39,7 +44,6 @@ export default {
type: "string",
label: "Team",
description: "The Team identifier or slug to perform the request on behalf of",
optional: true,
async options() {
try {
const teams = await this.listTeams();
Expand Down Expand Up @@ -111,10 +115,11 @@ export default {
}
return allResults;
},
async listProjects(max, $) {
async listProjects(params, max, $) {
const config = {
method: "GET",
endpoint: "v8/projects",
endpoint: "v9/projects",
params,
};
return this.paginate("projects", config, max, $);
},
Expand Down
4 changes: 2 additions & 2 deletions pnpm-lock.yaml

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

Loading