-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Add Prisma Postgres Actions for Database Provisioning, Management & Cleanup via Prisma Management API #18092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
@nurul3101 is attempting to deploy a commit to the Pipedreamers Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughAdds a new Prisma Management API app client with authenticated HTTP helpers and dynamic region prop, a README, package dependency, and multiple new actions to create/list/get/delete projects, databases, and connection strings, plus a regions listing action. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Action as Pipedream Action
participant App as Prisma Mgmt App Client
participant API as Prisma Management API
User->>Action: Provide inputs (e.g., projectId, region, databaseId)
Action->>App: Call method (e.g., createDatabase, listProjects)
App->>API: HTTPS request (Bearer token) via _makeRequest
API-->>App: JSON / status
App-->>Action: Response object
Action-->>User: Summary + raw response
rect rgba(180,235,180,0.15)
note over App: _makeRequest centralizes auth and base URL
end
sequenceDiagram
autonumber
actor User
participant Action as Create New DB in Existing Project
participant App as App.createDatabase
participant API as POST /projects/{projectId}/databases
User->>Action: projectId, region, isDefault?
Action->>Action: Validate region (throws if missing)
Action->>App: createDatabase({ projectId, data:{ region, default? } })
App->>API: POST with Bearer token
API-->>App: 201 Created (db id)
App-->>Action: Response
Action-->>User: $summary "Successfully created database..."
sequenceDiagram
autonumber
actor User
participant Action as Connection String Actions
participant App as App.*ConnectionString
participant API as /databases/{id}/connections
User->>Action: databaseId / connectionId
alt Create
Action->>App: createConnectionString({ databaseId, data:{ name } })
App->>API: POST /databases/{id}/connections
else List
Action->>App: listConnectionStrings({ databaseId })
App->>API: GET /databases/{id}/connections
else Delete
Action->>App: deleteConnectionString({ connectionId })
App->>API: DELETE /connections/{connectionId}
end
API-->>App: JSON / null
App-->>Action: Response
Action-->>User: $summary + return
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. 📜 Recent review detailsConfiguration used: CodeRabbit UI 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Thank you so much for submitting this! We've added it to our backlog to review, and our team has been notified. |
Thanks for submitting this PR! When we review PRs, we follow the Pipedream component guidelines. If you're not familiar, here's a quick checklist:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (33)
components/prisma_management_api/README.md (3)
25-31
: Tighten wording and avoid hard-coding region listSmall grammar fix and suggest referencing the regions action instead of a static list to prevent drift.
-#### Create Postgres Database -Creates a new Postgres database project via Prisma Management API. This action creates a complete project with database and provides connection string details in the response for immediate use. +#### Create Postgres Database +Creates a new Prisma Postgres project via the Management API. This creates a complete project with a database and provides connection-string details in the response for immediate use. @@ -**Available regions:** us-east-1, us-west-1, eu-west-3, eu-central-1, ap-northeast-1, ap-southeast-1 +Tip: Regions evolve over time. Use the "Get Prisma Postgres Regions" action at runtime to retrieve the latest supported regions.
104-111
: Align terminology: “Service Token” vs “API Token” and add minor punctuationUse a single term throughout (Prisma docs use “Service Token”) and add periods for readability.
-This integration uses API Token authentication. You'll need to provide your Prisma Management API Service token when configuring the connection in Pipedream. +This integration uses Service Token authentication. You'll need to provide your Prisma Management API service token when configuring the connection in Pipedream. @@ -To obtain your API token: -1. Log in to your Prisma account -2. Navigate to your workspace settings -3. Generate a new Service Token -4. Copy the token for use in Pipedream +To obtain your service token: +1. Log in to your Prisma account. +2. Navigate to your workspace settings. +3. Generate a new service token. +4. Copy the token for use in Pipedream.
118-126
: Minor copy edits in Example WorkflowsAdd punctuation and consistent phrasing.
-Trigger a workflow when a new project is created in your system, automatically provision a Prisma Postgres database, and store the connection details in your configuration management system. +Trigger a workflow when a new project is created in your system, automatically provision a Prisma Postgres database, and store the connection details in your configuration management system. @@ -Schedule periodic cleanup of unused databases and connection strings to maintain security and reduce costs. +Schedule periodic cleanup of unused databases and connection strings to maintain security and reduce costs. @@ -Create databases across multiple regions for improved performance and redundancy based on your application's geographic distribution. +Create databases across multiple regions for improved performance and redundancy, based on your application's geographic distribution.components/prisma_management_api/prisma_management_api.app.mjs (3)
12-21
: Avoid defaulting $ to this in _makeRequestDefaulting $ to this is unconventional and could produce confusing logs/metrics. Prefer requiring $ explicitly; callers already pass it.
- _makeRequest({ - $ = this, path, ...args - }) { - return axios($, { - url: `${this._baseUrl()}${path}`, + _makeRequest({ + $, path, ...args + }) { + return axios($, { + url: `${this._baseUrl()}${path}`, headers: { Authorization: `Bearer ${this.$auth.api_token}`, "Content-Type": "application/json", }, ...args, }); },
23-125
: URL-encode path parameters to guard against unsafe charactersDefensive encoding prevents accidental breakage if IDs ever contain reserved URL characters.
_baseUrl() { return "https://api.prisma.io/v1"; }, + _segment(v) { + return encodeURIComponent(String(v)); + }, @@ async deleteProject({ projectId, ...args }) { return this._makeRequest({ - path: `/projects/${projectId}`, + path: `/projects/${this._segment(projectId)}`, method: "delete", ...args, }); }, @@ async getProject({ projectId, ...args }) { return this._makeRequest({ - path: `/projects/${projectId}`, + path: `/projects/${this._segment(projectId)}`, method: "get", ...args, }); }, @@ async createDatabase({ projectId, ...args }) { return this._makeRequest({ - path: `/projects/${projectId}/databases`, + path: `/projects/${this._segment(projectId)}/databases`, method: "post", ...args, }); }, @@ async listDatabases({ projectId, ...args }) { return this._makeRequest({ - path: `/projects/${projectId}/databases`, + path: `/projects/${this._segment(projectId)}/databases`, method: "get", ...args, }); }, @@ async getDatabase({ databaseId, ...args }) { return this._makeRequest({ - path: `/databases/${databaseId}`, + path: `/databases/${this._segment(databaseId)}`, method: "get", ...args, }); }, @@ async deleteDatabase({ databaseId, ...args }) { return this._makeRequest({ - path: `/databases/${databaseId}`, + path: `/databases/${this._segment(databaseId)}`, method: "delete", ...args, }); }, @@ async listConnectionStrings({ databaseId, ...args }) { return this._makeRequest({ - path: `/databases/${databaseId}/connections`, + path: `/databases/${this._segment(databaseId)}/connections`, method: "get", ...args, }); }, @@ async createConnectionString({ databaseId, data, ...args }) { return this._makeRequest({ - path: `/databases/${databaseId}/connections`, + path: `/databases/${this._segment(databaseId)}/connections`, method: "post", data: data || {}, ...args, }); }, @@ async deleteConnectionString({ connectionId, ...args }) { return this._makeRequest({ - path: `/connections/${connectionId}`, + path: `/connections/${this._segment(connectionId)}`, method: "delete", ...args, }); },
6-6
: Optional: centralize common propDefinitions for reuse across actionsTo reduce duplication and ensure consistent labels/descriptions across actions, consider defining shared props on the app for projectId, databaseId, and connectionId, then reference them in actions via props: { projectId: app.propDefinitions.projectId, ... }.
Example addition to prisma_management_api.app.mjs (outside current changed lines):
propDefinitions: { projectId: { type: "string", label: "Project ID", description: "The Prisma project ID.", }, databaseId: { type: "string", label: "Database ID", description: "The Prisma Postgres database ID.", }, connectionId: { type: "string", label: "Connection ID", description: "The connection string ID.", }, },components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
17-23
: Be resilient to response shape and return the payload, not the raw responseAPIs sometimes return arrays directly or nest them (e.g., { regions: [] }). Compute the list defensively and return it to keep step output clean.
- if (response) { - const count = response.data?.length || 0; - $.export("$summary", `Successfully retrieved ${count} available Postgres region${count !== 1 ? "s" : ""}`); - } - - return response; + if (response) { + const items = Array.isArray(response.data) + ? response.data + : (response.data?.regions || []); + const count = Array.isArray(items) ? items.length : 0; + $.export("$summary", `Successfully retrieved ${count} available Postgres region${count !== 1 ? "s" : ""}`); + return items; + } + return response;components/prisma_management_api/actions/get-database-details/get-database-details.mjs (2)
4-8
: Polish name/description for consistency and clarityTitle-case “Details” and tighten the description.
- name: "Get Database details", + name: "Get Database Details", @@ - description: "Get database details of a particular Prisma Postgres database via Prisma Management API. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)", + description: "Retrieve details for a Prisma Postgres database via the Prisma Management API. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)",
23-28
: Return response payload instead of the entire HTTP responseReturning response.data keeps step output clean and consistent.
- return response; + return response?.data ?? response;components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (2)
23-25
: Export summary unconditionally after a successful await.If the HTTP client throws on non-2xx, this code path won’t run anyway. The extra condition can hide success summaries if the client returns
undefined
for 204 responses. Simplify by exporting the summary after the await.Apply this diff:
- if (response || response === null) { - $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`); - } + $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`);
27-31
: Consider standardizing return shapes across actions.Some actions return the raw API response, others return a
{ success, id, message }
object. Standardizing improves DX for workflows that chain multiple actions.components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
7-7
: Description claims pagination support but no pagination is exposed.Currently there are no pagination props or logic passed to
listProjects
. Either add pagination props (e.g., cursor/page, limit) and wire them through, or adjust the description to avoid implying pagination.Apply this minimal description fix if you prefer not to add props now:
- description: "List Projects in a Prisma Workspace via Prisma Management API. Supports pagination for large result sets. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)", + description: "List Projects in a Prisma Workspace via Prisma Management API. [See docs here](https://www.prisma.io/docs/postgres/introduction/management-api)",components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (2)
23-25
: Export summary unconditionally after a successful await.Same reasoning as other delete actions: if the API call fails it will throw. Exporting the summary unconditionally avoids edge cases where clients return
undefined
for 204 responses.Apply this diff:
- if (response || response === null) { - $.export("$summary", `Successfully deleted database connection with ID ${this.connectionId}`); - } + $.export("$summary", `Successfully deleted database connection with ID ${this.connectionId}`);
27-31
: Tighten message wording to “connection string” for clarity.Minor copy nit to match the action name and avoid ambiguity with other connection objects.
Apply this diff:
- message: "Database connection deleted successfully", + message: "Database connection string deleted successfully",components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (2)
20-29
: Consider dynamic region options sourced from the API.Hardcoding regions can drift from reality. Prefer populating options from
listRegions
to ensure accuracy and better UX.Two approaches:
- Define a propDefinition in the app with dynamic options and reference it here.
- Or implement a dynamic
options
function that queriesthis.app.listRegions
and returns{ label, value }
pairs.Happy to provide a concrete snippet if you share the app’s propDefinition patterns.
55-56
: Align return shape with other actions for consistency.This action returns the raw response, while delete actions return a
{ success, id, message }
object. Consider standardizing across the suite (either always raw response or always a normalized object plus raw under a key).components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (2)
23-25
: Export summary unconditionally after a successful await.Mirror the simplification suggested for the other delete actions to avoid missing summaries on 204/empty responses.
Apply this diff:
- if (response || response === null) { - $.export("$summary", `Successfully deleted Postgres database project with ID ${this.projectId}`); - } + $.export("$summary", `Successfully deleted Postgres database project with ID ${this.projectId}`);
11-15
: Optional: Provide dynamic options for selecting a project.To reduce copy/paste of IDs, consider a dynamic options prop that lists projects (via
listProjects
) so users can pick a project by name in the UI.components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
11-16
: Consider dynamic projectId via propDefinition for UXLeverage a propDefinition (backed by listProjects) so users can pick a project from a dropdown instead of pasting IDs.
Apply this diff if
projectId
propDefinition exists in the app:- projectId: { - type: "string", - label: "Project ID", - description: "The ID of the project to list databases from", - }, + projectId: { + propDefinition: [app, "projectId"], + description: "Select the project to list databases from", + },If you don't have it yet, add to
prisma_management_api.app.mjs
:// Inside export default { ... app ... } propDefinitions: { projectId: { type: "string", label: "Project", description: "Select a Prisma project", async options({ $ }) { const res = await this.listProjects({ $ }); const items = res?.data ?? []; return items.map((p) => ({ label: `${p.name} (${p.id})`, value: p.id })); }, }, },
23-26
: Make summary resilient to varied response shapesIf your app client ever returns arrays at the top level (vs under
data
), count can be wrong.Apply:
- const count = response.data?.length || 0; + const items = Array.isArray(response?.data) ? response.data : (Array.isArray(response) ? response : []); + const count = items.length;components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (3)
11-16
: Enable databaseId selection via propDefinitionImprove DX by letting users select a database from a list (backed by listDatabases).
- databaseId: { - type: "string", - label: "Database ID", - description: "The ID of the database to create a connection string for", - }, + databaseId: { + propDefinition: [app, "databaseId"], + description: "Select the database to create a connection string for", + },Add to
prisma_management_api.app.mjs
if missing:propDefinitions: { // ...projectId as shown earlier... databaseId: { type: "string", label: "Database", description: "Select a database within a project", async options({ $ }) { // Optionally gate by selected projectId from other props // e.g. const { projectId } = this; // const res = await this.listDatabases({ $, projectId }); // If no projectId context, fetch recently used or all (if API supports). return []; }, }, },
31-33
: Use robust ID fallback in summaryThe ID may come as
response.id
orresponse.data.id
depending on the app client shape.- $.export("$summary", `Successfully created connection string for database ${this.databaseId}${response.id ? ` with connection ID ${response.id}` : ""}`); + const id = response?.id ?? response?.data?.id; + $.export("$summary", `Successfully created connection string for database ${this.databaseId}${id ? ` with connection ID ${id}` : ""}`);
35-36
: Be mindful of returning secrets in step outputCreating a connection string may return the raw DSN with credentials. Returning the full response is often desired, but it can expose secrets in step results. Consider a boolean prop to control whether to return the raw string or to return only metadata by default.
I can draft a small change to add a
returnConnectionString
boolean (default false) and conditionally filter the returned payload.components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (3)
11-15
: Tighten copy and enable dynamic selection
- Wording: use “connection strings” for clarity.
- Prefer
propDefinition
fordatabaseId
to enable dropdown selection.- databaseId: { - type: "string", - label: "Database ID", - description: "The ID of the database to list connections for", - }, + databaseId: { + propDefinition: [app, "databaseId"], + description: "The database to list connection strings for", + },
23-26
: Defensive count calc across response shapesMirror the pattern suggested in the other list action for resilience.
- const count = response.data?.length || 0; + const items = Array.isArray(response?.data) ? response.data : (Array.isArray(response) ? response : []); + const count = items.length;
17-21
: Implement pagination forlistConnectionStrings
The
listConnectionStrings
helper in
•components/prisma_management_api/prisma_management_api.app.mjs
(around lines 91–94)
currently just calls_makeRequest
with no loop over anextLink
, so it will only return the first page of results. Likewise, the action in
•components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs
(lines 17–21)
simply forwards that call, without handling pagination.Please update the wrapper (or the action) to:
- Detect and follow a
nextLink
(or equivalent pagination token) in the response, aggregating all pages before returning.- Or expose standard paging controls (e.g.,
top
,skipToken
) so callers can request subsequent pages as needed.components/prisma_management_api/actions/get-project-details/get-project-details.mjs (3)
4-4
: Title case the action name for consistencyMinor naming nit.
- name: "Get Project details", + name: "Get Project Details",
11-16
: Use propDefinition for project selectionImproves UX by letting users select a project from a list.
- projectId: { - type: "string", - label: "Project ID", - description: "The ID of the project to retrieve information for", - }, + projectId: { + propDefinition: [app, "projectId"], + description: "Select the project to retrieve information for", + },
23-25
: Enrich summary with project name when availableSmall UX win.
- $.export("$summary", `Successfully retrieved project information for ID ${this.projectId}`); + const name = response?.name ?? response?.data?.name; + $.export("$summary", `Successfully retrieved project ${name ? `"${name}"` : `ID ${this.projectId}`}`);components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (4)
10-16
: Adopt propDefinition for projectIdFacilitates selection from workspace projects.
- projectId: { - type: "string", - label: "Project ID", - description: "The ID of the project where the database should be created", - }, + projectId: { + propDefinition: [app, "projectId"], + description: "Select the project where the database should be created", + },
16-29
: Prefer dynamic region options from API instead of hardcodingRegions can change; fetch dynamically via
listRegions
. If you have aregion
propDefinition in the app, use that; otherwise add an async options function.Option A (propDefinition):
- region: { - type: "string", - label: "Region", - description: "The AWS region where the database should be created", - options: [ - "us-east-1", - "us-west-1", - "eu-west-3", - "eu-central-1", - "ap-northeast-1", - "ap-southeast-1", - ], - optional: true, - }, + region: { + propDefinition: [app, "region"], + optional: true, + description: "Select the region for the new database", + },Add to
prisma_management_api.app.mjs
if missing:propDefinitions: { // ... region: { type: "string", label: "Region", description: "Select a Prisma Postgres region", async options({ $ }) { const res = await this.listRegions({ $ }); const items = res?.data ?? []; return items.map((r) => ({ label: `${r.name} (${r.id})`, value: r.id })); }, }, },Option B (inline async options if you prefer not to touch the app yet):
- region: { - type: "string", - label: "Region", - description: "The AWS region where the database should be created", - options: [ - "us-east-1", - "us-west-1", - "eu-west-3", - "eu-central-1", - "ap-northeast-1", - "ap-southeast-1", - ], - optional: true, - }, + region: { + type: "string", + label: "Region", + description: "Select the region for the new database", + optional: true, + async options({ $ }) { + const res = await app.listRegions({ $ }); + const items = res?.data ?? []; + return items.map((r) => ({ label: `${r.name} (${r.id})`, value: r.id })); + }, + },
39-42
: Slightly cleaner payload constructionMinor readability improvement using object spread.
- const data = {}; - if (this.region) data.region = this.region; - if (this.isDefault !== undefined) data.default = this.isDefault; + const data = { + ...(this.region && { region: this.region }), + ...(this.isDefault !== undefined && { default: this.isDefault }), + };
49-51
: Use robust ID fallback in summaryMirror the ID fallback used elsewhere.
- $.export("$summary", `Successfully created database in project ${this.projectId}${response.id ? ` with ID ${response.id}` : ""}`); + const id = response?.id ?? response?.data?.id; + $.export("$summary", `Successfully created database in project ${this.projectId}${id ? ` with ID ${id}` : ""}`);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (15)
components/prisma_management_api/README.md
(1 hunks)components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs
(1 hunks)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs
(1 hunks)components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs
(1 hunks)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs
(1 hunks)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs
(1 hunks)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs
(1 hunks)components/prisma_management_api/actions/get-database-details/get-database-details.mjs
(1 hunks)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs
(1 hunks)components/prisma_management_api/actions/get-project-details/get-project-details.mjs
(1 hunks)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs
(1 hunks)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs
(1 hunks)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs
(1 hunks)components/prisma_management_api/package.json
(1 hunks)components/prisma_management_api/prisma_management_api.app.mjs
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2024-12-12T19:23:09.039Z
Learnt from: jcortes
PR: PipedreamHQ/pipedream#14935
File: components/sailpoint/package.json:15-18
Timestamp: 2024-12-12T19:23:09.039Z
Learning: When developing Pipedream components, do not add built-in Node.js modules like `fs` to `package.json` dependencies, as they are native modules provided by the Node.js runtime.
Applied to files:
components/prisma_management_api/package.json
🧬 Code Graph Analysis (13)
components/prisma_management_api/actions/get-database-details/get-database-details.mjs (10)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
response
(32-38)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (4)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)
components/prisma_management_api/prisma_management_api.app.mjs (2)
components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (2)
projectId
(41-41)databaseId
(42-42)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
data
(39-39)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
response
(32-38)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)
components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
response
(32-38)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (2)
response
(18-21)count
(24-24)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
response
(18-21)count
(24-24)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
response
(13-15)count
(18-18)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (9)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
response
(32-38)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (4)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (8)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
response
(32-38)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
response
(13-15)count
(18-18)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (2)
response
(18-21)count
(24-24)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
response
(13-15)count
(18-18)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (11)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(43-47)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
response
(32-38)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
response
(13-15)count
(18-18)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
response
(18-21)count
(24-24)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
response
(13-15)count
(18-18)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (5)
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (5)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
response
(18-21)count
(24-24)
🪛 LanguageTool
components/prisma_management_api/README.md
[grammar] ~25-~25: There might be a mistake here.
Context: ... This action creates a complete project with database and provides connection string...
(QB_NEW_EN)
[grammar] ~33-~33: There might be a mistake here.
Context: ... #### List Projects in Prisma Workspace Retrieves all projects within your Prism...
(QB_NEW_EN)
[grammar] ~36-~36: There might be a mistake here.
Context: ...sma workspace. #### Get Project Details Retrieves detailed information about a s...
(QB_NEW_EN)
[grammar] ~42-~42: There might be a mistake here.
Context: ... retrieve #### Delete Postgres Database Removes an entire Postgres database proj...
(QB_NEW_EN)
[grammar] ~50-~50: There might be a mistake here.
Context: ... Create New Database in Existing Project Adds a new database to an existing Prism...
(QB_NEW_EN)
[grammar] ~58-~58: There might be a mistake here.
Context: ...roject #### List Databases from Project Retrieves all databases within a specifi...
(QB_NEW_EN)
[grammar] ~64-~64: There might be a mistake here.
Context: ...f the project #### Get Database Details Retrieves detailed information about a s...
(QB_NEW_EN)
[grammar] ~70-~70: There might be a mistake here.
Context: ...ase #### Delete Database by Database ID Removes a specific database by its ID. ...
(QB_NEW_EN)
[grammar] ~78-~78: There might be a mistake here.
Context: ... #### Create Database Connection String Generates a new connection string for da...
(QB_NEW_EN)
[grammar] ~85-~85: There might be a mistake here.
Context: ...n #### List Database Connection Strings Retrieves all connection strings for a s...
(QB_NEW_EN)
[grammar] ~91-~91: There might be a mistake here.
Context: ... #### Delete Database Connection String Removes a specific connection string. *...
(QB_NEW_EN)
[grammar] ~99-~99: There might be a mistake here.
Context: ...lities #### Get Prisma Postgres Regions Retrieves the list of available regions ...
(QB_NEW_EN)
[grammar] ~106-~106: There might be a mistake here.
Context: ...in Pipedream. To obtain your API token: 1. Log in to your Prisma account 2. Navigat...
(QB_NEW_EN)
[grammar] ~118-~118: There might be a mistake here.
Context: ...utomated Database Setup for New Projects Trigger a workflow when a new project is...
(QB_NEW_EN)
[grammar] ~121-~121: There might be a mistake here.
Context: ...system. ### Database Cleanup Automation Schedule periodic cleanup of unused data...
(QB_NEW_EN)
[grammar] ~124-~124: There might be a mistake here.
Context: ...s. ### Multi-Region Database Deployment Create databases across multiple regions...
(QB_NEW_EN)
🔇 Additional comments (15)
components/prisma_management_api/package.json (2)
15-17
: Dependency addition looks goodAdding "@pipedream/platform": "^1.5.1" is appropriate for Pipedream actions, and you avoided adding Node built-ins as deps (per our past guidance). JSON structure is valid with the trailing comma after publishConfig.
15-17
: Confirm Pipedream Platform Version AlignmentI scanned every
package.json
and found that:
- components/prisma_management_api/package.json and the repo root use ^1.5.1
- The majority of components have migrated to ^3.x
- Several others are still on ^2.x, ^0.x or various patch versions
Such a spread of major versions can lead to subtle runtime and API differences. Please review whether this package should stay on v1, or be bumped to align with the current stable major across the repo—and then update its
"@pipedream/platform"
range accordingly.components/prisma_management_api/README.md (1)
31-31
: Region list verified
The explicit list in components/prisma_management_api/README.md (line 31) matches the Prisma Postgres regions documented as of August 18, 2025.(Optional) For future-proofing, consider calling the Management API endpoint GET /regions/postgres to retrieve this list programmatically.
components/prisma_management_api/prisma_management_api.app.mjs (1)
8-11
: Confirmed Prisma Management API Base URLThe base URL and version (
https://api.prisma.io/v1
) are correct for endpoints like/projects
,/databases
,/connections
, and/regions/postgres
. No changes required.components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
1-16
: Solid action metadata and props.Name, key, description, and props follow Pipedream conventions and clearly convey the destructive nature of the operation.
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
12-16
: LGTM: clear run flow and concise summary.The call to
this.app.listProjects
and the summary export are consistent with other actions. Returning the raw response is appropriate if callers need full metadata.Also applies to: 22-23
components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (2)
3-16
: Well-defined destructive action and props.Naming, description, and the
connectionId
prop are clear and consistent with the rest of the suite.
17-21
: Parameter name verified
ThedeleteConnectionString
method inprisma_management_api.app.mjs
is declared as:async deleteConnectionString({ connectionId, ...args }) { … }so passing
connectionId: this.connectionId
is correct. No changes needed.components/prisma_management_api/actions/create-postgres-database/create-postgres-database.mjs (1)
40-53
: Nice summary assembly with conditional IDs.Building a clear $summary that includes discovered IDs is helpful for users scanning step results.
components/prisma_management_api/actions/delete-postgres-database/delete-postgres-database.mjs (1)
1-16
: Clear destructive action with accurate labeling.Action metadata, prop definition, and description align with the create/list/get counterparts.
components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
3-16
: Solid action scaffold and consistent metadataNaming, key, description, and props structure align well with other actions in this suite.
17-21
: Verify cursor-based pagination for listDatabasesI didn’t see any pagination logic in the
listDatabases
implementation—it simply forwardsprojectId
(and any extra args) to_makeRequest
. If the Management API paginates, this action will return only the first page. Please:
- Confirm whether
this.app.listDatabases
supports pagination parameters (e.g.cursor
,limit
,page
, etc.).- If it does, update the action to loop through all pages (e.g. calling
listDatabases
with the returned cursor until no more pages).- If it doesn’t paginate (all results are returned at once), add a note in the docs or code comment to affirm no pagination is needed.
Also applies to the similar calls in lines 28–29 of the same file.
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
3-21
: Good, follows the established action patternClear props and description; run implementation matches the app method contract used elsewhere.
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
3-16
: Consistent list action implementationStructure, metadata, and call pattern are consistent with the rest of the actions.
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
3-9
: Well-structured action and clear descriptionThe action follows the established pattern and is easy to follow.
.../actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs
Outdated
Show resolved
Hide resolved
...nagement_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 8
🧹 Nitpick comments (15)
components/prisma_management_api/README.md (2)
99-101
: Reference dynamic regions instead of listing them elsewhereYou already have a “Get Prisma Postgres Regions” utility. Consider adding a sentence here that these regions are fetched dynamically and may change, to avoid drift.
#### Get Prisma Postgres Regions -Retrieves the list of available regions for Prisma Postgres deployment. +Retrieves the list of available regions for Prisma Postgres deployment. This list is dynamic and may change over time.
104-111
: Minor authentication wording cleanupSmall grammar tweak and consistent capitalization.
-This integration uses API Token authentication. You'll need to provide your Prisma Management API Service token when configuring the connection in Pipedream. +This integration uses API token authentication. You'll need to provide your Prisma Management API service token when configuring the connection in Pipedream. -To obtain your API token: -1. Log in to your Prisma account -2. Navigate to your workspace settings -3. Generate a new Service Token -4. Copy the token for use in Pipedream +To obtain your API token: +1. Log in to your Prisma account. +2. Navigate to your workspace settings. +3. Generate a new service token. +4. Copy the token for use in Pipedream.components/prisma_management_api/prisma_management_api.app.mjs (3)
11-21
: Pass context into listRegions for consistency and better instrumentationWhile _makeRequest defaults to this as context, it’s safer and more consistent to pass a context explicitly.
- async options() { - const response = await this.listRegions(); + async options() { + const response = await this.listRegions({ $: this }); const regions = response?.data || []; return regions
24-38
: Avoid default param referencingthis
in destructuring; refactor _makeRequestDefaulting
$ = this
inside the parameter destructuring is brittle. Prefer extracting inside the function and computing a context variable. This also simplifies call sites.- _makeRequest({ - $ = this, path, ...args - }) { - return axios($, { + _makeRequest(params = {}) { + const { $, path, ...args } = params; + const ctx = $ || this; + return axios(ctx, { url: `${this._baseUrl()}${path}`, headers: { Authorization: `Bearer ${this.$auth.api_token}`, "Content-Type": "application/json", }, ...args, }); },
39-141
: Consider pagination helpers for list endpointslistProjects, listDatabases, listConnectionStrings, and listRegions may return paginated results. If the API paginates, expose page/cursor props in actions and/or provide a helper to iterate pages.
I can add a generic paginate method and wire optional props (limit, cursor) into the list actions if the API supports them.
components/prisma_management_api/actions/create-database/create-database.mjs (1)
33-49
: Expose IDs in the action output for easier downstream useReturning only the raw response forces users to traverse nested data. Exporting the IDs alongside the response improves UX.
- return response; + return { + projectId: response?.data?.id, + databaseId: response?.data?.database?.id, + raw: response, + };components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
23-31
: Adjust summary and return message to reflect project deletionUpdate wording to avoid referring to database deletion.
- $.export("$summary", `Successfully deleted Postgres database project with ID ${this.projectId}`); + $.export("$summary", `Successfully deleted Prisma Postgres project with ID ${this.projectId}`);- message: "Database project deleted successfully", + message: "Project deleted successfully",components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
23-26
: Be defensive about response shape and consider paginationIf the API returns an object (e.g., { data: [...] } or { connections: [...] }), counting response.data?.length may be incorrect. Also, if the endpoint paginates, consider optional cursor/limit props.
- const count = response.data?.length || 0; - $.export("$summary", `Successfully retrieved ${count} connection${count !== 1 ? "s" : ""} for database ${this.databaseId}`); + const connections = + Array.isArray(response?.data) ? response.data + : Array.isArray(response?.data?.connections) ? response.data.connections + : Array.isArray(response?.connections) ? response.connections + : []; + const count = connections.length; + $.export("$summary", `Successfully retrieved ${count} connection string${count !== 1 ? "s" : ""} for database ${this.databaseId}`);I can also add optional props (cursor, limit) and wire them into the request if the API supports pagination.
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
27-27
: Optionally return a stable shape with items + raw responseReturning a consistent
{ items, raw }
payload can improve downstream ergonomics while preserving access to the original response.Apply this diff if you want to return both:
- return response; + return { + items, + raw: response, + };
17-25
: Normalize count logic across Prisma Management API actionsSeveral actions still calculate their counts using
response.data?.length || 0
, which will undercount if the API returns the array directly. To keep them in line withlist-projects-in-prisma-workspace
, consider updating these actions to first normalize into anitems
array, then derivecount
:• components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs
– Replace
js const count = response.data?.length || 0;
– With
js const items = Array.isArray(response) ? response : Array.isArray(response?.data) ? response.data : []; const count = items.length;
• components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs
– Same replacement at thecount
assignment (line 24).• components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs
– Same replacement at thecount
assignment (line 18).(Optional) You can also collapse into a one-liner:
const count = Array.isArray(response) ? response.length : Array.isArray(response?.data) ? response.data.length : 0;components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (2)
23-25
: Export summary unconditionally after a successful callIf the API returns 204/empty body,
response
may beundefined
, skipping the summary. Since the call didn’t throw, it’s a success—export the summary unconditionally.Apply this diff:
- if (response || response === null) { - $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`); - } + $.export("$summary", `Successfully deleted database with ID ${this.databaseId}`);
27-31
: Consider returning the API response for consistencyMost actions return the API response. Returning a custom object here is okay, but it’s inconsistent. If you want consistency, return
response
(falling back to a minimal success object on 204).Apply this diff:
- return { - success: true, - databaseId: this.databaseId, - message: "Database deleted successfully", - }; + return response ?? { success: true, databaseId: this.databaseId };components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
11-15
: Optional UX Improvement: Add async project picker
To streamline the “Project ID” input and let users pick from existing projects, you can expose aprojectId
propDefinition that uses the existinglistProjects
method:• In
components/prisma_management_api/prisma_management_api.app.mjs
, extendpropDefinitions
:propDefinitions: { region: { type: "string", label: "Region", }, + projectId: { + type: "string", + label: "Project ID", + async options() { + const projects = await this.listProjects(); + return projects.map(p => ({ + label: p.name || p.id, + value: p.id, + })); + }, + }, },• Then in your action (
get-project-details.mjs
), swap the manual field for a propDefinition reference:- projectId: { - type: "string", - label: "Project ID", - description: "The ID of the project to retrieve information for", - }, + projectId: { + propDefinition: [ "app", "projectId" ], + },This aligns with Pipedream’s patterns and lets users select a project by name.
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (2)
11-15
: Add async options for Project ID selectionThe
prisma_management_api.app.mjs
defines alistProjects
method and apropDefinitions
section (which currently only includesregion
), but there’s noprojectId
propDefinition leveraging it. To improve UX and align with guidelines, add an asyncpropDefinition
forprojectId
that pulls its options fromlistProjects
.• File: components/prisma_management_api/prisma_management_api.app.mjs
– Inside thepropDefinitions
block alongsideregion
, add:propDefinitions: { region: { type: "string", label: "Region", /* … */ }, + projectId: { + propDefinition: [this.app, "projectId"], + }, },This will enable the
projectId
field in your action to show a dropdown populated bylistProjects
.
31-33
: Ensureregion
prop is required in the UI
Theregion
prop uses apropDefinition
but isn’t markedrequired
, so users can still submit the form without selecting one. Addrequired: true
in the action’s props:// components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs region: { propDefinition: [app, "region"], + required: true, },
The runtime guard (
if (!this.region)
) is a good fallback, but marking the prop required prevents users from running the action without a region.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (14)
components/prisma_management_api/README.md
(1 hunks)components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs
(1 hunks)components/prisma_management_api/actions/create-database/create-database.mjs
(1 hunks)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs
(1 hunks)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs
(1 hunks)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs
(1 hunks)components/prisma_management_api/actions/delete-database/delete-database.mjs
(1 hunks)components/prisma_management_api/actions/get-database-details/get-database-details.mjs
(1 hunks)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs
(1 hunks)components/prisma_management_api/actions/get-project-details/get-project-details.mjs
(1 hunks)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs
(1 hunks)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs
(1 hunks)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs
(1 hunks)components/prisma_management_api/prisma_management_api.app.mjs
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (5)
- components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs
- components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs
- components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs
- components/prisma_management_api/actions/get-database-details/get-database-details.mjs
- components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs
🧰 Additional context used
🧬 Code Graph Analysis (7)
components/prisma_management_api/actions/delete-database/delete-database.mjs (10)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(40-44)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)
components/prisma_management_api/actions/create-database/create-database.mjs (12)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(40-44)components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/prisma_management_api.app.mjs (1)
response
(12-12)
components/prisma_management_api/actions/get-project-details/get-project-details.mjs (11)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(40-44)components/prisma_management_api/actions/create-database/create-database.mjs (1)
response
(25-31)components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/prisma_management_api.app.mjs (1)
response
(12-12)
components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (3)
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/prisma_management_api.app.mjs (1)
response
(12-12)
components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (8)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
response
(18-21)count
(24-24)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (2)
response
(13-15)count
(23-23)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
response
(13-15)count
(18-18)components/prisma_management_api/prisma_management_api.app.mjs (1)
response
(12-12)
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (12)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-database/create-database.mjs (1)
response
(25-31)components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
response
(13-15)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (1)
response
(13-15)components/prisma_management_api/prisma_management_api.app.mjs (1)
response
(12-12)
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (11)
components/prisma_management_api/actions/create-database-connection-string/create-database-connection-string.mjs (1)
response
(23-29)components/prisma_management_api/actions/delete-database-by-database-id/delete-database-by-database-id.mjs (1)
response
(18-21)components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
response
(40-44)components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
response
(18-21)components/prisma_management_api/actions/delete-database-connection-string/delete-database-connection-string.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-database-details/get-database-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
response
(18-21)components/prisma_management_api/actions/list-databases-from-project/list-databases-from-project.mjs (2)
response
(18-21)count
(24-24)components/prisma_management_api/actions/list-database-connection-strings/list-database-connection-strings.mjs (2)
response
(18-21)count
(24-24)components/prisma_management_api/actions/get-postgres-regions/get-postgres-regions.mjs (2)
response
(13-15)count
(18-18)components/prisma_management_api/prisma_management_api.app.mjs (1)
response
(12-12)
🪛 LanguageTool
components/prisma_management_api/README.md
[grammar] ~25-~25: There might be a mistake here.
Context: ... This action creates a complete project with database and provides connection string...
(QB_NEW_EN)
[grammar] ~33-~33: There might be a mistake here.
Context: ... #### List Projects in Prisma Workspace Retrieves all projects within your Prism...
(QB_NEW_EN)
[grammar] ~36-~36: There might be a mistake here.
Context: ...sma workspace. #### Get Project Details Retrieves detailed information about a s...
(QB_NEW_EN)
[grammar] ~42-~42: There might be a mistake here.
Context: ...roject to retrieve #### Delete Database Removes an entire Postgres database proj...
(QB_NEW_EN)
[grammar] ~50-~50: There might be a mistake here.
Context: ... Create New Database in Existing Project Adds a new database to an existing Prism...
(QB_NEW_EN)
[grammar] ~58-~58: There might be a mistake here.
Context: ...roject #### List Databases from Project Retrieves all databases within a specifi...
(QB_NEW_EN)
[grammar] ~64-~64: There might be a mistake here.
Context: ...f the project #### Get Database Details Retrieves detailed information about a s...
(QB_NEW_EN)
[grammar] ~70-~70: There might be a mistake here.
Context: ...ase #### Delete Database by Database ID Removes a specific database by its ID. ...
(QB_NEW_EN)
[grammar] ~78-~78: There might be a mistake here.
Context: ... #### Create Database Connection String Generates a new connection string for da...
(QB_NEW_EN)
[grammar] ~85-~85: There might be a mistake here.
Context: ...n #### List Database Connection Strings Retrieves all connection strings for a s...
(QB_NEW_EN)
[grammar] ~91-~91: There might be a mistake here.
Context: ... #### Delete Database Connection String Removes a specific connection string. *...
(QB_NEW_EN)
[grammar] ~99-~99: There might be a mistake here.
Context: ...lities #### Get Prisma Postgres Regions Retrieves the list of available regions ...
(QB_NEW_EN)
[grammar] ~106-~106: There might be a mistake here.
Context: ...in Pipedream. To obtain your API token: 1. Log in to your Prisma account 2. Navigat...
(QB_NEW_EN)
[grammar] ~118-~118: There might be a mistake here.
Context: ...utomated Database Setup for New Projects Trigger a workflow when a new project is...
(QB_NEW_EN)
[grammar] ~121-~121: There might be a mistake here.
Context: ...system. ### Database Cleanup Automation Schedule periodic cleanup of unused data...
(QB_NEW_EN)
[grammar] ~124-~124: There might be a mistake here.
Context: ...s. ### Multi-Region Database Deployment Create databases across multiple regions...
(QB_NEW_EN)
🔇 Additional comments (5)
components/prisma_management_api/actions/create-database/create-database.mjs (1)
24-31
: Confirm request payload shape matches API contractYou’re sending data: { name, region } to createProject. Ensure the endpoint expects these fields at the top level (vs nested under e.g. { project: { name, region } }).
Would you like me to adjust the payload once we confirm the exact schema?
components/prisma_management_api/actions/delete-database/delete-database.mjs (1)
12-15
: Prop label/description are correct for project deletion—keep these as-isGood alignment: the prop is projectId and clearly documents deleting a project.
components/prisma_management_api/actions/list-projects-in-prisma-workspace/list-projects-in-prisma-workspace.mjs (1)
17-25
: Good fix: normalize API response shape before counting itemsThe normalization handles both array and
{ data: [] }
shapes and fixes the earlier incorrectresponse.data?.length
assumption.components/prisma_management_api/actions/get-project-details/get-project-details.mjs (1)
17-27
: LGTM: straightforward get-by-id with summaryImplementation is clear and consistent with the app client pattern. No issues spotted.
components/prisma_management_api/actions/create-new-database-in-existing-project/create-new-database-in-existing-project.mjs (1)
46-48
: Nice touch: conditional ID in summaryIncluding the newly created database ID in the summary when available is helpful.
Hi Pipedream team! 👋
I'm from the Prisma team. This PR adds actions that allows users to automate Prisma Postgres database provisioning, management, and cleanup directly within their Pipedream workflows.
Here are the actions:

All actions have been tested and documented following Pipedream's component guidelines.
Please let me know if any changes are needed from our end.
Thank you!
Summary by CodeRabbit