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-vidlab7
|
||||
|
||||
This library was generated with [Nx](https://nx.dev).
|
||||
|
||||
## Building
|
||||
|
||||
Run `nx build pieces-vidlab7` to build the library.
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "@activepieces/piece-vidlab7",
|
||||
"version": "0.0.2",
|
||||
"type": "commonjs",
|
||||
"main": "./src/index.js",
|
||||
"types": "./src/index.d.ts",
|
||||
"dependencies": {
|
||||
"tslib": "^2.3.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
{
|
||||
"name": "pieces-vidlab7",
|
||||
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
|
||||
"sourceRoot": "packages/pieces/community/vidlab7/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/vidlab7",
|
||||
"tsConfig": "packages/pieces/community/vidlab7/tsconfig.lib.json",
|
||||
"packageJson": "packages/pieces/community/vidlab7/package.json",
|
||||
"main": "packages/pieces/community/vidlab7/src/index.ts",
|
||||
"assets": [
|
||||
"packages/pieces/community/vidlab7/*.md",
|
||||
{
|
||||
"input": "packages/pieces/community/vidlab7/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/vidlab7",
|
||||
"command": "bun install --no-save --silent"
|
||||
}
|
||||
},
|
||||
"lint": {
|
||||
"executor": "@nx/eslint:lint",
|
||||
"outputs": [
|
||||
"{options.outputFile}"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { createPiece } from '@activepieces/pieces-framework';
|
||||
import { PieceCategory } from '@activepieces/shared';
|
||||
import { createVideo } from './lib/actions/create-video';
|
||||
import { vidlab7Auth } from './lib/common/auth';
|
||||
|
||||
export const vidlab7 = createPiece({
|
||||
displayName: 'VidLab7',
|
||||
auth: vidlab7Auth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/vidlab7.png',
|
||||
categories: [PieceCategory.ARTIFICIAL_INTELLIGENCE],
|
||||
description:
|
||||
'AI Avatars that pitch, show demos, qualify buyers, follow up, secure meetings and close deals – on autopilot.',
|
||||
authors: ['sanket-a11y'],
|
||||
actions: [createVideo],
|
||||
triggers: [],
|
||||
});
|
||||
@@ -0,0 +1,137 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
|
||||
import { vidlab7Auth } from '../common/auth';
|
||||
|
||||
export const createVideo = createAction({
|
||||
auth: vidlab7Auth,
|
||||
name: 'createVideo',
|
||||
displayName: 'Create Video',
|
||||
description: 'Generate a video using a studio avatar',
|
||||
props: {
|
||||
avatarId: Property.ShortText({
|
||||
displayName: 'Avatar ID',
|
||||
description: 'The ID of the avatar to be used for the video generation',
|
||||
required: true,
|
||||
}),
|
||||
script: Property.LongText({
|
||||
displayName: 'Script',
|
||||
description: 'The script to be used for the video generation',
|
||||
required: true,
|
||||
}),
|
||||
voiceId: Property.ShortText({
|
||||
displayName: 'Voice ID',
|
||||
description: 'The ID of the voice to be used for the video generation',
|
||||
required: true,
|
||||
}),
|
||||
webhookUrl: Property.ShortText({
|
||||
displayName: 'Webhook URL',
|
||||
description:
|
||||
'The URL to which the webhook will be sent when video generation is complete',
|
||||
required: true,
|
||||
}),
|
||||
similarity_boost: Property.Number({
|
||||
displayName: 'Similarity Boost',
|
||||
description: 'Voice similarity boost setting (0-100)',
|
||||
required: false,
|
||||
defaultValue: 50,
|
||||
}),
|
||||
use_speaker_boost: Property.Checkbox({
|
||||
displayName: 'Use Speaker Boost',
|
||||
description: 'Enable speaker boost for better voice quality',
|
||||
required: false,
|
||||
defaultValue: true,
|
||||
}),
|
||||
style: Property.Number({
|
||||
displayName: 'Style',
|
||||
description: 'Voice style setting',
|
||||
required: false,
|
||||
defaultValue: 0,
|
||||
}),
|
||||
stability: Property.Number({
|
||||
displayName: 'Stability',
|
||||
description: 'Voice stability setting (0-100)',
|
||||
required: false,
|
||||
defaultValue: 50,
|
||||
}),
|
||||
waitForCompletion: Property.Checkbox({
|
||||
displayName: 'Wait for Completion',
|
||||
description:
|
||||
'Wait for the video generation to complete and return the video URL. If disabled, only returns the video ID.',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
avatarId,
|
||||
script,
|
||||
voiceId,
|
||||
webhookUrl,
|
||||
similarity_boost,
|
||||
use_speaker_boost,
|
||||
style,
|
||||
stability,
|
||||
waitForCompletion,
|
||||
} = context.propsValue;
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: 'https://api-prd.vidlab7.com/api/studio-avatar/generate-video',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'x-api-key': context.auth.secret_text,
|
||||
},
|
||||
body: {
|
||||
avatarId,
|
||||
script,
|
||||
voiceId,
|
||||
webhookUrl,
|
||||
voice_settings: {
|
||||
similarity_boost,
|
||||
use_speaker_boost,
|
||||
style,
|
||||
stability,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const initialResult = response.body as { id: string; status: string };
|
||||
|
||||
if (!waitForCompletion) {
|
||||
return initialResult;
|
||||
}
|
||||
|
||||
const videoId = initialResult.id;
|
||||
const interval = 5 * 1000;
|
||||
const maxWait = 300 * 1000;
|
||||
const startTime = Date.now();
|
||||
|
||||
while (Date.now() - startTime < maxWait) {
|
||||
await new Promise((resolve) => setTimeout(resolve, interval));
|
||||
|
||||
const statusResponse = await httpClient.sendRequest({
|
||||
method: HttpMethod.GET,
|
||||
url: `https://api-prd.vidlab7.com/api/studio-avatar/generated-video/${videoId}`,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'x-api-key': context.auth.secret_text,
|
||||
},
|
||||
});
|
||||
|
||||
const statusData = statusResponse.body as {
|
||||
success: boolean;
|
||||
data: { status: string; videoUrl?: string };
|
||||
};
|
||||
|
||||
if (statusData.success && statusData.data.status === 'COMPLETED') {
|
||||
return statusData.data;
|
||||
}
|
||||
|
||||
if (statusData.data.status === 'FAILED') {
|
||||
throw new Error('Video generation failed');
|
||||
}
|
||||
}
|
||||
|
||||
throw new Error(`Video generation timed out after 300 seconds`);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,15 @@
|
||||
import { PieceAuth } from '@activepieces/pieces-framework';
|
||||
|
||||
export const vidlab7Auth = PieceAuth.SecretText({
|
||||
displayName: 'API Key',
|
||||
description: `
|
||||
To generate your API key:
|
||||
|
||||
1. Log in to [studio.vidlab7.com](https://studio.vidlab7.com/)
|
||||
2. Click on **API** in the bottom section of the left-hand menu
|
||||
3. Click the **Generate new key** button at the top right
|
||||
4. Give your key a descriptive name and click **Generate**
|
||||
5. Copy and store the key securely (you'll only see it once)
|
||||
`,
|
||||
required: true,
|
||||
});
|
||||
@@ -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