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-tiny-talk-ai
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build pieces-tiny-talk-ai` to build the library.
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@activepieces/piece-tiny-talk-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-tiny-talk-ai",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/tiny-talk-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/tiny-talk-ai",
|
||||
"tsConfig": "packages/pieces/community/tiny-talk-ai/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/tiny-talk-ai/package.json",
|
||||
"main": "packages/pieces/community/tiny-talk-ai/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/tiny-talk-ai/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/tiny-talk-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/tiny-talk-ai",
|
||||
"command": "bun install --no-save --silent"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
|
||||
import { createPiece } from "@activepieces/pieces-framework";
|
||||
import { tinyTalkAiAuth } from "./lib/common/auth";
|
||||
import { askBotAction } from "./lib/actions/ask-bot";
|
||||
|
||||
export const tinyTalkAi = createPiece({
|
||||
displayName: "Tiny Talk AI",
|
||||
auth: tinyTalkAiAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: "https://cdn.activepieces.com/pieces/tiny-talk-ai.png",
|
||||
authors: ['kishanprmr'],
|
||||
actions: [askBotAction],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -0,0 +1,86 @@
|
||||
import { createAction, Property } from "@activepieces/pieces-framework";
|
||||
import { tinyTalkAiAuth } from "../common/auth";
|
||||
|
||||
export const askBotAction = createAction({
|
||||
name: 'ask-bot',
|
||||
auth: tinyTalkAiAuth,
|
||||
displayName: 'Ask Bot',
|
||||
description: 'Sends message to selected bot.',
|
||||
props: {
|
||||
botId: Property.ShortText({
|
||||
displayName: 'Bot ID',
|
||||
required: true,
|
||||
description: 'You can find this in your Bot Details page in the dashboard.'
|
||||
}),
|
||||
prompt: Property.LongText({
|
||||
displayName: 'Question',
|
||||
required: true
|
||||
})
|
||||
},
|
||||
async run(context) {
|
||||
const { botId, prompt } = context.propsValue;
|
||||
|
||||
const response = await fetch("https://api.tinytalk.ai/v1/chat/completions", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
'Api-Key': context.auth.secret_text,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
botId,
|
||||
messages: [
|
||||
|
||||
{
|
||||
"role": "user",
|
||||
"content": prompt
|
||||
},
|
||||
]
|
||||
}),
|
||||
redirect: "follow",
|
||||
})
|
||||
|
||||
if (!response.ok) {
|
||||
const errorData = await response.json();
|
||||
throw Error(errorData.message);
|
||||
}
|
||||
|
||||
const stream = response.body;
|
||||
|
||||
if (!stream) {
|
||||
throw new Error("No stream returned from TinyTalk API");
|
||||
}
|
||||
|
||||
const reader = stream.getReader();
|
||||
const decoder = new TextDecoder();
|
||||
|
||||
let fullText = "";
|
||||
let done = false;
|
||||
|
||||
while (!done) {
|
||||
const { value, done: doneReading } = await reader.read();
|
||||
done = doneReading;
|
||||
|
||||
if (!value) continue;
|
||||
|
||||
const chunk = decoder.decode(value, { stream: true });
|
||||
|
||||
chunk.split("\n").forEach((line) => {
|
||||
if (line.startsWith("data: ") && !line.includes("[DONE]")) {
|
||||
try {
|
||||
const json = JSON.parse(line.replace("data: ", ""));
|
||||
const delta = json?.choices?.[0]?.delta;
|
||||
if (delta?.content) {
|
||||
fullText += delta.content;
|
||||
process.stdout.write(delta.content);
|
||||
}
|
||||
} catch {
|
||||
// ignore malformed lines
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return fullText;
|
||||
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,7 @@
|
||||
import { PieceAuth } from "@activepieces/pieces-framework";
|
||||
|
||||
export const tinyTalkAiAuth = PieceAuth.SecretText({
|
||||
displayName:'API Key',
|
||||
required:true,
|
||||
description:`You can obtain API key from [Dashboard Settings](https://dashboard.tinytalk.ai/).`
|
||||
})
|
||||
@@ -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