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:
poduck
2025-12-18 22:59:37 -05:00
parent 9848268d34
commit 3aa7199503
16292 changed files with 1284892 additions and 4708 deletions

View File

@@ -0,0 +1,38 @@
import {
PiecePropValueSchema,
Property,
createAction,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../..';
import { flowluCommon, makeClient } from '../../common';
import { flowluProps } from '../../common/props';
export const createContactAction = createAction({
auth: flowluAuth,
name: 'flowlu_create_contact',
displayName: 'Create CRM Account(Contact)',
description: 'Creates a new contact in CRM.',
props: {
honorific_title_id: flowluCommon.honorific_title_id(false),
first_name: Property.ShortText({
displayName: 'First Name',
required: true,
}),
middle_name: Property.ShortText({
displayName: 'Middle Name',
required: false,
}),
last_name: Property.ShortText({
displayName: 'Last Name',
required: false,
}),
...flowluProps.account,
},
async run(context) {
const {auth, ...propsValue} = context;
const client = makeClient(
context.auth
);
return await client.createAccount({ type: 2, ...propsValue });
},
});

View File

@@ -0,0 +1,32 @@
import {
PiecePropValueSchema,
Property,
createAction,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../..';
import { makeClient } from '../../common';
import { flowluProps } from '../../common/props';
export const createOrganizationAction = createAction({
auth: flowluAuth,
name: 'flowlu_create_organization',
displayName: 'Create CRM Account(Organization)',
description: 'Creates a new organization in CRM.',
props: {
name: Property.ShortText({
displayName: 'Organization Name',
required: true,
}),
name_legal_full: Property.ShortText({
displayName: 'Full legal name for Organization',
required: false,
}),
...flowluProps.account,
},
async run(context) {
const client = makeClient(
context.auth
);
return await client.createAccount({ type: 1, ...context.propsValue });
},
});

View File

@@ -0,0 +1,28 @@
import {
createAction,
PiecePropValueSchema,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../..';
import { flowluCommon, makeClient } from '../../common';
import { FlowluEntity, FlowluModule } from '../../common/constants';
export const deleteContactAction = createAction({
auth: flowluAuth,
name: 'flowlu_delete_contact',
displayName: 'Delete CRM Account(Contact)',
description: 'Deletes an existing contact in CRM.',
props: {
id: flowluCommon.contact_id(true),
},
async run(context) {
const id = context.propsValue.id!;
const client = makeClient(
context.auth
);
return await client.deleteAction(
FlowluModule.CRM,
FlowluEntity.ACCOUNT,
id
);
},
});

View File

@@ -0,0 +1,39 @@
import {
PiecePropValueSchema,
Property,
createAction,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../..';
import { flowluCommon, makeClient } from '../../common';
import { flowluProps } from '../../common/props';
export const updateContactAction = createAction({
auth: flowluAuth,
name: 'flowlu_update_contact',
displayName: 'Update CRM Account(Contact)',
description: 'Updates an existing contact in CRM.',
props: {
id: flowluCommon.contact_id(true),
honorific_title_id: flowluCommon.honorific_title_id(false),
first_name: Property.ShortText({
displayName: 'First Name',
required: false,
}),
middle_name: Property.ShortText({
displayName: 'Middle Name',
required: false,
}),
last_name: Property.ShortText({
displayName: 'Last Name',
required: false,
}),
...flowluProps.account,
},
async run(context) {
const id = context.propsValue.id!;
const client = makeClient(
context.auth
);
return await client.updateContact(id, { type: 2, ...context.propsValue });
},
});

View File

@@ -0,0 +1,28 @@
import {
PiecePropValueSchema,
Property,
createAction,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../../';
import { makeClient } from '../../common';
import { flowluProps } from '../../common/props';
export const createOpportunityAction = createAction({
auth: flowluAuth,
name: 'flowlu_create_opportunity',
displayName: 'Create Opportunity',
description: 'Creates a new opportunity.',
props: {
name: Property.ShortText({
displayName: 'Title',
required: true,
}),
...flowluProps.opportunity,
},
async run(context) {
const client = makeClient(
context.auth
);
return await client.createOpportunity(context.propsValue);
},
});

View File

@@ -0,0 +1,28 @@
import {
createAction,
PiecePropValueSchema,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../../';
import { flowluCommon, makeClient } from '../../common';
import { FlowluEntity, FlowluModule } from '../../common/constants';
export const deleteOpportunityAction = createAction({
auth: flowluAuth,
name: 'flowlu_delete_opportunity',
displayName: 'Delete Opportunity',
description: 'Deletes an existing opportunity.',
props: {
id: flowluCommon.opportunity_id(true),
},
async run(context) {
const id = context.propsValue.id!;
const client = makeClient(
context.auth
);
return await client.deleteAction(
FlowluModule.CRM,
FlowluEntity.OPPORTUNITY,
id
);
},
});

View File

@@ -0,0 +1,30 @@
import {
PiecePropValueSchema,
Property,
createAction,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../../';
import { flowluCommon, makeClient } from '../../common';
import { flowluProps } from '../../common/props';
export const updateOpportunityAction = createAction({
auth: flowluAuth,
name: 'flowlu_update_opportunity',
displayName: 'Update Opportunity',
description: 'Updates an existing opportunity.',
props: {
id: flowluCommon.opportunity_id(true),
name: Property.ShortText({
displayName: 'Title',
required: false,
}),
...flowluProps.opportunity,
},
async run(context) {
const id = context.propsValue.id!;
const client = makeClient(
context.auth
);
return await client.updateOpportunity(id, context.propsValue);
},
});

View File

@@ -0,0 +1,47 @@
import {
PiecePropValueSchema, Property,
createAction,
} from '@activepieces/pieces-framework';
import dayjs from 'dayjs';
import { flowluAuth } from '../../../';
import { makeClient } from '../../common';
import { flowluProps } from '../../common/props';
export const createTaskAction = createAction({
auth: flowluAuth,
name: 'flowlu_create_task',
displayName: 'Create Task',
description: 'Creates a new task.',
props: {
name: Property.ShortText({
displayName: 'Name',
required: true,
}),
...flowluProps.task,
},
async run(context) {
const client = makeClient(
context.auth
);
return await client.createTask({
name: context.propsValue.name,
description: context.propsValue.description,
priority: context.propsValue.priority,
plan_start_date: context.propsValue.plan_start_date
? dayjs(context.propsValue.plan_start_date).format(
'YYYY-MM-DD HH:mm:ss'
)
: undefined,
deadline: context.propsValue.deadline
? dayjs(context.propsValue.deadline).format('YYYY-MM-DD HH:mm:ss')
: undefined,
deadline_allowchange: context.propsValue.deadline_allowchange ? 1 : 0,
task_checkbyowner: context.propsValue.task_checkbyowner ? 1 : 0,
responsible_id: context.propsValue.responsible_id,
owner_id: context.propsValue.owner_id,
type: context.propsValue.type,
workflow_id: context.propsValue.workflow_id,
workflow_stage_id: context.propsValue.workflow_stage_id,
});
},
});

View File

@@ -0,0 +1,28 @@
import {
createAction,
PiecePropValueSchema,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../..';
import { flowluCommon, makeClient } from '../../common';
import { FlowluEntity, FlowluModule } from '../../common/constants';
export const deleteTaskAction = createAction({
auth: flowluAuth,
name: 'flowlu_delete_task',
displayName: 'Delete Task',
description: 'Deletes an existing task.',
props: {
task_id: flowluCommon.task_id(true),
},
async run(context) {
const task_id = context.propsValue.task_id!;
const client = makeClient(
context.auth
);
return await client.deleteAction(
FlowluModule.TASK,
FlowluEntity.TASKS,
task_id
);
},
});

View File

@@ -0,0 +1,23 @@
import {
createAction,
PiecePropValueSchema,
} from '@activepieces/pieces-framework';
import { flowluAuth } from '../../..';
import { flowluCommon, makeClient } from '../../common';
export const getTaskAction = createAction({
auth: flowluAuth,
name: 'flowlu_get_task',
displayName: 'Get Task',
description: 'Retrieves an existing task.',
props: {
task_id: flowluCommon.task_id(true),
},
async run(context) {
const task_id = context.propsValue.task_id!;
const client = makeClient(
context.auth
);
return await client.getTask(task_id);
},
});

View File

@@ -0,0 +1,48 @@
import {
PiecePropValueSchema, Property,
createAction,
} from '@activepieces/pieces-framework';
import dayjs from 'dayjs';
import { flowluAuth } from '../../../';
import { flowluCommon, makeClient } from '../../common';
import { flowluProps } from '../../common/props';
export const updateTaskAction = createAction({
auth: flowluAuth,
name: 'flowlu_update_task',
displayName: 'Update Task',
description: 'Updates an existing task.',
props: {
task_id: flowluCommon.task_id(true),
name: Property.ShortText({
displayName: 'Name',
required: false,
}),
...flowluProps.task,
},
async run(context) {
const client = makeClient(
context.auth
);
return await client.updateTask(context.propsValue.task_id!, {
name: context.propsValue.name,
description: context.propsValue.description,
priority: context.propsValue.priority,
plan_start_date: context.propsValue.plan_start_date
? dayjs(context.propsValue.plan_start_date).format(
'YYYY-MM-DD HH:mm:ss'
)
: undefined,
deadline: context.propsValue.deadline
? dayjs(context.propsValue.deadline).format('YYYY-MM-DD HH:mm:ss')
: undefined,
deadline_allowchange: context.propsValue.deadline_allowchange ? 1 : 0,
task_checkbyowner: context.propsValue.task_checkbyowner ? 1 : 0,
type: context.propsValue.type,
responsible_id: context.propsValue.responsible_id,
owner_id: context.propsValue.owner_id,
workflow_id: context.propsValue.workflow_id,
workflow_stage_id: context.propsValue.workflow_stage_id,
});
},
});

View File

@@ -0,0 +1,213 @@
import {
HttpMessageBody,
HttpMethod,
QueryParams,
httpClient,
} from '@activepieces/pieces-common';
import { FlowluEntity, FlowluModule } from './constants';
import {
Account,
AccountCategory,
AccountHonorificTitle,
AccountIndustry,
CreateCRMAccountAPIRequest,
CreateOpportunityAPIRequest,
CreateTaskAPIRequest,
ListAPIResponse,
Opportunity,
OpportunitySource,
Pipeline,
PipelineStage,
Task,
TaskWorkflow,
TaskWorkflowStage,
User,
} from './types';
function emptyValueFilter(
accessor: (key: string) => any
): (key: string) => boolean {
return (key: string) => {
const val = accessor(key);
return (
val !== null &&
val !== undefined &&
(typeof val != 'string' || val.length > 0)
);
};
}
export function prepareQuery(request?: Record<string, any>): QueryParams {
const params: QueryParams = {};
if (!request) return params;
Object.keys(request)
.filter(emptyValueFilter((k) => request[k]))
.forEach((k: string) => {
params[k] = (request as Record<string, any>)[k].toString();
});
return params;
}
export class FlowluClient {
constructor(private domain: string, private apiKey: string) {}
async makeRequest<T extends HttpMessageBody>(
method: HttpMethod,
resourceUri: string,
query?: QueryParams,
body: any | undefined = undefined
): Promise<T> {
const res = await httpClient.sendRequest<T>({
method: method,
url: `https://${this.domain}.flowlu.com/api/v1/module` + resourceUri,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
queryParams: { api_key: this.apiKey, ...query },
body: body,
});
return res.body;
}
async createAccount(request: CreateCRMAccountAPIRequest) {
return await this.makeRequest(
HttpMethod.POST,
'/crm/account/create',
undefined,
request
);
}
async updateContact(id: number, request: CreateCRMAccountAPIRequest) {
return await this.makeRequest(
HttpMethod.POST,
`/crm/account/update/${id}`,
undefined,
request
);
}
async listAllAccounts() {
return await this.makeRequest<ListAPIResponse<Account[]>>(
HttpMethod.GET,
'/crm/account/list'
);
}
async listAllContacts() {
return await this.makeRequest<ListAPIResponse<Account[]>>(
HttpMethod.GET,
'/crm/account/list',
{ 'filter[type]': '2' }
);
}
async createTask(request: CreateTaskAPIRequest) {
return await this.makeRequest(
HttpMethod.POST,
'/task/tasks/create',
undefined,
request
);
}
async updateTask(id: number, request: CreateTaskAPIRequest) {
return await this.makeRequest(
HttpMethod.POST,
`/task/tasks/update/${id}`,
undefined,
request
);
}
async getTask(id: number) {
return await this.makeRequest(HttpMethod.GET, `/task/tasks/get/${id}`);
}
async listAllTasks() {
return await this.makeRequest<ListAPIResponse<Task[]>>(
HttpMethod.GET,
'/task/tasks/list'
);
}
async createOpportunity(request: CreateOpportunityAPIRequest) {
return await this.makeRequest(
HttpMethod.POST,
'/crm/lead/create',
undefined,
request
);
}
async updateOpportunity(id: number, request: CreateOpportunityAPIRequest) {
return await this.makeRequest(
HttpMethod.POST,
`/crm/lead/update/${id}`,
undefined,
request
);
}
async listAllOpportunities() {
return await this.makeRequest<ListAPIResponse<Opportunity[]>>(
HttpMethod.GET,
'/crm/lead/list'
);
}
async listAllUsers() {
return await this.makeRequest<ListAPIResponse<User[]>>(
HttpMethod.GET,
'/core/user/list'
);
}
async listAllTaskWorkflow() {
return await this.makeRequest<ListAPIResponse<TaskWorkflow[]>>(
HttpMethod.GET,
'/task/workflows/list'
);
}
async listAllTaskStages() {
return await this.makeRequest<ListAPIResponse<TaskWorkflowStage[]>>(
HttpMethod.GET,
'/task/stages/list'
);
}
async listAllHonorificTitles() {
return await this.makeRequest<ListAPIResponse<AccountHonorificTitle[]>>(
HttpMethod.GET,
'/crm/honorific_title/list'
);
}
async listAllAccountCategories() {
return await this.makeRequest<ListAPIResponse<AccountCategory[]>>(
HttpMethod.GET,
'/crm/account_category/list'
);
}
async listAllAccountIndustries() {
return await this.makeRequest<ListAPIResponse<AccountIndustry[]>>(
HttpMethod.GET,
'/crm/industry/list'
);
}
async listAllOpportunitySources() {
return await this.makeRequest<ListAPIResponse<OpportunitySource[]>>(
HttpMethod.GET,
'/crm/source/list'
);
}
async listSalesPipelines() {
return await this.makeRequest<ListAPIResponse<Pipeline[]>>(
HttpMethod.GET,
'/crm/pipeline/list'
);
}
async listSalesPipelineStages(pipeline_id: number) {
return await this.makeRequest<ListAPIResponse<PipelineStage[]>>(
HttpMethod.GET,
'/crm/pipeline_stage/list',
{ 'filter[pipeline_id]': pipeline_id.toString() }
);
}
async deleteAction(
moduleName: FlowluModule,
entityName: FlowluEntity,
id: number
) {
return await this.makeRequest(
HttpMethod.GET,
`/${moduleName}/${entityName}/delete/${id}`
);
}
}

View File

@@ -0,0 +1,20 @@
export const enum FlowluModule {
TASK = 'task',
CRM = 'crm',
PROJECT = 'st',
CORE = 'core',
}
export const enum FlowluEntity {
TASKS = 'tasks',
WORKFLOWS = 'workflows',
STAGES = 'stages',
ACCOUNT = 'account',
SOURCE = 'source',
PIPELINE_STAGES = 'pipeline_stage',
PIPELINE = 'pipeline',
OPPORTUNITY = 'lead',
ACCOUNT_TYPE = 'account_category',
ACCOUNT_INDUSTRY = 'industry',
USER = 'user',
HONORIFIC_TITLE = 'honorific_title',
}

View File

@@ -0,0 +1,406 @@
import { AppConnectionValueForAuthProperty, PiecePropValueSchema, Property } from '@activepieces/pieces-framework';
import { flowluAuth } from '../..';
import { FlowluClient } from './client';
export function makeClient(
auth: AppConnectionValueForAuthProperty<typeof flowluAuth>
): FlowluClient {
const client = new FlowluClient(auth.props.domain, auth.props.apiKey);
return client;
}
function mapItemsToOptions(items: { id: string | number; name: string }[]) {
return items.map((item) => ({ label: item.name, value: item.id }));
}
export const flowluCommon = {
task_id: (required = true) =>
Property.Dropdown({
displayName: 'Task ID',
required,
refreshers: [],
auth: flowluAuth,
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllTasks();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
user_id: (required = true, displayName = 'User ID') =>
Property.Dropdown({
auth: flowluAuth,
displayName,
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllUsers();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
workflow_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Task Workflow ID',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllTaskWorkflow();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
workflow_stage_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Task Workflow Status ID',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllTaskStages();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
honorific_title_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Title',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const res = await client.listAllHonorificTitles();
const { response } = res;
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
account_category_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Account Category',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllAccountCategories();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
industry_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Account Industry',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllAccountIndustries();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
source_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Opportunity Source',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllOpportunitySources();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
opportunity_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Opportunity ID',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllOpportunities();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
account_id: (
required = false,
displayName = 'Account ID',
description = ''
) =>
Property.Dropdown({
auth: flowluAuth,
displayName,
description,
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllAccounts();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
contact_id: (
required = false,
displayName = 'Contact ID',
description = ''
) =>
Property.Dropdown({
auth: flowluAuth,
displayName,
description,
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listAllContacts();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
pipeline_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Sales Pipeline ID',
required,
refreshers: [],
options: async ({ auth }) => {
if (!auth) {
return {
disabled: true,
placeholder: 'Connect your account first',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listSalesPipelines();
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
pipeline_stage_id: (required = false) =>
Property.Dropdown({
auth: flowluAuth,
displayName: 'Sales Pipeline Stage ID',
required,
refreshers: ['pipeline_id'],
options: async ({ auth, pipeline_id }) => {
if (!auth || !pipeline_id) {
return {
disabled: true,
placeholder:
'Connect your account first and select sales pipeline.',
options: [],
};
}
const client = makeClient(
auth
);
const { response } = await client.listSalesPipelineStages(
pipeline_id as number
);
return {
disabled: false,
options: response.items.map((item) => {
return {
label: item.name,
value: item.id,
};
}),
};
},
}),
};

View File

@@ -0,0 +1,225 @@
import { Property } from '@activepieces/pieces-framework';
import { flowluCommon } from '.';
export const flowluProps = {
task: {
description: Property.LongText({
displayName: 'Description',
required: false,
}),
priority: Property.StaticDropdown({
displayName: 'Priority',
required: false,
options: {
disabled: false,
options: [
{
label: 'Low',
value: 1,
},
{
label: 'Medium',
value: 2,
},
{
label: 'High',
value: 3,
},
],
},
}),
plan_start_date: Property.DateTime({
displayName: 'Start Date',
required: false,
description: 'Please use YYYY-MM-DD HH:mm:ss format.',
}),
deadline: Property.DateTime({
displayName: 'End Date',
required: false,
description: 'Please use YYYY-MM-DD HH:mm:ss format.',
}),
deadline_allowchange: Property.Checkbox({
displayName: 'The assignee can change the end date for this task?',
required: false,
defaultValue: false,
}),
task_checkbyowner: Property.Checkbox({
displayName: 'This task needs approval from the owner?',
required: false,
defaultValue: false,
}),
responsible_id: flowluCommon.user_id(false, 'Assignee ID'),
owner_id: flowluCommon.user_id(false, 'Owner ID'),
type: Property.StaticDropdown({
displayName: 'Task Type',
required: false,
defaultValue: 0,
options: {
disabled: false,
options: [
{
label: 'Task',
value: 0,
},
{
label: 'Inbox',
value: 1,
},
{
label: 'Event',
value: 20,
},
{
label: 'Task template',
value: 30,
},
],
},
}),
workflow_id: flowluCommon.workflow_id(false),
workflow_stage_id: flowluCommon.workflow_stage_id(false),
},
account: {
owner_id: flowluCommon.user_id(false, 'Assignee ID'),
account_category_id: flowluCommon.account_category_id(false),
industry_id: flowluCommon.industry_id(false),
web: Property.ShortText({
displayName: 'Website',
required: false,
}),
email: Property.ShortText({
displayName: 'Email',
required: false,
}),
phone: Property.ShortText({
displayName: 'Primary Phone Number',
required: false,
}),
description: Property.LongText({
displayName: 'Description',
required: false,
}),
vat: Property.ShortText({
displayName: 'VAT or TAX ID',
required: false,
}),
bank_details: Property.LongText({
displayName: 'Bank Details',
required: false,
}),
telegram: Property.ShortText({
displayName: 'Telegram',
required: false,
}),
skype: Property.ShortText({
displayName: 'Skype Account ID',
required: false,
}),
link_google: Property.ShortText({
displayName: 'Link to Google+',
required: false,
}),
link_facebook: Property.ShortText({
displayName: 'Link to Facebook',
required: false,
}),
link_linkedin: Property.ShortText({
displayName: 'Link to Linkedin',
required: false,
}),
link_instagram: Property.ShortText({
displayName: 'Link to Instagram',
required: false,
}),
billing_country: Property.ShortText({
displayName: 'Billing Country',
required: false,
}),
billing_state: Property.ShortText({
displayName: 'Billing State',
required: false,
}),
billing_city: Property.ShortText({
displayName: 'Billing City',
required: false,
}),
billing_zip: Property.ShortText({
displayName: 'Billing Postal code',
required: false,
}),
billing_address_line_1: Property.ShortText({
displayName: 'Billing Address Line 1',
required: false,
}),
billing_address_line_2: Property.ShortText({
displayName: 'Billing Address Line 2',
required: false,
}),
billing_address_line_3: Property.ShortText({
displayName: 'Billing Address Line 3',
required: false,
}),
shipping_country: Property.ShortText({
displayName: 'Shipping Country',
required: false,
}),
shipping_state: Property.ShortText({
displayName: 'Shipping State',
required: false,
}),
shipping_city: Property.ShortText({
displayName: 'Shipping City',
required: false,
}),
shipping_zip: Property.ShortText({
displayName: 'Shipping Postal code',
required: false,
}),
shipping_address_line_1: Property.ShortText({
displayName: 'Shipping Address Line 1',
required: false,
}),
shipping_address_line_2: Property.ShortText({
displayName: 'Shipping Address Line 2',
required: false,
}),
shipping_address_line_3: Property.ShortText({
displayName: 'Shipping Address Line 3',
required: false,
}),
},
opportunity: {
budget: Property.Number({
displayName: 'Opportunity Amount',
required: false,
}),
description: Property.LongText({
displayName: 'Description',
required: false,
}),
source_id: flowluCommon.source_id(false),
start_date: Property.DateTime({
displayName: 'Start Date',
required: false,
description: 'Please use YYYY-MM-DD HH:mm:ss format.',
}),
deadline: Property.DateTime({
displayName: 'End Date',
required: false,
description: 'Please use YYYY-MM-DD HH:mm:ss format.',
}),
assignee_id: flowluCommon.user_id(false, 'Assignee ID'),
customer_id: flowluCommon.account_id(
false,
'Customer ID',
`This is an id of the CRM company or contact which is needed to be linked with the opportunity. This allows you to link the client to the opportunity. If your client is a company, and you need to relate an opportunity to the person (contact) at this company, then enter his/her id in the contact_id field.`
),
contact_id: flowluCommon.contact_id(
false,
'Contact ID',
`Id of the company-related contact (account_id).`
),
pipeline_id: flowluCommon.pipeline_id(false),
pipeline_stage_id: flowluCommon.pipeline_stage_id(false),
},
};

View File

@@ -0,0 +1,229 @@
import { HttpMessageBody } from '@activepieces/pieces-common';
export interface Task {
id: number;
name: string;
description: string;
report: string;
parent_id: number;
prev_task_id: number;
deadline: string;
deadline_allowchange: number;
plan_start_date: string;
plan_end_date: string;
priority: number;
task_checkbyowner: number;
responsible_id: number;
time_estimate: number;
time_spent: number;
status_firstviewdate: string;
start_date: string;
closed_date: string;
first_closed_date: string;
closed_by: number;
return_count: number;
rating: number;
ref: string;
ref_id: string;
module: string;
model: string;
model_id: number;
type: number;
report_complete: string;
all_day: number;
ordering: number;
uuid: string;
public_template: number;
template_id: number;
is_repeat: number;
event_location: string;
event_color: string;
event_busy_status: number;
event_access_type: number;
event_calendar_id: number;
event_type: number;
event_etag: string;
event_sync_type: number;
extra_fields: string;
archive_status: number;
is_hidden: number;
workflow_id: number;
workflow_stage_id: number;
deleted_at: null;
is_archive: string;
created_date: string;
owner_id: number;
updated_date: string;
updated_by: number;
status_updated_date: string;
status_updated_by: number;
project_stage_id: number;
project_checkitem_id: number;
crm_account_id: number;
}
export interface User {
id: string;
last_active: string;
username: string;
first_name: string;
second_name: string;
last_name: string;
birth_date: string;
lang_id: string;
timezone: string;
register_date: string;
image: string;
role_admin: number;
role_login: number;
name: string;
}
export interface Account {
id: number;
name: string;
type: number;
}
export interface TaskWorkflow {
id: number;
name: string;
description: string;
ordering: number;
created_by: number;
updated_by: number;
updated_date: string;
active: number;
deleted_at: string;
}
export interface TaskWorkflowStage {
id: number;
name: string;
description: string;
ordering: number;
created_by: number;
updated_by: number;
updated_date: string;
workflow_id: number;
color: string;
task_status: number;
deleted_at: string;
}
export interface ListAPIResponse<T> extends HttpMessageBody {
response: {
total: number;
total_result: number;
page: number;
count: number;
items: T;
};
}
export interface AccountHonorificTitle {
id: number;
name: string;
ordering: number;
active: number;
}
export interface AccountCategory {
id: number;
active: number;
ordering: number;
name: string;
deleted_at: string;
}
export interface AccountIndustry {
id: number;
name: string;
ordering: number;
active: number;
deleted_at: string;
}
export interface OpportunitySource {
id: number;
name: string;
ordering: number;
active: number;
description: string;
deleted_at: string;
}
export interface Opportunity {
id: number;
name: string;
}
export interface Pipeline {
id: number;
name: string;
ordering: number;
description: string;
deleted_at: string;
}
export interface PipelineStage {
id: number;
name: string;
ordering: number;
active: number;
pipeline_id: number;
color: string;
deleted_at: string;
}
export interface CreateTaskAPIRequest {
name?: string;
description?: string;
priority?: number;
plan_start_date?: string;
deadline?: string;
deadline_allowchange?: number;
task_checkbyowner?: number;
responsible_id?: string;
owner_id?: string;
type?: number;
workflow_id?: number;
workflow_stage_id?: number;
}
export interface CreateCRMAccountAPIRequest {
type: number;
name_legal_full?: string;
first_name?: string;
middle_name?: string;
last_name?: string;
owner_id?: string;
account_category_id?: number;
industry_id?: number;
web?: string;
email?: string;
phone?: string;
description?: string;
vat?: string;
bank_details?: string;
telegram?: string;
skype?: string;
link_google?: string;
link_facebook?: string;
link_linkedin?: string;
link_instagram?: string;
billing_country?: string;
billing_state?: string;
billing_city?: string;
billing_zip?: string;
billing_address_line_1?: string;
billing_address_line_2?: string;
billing_address_line_3?: string;
shipping_country?: string;
shipping_state?: string;
shipping_city?: string;
shipping_zip?: string;
shipping_address_line_1?: string;
shipping_address_line_2?: string;
shipping_address_line_3?: string;
}
export interface CreateOpportunityAPIRequest {
name?: string;
budget?: number;
description?: string;
source_id?: number;
start_date?: string;
deadline?: string;
assignee_id?: string;
customer_id?: number;
contact_id?: number;
pipeline_id?: number;
pipeline_stage_id?: number;
}