Add Activepieces integration for workflow automation
- Add Activepieces fork with SmoothSchedule custom piece - Create integrations app with Activepieces service layer - Add embed token endpoint for iframe integration - Create Automations page with embedded workflow builder - Add sidebar visibility fix for embed mode - Add list inactive customers endpoint to Public API - Include SmoothSchedule triggers: event created/updated/cancelled - Include SmoothSchedule actions: create/update/cancel events, list resources/services/customers 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"extends": [
|
||||
"../../../../.eslintrc.base.json"
|
||||
],
|
||||
"ignorePatterns": [
|
||||
"!**/*"
|
||||
],
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.ts",
|
||||
"*.tsx",
|
||||
"*.js",
|
||||
"*.jsx"
|
||||
],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.ts",
|
||||
"*.tsx"
|
||||
],
|
||||
"rules": {}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"*.js",
|
||||
"*.jsx"
|
||||
],
|
||||
"rules": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
# pieces-alt-text-ai
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build pieces-alt-text-ai` to build the library.
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@activepieces/piece-alt-text-ai",
|
||||
"version": "0.0.1",
|
||||
"type": "commonjs",
|
||||
"main": "./src/index.js",
|
||||
"types": "./src/index.d.ts",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "pieces-alt-text-ai",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/alt-text-ai/src",
|
||||
"projectType": "library",
|
||||
"release": {
|
||||
"version": {
|
||||
"manifestRootsToUpdate": [
|
||||
"dist/{projectRoot}"
|
||||
],
|
||||
"currentVersionResolver": "git-tag",
|
||||
"fallbackCurrentVersionResolver": "disk"
|
||||
}
|
||||
},
|
||||
"tags": [],
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nx/js:tsc",
|
||||
"outputs": [
|
||||
"{options.outputPath}"
|
||||
],
|
||||
"options": {
|
||||
"outputPath": "dist/packages/pieces/community/alt-text-ai",
|
||||
"tsConfig": "packages/pieces/community/alt-text-ai/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/alt-text-ai/package.json",
|
||||
"main": "packages/pieces/community/alt-text-ai/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/alt-text-ai/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/alt-text-ai/src/i18n",
|
||||
"output": "./src/i18n",
|
||||
"glob": "**/!(i18n.json)"
|
||||
}
|
||||
],
|
||||
"buildableProjectDepsInPackageJsonType": "dependencies",
|
||||
"updateBuildableProjectDepsInPackageJson": true
|
||||
},
|
||||
"dependsOn": [
|
||||
"prebuild",
|
||||
"^build"
|
||||
]
|
||||
},
|
||||
"nx-release-publish": {
|
||||
"options": {
|
||||
"packageRoot": "dist/{projectRoot}"
|
||||
}
|
||||
},
|
||||
"prebuild": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"executor": "nx:run-commands",
|
||||
"options": {
|
||||
"cwd": "packages/pieces/community/alt-text-ai",
|
||||
"command": "bun install --no-save --silent"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
import { createPiece, PieceAuth } from "@activepieces/pieces-framework";
|
||||
import { generateAltTextAction } from "./lib/actions/generate-alt-text";
|
||||
import { createCustomApiCallAction } from "@activepieces/pieces-common";
|
||||
import { altTextAiAuth } from "./lib/common/auth";
|
||||
import { BASE_URL } from "./lib/common/constants";
|
||||
import { PieceCategory } from "@activepieces/shared";
|
||||
|
||||
export const altTextAi = createPiece({
|
||||
displayName: "AltText.ai",
|
||||
categories:[PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
||||
auth: altTextAiAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: "https://cdn.activepieces.com/pieces/alt-text-ai.png",
|
||||
authors: ['kishanprmr'],
|
||||
actions: [generateAltTextAction,
|
||||
createCustomApiCallAction({
|
||||
auth:altTextAiAuth,
|
||||
baseUrl:()=>BASE_URL,
|
||||
authMapping:async (auth)=>{
|
||||
return{
|
||||
'X-API-Key':auth.secret_text
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
triggers: [],
|
||||
});
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import { createAction, Property } from "@activepieces/pieces-framework";
|
||||
import { altTextAiAuth } from "../common/auth";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { BASE_URL } from "../common/constants";
|
||||
|
||||
export const generateAltTextAction = createAction({
|
||||
name: 'generate-alt-text',
|
||||
auth: altTextAiAuth,
|
||||
displayName: 'Generate Alt Text',
|
||||
description: 'Generates a descriptive alt text for a given image.',
|
||||
props: {
|
||||
image: Property.File({
|
||||
displayName: 'Image',
|
||||
required: true
|
||||
}),
|
||||
keywords: Property.Array({
|
||||
displayName: 'Keywords',
|
||||
required: false,
|
||||
description: 'keywords / phrases to be considered when generating the alt text.'
|
||||
}),
|
||||
negativeKeywords: Property.Array({
|
||||
displayName: 'Negative Keywords',
|
||||
required: false,
|
||||
description: 'negative keywords / phrases to be removed from any generated alt text.'
|
||||
}),
|
||||
keywordSource: Property.LongText({
|
||||
displayName: 'Keyword Source',
|
||||
required: false,
|
||||
description: 'Text to use as the source of keywords for the alt text.'
|
||||
})
|
||||
},
|
||||
async run(context) {
|
||||
const { image, keywords, keywordSource, negativeKeywords } = context.propsValue;
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: BASE_URL + '/images',
|
||||
headers: {
|
||||
'X-API-Key': context.auth.secret_text
|
||||
},
|
||||
body: {
|
||||
image: {
|
||||
raw: image.base64
|
||||
},
|
||||
keywords,
|
||||
keyword_source: keywordSource,
|
||||
negative_keywords: negativeKeywords
|
||||
}
|
||||
})
|
||||
|
||||
return response.body;
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,30 @@
|
||||
import { PieceAuth } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { BASE_URL } from "./constants";
|
||||
|
||||
export const altTextAiAuth = PieceAuth.SecretText({
|
||||
displayName: 'API Key',
|
||||
required: true,
|
||||
description: `You can obtain your API key from [Account Settings](https://alttext.ai/account/api_keys).`,
|
||||
validate: async ({ auth }) => {
|
||||
try {
|
||||
await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: BASE_URL + '/account',
|
||||
headers: {
|
||||
'X-API-Key': auth
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
valid: true
|
||||
}
|
||||
|
||||
} catch {
|
||||
return {
|
||||
valid: false,
|
||||
error: 'Invalid API Key'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
export const BASE_URL = 'https://alttext.ai/api/v1'
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"extends": "../../../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"strict": true,
|
||||
"importHelpers": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noPropertyAccessFromIndexSignature": true
|
||||
},
|
||||
"files": [],
|
||||
"include": [],
|
||||
"references": [
|
||||
{
|
||||
"path": "./tsconfig.lib.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "../../../../dist/out-tsc",
|
||||
"declaration": true,
|
||||
"types": ["node"]
|
||||
},
|
||||
"include": ["src/**/*.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user