Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(pieces): generate images, manage storage/users, and inspect models across google-gemini, open-router, supabase (#15389)

Kishan Parmar47b503d35753
diff --git a/bun.lock b/bun.lock
index a60325babcf..2051d39bfcc 100644
--- a/bun.lock
+++ b/bun.lock
@@ -188,7 +188,7 @@
},
"packages/core/utils": {
"name": "@activepieces/core-utils",
- "version": "0.7.0",
+ "version": "0.8.0",
"dependencies": {
"deepmerge-ts": "8.0.2",
"ipaddr.js": "2.3.0",
@@ -3865,7 +3865,7 @@
},
"packages/pieces/community/google-gemini": {
"name": "@activepieces/piece-google-gemini",
- "version": "0.2.0",
+ "version": "0.3.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
@@ -6534,7 +6534,7 @@
},
"packages/pieces/community/open-router": {
"name": "@activepieces/piece-open-router",
- "version": "0.2.0",
+ "version": "0.3.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
@@ -8719,7 +8719,7 @@
},
"packages/pieces/community/supabase": {
"name": "@activepieces/piece-supabase",
- "version": "0.2.0",
+ "version": "0.3.0",
"dependencies": {
"@activepieces/core-piece-types": "workspace:*",
"@activepieces/core-utils": "workspace:*",
diff --git a/packages/pieces/community/google-gemini/package.json b/packages/pieces/community/google-gemini/package.json
index 46181620102..c262a7425e0 100644
--- a/packages/pieces/community/google-gemini/package.json
+++ b/packages/pieces/community/google-gemini/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-google-gemini",
- "version": "0.2.0",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/community/google-gemini/src/index.ts b/packages/pieces/community/google-gemini/src/index.ts
index 62216e01a79..ecb901bca3e 100644
--- a/packages/pieces/community/google-gemini/src/index.ts
+++ b/packages/pieces/community/google-gemini/src/index.ts
@@ -2,9 +2,13 @@ import { createCustomApiCallAction } from '@activepieces/pieces-common';
import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { chatGemini } from './lib/actions/chat-gemini.action';
+import { countTokensAction } from './lib/actions/count-tokens.action';
import { createVideoAction } from './lib/actions/create-video.action';
import { generateContentFromImageAction } from './lib/actions/generate-content-from-image.action';
import { generateContentAction } from './lib/actions/generate-content.action';
+import { generateEmbeddingsAction } from './lib/actions/generate-embeddings.action';
+import { generateImageAction } from './lib/actions/generate-image.action';
+import { listModelsAction } from './lib/actions/list-models.action';
import { textToSpeechAction } from './lib/actions/text-to-speech.action';
import { generateContentWithFileSearchAction } from './lib/actions/generate-content-with-file-search';
import { googleGeminiAuth } from './lib/auth';
@@ -13,7 +17,7 @@ export const googleGemini = createPiece({
displayName: 'Google Gemini',
auth: googleGeminiAuth,
description: 'Use the new Gemini models from Google',
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.87.0',
logoUrl: 'https://cdn.activepieces.com/pieces/google-gemini.png',
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
authors: ["pfernandez98","kishanprmr","MoShizzle","AbdulTheActivePiecer","abuaboud"],
@@ -24,6 +28,10 @@ export const googleGemini = createPiece({
chatGemini,
textToSpeechAction,
createVideoAction,
+ generateImageAction,
+ listModelsAction,
+ generateEmbeddingsAction,
+ countTokensAction,
createCustomApiCallAction({
baseUrl: () => 'https://generativelanguage.googleapis.com/v1beta',
auth: googleGeminiAuth,
diff --git a/packages/pieces/community/google-gemini/src/lib/actions/count-tokens.action.ts b/packages/pieces/community/google-gemini/src/lib/actions/count-tokens.action.ts
new file mode 100644
index 00000000000..3f4bef1c88e
--- /dev/null
+++ b/packages/pieces/community/google-gemini/src/lib/actions/count-tokens.action.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { GoogleGenAI } from '@google/genai';
+import { googleGeminiAuth } from '../auth';
+import { defaultLLM, getGeminiModelOptions } from '../common/common';
+import { countTokensActionOutputSchema } from '../output-schemas';
+
+export const countTokensAction = createAction({
+ audience: 'both',
+ name: 'count_tokens',
+ classification: 'READ',
+ auth: googleGeminiAuth,
+ displayName: 'Count Tokens',
+ description: 'Counts how many tokens a prompt will consume for a given Gemini model.',
+ aiMetadata: {
+ description:
+ 'Counts the tokens a piece of text will consume for a given Gemini model, without generating any content. Use it before generate_content or chat_gemini to check a prompt fits the model\'s input limit or to estimate cost. Idempotent: same text and model always return the same count.',
+ idempotent: true,
+ },
+ props: {
+ text: Property.LongText({
+ displayName: 'Text',
+ required: true,
+ description: 'The text to count tokens for.',
+ }),
+ model: Property.Dropdown({
+ displayName: 'Model',
+ required: true,
+ auth: googleGeminiAuth,
+ refreshers: [],
+ defaultValue: defaultLLM,
+ options: async ({ auth }) => getGeminiModelOptions({ auth }),
+ }),
+ },
+ outputSchema: countTokensActionOutputSchema,
+ async run({ auth, propsValue }) {
+ const { text, model } = propsValue;
+
+ const genAI = new GoogleGenAI({ apiKey: auth.secret_text });
+
+ const response = await genAI.models.countTokens({
+ model,
+ contents: text,
+ });
+
+ return {
+ totalTokens: response.totalTokens ?? null,
+ cachedContentTokenCount: response.cachedContentTokenCount ?? null,
+ };
+ },
+});
diff --git a/packages/pieces/community/google-gemini/src/lib/actions/generate-embeddings.action.ts b/packages/pieces/community/google-gemini/src/lib/actions/generate-embeddings.action.ts
new file mode 100644
index 00000000000..919a871caec
--- /dev/null
+++ b/packages/pieces/community/google-gemini/src/lib/actions/generate-embeddings.action.ts
@@ -0,0 +1,87 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { GoogleGenAI } from '@google/genai';
+import { googleGeminiAuth } from '../auth';
+import { getGeminiEmbeddingModelOptions } from '../common/common';
+import { generateEmbeddingsActionOutputSchema } from '../output-schemas';
+
+export const generateEmbeddingsAction = createAction({
+ audience: 'both',
+ name: 'generate_embeddings',
+ classification: 'READ',
+ auth: googleGeminiAuth,
+ displayName: 'Generate Embeddings',
+ description: 'Converts text into a numerical embedding vector using a Gemini embedding model.',
+ aiMetadata: {
+ description:
+ 'Converts input text into a numerical embedding vector for semantic search, similarity comparison, clustering, or classification. Set Task Type to the intended use (e.g. retrieval_document when indexing content, retrieval_query when searching it) for a better-tuned vector. Idempotent: the same text and settings always produce the same vector.',
+ idempotent: true,
+ },
+ props: {
+ text: Property.LongText({
+ displayName: 'Text',
+ required: true,
+ description: 'The text to generate an embedding for.',
+ }),
+ model: Property.Dropdown({
+ displayName: 'Model',
+ required: true,
+ auth: googleGeminiAuth,
+ refreshers: [],
+ defaultValue: 'gemini-embedding-001',
+ options: async ({ auth }) => getGeminiEmbeddingModelOptions({ auth }),
+ }),
+ taskType: Property.StaticDropdown({
+ displayName: 'Task Type',
+ description: 'Tunes the embedding for how it will be used.',
+ required: false,
+ options: {
+ disabled: false,
+ options: [
+ { label: 'Retrieval Query (searching)', value: 'RETRIEVAL_QUERY' },
+ { label: 'Retrieval Document (indexing)', value: 'RETRIEVAL_DOCUMENT' },
+ { label: 'Semantic Similarity', value: 'SEMANTIC_SIMILARITY' },
+ { label: 'Classification', value: 'CLASSIFICATION' },
+ { label: 'Clustering', value: 'CLUSTERING' },
+ { label: 'Question Answering', value: 'QUESTION_ANSWERING' },
+ ],
+ },
+ }),
+ title: Property.ShortText({
+ displayName: 'Title',
+ description: 'Only used when Task Type is Retrieval Document; improves embedding quality for document search.',
+ required: false,
+ }),
+ outputDimensionality: Property.Number({
+ displayName: 'Output Dimensionality',
+ description: 'Truncate the embedding to this many dimensions. Only supported on newer models.',
+ required: false,
+ }),
+ },
+ outputSchema: generateEmbeddingsActionOutputSchema,
+ async run({ auth, propsValue }) {
+ const { text, model, taskType, title, outputDimensionality } = propsValue;
+
+ const genAI = new GoogleGenAI({ apiKey: auth.secret_text });
+
+ const response = await genAI.models.embedContent({
+ model,
+ contents: text,
+ config: {
+ taskType,
+ title,
+ outputDimensionality,
+ },
+ });
+
+ const embedding = response.embeddings?.[0];
+
+ if (!embedding?.values) {
+ throw new Error('No embedding returned from model response.');
+ }
+
+ return {
+ embedding: embedding.values,
+ dimensions: embedding.values.length,
+ };
+ },
+});
diff --git a/packages/pieces/community/google-gemini/src/lib/actions/generate-image.action.ts b/packages/pieces/community/google-gemini/src/lib/actions/generate-image.action.ts
new file mode 100644
index 00000000000..bb4e2194f7f
--- /dev/null
+++ b/packages/pieces/community/google-gemini/src/lib/actions/generate-image.action.ts
@@ -0,0 +1,99 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { GoogleGenAI } from '@google/genai';
+import mime from 'mime-types';
+import { googleGeminiAuth } from '../auth';
+import { getGeminiImageModelOptions } from '../common/common';
+import { generateImageActionOutputSchema } from '../output-schemas';
+
+export const generateImageAction = createAction({
+ audience: 'both',
+ name: 'generate_image',
+ classification: 'READ',
+ auth: googleGeminiAuth,
+ displayName: 'Generate Image',
+ description: 'Generate an image from a text prompt using a Gemini image model.',
+ aiMetadata: {
+ description:
+ 'Generates an image from a text prompt using a Gemini image-generation model (e.g. Nano Banana) and returns it as a downloadable file. Use this for text-to-image; generate_content_from_image goes the other direction (image in, text out), and create_video is for motion output. Not idempotent: each call renders a new image.',
+ idempotent: false,
+ },
+ props: {
+ prompt: Property.LongText({
+ displayName: 'Prompt',
+ required: true,
+ description: 'Describe the image you want to generate.',
+ }),
+ model: Property.Dropdown({
+ displayName: 'Model',
+ required: true,
+ auth: googleGeminiAuth,
+ refreshers: [],
+ options: async ({ auth }) => getGeminiImageModelOptions({ auth }),
+ }),
+ aspectRatio: Property.StaticDropdown({
+ displayName: 'Aspect Ratio',
+ required: false,
+ defaultValue: '1:1',
+ options: {
+ disabled: false,
+ options: [
+ { label: '1:1 (Square)', value: '1:1' },
+ { label: '2:3 (Portrait)', value: '2:3' },
+ { label: '3:2 (Landscape)', value: '3:2' },
+ { label: '3:4 (Portrait)', value: '3:4' },
+ { label: '4:3 (Landscape)', value: '4:3' },
+ { label: '9:16 (Portrait)', value: '9:16' },
+ { label: '16:9 (Landscape)', value: '16:9' },
+ { label: '21:9 (Widescreen)', value: '21:9' },
+ ],
+ },
+ }),
+ imageSize: Property.StaticDropdown({
+ displayName: 'Image Size',
+ required: false,
+ defaultValue: '1K',
+ options: {
+ disabled: false,
+ options: [
+ { label: '1K', value: '1K' },
+ { label: '2K', value: '2K' },
+ { label: '4K', value: '4K' },
+ ],
+ },
+ }),
+ },
+ outputSchema: generateImageActionOutputSchema,
+ async run({ auth, propsValue, files }) {
+ const { prompt, model, aspectRatio, imageSize } = propsValue;
+
+ const genAI = new GoogleGenAI({ apiKey: auth.secret_text });
+
+ const response = await genAI.models.generateContent({
+ model,
+ contents: prompt,
+ config: {
+ responseModalities: ['IMAGE'],
+ imageConfig: {
+ aspectRatio,
+ imageSize,
+ },
+ },
+ });
+
+ const imagePart = response.candidates?.[0]?.content?.parts?.find(
+ (part) => part.inlineData?.data
+ );
+
+ if (!imagePart?.inlineData?.data) {
+ throw new Error('No image data returned from model response.');
+ }
+
+ const mimeType = imagePart.inlineData.mimeType ?? 'image/png';
+ const extension = mime.extension(mimeType) || 'png';
+
+ return await files.write({
+ data: Buffer.from(imagePart.inlineData.data, 'base64'),
+ fileName: `image.${extension}`,
+ });
+ },
+});
diff --git a/packages/pieces/community/google-gemini/src/lib/actions/list-models.action.ts b/packages/pieces/community/google-gemini/src/lib/actions/list-models.action.ts
new file mode 100644
index 00000000000..c3799f33ad7
--- /dev/null
+++ b/packages/pieces/community/google-gemini/src/lib/actions/list-models.action.ts
@@ -0,0 +1,35 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { googleGeminiAuth } from '../auth';
+import { listAllModels } from '../common/common';
+import { listModelsActionOutputSchema } from '../output-schemas';
+
+export const listModelsAction = createAction({
+ audience: 'both',
+ name: 'list_models',
+ classification: 'SEARCH',
+ auth: googleGeminiAuth,
+ displayName: 'List Models',
+ description: 'Lists the Gemini and Veo models available to this API key.',
+ aiMetadata: {
+ description:
+ 'Lists every Gemini/Veo model available to this API key, with its token limits and supported generation methods. Use this to discover valid model names before calling generate_content, generate_image, create_video, or generate_embeddings, or to check a model\'s input/output token limits. Safe to retry: read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listModelsActionOutputSchema,
+ async run({ auth }) {
+ const models = await listAllModels({ auth });
+
+ return models.map((model) => ({
+ name: model.name.replace('models/', ''),
+ displayName: model.displayName ?? null,
+ description: model.description ?? null,
+ version: model.version ?? null,
+ inputTokenLimit: model.inputTokenLimit ?? null,
+ outputTokenLimit: model.outputTokenLimit ?? null,
+ supportedGenerationMethods: Array.isArray(model.supportedGenerationMethods)
+ ? model.supportedGenerationMethods.join(', ')
+ : null,
+ }));
+ },
+});
diff --git a/packages/pieces/community/google-gemini/src/lib/common/common.ts b/packages/pieces/community/google-gemini/src/lib/common/common.ts
index 8fdd81a6778..ff4833c00be 100644
--- a/packages/pieces/community/google-gemini/src/lib/common/common.ts
+++ b/packages/pieces/community/google-gemini/src/lib/common/common.ts
@@ -30,7 +30,15 @@ const isTtsModel = (model: GeminiModel): boolean =>
const isVeoModel = (model: GeminiModel): boolean =>
model.name.toLowerCase().includes('veo');
-const listAllModels = async ({
+const isImageModel = (model: GeminiModel): boolean =>
+ model.name.toLowerCase().includes('image') &&
+ !isTtsModel(model) &&
+ !isVeoModel(model);
+
+const isEmbeddingModel = (model: GeminiModel): boolean =>
+ model.name.toLowerCase().includes('embedding');
+
+export const listAllModels = async ({
auth,
}: {
auth: GeminiAuth;
@@ -107,11 +115,27 @@ export const getGeminiVideoModelOptions = async ({
auth?: GeminiAuth;
}) => fetchModelOptions({ auth, filter: isVeoModel });
+export const getGeminiImageModelOptions = async ({
+ auth,
+}: {
+ auth?: GeminiAuth;
+}) => fetchModelOptions({ auth, filter: isImageModel });
+
+export const getGeminiEmbeddingModelOptions = async ({
+ auth,
+}: {
+ auth?: GeminiAuth;
+}) => fetchModelOptions({ auth, filter: isEmbeddingModel });
+
type GeminiAuth = AppConnectionValueForAuthProperty<typeof googleGeminiAuth>;
-type GeminiModel = {
+export type GeminiModel = {
name: string;
displayName?: string;
+ description?: string;
+ version?: string;
+ inputTokenLimit?: number;
+ outputTokenLimit?: number;
supportedGenerationMethods?: string[];
};
diff --git a/packages/pieces/community/google-gemini/src/lib/output-schemas.ts b/packages/pieces/community/google-gemini/src/lib/output-schemas.ts
index 7c01bfc8c53..b2aa073d472 100644
--- a/packages/pieces/community/google-gemini/src/lib/output-schemas.ts
+++ b/packages/pieces/community/google-gemini/src/lib/output-schemas.ts
@@ -140,3 +140,63 @@ export const createVideoActionOutputSchema: OutputSchema = {
},
],
};
+
+export const generateImageActionOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'imageFile',
+ label: 'Image File URL',
+ value: '',
+ format: 'url',
+ },
+ ],
+};
+
+export const listModelsActionOutputSchema: OutputSchema = {
+ itemLabel: '{name}',
+ fields: [
+ {
+ key: 'models',
+ label: 'Models',
+ value: '',
+ listItems: [
+ { key: 'name', label: 'Model Name' },
+ { key: 'displayName', label: 'Display Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'version', label: 'Version' },
+ { key: 'inputTokenLimit', label: 'Input Token Limit', format: 'number' },
+ { key: 'outputTokenLimit', label: 'Output Token Limit', format: 'number' },
+ { key: 'supportedGenerationMethods', label: 'Supported Methods' },
+ ],
+ },
+ ],
+};
+
+export const generateEmbeddingsActionOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'embedding',
+ label: 'Embedding Vector',
+ },
+ {
+ key: 'dimensions',
+ label: 'Dimensions',
+ format: 'number',
+ },
+ ],
+};
+
+export const countTokensActionOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'totalTokens',
+ label: 'Total Tokens',
+ format: 'number',
+ },
+ {
+ key: 'cachedContentTokenCount',
+ label: 'Cached Content Token Count',
+ format: 'number',
+ },
+ ],
+};
diff --git a/packages/pieces/community/open-router/package.json b/packages/pieces/community/open-router/package.json
index f547e429b4b..3b54daa3d7c 100644
--- a/packages/pieces/community/open-router/package.json
+++ b/packages/pieces/community/open-router/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-open-router",
- "version": "0.2.0",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"scripts": {
diff --git a/packages/pieces/community/open-router/src/index.ts b/packages/pieces/community/open-router/src/index.ts
index 9cb8617ed9e..cd0519938da 100644
--- a/packages/pieces/community/open-router/src/index.ts
+++ b/packages/pieces/community/open-router/src/index.ts
@@ -1,32 +1,33 @@
-import {
- AuthenticationType,
- createCustomApiCallAction,
- httpClient,
- HttpMethod,
- HttpRequest,
-} from '@activepieces/pieces-common';
-import { createPiece, PieceAuth } from '@activepieces/pieces-framework';
+import { createCustomApiCallAction } from '@activepieces/pieces-common';
+import { createPiece } from '@activepieces/pieces-framework';
import { PieceCategory } from '@activepieces/pieces-framework';
import { askOpenRouterAction } from './lib/actions/ask-open-router';
+import { getCreditsAction } from './lib/actions/get-credits.action';
+import { getCurrentKeyAction } from './lib/actions/get-current-key.action';
+import { listEmbeddingModelsAction } from './lib/actions/list-embedding-models.action';
+import { listModelEndpointsAction } from './lib/actions/list-model-endpoints.action';
+import { listModelsAction } from './lib/actions/list-models.action';
+import { listProvidersAction } from './lib/actions/list-providers.action';
+import { listUserModelsAction } from './lib/actions/list-user-models.action';
import { openRouterAuth } from './lib/auth';
-const markdownDescription = `
-Follow these instructions to get your OpenAI API Key:
-
-1. Visit the following website: https://openrouter.ai/keys.
-2. Once on the website, click on create a key.
-3. Once you have created a key, copy it and use it for the Api key field on the site.
-`;
export const openRouter = createPiece({
displayName: 'OpenRouter',
description: 'Use any AI model to generate code, text, or images via OpenRouter.ai.',
auth: openRouterAuth,
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.87.0',
logoUrl: 'https://cdn.activepieces.com/pieces/open-router.png',
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
authors: ["Salem-Alaa","kishanprmr","MoShizzle","abuaboud"],
actions: [
askOpenRouterAction,
+ listModelsAction,
+ listEmbeddingModelsAction,
+ listUserModelsAction,
+ listModelEndpointsAction,
+ listProvidersAction,
+ getCreditsAction,
+ getCurrentKeyAction,
createCustomApiCallAction({
baseUrl: () => 'https://openrouter.ai/api/v1',
auth: openRouterAuth,
diff --git a/packages/pieces/community/open-router/src/lib/actions/get-credits.action.ts b/packages/pieces/community/open-router/src/lib/actions/get-credits.action.ts
new file mode 100644
index 00000000000..3774c1046f5
--- /dev/null
+++ b/packages/pieces/community/open-router/src/lib/actions/get-credits.action.ts
@@ -0,0 +1,42 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { openRouterAuth } from '../auth';
+import { getCreditsActionOutputSchema } from '../output-schemas';
+
+interface OpenRouterCreditsResponse {
+ data: {
+ total_credits: number;
+ total_usage: number;
+ };
+}
+
+export const getCreditsAction = createAction({
+ audience: 'both',
+ name: 'get_credits',
+ classification: 'READ',
+ auth: openRouterAuth,
+ displayName: 'Get Credits',
+ description: "Gets this account's current API credit balance and total usage.",
+ aiMetadata: {
+ description:
+ "Returns the total credits purchased and total credits used on this OpenRouter account. Call it before a large or batched job to confirm there is enough balance left; a low or exhausted balance makes every paid model generation fail. Safe to retry: read-only.",
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: getCreditsActionOutputSchema,
+ async run({ auth }) {
+ const response = await httpClient.sendRequest<OpenRouterCreditsResponse>({
+ url: 'https://openrouter.ai/api/v1/credits',
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+
+ return {
+ totalCredits: response.body.data.total_credits,
+ totalUsage: response.body.data.total_usage,
+ };
+ },
+});
diff --git a/packages/pieces/community/open-router/src/lib/actions/get-current-key.action.ts b/packages/pieces/community/open-router/src/lib/actions/get-current-key.action.ts
new file mode 100644
index 00000000000..6dee73b8385
--- /dev/null
+++ b/packages/pieces/community/open-router/src/lib/actions/get-current-key.action.ts
@@ -0,0 +1,56 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { openRouterAuth } from '../auth';
+import { getCurrentKeyActionOutputSchema } from '../output-schemas';
+
+interface OpenRouterKeyResponse {
+ data: {
+ label: string;
+ usage: number;
+ limit: number | null;
+ is_free_tier: boolean;
+ rate_limit: {
+ requests: number;
+ interval: string;
+ };
+ };
+}
+
+export const getCurrentKeyAction = createAction({
+ audience: 'both',
+ name: 'get_current_key',
+ classification: 'READ',
+ auth: openRouterAuth,
+ displayName: 'Get API Key Usage',
+ description: 'Gets usage, spend limit, and rate-limit info for your connected API key.',
+ aiMetadata: {
+ description:
+ "Returns metadata for the connected OpenRouter API key: its label, usage so far, spend limit if one is set, whether it is free-tier, and its rate limit. Use it to check remaining headroom before a batch of generations. Safe to retry: read-only.",
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: getCurrentKeyActionOutputSchema,
+ async run({ auth }) {
+ const response = await httpClient.sendRequest<OpenRouterKeyResponse>({
+ url: 'https://openrouter.ai/api/v1/key',
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+
+ const { label, usage, limit, is_free_tier, rate_limit } = response.body.data;
+
+ return {
+ label,
+ usage,
+ limit,
+ isFreeTier: is_free_tier,
+ rateLimit: {
+ requests: rate_limit?.requests ?? null,
+ interval: rate_limit?.interval ?? null,
+ },
+ };
+ },
+});
diff --git a/packages/pieces/community/open-router/src/lib/actions/list-embedding-models.action.ts b/packages/pieces/community/open-router/src/lib/actions/list-embedding-models.action.ts
new file mode 100644
index 00000000000..d55992d839f
--- /dev/null
+++ b/packages/pieces/community/open-router/src/lib/actions/list-embedding-models.action.ts
@@ -0,0 +1,37 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { openRouterAuth } from '../auth';
+import { OpenRouterModel, mapOpenRouterModelSummary } from '../common';
+import { listModelsActionOutputSchema } from '../output-schemas';
+
+export const listEmbeddingModelsAction = createAction({
+ audience: 'both',
+ name: 'list_embedding_models',
+ classification: 'SEARCH',
+ auth: openRouterAuth,
+ displayName: 'List Embedding Models',
+ description: 'Lists the embedding models available through OpenRouter.',
+ aiMetadata: {
+ description:
+ 'Lists only the models in the OpenRouter catalog whose output is an embedding vector, for use as the model id in a raw call to the embeddings endpoint. Pick List Models instead when the target is a text or chat generation model. Safe to retry: read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listModelsActionOutputSchema,
+ async run({ auth }) {
+ const response = await httpClient.sendRequest<{ data: OpenRouterModel[] }>({
+ url: 'https://openrouter.ai/api/v1/models',
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+
+ const embeddingModels = response.body.data.filter((model) =>
+ model.architecture?.output_modalities?.includes('embedding')
+ );
+
+ return embeddingModels.map(mapOpenRouterModelSummary);
+ },
+});
diff --git a/packages/pieces/community/open-router/src/lib/actions/list-model-endpoints.action.ts b/packages/pieces/community/open-router/src/lib/actions/list-model-endpoints.action.ts
new file mode 100644
index 00000000000..6859649641a
--- /dev/null
+++ b/packages/pieces/community/open-router/src/lib/actions/list-model-endpoints.action.ts
@@ -0,0 +1,81 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { openRouterAuth } from '../auth';
+import { OpenRouterEndpoint, OpenRouterModel, mapOpenRouterEndpoint } from '../common';
+import { listModelEndpointsActionOutputSchema } from '../output-schemas';
+
+export const listModelEndpointsAction = createAction({
+ audience: 'both',
+ name: 'list_model_endpoints',
+ classification: 'READ',
+ auth: openRouterAuth,
+ displayName: 'List Providers for a Model',
+ description: 'Lists every provider serving a specific model, with the pricing and uptime each one offers.',
+ aiMetadata: {
+ description:
+ "Lists every provider serving one model on OpenRouter, each with its own pricing, quantization, context length, and uptime. Use it to compare providers for a model discovered with List Models before pinning a request to one. Safe to retry: read-only.",
+ idempotent: true,
+ },
+ props: {
+ model: Property.Dropdown({
+ displayName: 'Model',
+ description: 'The model to list providers for.',
+ required: true,
+ refreshers: [],
+ auth: openRouterAuth,
+ options: async ({ auth }) => {
+ if (!auth) {
+ return {
+ disabled: true,
+ options: [],
+ placeholder: 'Please connect your account first',
+ };
+ }
+ try {
+ const response = await httpClient.sendRequest<{ data: OpenRouterModel[] }>({
+ url: 'https://openrouter.ai/api/v1/models',
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+ return {
+ disabled: false,
+ options: response.body.data.map((model) => ({ label: model.id, value: model.id })),
+ };
+ } catch (error) {
+ return {
+ disabled: true,
+ options: [],
+ placeholder: `Couldn't load models:\n${error}`,
+ };
+ }
+ },
+ }),
+ },
+ outputSchema: listModelEndpointsActionOutputSchema,
+ async run({ auth, propsValue }) {
+ const [author, ...slugParts] = propsValue.model.split('/');
+ const slug = slugParts.join('/');
+
+ const response = await httpClient.sendRequest<{
+ data: { id: string; name: string; endpoints: OpenRouterEndpoint[] };
+ }>({
+ url: `https://openrouter.ai/api/v1/models/${author}/${slug}/endpoints`,
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+
+ const { id, name, endpoints } = response.body.data;
+
+ return {
+ id,
+ name,
+ endpoints: endpoints.map(mapOpenRouterEndpoint),
+ };
+ },
+});
diff --git a/packages/pieces/community/open-router/src/lib/actions/list-models.action.ts b/packages/pieces/community/open-router/src/lib/actions/list-models.action.ts
new file mode 100644
index 00000000000..48c19d89b79
--- /dev/null
+++ b/packages/pieces/community/open-router/src/lib/actions/list-models.action.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { AuthenticationType, httpClient, HttpMethod, QueryParams } from '@activepieces/pieces-common';
+import { openRouterAuth } from '../auth';
+import { OpenRouterModel, mapOpenRouterModelSummary } from '../common';
+import { listModelsActionOutputSchema } from '../output-schemas';
+
+const MODEL_CATEGORIES = [
+ 'programming',
+ 'roleplay',
+ 'marketing',
+ 'marketing/seo',
+ 'technology',
+ 'science',
+ 'translation',
+ 'legal',
+ 'finance',
+ 'health',
+ 'trivia',
+ 'academia',
+];
+
+export const listModelsAction = createAction({
+ audience: 'both',
+ name: 'list_models',
+ classification: 'SEARCH',
+ auth: openRouterAuth,
+ displayName: 'List Models',
+ description: 'Lists the models available through OpenRouter, with pricing and context limits.',
+ aiMetadata: {
+ description:
+ 'Lists every model in the OpenRouter catalog, with context length, per-token pricing, and supported parameters. Use this to discover a valid model id before calling Ask LLM or Chat Completion, or to compare pricing and context limits across providers. Optionally filter by category. Safe to retry: read-only.',
+ idempotent: true,
+ },
+ props: {
+ category: Property.StaticDropdown({
+ displayName: 'Category',
+ description: 'Only return models tagged for this use case.',
+ required: false,
+ options: {
+ disabled: false,
+ options: MODEL_CATEGORIES.map((category) => ({ label: category, value: category })),
+ },
+ }),
+ },
+ outputSchema: listModelsActionOutputSchema,
+ async run({ auth, propsValue }) {
+ const queryParams: QueryParams = {};
+ if (propsValue.category) {
+ queryParams['category'] = propsValue.category;
+ }
+
+ const response = await httpClient.sendRequest<{ data: OpenRouterModel[] }>({
+ url: 'https://openrouter.ai/api/v1/models',
+ method: HttpMethod.GET,
+ queryParams,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+
+ return response.body.data.map(mapOpenRouterModelSummary);
+ },
+});
diff --git a/packages/pieces/community/open-router/src/lib/actions/list-providers.action.ts b/packages/pieces/community/open-router/src/lib/actions/list-providers.action.ts
new file mode 100644
index 00000000000..08933da584c
--- /dev/null
+++ b/packages/pieces/community/open-router/src/lib/actions/list-providers.action.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { openRouterAuth } from '../auth';
+import { OpenRouterProvider } from '../common';
+import { listProvidersActionOutputSchema } from '../output-schemas';
+
+export const listProvidersAction = createAction({
+ audience: 'both',
+ name: 'list_providers',
+ classification: 'SEARCH',
+ auth: openRouterAuth,
+ displayName: 'List Providers',
+ description: 'Lists the upstream AI model providers routed through OpenRouter.',
+ aiMetadata: {
+ description:
+ 'Lists every upstream provider OpenRouter can route requests to (e.g. Azure, CoreWeave, Cerebras), with headquarters and policy links. Use it to see which providers exist before restricting a model to specific providers with provider routing options. Safe to retry: read-only.',
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listProvidersActionOutputSchema,
+ async run({ auth }) {
+ const response = await httpClient.sendRequest<{ data: OpenRouterProvider[] }>({
+ url: 'https://openrouter.ai/api/v1/providers',
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+
+ return response.body.data;
+ },
+});
diff --git a/packages/pieces/community/open-router/src/lib/actions/list-user-models.action.ts b/packages/pieces/community/open-router/src/lib/actions/list-user-models.action.ts
new file mode 100644
index 00000000000..f3ab7a441d7
--- /dev/null
+++ b/packages/pieces/community/open-router/src/lib/actions/list-user-models.action.ts
@@ -0,0 +1,33 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { AuthenticationType, httpClient, HttpMethod } from '@activepieces/pieces-common';
+import { openRouterAuth } from '../auth';
+import { OpenRouterModel, mapOpenRouterModelSummary } from '../common';
+import { listModelsActionOutputSchema } from '../output-schemas';
+
+export const listUserModelsAction = createAction({
+ audience: 'both',
+ name: 'list_user_models',
+ classification: 'SEARCH',
+ auth: openRouterAuth,
+ displayName: 'List My Available Models',
+ description: "Lists the models your account can actually use once your provider preferences, privacy settings, and guardrails are applied.",
+ aiMetadata: {
+ description:
+ "Lists the OpenRouter models this account can actually use once its provider preferences, privacy settings, and guardrails are applied - narrower than List Models when the account has restrictions configured. Use it to confirm a model is reachable before calling it. Safe to retry: read-only.",
+ idempotent: true,
+ },
+ props: {},
+ outputSchema: listModelsActionOutputSchema,
+ async run({ auth }) {
+ const response = await httpClient.sendRequest<{ data: OpenRouterModel[] }>({
+ url: 'https://openrouter.ai/api/v1/models/user',
+ method: HttpMethod.GET,
+ authentication: {
+ type: AuthenticationType.BEARER_TOKEN,
+ token: auth.secret_text,
+ },
+ });
+
+ return response.body.data.map(mapOpenRouterModelSummary);
+ },
+});
diff --git a/packages/pieces/community/open-router/src/lib/common/index.ts b/packages/pieces/community/open-router/src/lib/common/index.ts
index 29a39934487..5edea151b82 100644
--- a/packages/pieces/community/open-router/src/lib/common/index.ts
+++ b/packages/pieces/community/open-router/src/lib/common/index.ts
@@ -1,3 +1,27 @@
+export const mapOpenRouterModelSummary = (model: OpenRouterModel) => ({
+ id: model.id,
+ name: model.name,
+ description: model.description ?? null,
+ contextLength: model.context_length ?? null,
+ promptPrice: model.pricing?.prompt ?? null,
+ completionPrice: model.pricing?.completion ?? null,
+ supportedParameters: model.supported_parameters?.join(', ') ?? null,
+});
+
+export const mapOpenRouterEndpoint = (endpoint: OpenRouterEndpoint) => ({
+ name: endpoint.name,
+ modelId: endpoint.model_id ?? null,
+ modelName: endpoint.model_name ?? null,
+ providerName: endpoint.provider_name,
+ contextLength: endpoint.context_length,
+ promptPrice: endpoint.pricing?.prompt ?? null,
+ completionPrice: endpoint.pricing?.completion ?? null,
+ quantization: endpoint.quantization,
+ maxCompletionTokens: endpoint.max_completion_tokens,
+ status: endpoint.status,
+ uptimeLast30m: endpoint.uptime_last_30m,
+});
+
export interface promptResponse {
choices: {
text: string;
@@ -11,3 +35,46 @@ export interface openRouterModels {
id: string;
}[];
}
+
+export interface OpenRouterModel {
+ id: string;
+ name: string;
+ description?: string;
+ context_length?: number;
+ architecture?: {
+ modality?: string;
+ input_modalities?: string[];
+ output_modalities?: string[];
+ };
+ pricing?: {
+ prompt?: string;
+ completion?: string;
+ };
+ supported_parameters?: string[];
+}
+
+export interface OpenRouterProvider {
+ name: string;
+ slug: string;
+ privacy_policy_url: string | null;
+ terms_of_service_url: string | null;
+ status_page_url: string | null;
+ headquarters: string | null;
+ datacenters: string[] | null;
+}
+
+export interface OpenRouterEndpoint {
+ name: string;
+ model_id?: string;
+ model_name?: string;
+ provider_name: string;
+ context_length: number | null;
+ pricing?: {
+ prompt?: string;
+ completion?: string;
+ };
+ quantization: string | null;
+ max_completion_tokens: number | null;
+ status: number;
+ uptime_last_30m: number | null;
+}
diff --git a/packages/pieces/community/open-router/src/lib/output-schemas.ts b/packages/pieces/community/open-router/src/lib/output-schemas.ts
index 88ffebfdccc..12fb5f8e3c3 100644
--- a/packages/pieces/community/open-router/src/lib/output-schemas.ts
+++ b/packages/pieces/community/open-router/src/lib/output-schemas.ts
@@ -1,4 +1,4 @@
-import { OutputSchema } from '@activepieces/pieces-framework';
+import { OutputSchema, OutputSchemaField } from '@activepieces/pieces-framework';
export const askLmmActionOutputSchema: OutputSchema = {
fields: [
@@ -10,3 +10,95 @@ export const askLmmActionOutputSchema: OutputSchema = {
},
],
};
+
+const modelSummaryListItems: OutputSchemaField[] = [
+ { key: 'id', label: 'Model ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'description', label: 'Description' },
+ { key: 'contextLength', label: 'Context Length', format: 'number' },
+ { key: 'promptPrice', label: 'Prompt Price (per token)' },
+ { key: 'completionPrice', label: 'Completion Price (per token)' },
+ { key: 'supportedParameters', label: 'Supported Parameters' },
+];
+
+export const listModelsActionOutputSchema: OutputSchema = {
+ itemLabel: '{id}',
+ fields: [
+ {
+ key: 'models',
+ label: 'Models',
+ value: '',
+ listItems: modelSummaryListItems,
+ },
+ ],
+};
+
+export const listProvidersActionOutputSchema: OutputSchema = {
+ itemLabel: '{name}',
+ fields: [
+ {
+ key: 'providers',
+ label: 'Providers',
+ value: '',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ { key: 'slug', label: 'Slug' },
+ { key: 'headquarters', label: 'Headquarters' },
+ { key: 'privacy_policy_url', label: 'Privacy Policy URL', format: 'url' },
+ { key: 'terms_of_service_url', label: 'Terms of Service URL', format: 'url' },
+ { key: 'status_page_url', label: 'Status Page URL', format: 'url' },
+ ],
+ },
+ ],
+};
+
+const endpointListItems: OutputSchemaField[] = [
+ { key: 'name', label: 'Endpoint Name' },
+ { key: 'modelId', label: 'Model ID' },
+ { key: 'modelName', label: 'Model Name' },
+ { key: 'providerName', label: 'Provider' },
+ { key: 'contextLength', label: 'Context Length', format: 'number' },
+ { key: 'promptPrice', label: 'Prompt Price (per token)' },
+ { key: 'completionPrice', label: 'Completion Price (per token)' },
+ { key: 'quantization', label: 'Quantization' },
+ { key: 'maxCompletionTokens', label: 'Max Completion Tokens', format: 'number' },
+ { key: 'uptimeLast30m', label: 'Uptime (last 30m %)', format: 'number' },
+];
+
+export const listModelEndpointsActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'Model ID' },
+ { key: 'name', label: 'Model Name' },
+ {
+ key: 'endpoints',
+ label: 'Endpoints',
+ value: '',
+ listItems: endpointListItems,
+ },
+ ],
+};
+
+export const getCreditsActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'totalCredits', label: 'Total Credits', format: 'number' },
+ { key: 'totalUsage', label: 'Total Usage', format: 'number' },
+ ],
+};
+
+export const getCurrentKeyActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'label', label: 'Key Label' },
+ { key: 'usage', label: 'Usage', format: 'number' },
+ { key: 'limit', label: 'Limit', format: 'number' },
+ { key: 'isFreeTier', label: 'Is Free Tier', format: 'boolean' },
+ {
+ key: 'rateLimit',
+ label: 'Rate Limit',
+ value: 'rateLimit',
+ children: [
+ { key: 'requests', label: 'Requests', format: 'number' },
+ { key: 'interval', label: 'Interval' },
+ ],
+ },
+ ],
+};
diff --git a/packages/pieces/community/supabase/package.json b/packages/pieces/community/supabase/package.json
index e036ff72409..147fa91cee4 100644
--- a/packages/pieces/community/supabase/package.json
+++ b/packages/pieces/community/supabase/package.json
@@ -1,6 +1,6 @@
{
"name": "@activepieces/piece-supabase",
- "version": "0.2.0",
+ "version": "0.3.0",
"main": "./dist/src/index.js",
"types": "./dist/src/index.d.ts",
"dependencies": {
diff --git a/packages/pieces/community/supabase/src/index.ts b/packages/pieces/community/supabase/src/index.ts
index ebf9a616095..9a41f55db0d 100644
--- a/packages/pieces/community/supabase/src/index.ts
+++ b/packages/pieces/community/supabase/src/index.ts
@@ -1,10 +1,7 @@
import { createCustomApiCallAction } from '@activepieces/pieces-common';
import {
createPiece,
- PieceAuth,
- Property,
} from '@activepieces/pieces-framework';
-import { createClient } from '@supabase/supabase-js';
import { PieceCategory } from '@activepieces/pieces-framework';
import { uploadFile } from './lib/actions/upload-file';
import { createRow } from './lib/actions/create-row';
@@ -14,39 +11,27 @@ import { upsertRow } from './lib/actions/upsert-row';
import { searchRows } from './lib/actions/search-rows';
import { listTables } from './lib/actions/list-tables';
import { getTableSchema } from './lib/actions/get-table-schema';
+import { createBucket } from './lib/actions/create-bucket';
+import { deleteBucket } from './lib/actions/delete-bucket';
+import { listBuckets } from './lib/actions/list-buckets';
+import { listFiles } from './lib/actions/list-files';
+import { downloadFile } from './lib/actions/download-file';
+import { deleteFile } from './lib/actions/delete-file';
+import { createSignedUrl } from './lib/actions/create-signed-url';
+import { listUsers } from './lib/actions/list-users';
+import { getUser } from './lib/actions/get-user';
+import { createUser } from './lib/actions/create-user';
+import { updateUser } from './lib/actions/update-user';
+import { deleteUser } from './lib/actions/delete-user';
+import { inviteUser } from './lib/actions/invite-user';
import { newRow } from './lib/triggers/new-row';
import { supabaseAuth } from './lib/auth';
-const markdown = `
-## Supabase Connection Setup
-
-### 1. Get Your Project URL
-- Go to your [Supabase Dashboard](https://supabase.com/dashboard)
-- Select your project
-- Go to **Settings** → **API**
-- Copy the **Project URL** (format: \`https://your-project-ref.supabase.co\`)
-
-### 2. Get Your API Key
-Choose the appropriate key based on your use case:
-
-**For Actions (Database Operations):**
-- Use **Service Role Key** (secret) for server-side operations
-- Has full access to bypass Row Level Security (RLS)
-
-**For Triggers (Webhooks):**
-- Use **Anonymous Key** (public) if your webhooks don't need elevated permissions
-- Use **Service Role Key** for elevated permissions
-
-**Security Note:** Keep your Service Role Key secret - it bypasses all RLS policies.
-
-Find your keys in **Settings** → **API** → **Project API keys**
-`;
-
export const supabase = createPiece({
displayName: 'Supabase',
description: 'The open-source Firebase alternative',
auth: supabaseAuth,
- minimumSupportedRelease: '0.30.0',
+ minimumSupportedRelease: '0.87.0',
logoUrl: 'https://cdn.activepieces.com/pieces/supabase.png',
categories: [PieceCategory.DEVELOPER_TOOLS],
authors: ["kishanprmr","MoShizzle","abuaboud","fortunamide"],
@@ -59,6 +44,19 @@ export const supabase = createPiece({
searchRows,
listTables,
getTableSchema,
+ createBucket,
+ deleteBucket,
+ listBuckets,
+ listFiles,
+ downloadFile,
+ deleteFile,
+ createSignedUrl,
+ listUsers,
+ getUser,
+ createUser,
+ updateUser,
+ deleteUser,
+ inviteUser,
createCustomApiCallAction({
baseUrl: (auth) => auth?.props?.url || '',
auth: supabaseAuth,
diff --git a/packages/pieces/community/supabase/src/lib/actions/create-bucket.ts b/packages/pieces/community/supabase/src/lib/actions/create-bucket.ts
new file mode 100644
index 00000000000..0a4204e6b94
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/create-bucket.ts
@@ -0,0 +1,52 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { createBucketActionOutputSchema } from '../output-schemas';
+
+export const createBucket = createAction({
+ name: 'create_bucket',
+ classification: 'WRITE',
+ displayName: 'Create Storage Bucket',
+ description: 'Creates a new Storage bucket, public or private.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Creates a new Storage bucket with a given name, either public (files reachable by direct URL) or private (files require a signed URL or download). Use before uploading files to a bucket that does not exist yet. Not idempotent: creating a bucket with a name that already exists errors.',
+ idempotent: false,
+ },
+ auth: supabaseAuth,
+ props: {
+ name: Property.ShortText({
+ displayName: 'Bucket Name',
+ required: true,
+ }),
+ public: Property.Checkbox({
+ displayName: 'Public',
+ description: 'Whether files in this bucket are publicly readable by URL.',
+ required: false,
+ defaultValue: false,
+ }),
+ fileSizeLimit: Property.Number({
+ displayName: 'File Size Limit (bytes)',
+ required: false,
+ }),
+ },
+ outputSchema: createBucketActionOutputSchema,
+ async run(context) {
+ const { name, public: isPublic, fileSizeLimit } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.storage.createBucket(name, {
+ public: isPublic ?? false,
+ fileSizeLimit: fileSizeLimit || undefined,
+ });
+
+ if (error) {
+ throw new Error(`Failed to create bucket: ${error.message}`);
+ }
+
+ return {
+ name: data.name,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/create-signed-url.ts b/packages/pieces/community/supabase/src/lib/actions/create-signed-url.ts
new file mode 100644
index 00000000000..a84f7cef000
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/create-signed-url.ts
@@ -0,0 +1,53 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { createSignedUrlActionOutputSchema } from '../output-schemas';
+
+export const createSignedUrl = createAction({
+ name: 'create_signed_url',
+ classification: 'READ',
+ displayName: 'Create Temporary File Link',
+ description: 'Generates a time-limited URL that grants temporary access to a file in a private Storage bucket.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Generates a time-limited signed URL for a file in a Storage bucket, so it can be accessed (e.g. shared or fetched) without making the bucket public. Use for files in private buckets, or when a temporary link is preferable to returning the full file content. Read-only and idempotent: repeated calls just mint a new link with the same expiry window.',
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ bucket: Property.ShortText({
+ displayName: 'Bucket',
+ description: 'The name of the Storage bucket.',
+ required: true,
+ }),
+ path: Property.ShortText({
+ displayName: 'File Path',
+ description: 'The path of the file within the bucket.',
+ required: true,
+ }),
+ expiresIn: Property.Number({
+ displayName: 'Expires In (seconds)',
+ description: 'How long the link stays valid, in seconds.',
+ required: false,
+ defaultValue: 3600,
+ }),
+ },
+ outputSchema: createSignedUrlActionOutputSchema,
+ async run(context) {
+ const { bucket, path, expiresIn } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.storage
+ .from(bucket)
+ .createSignedUrl(path, expiresIn || 3600);
+
+ if (error) {
+ throw new Error(`Failed to create signed URL: ${error.message}`);
+ }
+
+ return {
+ signedUrl: data.signedUrl,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/create-user.ts b/packages/pieces/community/supabase/src/lib/actions/create-user.ts
new file mode 100644
index 00000000000..6546b883827
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/create-user.ts
@@ -0,0 +1,70 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { createUserActionOutputSchema } from '../output-schemas';
+
+export const createUser = createAction({
+ name: 'create_user',
+ classification: 'WRITE',
+ displayName: 'Create User',
+ description: 'Creates a new user directly in the project\'s Auth system, with an immediately usable password. Requires the Service Role Key.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Creates a new user in Auth with an email/phone and password that can sign in immediately, skipping the invite/confirmation email flow. Requires the Service Role Key. Use for programmatic account provisioning; use Invite User by Email instead if the user should set their own password via an email link. Not idempotent: calling twice with the same email creates a conflict error, not a second identical user.',
+ idempotent: false,
+ },
+ auth: supabaseAuth,
+ props: {
+ email: Property.ShortText({
+ displayName: 'Email',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'Phone',
+ required: false,
+ }),
+ password: Property.ShortText({
+ displayName: 'Password',
+ required: false,
+ }),
+ emailConfirm: Property.Checkbox({
+ displayName: 'Mark Email as Confirmed',
+ required: false,
+ defaultValue: false,
+ }),
+ userMetadata: Property.Json({
+ displayName: 'User Metadata',
+ description: 'Custom data to attach to the user, as a JSON object.',
+ required: false,
+ }),
+ },
+ outputSchema: createUserActionOutputSchema,
+ async run(context) {
+ const { email, phone, password, emailConfirm, userMetadata } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ if (!email && !phone) {
+ throw new Error('Either Email or Phone must be provided.');
+ }
+
+ const { data, error } = await supabase.auth.admin.createUser({
+ email,
+ phone,
+ password,
+ email_confirm: emailConfirm,
+ user_metadata: (userMetadata as Record<string, unknown>) ?? undefined,
+ });
+
+ if (error) {
+ throw new Error(`Failed to create user: ${error.message}`);
+ }
+
+ return {
+ id: data.user.id,
+ email: data.user.email ?? null,
+ phone: data.user.phone ?? null,
+ created_at: data.user.created_at,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/delete-bucket.ts b/packages/pieces/community/supabase/src/lib/actions/delete-bucket.ts
new file mode 100644
index 00000000000..1663b5ff87f
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/delete-bucket.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { deleteBucketActionOutputSchema } from '../output-schemas';
+
+export const deleteBucket = createAction({
+ name: 'delete_bucket',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete Storage Bucket',
+ description: 'Permanently deletes a Storage bucket. The bucket must be empty first.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Permanently deletes a Storage bucket by name. The bucket must already be empty (delete its files first) or the call fails. Use only once you have confirmed the bucket name and that it should be removed entirely. Idempotent: deleting an already-deleted bucket errors without further effect.',
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ name: Property.ShortText({
+ displayName: 'Bucket Name',
+ required: true,
+ }),
+ },
+ outputSchema: deleteBucketActionOutputSchema,
+ async run(context) {
+ const { name } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { error } = await supabase.storage.deleteBucket(name);
+
+ if (error) {
+ throw new Error(`Failed to delete bucket: ${error.message}`);
+ }
+
+ return {
+ success: true,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/delete-file.ts b/packages/pieces/community/supabase/src/lib/actions/delete-file.ts
new file mode 100644
index 00000000000..2b1f3ae259d
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/delete-file.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { deleteFileActionOutputSchema } from '../output-schemas';
+
+export const deleteFile = createAction({
+ name: 'delete_file',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete File',
+ description: 'Permanently deletes one or more files from a Storage bucket.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Permanently deletes one or more files from a Storage bucket, given their full paths. Use only once you have confirmed the paths (List Files in Bucket first). Idempotent: re-running on paths that no longer exist deletes nothing further.',
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ bucket: Property.ShortText({
+ displayName: 'Bucket',
+ description: 'The name of the Storage bucket.',
+ required: true,
+ }),
+ paths: Property.Array({
+ displayName: 'File Paths',
+ description: 'Paths of the files to delete within the bucket.',
+ required: true,
+ }),
+ },
+ outputSchema: deleteFileActionOutputSchema,
+ async run(context) {
+ const { bucket, paths } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.storage.from(bucket).remove(paths as string[]);
+
+ if (error) {
+ throw new Error(`Failed to delete file(s): ${error.message}`);
+ }
+
+ return {
+ deleted_files: (data ?? []).map((file) => ({
+ name: file.name,
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/delete-user.ts b/packages/pieces/community/supabase/src/lib/actions/delete-user.ts
new file mode 100644
index 00000000000..998175c2e6e
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/delete-user.ts
@@ -0,0 +1,39 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { deleteUserActionOutputSchema } from '../output-schemas';
+
+export const deleteUser = createAction({
+ name: 'delete_user',
+ classification: 'DESTRUCTIVE',
+ displayName: 'Delete User',
+ description: 'Permanently deletes a user from the project\'s Auth system. Requires the Service Role Key.',
+ audience: 'both',
+ aiMetadata: {
+ description: "Permanently deletes a user from Auth by ID, removing their ability to sign in. Requires the Service Role Key. Use only once you have confirmed the user ID (Get User or List Users first) — this cannot be undone. Idempotent: deleting an already-deleted user ID errors without further effect.",
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ required: true,
+ }),
+ },
+ outputSchema: deleteUserActionOutputSchema,
+ async run(context) {
+ const { userId } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { error } = await supabase.auth.admin.deleteUser(userId);
+
+ if (error) {
+ throw new Error(`Failed to delete user: ${error.message}`);
+ }
+
+ return {
+ success: true,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/download-file.ts b/packages/pieces/community/supabase/src/lib/actions/download-file.ts
new file mode 100644
index 00000000000..443fd91143c
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/download-file.ts
@@ -0,0 +1,50 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { downloadFileActionOutputSchema } from '../output-schemas';
+
+export const downloadFile = createAction({
+ name: 'download_file',
+ classification: 'READ',
+ displayName: 'Download File',
+ description: 'Downloads a file from a Storage bucket and returns its content as base64.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Downloads a file from a Storage bucket by its path and returns its content as base64, along with its MIME type and size. Use when you need the actual file content rather than a link (for example, to read a small text/JSON file or pass an image on for processing). For large files, prefer Create Temporary File Link instead of loading the full content. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ bucket: Property.ShortText({
+ displayName: 'Bucket',
+ description: 'The name of the Storage bucket.',
+ required: true,
+ }),
+ path: Property.ShortText({
+ displayName: 'File Path',
+ description: 'The path of the file within the bucket.',
+ required: true,
+ }),
+ },
+ outputSchema: downloadFileActionOutputSchema,
+ async run(context) {
+ const { bucket, path } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.storage.from(bucket).download(path);
+
+ if (error) {
+ throw new Error(`Failed to download file: ${error.message}`);
+ }
+
+ const arrayBuffer = await data.arrayBuffer();
+ const base64 = Buffer.from(arrayBuffer).toString('base64');
+
+ return {
+ base64,
+ mimeType: data.type,
+ size: data.size,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/get-user.ts b/packages/pieces/community/supabase/src/lib/actions/get-user.ts
new file mode 100644
index 00000000000..d825d4b9aff
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/get-user.ts
@@ -0,0 +1,47 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { getUserActionOutputSchema } from '../output-schemas';
+
+export const getUser = createAction({
+ name: 'get_user',
+ classification: 'READ',
+ displayName: 'Get User',
+ description: 'Gets a single user\'s Auth record by ID. Requires the Service Role Key.',
+ audience: 'both',
+ aiMetadata: {
+ description: "Returns a single user's Auth record (email, phone, metadata, confirmation and sign-in timestamps) by user ID. Requires the Service Role Key. Use after List Users to inspect one account in full. Read-only and idempotent.",
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ required: true,
+ }),
+ },
+ outputSchema: getUserActionOutputSchema,
+ async run(context) {
+ const { userId } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.auth.admin.getUserById(userId);
+
+ if (error) {
+ throw new Error(`Failed to get user: ${error.message}`);
+ }
+
+ const user = data.user;
+ return {
+ id: user.id,
+ email: user.email ?? null,
+ phone: user.phone ?? null,
+ user_metadata: user.user_metadata ?? {},
+ app_metadata: user.app_metadata ?? {},
+ created_at: user.created_at,
+ last_sign_in_at: user.last_sign_in_at ?? null,
+ confirmed_at: user.confirmed_at ?? null,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/invite-user.ts b/packages/pieces/community/supabase/src/lib/actions/invite-user.ts
new file mode 100644
index 00000000000..ccfb9d0733b
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/invite-user.ts
@@ -0,0 +1,54 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { inviteUserActionOutputSchema } from '../output-schemas';
+
+export const inviteUser = createAction({
+ name: 'invite_user',
+ classification: 'WRITE',
+ displayName: 'Invite User by Email',
+ description: 'Sends an invite email to a new user, who sets their own password when accepting. Requires the Service Role Key.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Creates a new user and sends them an invite email with a link to set their own password. Requires the Service Role Key. Use for user-facing onboarding; use Create User instead when you need to provision a login programmatically without an email step. Not idempotent: calling twice for the same email errors on the second call once the account exists.',
+ idempotent: false,
+ },
+ auth: supabaseAuth,
+ props: {
+ email: Property.ShortText({
+ displayName: 'Email',
+ required: true,
+ }),
+ userMetadata: Property.Json({
+ displayName: 'User Metadata',
+ description: 'Custom data to attach to the user, as a JSON object.',
+ required: false,
+ }),
+ redirectTo: Property.ShortText({
+ displayName: 'Redirect URL',
+ description: 'Where to redirect the user after they accept the invite.',
+ required: false,
+ }),
+ },
+ outputSchema: inviteUserActionOutputSchema,
+ async run(context) {
+ const { email, userMetadata, redirectTo } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.auth.admin.inviteUserByEmail(email, {
+ data: (userMetadata as Record<string, unknown>) ?? undefined,
+ redirectTo,
+ });
+
+ if (error) {
+ throw new Error(`Failed to invite user: ${error.message}`);
+ }
+
+ return {
+ id: data.user.id,
+ email: data.user.email ?? null,
+ invited_at: data.user.invited_at ?? null,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/list-buckets.ts b/packages/pieces/community/supabase/src/lib/actions/list-buckets.ts
new file mode 100644
index 00000000000..a8b41e70cc4
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/list-buckets.ts
@@ -0,0 +1,39 @@
+import { createAction } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { listBucketsActionOutputSchema } from '../output-schemas';
+
+export const listBuckets = createAction({
+ name: 'list_buckets',
+ classification: 'READ',
+ displayName: 'List Storage Buckets',
+ description: 'Lists all Storage buckets in the project.',
+ audience: 'both',
+ aiMetadata: {
+ description: 'Lists every Storage bucket in the connected Supabase project, with each bucket\'s visibility (public/private) and file size limit. Use to discover which buckets exist before uploading, listing, or downloading files. Read-only and idempotent.',
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {},
+ outputSchema: listBucketsActionOutputSchema,
+ async run(context) {
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.storage.listBuckets();
+
+ if (error) {
+ throw new Error(`Failed to list buckets: ${error.message}`);
+ }
+
+ return {
+ buckets: (data ?? []).map((bucket) => ({
+ id: bucket.id,
+ name: bucket.name,
+ public: bucket.public,
+ created_at: bucket.created_at,
+ updated_at: bucket.updated_at,
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/list-files.ts b/packages/pieces/community/supabase/src/lib/actions/list-files.ts
new file mode 100644
index 00000000000..3da0f3dd4d0
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/list-files.ts
@@ -0,0 +1,53 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { listFilesActionOutputSchema } from '../output-schemas';
+
+export const listFiles = createAction({
+ name: 'list_files',
+ classification: 'SEARCH',
+ displayName: 'List Files in Bucket',
+ description: 'Lists files and folders inside a Storage bucket, optionally under a specific folder path.',
+ audience: 'both',
+ aiMetadata: {
+ description: "Lists files and folders inside a Storage bucket, optionally scoped to a folder path. Use to discover what's already stored before downloading, deleting, or generating a link for a file. Read-only and idempotent.",
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ bucket: Property.ShortText({
+ displayName: 'Bucket',
+ description: 'The name of the Storage bucket.',
+ required: true,
+ }),
+ path: Property.ShortText({
+ displayName: 'Folder Path',
+ description: 'Folder path to list within the bucket. Leave empty to list the bucket root.',
+ required: false,
+ }),
+ },
+ outputSchema: listFilesActionOutputSchema,
+ async run(context) {
+ const { bucket, path } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.storage.from(bucket).list(path || undefined);
+
+ if (error) {
+ throw new Error(`Failed to list files: ${error.message}`);
+ }
+
+ return {
+ files: (data ?? []).map((file) => ({
+ name: file.name,
+ id: file.id,
+ updated_at: file.updated_at,
+ created_at: file.created_at,
+ last_accessed_at: file.last_accessed_at,
+ size: file.metadata?.['size'] ?? null,
+ mimetype: file.metadata?.['mimetype'] ?? null,
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/list-users.ts b/packages/pieces/community/supabase/src/lib/actions/list-users.ts
new file mode 100644
index 00000000000..9c2e98ec792
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/list-users.ts
@@ -0,0 +1,56 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { listUsersActionOutputSchema } from '../output-schemas';
+
+export const listUsers = createAction({
+ name: 'list_users',
+ classification: 'SEARCH',
+ displayName: 'List Users',
+ description: 'Lists the users registered in the project\'s Auth system. Requires the Service Role Key.',
+ audience: 'both',
+ aiMetadata: {
+ description: "Lists users registered in the connected Supabase project's Auth system, paginated. Requires the Service Role Key. Use to look up or browse accounts before acting on a specific user. Read-only and idempotent.",
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ page: Property.Number({
+ displayName: 'Page',
+ description: 'Page number for pagination (starts from 1).',
+ required: false,
+ defaultValue: 1,
+ }),
+ perPage: Property.Number({
+ displayName: 'Users Per Page',
+ required: false,
+ defaultValue: 50,
+ }),
+ },
+ outputSchema: listUsersActionOutputSchema,
+ async run(context) {
+ const { page, perPage } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.auth.admin.listUsers({
+ page: page || 1,
+ perPage: perPage || 50,
+ });
+
+ if (error) {
+ throw new Error(`Failed to list users: ${error.message}`);
+ }
+
+ return {
+ users: data.users.map((user) => ({
+ id: user.id,
+ email: user.email ?? null,
+ phone: user.phone ?? null,
+ created_at: user.created_at,
+ last_sign_in_at: user.last_sign_in_at ?? null,
+ confirmed_at: user.confirmed_at ?? null,
+ })),
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/actions/update-user.ts b/packages/pieces/community/supabase/src/lib/actions/update-user.ts
new file mode 100644
index 00000000000..78d5539a00a
--- /dev/null
+++ b/packages/pieces/community/supabase/src/lib/actions/update-user.ts
@@ -0,0 +1,64 @@
+import { createAction, Property } from '@activepieces/pieces-framework';
+import { createClient } from '@supabase/supabase-js';
+import { supabaseAuth } from '../auth';
+import { updateUserActionOutputSchema } from '../output-schemas';
+
+export const updateUser = createAction({
+ name: 'update_user',
+ classification: 'WRITE',
+ displayName: 'Update User',
+ description: 'Updates a user\'s email, phone, password, or metadata. Requires the Service Role Key.',
+ audience: 'both',
+ aiMetadata: {
+ description: "Updates an existing user's email, phone, password, or metadata by user ID. Requires the Service Role Key. Only the fields provided are changed; leave the rest empty to keep them as-is. Idempotent: setting the same values again has no further effect.",
+ idempotent: true,
+ },
+ auth: supabaseAuth,
+ props: {
+ userId: Property.ShortText({
+ displayName: 'User ID',
+ required: true,
+ }),
+ email: Property.ShortText({
+ displayName: 'New Email',
+ required: false,
+ }),
+ phone: Property.ShortText({
+ displayName: 'New Phone',
+ required: false,
+ }),
+ password: Property.ShortText({
+ displayName: 'New Password',
+ required: false,
+ }),
+ userMetadata: Property.Json({
+ displayName: 'User Metadata',
+ description: 'Replaces the user\'s custom metadata, as a JSON object.',
+ required: false,
+ }),
+ },
+ outputSchema: updateUserActionOutputSchema,
+ async run(context) {
+ const { userId, email, phone, password, userMetadata } = context.propsValue;
+ const { url, apiKey } = context.auth.props;
+ const supabase = createClient(url, apiKey);
+
+ const { data, error } = await supabase.auth.admin.updateUserById(userId, {
+ email,
+ phone,
+ password,
+ user_metadata: (userMetadata as Record<string, unknown>) ?? undefined,
+ });
+
+ if (error) {
+ throw new Error(`Failed to update user: ${error.message}`);
+ }
+
+ return {
+ id: data.user.id,
+ email: data.user.email ?? null,
+ phone: data.user.phone ?? null,
+ updated_at: data.user.updated_at ?? null,
+ };
+ },
+});
diff --git a/packages/pieces/community/supabase/src/lib/output-schemas.ts b/packages/pieces/community/supabase/src/lib/output-schemas.ts
index fac5b3917da..68ce60bd2b3 100644
--- a/packages/pieces/community/supabase/src/lib/output-schemas.ts
+++ b/packages/pieces/community/supabase/src/lib/output-schemas.ts
@@ -414,6 +414,156 @@ export const uploadFileActionOutputSchema: OutputSchema = {
],
};
+export const createBucketActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'name', label: 'Name', value: 'name' },
+ ],
+};
+
+export const deleteBucketActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', value: 'success', format: 'boolean' },
+ ],
+};
+
+export const listBucketsActionOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'buckets',
+ label: 'Buckets',
+ value: '',
+ labelKey: 'name',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'name', label: 'Name' },
+ { key: 'public', label: 'Public', format: 'boolean' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+ },
+ ],
+};
+
+export const listFilesActionOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'files',
+ label: 'Files',
+ value: '',
+ labelKey: 'name',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ { key: 'id', label: 'ID' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'last_accessed_at', label: 'Last Accessed At', format: 'datetime' },
+ { key: 'size', label: 'Size (bytes)', format: 'number' },
+ { key: 'mimetype', label: 'MIME Type' },
+ ],
+ },
+ ],
+};
+
+export const downloadFileActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'base64', label: 'File Content (base64)' },
+ { key: 'mimeType', label: 'MIME Type' },
+ { key: 'size', label: 'Size (bytes)', format: 'number' },
+ ],
+};
+
+export const deleteFileActionOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'deleted_files',
+ label: 'Deleted Files',
+ value: '',
+ labelKey: 'name',
+ listItems: [
+ { key: 'name', label: 'Name' },
+ ],
+ },
+ ],
+};
+
+export const createSignedUrlActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'signedUrl', label: 'Signed URL', value: 'signedUrl', format: 'url' },
+ ],
+};
+
+export const listUsersActionOutputSchema: OutputSchema = {
+ fields: [
+ {
+ key: 'users',
+ label: 'Users',
+ value: '',
+ labelKey: 'email',
+ listItems: [
+ { key: 'id', label: 'ID' },
+ { key: 'email', label: 'Email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'last_sign_in_at', label: 'Last Sign In At', format: 'datetime' },
+ { key: 'confirmed_at', label: 'Confirmed At', format: 'datetime' },
+ ],
+ },
+ ],
+};
+
+export const getUserActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'email', label: 'Email' },
+ { key: 'phone', label: 'Phone' },
+ {
+ key: 'user_metadata',
+ label: 'User Metadata',
+ value: 'user_metadata',
+ },
+ {
+ key: 'app_metadata',
+ label: 'App Metadata',
+ value: 'app_metadata',
+ },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ { key: 'last_sign_in_at', label: 'Last Sign In At', format: 'datetime' },
+ { key: 'confirmed_at', label: 'Confirmed At', format: 'datetime' },
+ ],
+};
+
+export const createUserActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'email', label: 'Email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'created_at', label: 'Created At', format: 'datetime' },
+ ],
+};
+
+export const updateUserActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'email', label: 'Email' },
+ { key: 'phone', label: 'Phone' },
+ { key: 'updated_at', label: 'Updated At', format: 'datetime' },
+ ],
+};
+
+export const deleteUserActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'success', label: 'Success', value: 'success', format: 'boolean' },
+ ],
+};
+
+export const inviteUserActionOutputSchema: OutputSchema = {
+ fields: [
+ { key: 'id', label: 'ID' },
+ { key: 'email', label: 'Email' },
+ { key: 'invited_at', label: 'Invited At', format: 'datetime' },
+ ],
+};
+
export const newRowTriggerOutputSchema: OutputSchema = {
fields: [
{