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-raia-ai
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build pieces-raia-ai` to build the library.
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@activepieces/piece-raia-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-raia-ai",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/raia-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/raia-ai",
|
||||
"tsConfig": "packages/pieces/community/raia-ai/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/raia-ai/package.json",
|
||||
"main": "packages/pieces/community/raia-ai/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/raia-ai/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/raia-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/raia-ai",
|
||||
"command": "bun install --no-save --silent"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
import { createPiece } from "@activepieces/pieces-framework";
|
||||
import { promptAgentAction } from "./lib/actions/prompt-agent";
|
||||
import { uploadAgentFileAction } from "./lib/actions/upload-agent-file";
|
||||
import { createCustomApiCallAction } from "@activepieces/pieces-common";
|
||||
import { raiaAiAuth } from "./lib/common/auth";
|
||||
import { BASE_URL } from "./lib/common/constants";
|
||||
|
||||
export const raiaAi = createPiece({
|
||||
displayName: "raia",
|
||||
auth: raiaAiAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: "https://cdn.activepieces.com/pieces/raia-ai.png",
|
||||
authors: ["kishanprmr"],
|
||||
actions: [promptAgentAction, uploadAgentFileAction,
|
||||
createCustomApiCallAction({
|
||||
auth: raiaAiAuth,
|
||||
baseUrl: () => BASE_URL,
|
||||
authMapping: async (auth) => {
|
||||
return {
|
||||
'Agent-Secret-Key': auth.secret_text
|
||||
}
|
||||
}
|
||||
})
|
||||
],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
import { createAction, Property } from "@activepieces/pieces-framework";
|
||||
import { raiaAiAuth } from "../common/auth";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { BASE_URL } from "../common/constants";
|
||||
|
||||
export const promptAgentAction = createAction({
|
||||
name: 'prompt-agent',
|
||||
displayName: 'Prompt Agent',
|
||||
description: 'Sends a prompt to a Raia Agent.',
|
||||
auth: raiaAiAuth,
|
||||
props: {
|
||||
prompt: Property.LongText({
|
||||
displayName: 'Prompt',
|
||||
required: true
|
||||
})
|
||||
},
|
||||
async run(context) {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: BASE_URL + '/prompts',
|
||||
headers: {
|
||||
'Agent-Secret-Key': context.auth.secret_text,
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
body: { prompt: context.propsValue.prompt }
|
||||
})
|
||||
|
||||
return response.body
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,36 @@
|
||||
import { createAction, Property } from "@activepieces/pieces-framework";
|
||||
import { raiaAiAuth } from "../common/auth";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { BASE_URL } from "../common/constants";
|
||||
import FormData from 'form-data';
|
||||
|
||||
export const uploadAgentFileAction = createAction({
|
||||
name: 'upload-agent-file',
|
||||
displayName: 'Upload Agent File',
|
||||
description: 'Upload file to a Raia Agent.',
|
||||
auth: raiaAiAuth,
|
||||
props: {
|
||||
file: Property.File({
|
||||
displayName: 'File',
|
||||
required: true
|
||||
})
|
||||
},
|
||||
async run(context) {
|
||||
const {file} = context.propsValue
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('file',file.data,{filename:file.filename})
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: BASE_URL + '/agent-files/upload',
|
||||
headers: {
|
||||
'Agent-Secret-Key': context.auth.secret_text,
|
||||
...formData.getHeaders()
|
||||
},
|
||||
body: formData
|
||||
})
|
||||
|
||||
return response.body
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,33 @@
|
||||
import { PieceAuth } from "@activepieces/pieces-framework";
|
||||
import { httpClient, HttpMethod } from "@activepieces/pieces-common";
|
||||
import { BASE_URL } from "./constants";
|
||||
|
||||
export const raiaAiAuth = PieceAuth.SecretText({
|
||||
displayName: 'API Key',
|
||||
required: true,
|
||||
description: `
|
||||
1. Open your agent in raiaAI Launch Pad and go to Agent → Skills.
|
||||
2. Add/enable “API Skill” (toggle it Active).
|
||||
3. In the API Skill settings, click “Generate Secret Key” (your agent’s API key).`,
|
||||
validate: async ({ auth }) => {
|
||||
try {
|
||||
await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: BASE_URL + '/agents/by-api-key',
|
||||
headers: {
|
||||
'Agent-Secret-Key': auth
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
valid: true
|
||||
}
|
||||
}
|
||||
catch {
|
||||
return {
|
||||
valid: false,
|
||||
error: 'Invalid API Key.'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1 @@
|
||||
export const BASE_URL = 'https://api.raia2.com/external'
|
||||
@@ -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