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,32 @@
|
||||
{
|
||||
"\nTo get your Orimon API Key:\n\n1. **Login to your Orimon Dashboard**\n2. **Click the profile icon** (image icon) in the Top Right corner\n3. **Select \"Profile\"** from the menu\n4. **Click \"Generate Your Secret Key\"** to create a new API key\n5. **Click the eye icon** to reveal your key\n6. **Copy the key** and paste it here\n\nFor more details, visit: [Orimon Developer API Docs](https://orimon.gitbook.io/docs/developer-api/getting-started-with-apis)\n ": "\nTo get your Orimon API Key:\n\n1. **Login to your Orimon Dashboard**\n2. **Click the profile icon** (image icon) in the Top Right corner\n3. **Select \"Profile\"** from the menu\n4. **Click \"Generate Your Secret Key\"** to create a new API key\n5. **Click the eye icon** to reveal your key\n6. **Copy the key** and paste it here\n\nFor more details, visit: [Orimon Developer API Docs](https://orimon.gitbook.io/docs/developer-api/getting-started-with-apis)\n ",
|
||||
"Send Message": "Send Message",
|
||||
"Custom API Call": "Custom API Call",
|
||||
"Send a message to an Orimon chatbot and get a response": "Send a message to an Orimon chatbot and get a response",
|
||||
"Make a custom API call to a specific endpoint": "Make a custom API call to a specific endpoint",
|
||||
"Tenant ID": "Tenant ID",
|
||||
"Message": "Message",
|
||||
"Message ID": "Message ID",
|
||||
"Method": "Method",
|
||||
"Headers": "Headers",
|
||||
"Query Parameters": "Query Parameters",
|
||||
"Body": "Body",
|
||||
"Response is Binary ?": "Response is Binary ?",
|
||||
"No Error on Failure": "No Error on Failure",
|
||||
"Timeout (in seconds)": "Timeout (in seconds)",
|
||||
"To get it: Login to your dashboard and click on the bot configuration page. At the top in the URL bar, copy the value starting after \"tenant/\" to the end.": "To get it: Login to your dashboard and click on the bot configuration page. At the top in the URL bar, copy the value starting after \"tenant/\" to the end.",
|
||||
"The message to send to the chatbot": "The message to send to the chatbot",
|
||||
"Unique identifier for this message": "Unique identifier for this message",
|
||||
"Authorization headers are injected automatically from your connection.": "Authorization headers are injected automatically from your connection.",
|
||||
"Enable for files like PDFs, images, etc..": "Enable for files like PDFs, images, etc..",
|
||||
"GET": "GET",
|
||||
"POST": "POST",
|
||||
"PATCH": "PATCH",
|
||||
"PUT": "PUT",
|
||||
"DELETE": "DELETE",
|
||||
"HEAD": "HEAD",
|
||||
"New Lead": "New Lead",
|
||||
"Trigger when a new lead is captured by your Orimon chatbot": "Trigger when a new lead is captured by your Orimon chatbot",
|
||||
"Markdown": "Markdown",
|
||||
"\n## Webhook Configuration for Orimon\n\nTo enable this trigger, follow these steps to configure the webhook in your Orimon account:\n\n### Step-by-Step Setup:\n\n1. **Login to Orimon Dashboard** - [https://orimon.ai/login](https://orimon.ai/login).\n2. **Go to Bot Overview**.\n3. **Navigate to LeadFlow Integrations** - On the overview page, click on the **Settings** tab, then select **LeadFlow Integrations**\n4. **Select Webhook** - Click on the \"Webhook\" option from the integrations page\n5. **Paste the Webhook URL*": "\n## Webhook Configuration for Orimon\n\nTo enable this trigger, follow these steps to configure the webhook in your Orimon account:\n\n### Step-by-Step Setup:\n\n1. **Login to Orimon Dashboard** - [https://orimon.ai/login](https://orimon.ai/login).\n2. **Go to Bot Overview**.\n3. **Navigate to LeadFlow Integrations** - On the overview page, click on the **Settings** tab, then select **LeadFlow Integrations**\n4. **Select Webhook** - Click on the \"Webhook\" option from the integrations page\n5. **Paste the Webhook URL** - In the \"Webhook URL\" input field, paste the following URL:\n```text\n{{webhookUrl}}\n```\n6. **Submit** - Click the \"Submit\" button to save the configuration "
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
import { createPiece } from '@activepieces/pieces-framework';
|
||||
import { orimonAuth } from './lib/common/auth';
|
||||
import { sendMessage } from './lib/actions/send-message';
|
||||
import { newLead } from './lib/triggers/new-lead';
|
||||
import { createCustomApiCallAction } from '@activepieces/pieces-common';
|
||||
|
||||
export const orimon = createPiece({
|
||||
displayName: 'Orimon',
|
||||
auth: orimonAuth,
|
||||
minimumSupportedRelease: '0.36.1',
|
||||
logoUrl: 'https://cdn.activepieces.com/pieces/orimon.png',
|
||||
authors: ['sanket-a11y'],
|
||||
actions: [
|
||||
sendMessage,
|
||||
createCustomApiCallAction({
|
||||
auth: orimonAuth,
|
||||
baseUrl: () => 'https://channel-connector.orimon.ai/orimon/v1',
|
||||
authMapping: async (auth) => ({
|
||||
authorization: `apiKey ${auth.secret_text}`,
|
||||
}),
|
||||
}),
|
||||
],
|
||||
triggers: [newLead],
|
||||
});
|
||||
@@ -0,0 +1,72 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { orimonAuth } from '../common/auth';
|
||||
import { httpClient, HttpMethod } from '@activepieces/pieces-common';
|
||||
|
||||
export const sendMessage = createAction({
|
||||
auth: orimonAuth,
|
||||
name: 'sendMessage',
|
||||
displayName: 'Send Message',
|
||||
description: 'Send a message to an Orimon chatbot and get a response',
|
||||
props: {
|
||||
tenantId: Property.ShortText({
|
||||
displayName: 'Tenant ID',
|
||||
description:
|
||||
'To get it: Login to your dashboard and click on the bot configuration page. At the top in the URL bar, copy the value starting after "tenant/" to the end.',
|
||||
required: true,
|
||||
}),
|
||||
messageText: Property.LongText({
|
||||
displayName: 'Message',
|
||||
description: 'The message to send to the chatbot',
|
||||
required: true,
|
||||
}),
|
||||
messageId: Property.ShortText({
|
||||
displayName: 'Message ID',
|
||||
description: 'Unique identifier for this message',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { tenantId, messageText, messageId } = context.propsValue;
|
||||
const apiKey = context.auth;
|
||||
|
||||
const randomValue = Math.random().toString(36).substring(2, 15);
|
||||
const psid = `${randomValue}_${tenantId}`;
|
||||
|
||||
const payload = {
|
||||
type: 'message',
|
||||
info: {
|
||||
psid: psid,
|
||||
sender: 'user',
|
||||
tenantId: tenantId,
|
||||
platformName: 'web',
|
||||
},
|
||||
message: {
|
||||
id: messageId || `msg_${Date.now()}`,
|
||||
type: 'text',
|
||||
payload: {
|
||||
text: messageText,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
try {
|
||||
const response = await httpClient.sendRequest({
|
||||
method: HttpMethod.POST,
|
||||
url: 'https://channel-connector.orimon.ai/orimon/v1/conversation/api/message',
|
||||
headers: {
|
||||
authorization: `apiKey ${apiKey}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: payload,
|
||||
});
|
||||
|
||||
return response.body;
|
||||
} catch (error) {
|
||||
throw new Error(
|
||||
`Failed to send message to Orimon: ${
|
||||
error instanceof Error ? error.message : 'Unknown error'
|
||||
}`
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,19 @@
|
||||
import { PieceAuth } from '@activepieces/pieces-framework';
|
||||
|
||||
export const orimonAuth = PieceAuth.SecretText({
|
||||
displayName: 'Orimon API Key',
|
||||
description: `
|
||||
To get your Orimon API Key:
|
||||
|
||||
1. **Login to your Orimon Dashboard**
|
||||
2. **Click the profile icon** (image icon) in the Top Right corner
|
||||
3. **Select "Profile"** from the menu
|
||||
4. **Click "Generate Your Secret Key"** to create a new API key
|
||||
5. **Click the eye icon** to reveal your key
|
||||
6. **Copy the key** and paste it here
|
||||
|
||||
For more details, visit: [Orimon Developer API Docs](https://orimon.gitbook.io/docs/developer-api/getting-started-with-apis)
|
||||
`,
|
||||
required: true,
|
||||
|
||||
});
|
||||
@@ -0,0 +1,71 @@
|
||||
import {
|
||||
createTrigger,
|
||||
Property,
|
||||
TriggerStrategy,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { orimonAuth } from '../common/auth';
|
||||
|
||||
export const newLead = createTrigger({
|
||||
auth: orimonAuth,
|
||||
name: 'newLead',
|
||||
displayName: 'New Lead',
|
||||
description: 'Trigger when a new lead is captured by your Orimon chatbot',
|
||||
props: {
|
||||
markdown: Property.MarkDown({
|
||||
value: `
|
||||
## Webhook Configuration for Orimon
|
||||
|
||||
To enable this trigger, follow these steps to configure the webhook in your Orimon account:
|
||||
|
||||
### Step-by-Step Setup:
|
||||
|
||||
1. **Login to Orimon Dashboard** - [https://orimon.ai/login](https://orimon.ai/login).
|
||||
2. **Go to Bot Overview**.
|
||||
3. **Navigate to LeadFlow Integrations** - On the overview page, click on the **Settings** tab, then select **LeadFlow Integrations**
|
||||
4. **Select Webhook** - Click on the "Webhook" option from the integrations page
|
||||
5. **Paste the Webhook URL** - In the "Webhook URL" input field, paste the following URL:
|
||||
\`\`\`text
|
||||
{{webhookUrl}}
|
||||
\`\`\`
|
||||
6. **Submit** - Click the "Submit" button to save the configuration `,
|
||||
}),
|
||||
},
|
||||
sampleData: {
|
||||
email: 'test@test.com',
|
||||
host: 'channel-connector.orimon.ai',
|
||||
origin: 'https://bot.orimon.ai',
|
||||
referer:
|
||||
'https://bot.orimon.ai/deploy/index.html?tenantId=tenantId&testBot=true&defaultOpen=true',
|
||||
clientIp: '111.11.1.111',
|
||||
userIp: '111.11.1.111',
|
||||
userIpCity: 'Mumbai',
|
||||
userIpCountry: 'IN',
|
||||
platform_info: {
|
||||
description: 'Chrome 142.0.0.0 on Windows 10 64-bit',
|
||||
layout: 'Blink',
|
||||
manufacturer: null,
|
||||
name: 'Chrome',
|
||||
prerelease: null,
|
||||
product: null,
|
||||
ua: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36',
|
||||
version: '142.0.0.0',
|
||||
os: {
|
||||
architecture: 64,
|
||||
family: 'Windows',
|
||||
version: '10',
|
||||
},
|
||||
device: 'Desktop',
|
||||
device_name: 'NA',
|
||||
},
|
||||
},
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
async onEnable(context) {
|
||||
// Note:
|
||||
},
|
||||
async onDisable(context) {
|
||||
// In
|
||||
},
|
||||
async run(context) {
|
||||
return [context.payload.body];
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user