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,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