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,117 @@
|
||||
import { Property, createAction } from '@activepieces/pieces-framework';
|
||||
import { makeClient } from '../common';
|
||||
import { moxieCRMAuth } from '../..';
|
||||
|
||||
export const moxieCreateClientAction = createAction({
|
||||
auth: moxieCRMAuth,
|
||||
name: 'moxie_create_client',
|
||||
displayName: 'Create a Client',
|
||||
description: 'Create a new client record in moxie CRM.',
|
||||
props: {
|
||||
name: Property.ShortText({
|
||||
displayName: 'Name',
|
||||
required: true,
|
||||
}),
|
||||
clientType: Property.StaticDropdown({
|
||||
displayName: 'Client Type',
|
||||
required: true,
|
||||
defaultValue: 'Client',
|
||||
options: {
|
||||
disabled: false,
|
||||
options: [
|
||||
{
|
||||
label: 'Client',
|
||||
value: 'Client',
|
||||
},
|
||||
{
|
||||
label: 'Prospect',
|
||||
value: 'Prospect',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
initials: Property.ShortText({
|
||||
displayName: 'Initials',
|
||||
required: false,
|
||||
}),
|
||||
address1: Property.ShortText({
|
||||
displayName: 'Address 1',
|
||||
required: false,
|
||||
}),
|
||||
address2: Property.ShortText({
|
||||
displayName: 'Address 2',
|
||||
required: false,
|
||||
}),
|
||||
city: Property.ShortText({
|
||||
displayName: 'City',
|
||||
required: false,
|
||||
}),
|
||||
locality: Property.ShortText({
|
||||
displayName: 'Locality',
|
||||
required: false,
|
||||
}),
|
||||
postal: Property.ShortText({
|
||||
displayName: 'Postal',
|
||||
required: false,
|
||||
}),
|
||||
country: Property.ShortText({
|
||||
displayName: 'Country',
|
||||
required: false,
|
||||
description: 'ISO 3166-1 alpha-2 country code',
|
||||
}),
|
||||
website: Property.ShortText({
|
||||
displayName: 'Website',
|
||||
required: false,
|
||||
}),
|
||||
phone: Property.ShortText({
|
||||
displayName: 'Phone',
|
||||
required: false,
|
||||
}),
|
||||
color: Property.ShortText({
|
||||
displayName: 'Color',
|
||||
required: false,
|
||||
}),
|
||||
taxId: Property.ShortText({
|
||||
displayName: 'Tax ID',
|
||||
required: false,
|
||||
}),
|
||||
leadSource: Property.ShortText({
|
||||
displayName: 'Lead Source',
|
||||
required: false,
|
||||
}),
|
||||
archive: Property.Checkbox({
|
||||
displayName: 'Archive ?',
|
||||
required: true,
|
||||
defaultValue: false,
|
||||
}),
|
||||
payInstructions: Property.LongText({
|
||||
displayName: 'Pay Instructions',
|
||||
required: false,
|
||||
}),
|
||||
hourlyAmount: Property.Number({
|
||||
displayName: 'Hourly Amount',
|
||||
required: false,
|
||||
}),
|
||||
roundingIncrement: Property.Number({
|
||||
displayName: 'Rounding Increment',
|
||||
required: false,
|
||||
}),
|
||||
currency: Property.ShortText({
|
||||
displayName: 'Currency',
|
||||
required: false,
|
||||
description: 'Valid 3-Letter ISO 4217 currency code.',
|
||||
}),
|
||||
stripeClientId: Property.ShortText({
|
||||
displayName: 'Stripe Client ID',
|
||||
required: false,
|
||||
}),
|
||||
notes: Property.LongText({
|
||||
displayName: 'Notes',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run({ auth, propsValue }) {
|
||||
const client = await makeClient(auth);
|
||||
return await client.createClient(propsValue);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,166 @@
|
||||
import {
|
||||
Property,
|
||||
createAction,
|
||||
PiecePropValueSchema,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { makeClient, reformatDate } from '../common';
|
||||
import { moxieCRMAuth } from '../..';
|
||||
|
||||
export const moxieCreateProjectAction = createAction({
|
||||
auth: moxieCRMAuth,
|
||||
name: 'moxie_create_project',
|
||||
description: 'Creates a new project in moxie CRM.',
|
||||
displayName: 'Create a Project',
|
||||
props: {
|
||||
name: Property.ShortText({
|
||||
displayName: 'Project Name',
|
||||
required: true,
|
||||
}),
|
||||
clientName: Property.Dropdown({
|
||||
auth: moxieCRMAuth,
|
||||
displayName: 'Client',
|
||||
required: true,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Connect your account first',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const client = await makeClient(
|
||||
auth
|
||||
);
|
||||
const clients = await client.listClients();
|
||||
return {
|
||||
disabled: false,
|
||||
options: clients.map((client) => {
|
||||
return {
|
||||
label: client.name,
|
||||
value: client.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
}),
|
||||
startDate: Property.DateTime({
|
||||
displayName: 'Start Date',
|
||||
description: 'Please enter date in YYYY-MM-DD format.',
|
||||
required: false,
|
||||
}),
|
||||
dueDate: Property.DateTime({
|
||||
displayName: 'Due Date',
|
||||
description: 'Please enter date in YYYY-MM-DD format.',
|
||||
required: false,
|
||||
}),
|
||||
portalAccess: Property.StaticDropdown({
|
||||
displayName: 'Client Portal Access',
|
||||
description: 'One of: None, Overview, Full access, or Read only.',
|
||||
required: true,
|
||||
defaultValue: 'Read Only',
|
||||
options: {
|
||||
options: [
|
||||
{
|
||||
label: 'Not Visible',
|
||||
value: 'None',
|
||||
},
|
||||
{
|
||||
label: 'Overview only',
|
||||
value: 'Overview',
|
||||
},
|
||||
{
|
||||
label: 'Read only project collaboration',
|
||||
value: 'Read only',
|
||||
},
|
||||
{
|
||||
label: 'Full project collaboration',
|
||||
value: 'Full access',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
showTimeWorkedInPortal: Property.Checkbox({
|
||||
displayName: 'Show time worked in portal ?',
|
||||
required: false,
|
||||
defaultValue: true,
|
||||
}),
|
||||
feeType: Property.StaticDropdown({
|
||||
displayName: 'Fee Type',
|
||||
description: 'One of: Hourly, Fixed Price, Retainer, Per Item.',
|
||||
required: true,
|
||||
options: {
|
||||
options: [
|
||||
{
|
||||
label: 'Hourly',
|
||||
value: 'Hourly',
|
||||
},
|
||||
{
|
||||
label: 'Fixed Price',
|
||||
value: 'Fixed Price',
|
||||
},
|
||||
{
|
||||
label: 'Retainer',
|
||||
value: 'Retainer',
|
||||
},
|
||||
{
|
||||
label: 'Per Item',
|
||||
value: 'Per Item',
|
||||
},
|
||||
],
|
||||
},
|
||||
}),
|
||||
amount: Property.Number({
|
||||
displayName: 'Amount',
|
||||
required: false,
|
||||
defaultValue: 0,
|
||||
}),
|
||||
estimateMax: Property.Number({
|
||||
displayName: 'Estimate maximum Amount',
|
||||
required: false,
|
||||
defaultValue: 0,
|
||||
}),
|
||||
estimateMin: Property.Number({
|
||||
displayName: 'Estimate minimum Amount',
|
||||
required: false,
|
||||
defaultValue: 0,
|
||||
}),
|
||||
taxable: Property.Checkbox({
|
||||
displayName: 'Is amount taxable ?',
|
||||
required: false,
|
||||
defaultValue: false,
|
||||
}),
|
||||
},
|
||||
async run({ auth, propsValue }) {
|
||||
const {
|
||||
name,
|
||||
clientName,
|
||||
portalAccess,
|
||||
showTimeWorkedInPortal,
|
||||
feeType,
|
||||
amount,
|
||||
estimateMax,
|
||||
estimateMin,
|
||||
taxable,
|
||||
} = propsValue;
|
||||
const dueDate = reformatDate(propsValue.dueDate) as string;
|
||||
const startDate = reformatDate(propsValue.startDate) as string;
|
||||
const client = await makeClient(auth);
|
||||
return await client.createProject({
|
||||
name,
|
||||
clientName,
|
||||
startDate,
|
||||
dueDate,
|
||||
portalAccess,
|
||||
showTimeWorkedInPortal,
|
||||
feeSchedule: {
|
||||
feeType,
|
||||
amount,
|
||||
estimateMax,
|
||||
estimateMin,
|
||||
taxable,
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,165 @@
|
||||
import {
|
||||
Property,
|
||||
createAction,
|
||||
PiecePropValueSchema,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { makeClient, reformatDate } from '../common';
|
||||
import { moxieCRMAuth } from '../..';
|
||||
|
||||
export const moxieCreateTaskAction = createAction({
|
||||
auth: moxieCRMAuth,
|
||||
name: 'moxie_create_task',
|
||||
displayName: 'Create a Task',
|
||||
description: 'Create a task in project.',
|
||||
props: {
|
||||
name: Property.ShortText({
|
||||
displayName: 'Name',
|
||||
required: true,
|
||||
}),
|
||||
clientName: Property.Dropdown({
|
||||
auth: moxieCRMAuth,
|
||||
displayName: 'Client Name',
|
||||
description: 'Exact match of a client name in your CRM',
|
||||
required: true,
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Connect your account first',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
|
||||
const client = await makeClient(
|
||||
auth
|
||||
);
|
||||
const clients = await client.listClients();
|
||||
return {
|
||||
disabled: false,
|
||||
options: clients.map((client) => {
|
||||
return {
|
||||
label: client.name,
|
||||
value: client.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
}),
|
||||
projectName: Property.Dropdown({
|
||||
auth: moxieCRMAuth,
|
||||
displayName: 'Project Name',
|
||||
description: 'Exact match of a project that is owned by the client.',
|
||||
required: true,
|
||||
refreshers: ['clientName'],
|
||||
options: async ({ auth, clientName }) => {
|
||||
if (!auth || !clientName) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Connect your account first and select client',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
const client = await makeClient(
|
||||
auth
|
||||
);
|
||||
const projects = await client.searchProjects(clientName as string);
|
||||
return {
|
||||
disabled: false,
|
||||
options: projects.map((project) => {
|
||||
return {
|
||||
label: project.name,
|
||||
value: project.name,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
}),
|
||||
status: Property.Dropdown({
|
||||
auth: moxieCRMAuth,
|
||||
displayName: 'Status',
|
||||
required: true,
|
||||
defaultValue: 'Not Started',
|
||||
refreshers: [],
|
||||
options: async ({ auth }) => {
|
||||
if (!auth) {
|
||||
return {
|
||||
disabled: true,
|
||||
placeholder: 'Connect your account first',
|
||||
options: [],
|
||||
};
|
||||
}
|
||||
const client = await makeClient(
|
||||
auth
|
||||
);
|
||||
const stages = await client.listProjectTaskStages();
|
||||
return {
|
||||
disabled: false,
|
||||
options: stages.map((stage) => {
|
||||
return {
|
||||
label: stage.label,
|
||||
value: stage.label,
|
||||
};
|
||||
}),
|
||||
};
|
||||
},
|
||||
}),
|
||||
description: Property.LongText({
|
||||
displayName: 'Description',
|
||||
required: false,
|
||||
}),
|
||||
startDate: Property.DateTime({
|
||||
displayName: 'Start Date',
|
||||
required: false,
|
||||
description: 'ISO 8601 format date i.e. 2023-07-20',
|
||||
}),
|
||||
dueDate: Property.DateTime({
|
||||
displayName: 'Due Date',
|
||||
required: false,
|
||||
description: 'ISO 8601 format date i.e. 2023-07-20',
|
||||
}),
|
||||
|
||||
priority: Property.Number({
|
||||
displayName: 'Priority',
|
||||
required: false,
|
||||
description: 'Numeric priority for sorting in kanban.',
|
||||
}),
|
||||
tasks: Property.Array({
|
||||
displayName: 'Subtasks',
|
||||
required: false,
|
||||
}),
|
||||
assignedTo: Property.Array({
|
||||
displayName: 'Assigned To',
|
||||
required: false,
|
||||
description: 'email addresses of users in the workspace.',
|
||||
}),
|
||||
customValues: Property.Object({
|
||||
displayName: 'Custom Values',
|
||||
required: false,
|
||||
}),
|
||||
},
|
||||
async run({ auth, propsValue }) {
|
||||
const { name, clientName, projectName, status, description, priority } =
|
||||
propsValue;
|
||||
const dueDate = reformatDate(propsValue.dueDate) as string;
|
||||
const startDate = reformatDate(propsValue.startDate) as string;
|
||||
const tasks = (propsValue.tasks as string[]) || [];
|
||||
const assignedTo = (propsValue.assignedTo as string[]) || [];
|
||||
const customValues =
|
||||
(propsValue.customValues as Record<string, string>) || {};
|
||||
const client = await makeClient(auth);
|
||||
return await client.createTask({
|
||||
name,
|
||||
clientName,
|
||||
projectName,
|
||||
status,
|
||||
description,
|
||||
dueDate,
|
||||
startDate,
|
||||
priority,
|
||||
tasks,
|
||||
assignedTo,
|
||||
customValues,
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
import {
|
||||
HttpMethod,
|
||||
HttpMessageBody,
|
||||
httpClient,
|
||||
HttpResponse,
|
||||
QueryParams,
|
||||
} from '@activepieces/pieces-common';
|
||||
import {
|
||||
ContactCreateRequest,
|
||||
ClientCreateRequest,
|
||||
ClientListResponse,
|
||||
TaskCreateRequest,
|
||||
ProjectCreateRequest,
|
||||
ProjectSearchResponse,
|
||||
ProjectTaskStageListResponse,
|
||||
} from './models';
|
||||
|
||||
export class MoxieCRMClient {
|
||||
constructor(private baseUrl: string, private apiKey: string) {
|
||||
// Remove trailing slash from base URL
|
||||
this.baseUrl = baseUrl.replace(/\/$/, '');
|
||||
}
|
||||
async makeRequest<T extends HttpMessageBody>(
|
||||
method: HttpMethod,
|
||||
resourceUri: string,
|
||||
body: any | undefined = undefined,
|
||||
query?: QueryParams
|
||||
): Promise<HttpResponse<T>> {
|
||||
return await httpClient.sendRequest<T>({
|
||||
method: method,
|
||||
url: `${this.baseUrl}${resourceUri}`,
|
||||
headers: {
|
||||
'X-API-KEY': this.apiKey,
|
||||
},
|
||||
body: body,
|
||||
queryParams: query,
|
||||
});
|
||||
}
|
||||
async createContact(request: ContactCreateRequest) {
|
||||
return (
|
||||
await this.makeRequest(
|
||||
HttpMethod.POST,
|
||||
'/action/contacts/create',
|
||||
request
|
||||
)
|
||||
).body;
|
||||
}
|
||||
async createClient(request: ClientCreateRequest) {
|
||||
return (
|
||||
await this.makeRequest(HttpMethod.POST, '/action/clients/create', request)
|
||||
).body;
|
||||
}
|
||||
async listClients(): Promise<ClientListResponse[]> {
|
||||
return (
|
||||
await this.makeRequest<ClientListResponse[]>(
|
||||
HttpMethod.GET,
|
||||
'/action/clients/list'
|
||||
)
|
||||
).body;
|
||||
}
|
||||
async listInvoiceTemplates(): Promise<string[]> {
|
||||
return (
|
||||
await this.makeRequest<string[]>(
|
||||
HttpMethod.GET,
|
||||
'/action/invoiceTemplates/list'
|
||||
)
|
||||
).body;
|
||||
}
|
||||
|
||||
async createProject(request: ProjectCreateRequest) {
|
||||
return (
|
||||
await this.makeRequest(
|
||||
HttpMethod.POST,
|
||||
'/action/projects/create',
|
||||
request
|
||||
)
|
||||
).body;
|
||||
}
|
||||
async createTask(request: TaskCreateRequest) {
|
||||
return (
|
||||
await this.makeRequest(HttpMethod.POST, '/action/tasks/create', request)
|
||||
).body;
|
||||
}
|
||||
|
||||
async searchProjects(clientName: string): Promise<ProjectSearchResponse[]> {
|
||||
return (
|
||||
await this.makeRequest<ProjectSearchResponse[]>(
|
||||
HttpMethod.GET,
|
||||
'/action/projects/search',
|
||||
undefined,
|
||||
{ query: clientName }
|
||||
)
|
||||
).body;
|
||||
}
|
||||
|
||||
async listProjectTaskStages(): Promise<ProjectTaskStageListResponse[]> {
|
||||
return (
|
||||
await this.makeRequest<ProjectTaskStageListResponse[]>(
|
||||
HttpMethod.GET,
|
||||
'/action/taskStages/list'
|
||||
)
|
||||
).body;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { AppConnectionValueForAuthProperty, PiecePropValueSchema } from '@activepieces/pieces-framework';
|
||||
|
||||
import { moxieCRMAuth } from '../../';
|
||||
import { MoxieCRMClient } from './client';
|
||||
|
||||
export async function makeClient(
|
||||
auth: AppConnectionValueForAuthProperty<typeof moxieCRMAuth>
|
||||
): Promise<MoxieCRMClient> {
|
||||
const client = new MoxieCRMClient(auth.props.baseUrl, auth.props.apiKey);
|
||||
return client;
|
||||
}
|
||||
|
||||
export function reformatDate(s?: string): string | undefined {
|
||||
if (!s) return undefined;
|
||||
return s.split('T', 2)[0];
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
export type ContactCreateRequest = {
|
||||
first: string;
|
||||
last: string;
|
||||
email?: string;
|
||||
phone?: string;
|
||||
notes?: string;
|
||||
clientName?: string;
|
||||
defaultContact?: boolean;
|
||||
portalAccess?: boolean;
|
||||
invoiceContact?: boolean;
|
||||
};
|
||||
|
||||
export type ClientListResponse = {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export type ProjectSearchResponse = {
|
||||
id: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export type ProjectTaskStageListResponse = {
|
||||
id: string;
|
||||
label: string;
|
||||
hexColor: string;
|
||||
complete: boolean;
|
||||
clientApproval: boolean;
|
||||
};
|
||||
|
||||
export type ProjectCreateRequest = {
|
||||
name: string;
|
||||
clientName: string;
|
||||
startDate?: string;
|
||||
dueDate?: string;
|
||||
portalAccess: string;
|
||||
showTimeWorkedInPortal?: boolean;
|
||||
feeSchedule: {
|
||||
feeType: string;
|
||||
amount?: number;
|
||||
estimateMax?: number;
|
||||
estimateMin?: number;
|
||||
taxable?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
export type ClientCreateRequest = {
|
||||
name: string;
|
||||
clientType: string;
|
||||
initials?: string;
|
||||
address1?: string;
|
||||
address2?: string;
|
||||
city?: string;
|
||||
locality?: string;
|
||||
postal?: string;
|
||||
country?: string;
|
||||
website?: string;
|
||||
phone?: string;
|
||||
color?: string;
|
||||
taxId?: string;
|
||||
leadSource?: string;
|
||||
archive: boolean;
|
||||
payInstructions?: string;
|
||||
hourlyAmount?: number;
|
||||
roundingIncrement?: number;
|
||||
currency?: string;
|
||||
stripeClientId?: string;
|
||||
notes?: string;
|
||||
};
|
||||
|
||||
export type TaskCreateRequest = {
|
||||
name: string;
|
||||
clientName: string;
|
||||
projectName: string;
|
||||
status: string;
|
||||
description?: string;
|
||||
dueDate?: string;
|
||||
startDate?: string;
|
||||
priority?: number;
|
||||
tasks?: string[];
|
||||
assignedTo?: string[];
|
||||
customValues?: Record<string, string>;
|
||||
};
|
||||
@@ -0,0 +1,855 @@
|
||||
import { moxieCRMRegisterTrigger } from './register-trigger';
|
||||
export const enum MoxieCRMEventType {
|
||||
CLIENT_CREATED = 'ClientCreate',
|
||||
CLIENT_UPDATED = 'ClientUpdate',
|
||||
CLIENT_DELETED = 'ClientDelete',
|
||||
PROJECT_CREATED = 'ProjectCreate',
|
||||
PROJECT_UPDATED = 'ProjectUpdate',
|
||||
PROJECT_COMPLETED = 'ProjectComplete',
|
||||
TASK_CREATED = 'DeliverableCreate',
|
||||
TASK_UPDATED = 'DeliverableUpdate',
|
||||
TASK_DELETED = 'DeliverableDelete',
|
||||
TASK_APPROVAL = 'DeliverableApproval',
|
||||
FORM_SUBMITTED = 'FormCompleted',
|
||||
TIME_ENTRY_CREATED = 'TimerCreate',
|
||||
TIME_ENTRY_UPDATED = 'TimerUpdate',
|
||||
TIME_ENTRY_DELETED = 'TimerDelete',
|
||||
MEETING_SCHEDULED = 'MeetingScheduled',
|
||||
MEETING_UPDATED = 'MeetingUpdated',
|
||||
MEETING_CANCELLED = 'MeetingCancelled',
|
||||
OPPORTUNITY_CREATED = 'OpportunityCreate',
|
||||
OPPORTUNITY_UPDATED = 'OpportunityUpdate',
|
||||
OPPORTUNITY_DELETED = 'OpportunityDelete',
|
||||
INVOICE_SENT = 'InvoiceSent',
|
||||
PAYMENT_RECEIVED = 'PaymentReceived',
|
||||
}
|
||||
|
||||
const MoxieCRMWebhookSampleData = {
|
||||
PROJECT_EVENT_SAMPLE_DATA: {
|
||||
id: '6434749e852ec5116d546759',
|
||||
accountId: 10016,
|
||||
sampleData: false,
|
||||
clientId: '64230b34bd4bbd275c1f1739',
|
||||
name: 'Design & Development of Website',
|
||||
description: null,
|
||||
active: true,
|
||||
startDate: '2023-05-16',
|
||||
dueDate: '2023-06-06',
|
||||
dateCreated: '2023-04-10T20:42:06.572Z',
|
||||
client: {
|
||||
accountId: 10016,
|
||||
sampleData: false,
|
||||
id: '64230b34bd4bbd275c1f1739',
|
||||
clientType: 'Client',
|
||||
name: 'Moxie',
|
||||
initials: 'MOX1',
|
||||
locality: 'CO',
|
||||
country: null,
|
||||
color: '#3BDBBE',
|
||||
projects: [],
|
||||
hourlyAmount: 0,
|
||||
archive: false,
|
||||
currency: 'AUD',
|
||||
logo: 'https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://www.withmoxie.com&size=64',
|
||||
leadSource: 'Google',
|
||||
contact: null,
|
||||
},
|
||||
leadGenArchived: false,
|
||||
feeSchedule: {
|
||||
feeType: 'Fixed Price',
|
||||
amount: 5000,
|
||||
retainerSchedule: null,
|
||||
estimateMax: null,
|
||||
estimateMin: null,
|
||||
retainerStart: null,
|
||||
retainerTiming: 'Advanced',
|
||||
retainerOverageRate: null,
|
||||
taxable: false,
|
||||
fromProposalId: null,
|
||||
fromProposalSignedDate: null,
|
||||
updatedDate: '2023-04-10T20:42:16.141Z',
|
||||
updatedBy: 'G. Mina',
|
||||
},
|
||||
proposalId: null,
|
||||
proposalName: null,
|
||||
hexColor: '#3BDBBEFF',
|
||||
portalAccess: 'Overview',
|
||||
showTimeWorkedInPortal: true,
|
||||
files: [],
|
||||
deliverables: [],
|
||||
},
|
||||
CLIENT_EVENT_SAMPLE_DATA: {
|
||||
id: '63c5ea0c840e3207033931b5',
|
||||
accountId: 10016,
|
||||
name: 'Moxie',
|
||||
clientType: 'Client',
|
||||
initials: 'MOX',
|
||||
address1: '123 Any Street',
|
||||
address2: 'Suite 100',
|
||||
city: 'Anytown',
|
||||
locality: 'NY',
|
||||
postal: '12345',
|
||||
country: 'US',
|
||||
website: 'www.withmoxie.com',
|
||||
phone: '+18887231235',
|
||||
color: '#CE62E9',
|
||||
logo: 'https://t3.gstatic.com/faviconV2?client=SOCIAL&type=FAVICON&fallback_opts=TYPE,SIZE,URL&url=https://www.withmoxie.com&size=64',
|
||||
s3LogoFile: null,
|
||||
taxId: '1212121212',
|
||||
leadSource: 'PPC',
|
||||
archive: false,
|
||||
leadGenArchived: false,
|
||||
paymentTerms: {
|
||||
paymentDays: 7,
|
||||
latePaymentFee: 5,
|
||||
depositAmount: 50,
|
||||
depositType: 'Percentage',
|
||||
whoPaysCardFees: 'Freelancer',
|
||||
fromProposalId: '640b60752a524d1c45b6c528',
|
||||
fromProposalSignedDate: '2023-03-14T14:41:01.908Z',
|
||||
updatedDate: '2023-04-04T16:17:27.315Z',
|
||||
updatedBy: 'G. Mina',
|
||||
},
|
||||
payInstructions: null,
|
||||
hourlyAmount: 100,
|
||||
roundingIncrement: 1,
|
||||
currency: 'USD',
|
||||
lastInvoiceRunDate: null,
|
||||
nextInvoiceRunDate: null,
|
||||
importRecordId: null,
|
||||
integrationKeys: {
|
||||
quickbooksId: null,
|
||||
xeroId: null,
|
||||
},
|
||||
files: [],
|
||||
comments: [],
|
||||
created: '2023-01-17T00:21:32.663Z',
|
||||
sampleData: false,
|
||||
stripeClientId: 'cus_NFTM1mAFkgtfUI',
|
||||
notes: null,
|
||||
notifyOnCreate: null,
|
||||
contacts: [
|
||||
{
|
||||
id: '63d431ab3813ca3d0789d2cc',
|
||||
accountId: 10016,
|
||||
clientId: '63c5ea0c840e3207033931b5',
|
||||
clientPortalUserId: -66,
|
||||
firstName: 'Jeffrey',
|
||||
lastName: 'Marna',
|
||||
role: null,
|
||||
phone: null,
|
||||
email: 'geoff.mina@withmoxie.com',
|
||||
mobile: null,
|
||||
notes: null,
|
||||
defaultContact: true,
|
||||
invoiceContact: false,
|
||||
portalAccess: true,
|
||||
importRecordId: null,
|
||||
sampleData: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
PROJECT_TASK_EVENT_SAMPLE_DATA: {
|
||||
id: '64b3eba1249a076683fe3560',
|
||||
clientId: '6490580de30ecf51c2c22ffa',
|
||||
projectId: '649c83111c9cbe6ba1d4cabe',
|
||||
project: {
|
||||
id: '649c83111c9cbe6ba1d4cabe',
|
||||
accountId: 10016,
|
||||
sampleData: false,
|
||||
clientId: '6490580de30ecf51c2c22ffa',
|
||||
name: 'Hourly Project',
|
||||
description: null,
|
||||
active: true,
|
||||
startDate: null,
|
||||
dueDate: null,
|
||||
dateCreated: '2023-06-28T18:59:29.587Z',
|
||||
client: null,
|
||||
leadGenArchived: false,
|
||||
feeSchedule: {
|
||||
feeType: 'Hourly',
|
||||
amount: 150,
|
||||
retainerSchedule: null,
|
||||
estimateMax: null,
|
||||
estimateMin: null,
|
||||
retainerStart: null,
|
||||
retainerTiming: 'Advanced',
|
||||
retainerOverageRate: null,
|
||||
taxable: false,
|
||||
fromProposalId: null,
|
||||
fromProposalSignedDate: null,
|
||||
updatedDate: null,
|
||||
updatedBy: null,
|
||||
},
|
||||
proposalId: null,
|
||||
proposalName: null,
|
||||
hexColor: '#ffffff00',
|
||||
portalAccess: 'Overview',
|
||||
showTimeWorkedInPortal: true,
|
||||
files: [],
|
||||
deliverables: [],
|
||||
},
|
||||
client: {
|
||||
accountId: 10016,
|
||||
sampleData: false,
|
||||
id: '6490580de30ecf51c2c22ffa',
|
||||
clientType: 'Client',
|
||||
name: 'Moxie',
|
||||
initials: null,
|
||||
locality: 'NY',
|
||||
country: 'US',
|
||||
color: '#8EA3B8',
|
||||
projects: [],
|
||||
hourlyAmount: 150,
|
||||
archive: false,
|
||||
currency: 'USD',
|
||||
logo: null,
|
||||
leadSource: null,
|
||||
contact: {
|
||||
id: '6490580de30ecf51c2c22ffb',
|
||||
accountId: 10016,
|
||||
clientId: '6490580de30ecf51c2c22ffa',
|
||||
clientPortalUserId: -79,
|
||||
firstName: 'Geoffrey',
|
||||
lastName: 'Mina',
|
||||
role: null,
|
||||
phone: '+15555551212',
|
||||
email: 'geoff.mina@withmoxie.com',
|
||||
mobile: null,
|
||||
notes: null,
|
||||
defaultContact: true,
|
||||
invoiceContact: false,
|
||||
portalAccess: true,
|
||||
importRecordId: null,
|
||||
sampleData: null,
|
||||
},
|
||||
},
|
||||
name: 'Another new task to build website and victory',
|
||||
statusId: '05b26dd1-0668-4dcc-b438-87ac93d4eb15',
|
||||
status: 'In Progress',
|
||||
priority: 2,
|
||||
description: 'This is the description of the task',
|
||||
assignedTo: null,
|
||||
assignedToList: [16, 222],
|
||||
approvalRequired: false,
|
||||
product: null,
|
||||
quantity: 0,
|
||||
invoiceId: null,
|
||||
invoiceNumber: null,
|
||||
customValues: [
|
||||
{
|
||||
fieldId: '4591275b-1c76-4eae-9257-0438fe1d2354',
|
||||
fieldName: 'Text Input',
|
||||
value: 'Text input',
|
||||
},
|
||||
{
|
||||
fieldId: 'a7e49f95-e0f4-416e-9bbf-586d98e1a55e',
|
||||
fieldName: 'Numeric Input',
|
||||
value: 123,
|
||||
},
|
||||
{
|
||||
fieldId: '0a95ed1a-f084-4e13-be02-6065bea93aed',
|
||||
fieldName: 'Currency Input',
|
||||
value: 2000,
|
||||
},
|
||||
{
|
||||
fieldId: '399ac82b-e56e-4499-b4be-db7d3f81f0fc',
|
||||
fieldName: 'Radio Input',
|
||||
value: 'Two',
|
||||
},
|
||||
{
|
||||
fieldId: '006ec49b-68e1-4ebd-9bdc-d18776551616',
|
||||
fieldName: 'Checkbox Input',
|
||||
value: 'Three',
|
||||
},
|
||||
{
|
||||
fieldId: 'd255032b-4f82-4f1b-8b61-4bccc66370c4',
|
||||
fieldName: 'Phase',
|
||||
value: 'Phase 1',
|
||||
},
|
||||
{
|
||||
fieldId: '4a281477-bed5-4f56-9e89-0bcb3758b3f8',
|
||||
fieldName: 'Shoot Date',
|
||||
value: '2023-07-07',
|
||||
},
|
||||
{
|
||||
fieldId: '3fb9c4f2-8093-4315-b2cd-748a3526b497',
|
||||
fieldName: 'Recurs',
|
||||
value: 'Yes',
|
||||
},
|
||||
],
|
||||
comments: [
|
||||
{
|
||||
id: '81eec0c6-4b6b-46f5-a412-cdc66c8571c8',
|
||||
author: 'Geoffrey Mina',
|
||||
authorId: '16',
|
||||
comment: 'Comments in the task show up here.',
|
||||
clientComment: false,
|
||||
edited: false,
|
||||
privateComment: false,
|
||||
sendEmail: false,
|
||||
timestamp: '2023-07-20T10:51:32.086Z',
|
||||
},
|
||||
],
|
||||
startDate: '2023-07-01',
|
||||
dueDate: '2023-07-31',
|
||||
tasks: [
|
||||
{
|
||||
id: 'e105201a27f34a26a37ef54e6b0f522b',
|
||||
description: 'One',
|
||||
complete: true,
|
||||
},
|
||||
{
|
||||
id: '6c436ea963844783b569639f4c26768e',
|
||||
description: 'Two',
|
||||
complete: true,
|
||||
},
|
||||
{
|
||||
id: 'bf62b9745301466397d09ab9aaa4bd69',
|
||||
description: 'Three',
|
||||
complete: false,
|
||||
},
|
||||
{
|
||||
id: 'dd932850c2094d879c7128cecc468d83',
|
||||
description: 'Four',
|
||||
complete: false,
|
||||
},
|
||||
],
|
||||
archived: false,
|
||||
kanbanSort: 2,
|
||||
},
|
||||
FORM_EVENT_SAMPLE_DATA: {
|
||||
id: '64b8233d6ce6226305f24b47',
|
||||
accountId: 10016,
|
||||
client: null,
|
||||
formName: 'test-new-client',
|
||||
businessName: 'Moxie',
|
||||
firstName: 'Geoffrey',
|
||||
lastName: 'Mina',
|
||||
phone: '+444445551212',
|
||||
email: 'hello@withmoxie.com',
|
||||
role: null,
|
||||
address1: null,
|
||||
address2: null,
|
||||
city: null,
|
||||
locality: null,
|
||||
postal: null,
|
||||
country: null,
|
||||
website: null,
|
||||
leadSource: null,
|
||||
sourceUrl:
|
||||
'https://hello.withmoxie.dev/00/hectic-lab/test-new-client?inPortal=true',
|
||||
Field6: 'Answer to your first question',
|
||||
Field7: 'Another to your other question',
|
||||
submittedAt: '2023-07-19T17:54:05.257Z',
|
||||
},
|
||||
TIME_ENTRY_EVENT_SAMPLE_DATA: {
|
||||
id: '64b857b0b17c7c727001331c',
|
||||
accountId: 10016,
|
||||
sampleData: false,
|
||||
userId: 16,
|
||||
timerStart: '2023-07-19T21:37:35.684Z',
|
||||
timerEnd: '2023-07-19T21:37:52.431Z',
|
||||
userFullName: 'Geoffrey Mina',
|
||||
notes: 'These are some notes',
|
||||
clientId: '6490580de30ecf51c2c22ffa',
|
||||
projectId: '649976d658c17d4f29b068ee',
|
||||
deliverableId: '649976e158c17d4f29b068ef',
|
||||
clientName: 'Moxie',
|
||||
projectName: 'Fun project for client',
|
||||
deliverableName: 'Task 1',
|
||||
timestamp: null,
|
||||
timestampUpdated: null,
|
||||
invoiceId: null,
|
||||
invoiceNumber: null,
|
||||
importRecordId: null,
|
||||
feeSchedule: null,
|
||||
duration: 16,
|
||||
},
|
||||
MEETING_EVENT_SAMPLE_DATA: {
|
||||
id: '64b824df6ce6226305f24b53',
|
||||
accountId: 10016,
|
||||
ownerUserId: null,
|
||||
sampleData: false,
|
||||
meetingId: '63076a1320e0d10001e6cb63',
|
||||
clientId: '63c5ea0c840e3207033931b5',
|
||||
meetingStatus: 'Scheduled',
|
||||
meetingName: 'Geoff Mina / 30 minute meeting',
|
||||
schedulerName: '30 minute meeting',
|
||||
confirmedTime: {
|
||||
start: '2023-07-19T22:30:00.000Z',
|
||||
end: '2023-07-19T23:00:00.000Z',
|
||||
},
|
||||
scheduledTimezone: 'America/New_York',
|
||||
scheduledLocale: 'en-US',
|
||||
formData: {
|
||||
firstName: 'Geoff',
|
||||
lastName: 'Mina',
|
||||
email: 'geoff.mina@withmoxie.com',
|
||||
phone: '+445555555555',
|
||||
role: null,
|
||||
businessName: null,
|
||||
website: null,
|
||||
address1: null,
|
||||
address2: null,
|
||||
city: null,
|
||||
locality: null,
|
||||
postal: null,
|
||||
country: null,
|
||||
sourceUrl: null,
|
||||
opportunityId: null,
|
||||
templateId: null,
|
||||
cardTokenId: null,
|
||||
leadSource: null,
|
||||
answers: [],
|
||||
},
|
||||
location: {
|
||||
type: 'Google',
|
||||
},
|
||||
zoomMeeting: null,
|
||||
googleMeeting: {
|
||||
googleUserId: 16,
|
||||
eventId: '_6oq64e1i6hi6cdj3ckr34chm6co3aphi6hh3acq0d1im6t39cdgn0s1ecdnmq',
|
||||
hangoutLink: 'https://meet.google.com/swq-azkw-zkt',
|
||||
htmlLink:
|
||||
'https://www.google.com/calendar/event?eid=XzZvcTY0ZTFpNmhpNmNkajNja3IzNGNobTZjbzNhcGhpNmhoM2FjcTBkMWltNnQzOWNkZ24wczFlY2RubXEgZ2VvZmYubWluYUBoZWN0aWMudXM',
|
||||
googleUser: {
|
||||
name: 'Geoff Mina',
|
||||
given_name: 'Geoff',
|
||||
family_name: 'Mina',
|
||||
picture:
|
||||
'https://lh3.googleusercontent.com/a/AGNmyxYxJL9h8SnY6z2oXg7fNHAdov1TJ4--RQtiAMn8=s96-c',
|
||||
email: 'geoff.mina@hectic.us',
|
||||
email_verified: true,
|
||||
locale: 'en',
|
||||
},
|
||||
entryPoints: [
|
||||
{
|
||||
entryPointType: 'video',
|
||||
label: 'meet.google.com/swq-azkw-zkt',
|
||||
uri: 'https://meet.google.com/swq-azkw-zkt',
|
||||
},
|
||||
{
|
||||
entryPointType: 'more',
|
||||
pin: '4419810087411',
|
||||
uri: 'https://tel.meet/swq-azkw-zkt?pin=4419810087411',
|
||||
},
|
||||
{
|
||||
entryPointType: 'phone',
|
||||
label: '+1 646-504-7945',
|
||||
pin: '978184485',
|
||||
regionCode: 'US',
|
||||
uri: 'tel:+1-646-504-7945',
|
||||
},
|
||||
],
|
||||
},
|
||||
microsoftEvent: null,
|
||||
connectedICalUid: null,
|
||||
notes: null,
|
||||
cancellationReason: null,
|
||||
leadGenArchived: false,
|
||||
opportunityId: null,
|
||||
files: [],
|
||||
meetingWith: 'Moxie',
|
||||
incomeRecordId: null,
|
||||
icalUid: '64b824df6ce6226305f24b53@hecticapp.com',
|
||||
},
|
||||
OPPORTUNITY_EVENT_SAMPLE_DATA: {
|
||||
id: '642dfde9fd537145d22edbaa',
|
||||
accountId: 10016,
|
||||
clientId: '5f7b3335b50f2a000189217a',
|
||||
statusId: '30180ce4-ba0a-4b5d-b92c-d2733e11b514',
|
||||
kanbanSort: 1,
|
||||
name: 'New Opportunity',
|
||||
description: null,
|
||||
sentiment: 2,
|
||||
value: 1500,
|
||||
timePeriod: 'OneTime',
|
||||
periods: 1,
|
||||
estCloseDate: '2023-07-31',
|
||||
actualCloseDate: null,
|
||||
formData: {
|
||||
firstName: 'Geoff',
|
||||
lastName: 'Mina',
|
||||
email: 'geoff.mina@withmoxie.com',
|
||||
phone: '555-555-5554',
|
||||
role: 'Executive',
|
||||
businessName: 'Moxie',
|
||||
website: 'www.withmoxie.com',
|
||||
address1: '123 Any Stree',
|
||||
address2: 'Suite 100',
|
||||
city: 'Boulder',
|
||||
locality: 'CO',
|
||||
postal: '80301',
|
||||
country: 'US',
|
||||
sourceUrl: 'https://hello.hecticapp.dev/00/hectic-lab/fancy-new-form-v2',
|
||||
opportunityId: null,
|
||||
templateId: '642356ec35707318aa08bd18',
|
||||
cardTokenId: null,
|
||||
leadSource: 'Google',
|
||||
answers: [
|
||||
{
|
||||
id: '516e2366-a52f-4d69-8059-d2df8e692f12',
|
||||
fieldKey: 'Field9',
|
||||
fieldType: 'TextInput',
|
||||
question: 'Enter question text',
|
||||
answer: 'Blah',
|
||||
},
|
||||
{
|
||||
id: 'e30eb7c2-2b69-4a88-a973-92321c5c147d',
|
||||
fieldKey: 'Field16',
|
||||
fieldType: 'Checkbox',
|
||||
question: 'Choose an option',
|
||||
answer: 'Option 1, Option 2',
|
||||
},
|
||||
{
|
||||
id: 'ba71978a-67df-4335-9a70-7bfad8185788',
|
||||
fieldKey: 'Field13',
|
||||
fieldType: 'Radio',
|
||||
question: 'Choose an option',
|
||||
answer: 'Option 2',
|
||||
},
|
||||
{
|
||||
id: '4dd4471d-04c0-4795-8859-5f4d3b0fb283',
|
||||
fieldKey: 'Field7',
|
||||
fieldType: 'DateInput',
|
||||
question: 'Select a date',
|
||||
answer: '2023-04-06',
|
||||
},
|
||||
{
|
||||
id: 'a201bb30-48c4-4408-a35e-0ff619a660f9',
|
||||
fieldKey: 'Field15',
|
||||
fieldType: 'TextArea',
|
||||
question: 'Enter question text',
|
||||
answer: 'Blah',
|
||||
},
|
||||
{
|
||||
id: '973d4b26-2629-4819-92ed-7f8c73268982',
|
||||
fieldKey: 'Field8',
|
||||
fieldType: 'FileInput',
|
||||
question: 'Upload your file',
|
||||
answer: '["4BFE0272-D8BC-46CA-A8C8-079BB34B1BA0.jpeg"]',
|
||||
},
|
||||
],
|
||||
},
|
||||
archive: false,
|
||||
initialWorkflow: true,
|
||||
toDos: [
|
||||
{
|
||||
id: '4ed64532451f4421a063a7b61f2016b7',
|
||||
item: 'Make Phone Call',
|
||||
complete: false,
|
||||
dueDate: '2023-07-20',
|
||||
dateCompleted: null,
|
||||
relativeDueDate: {
|
||||
duration: null,
|
||||
timeUnit: null,
|
||||
},
|
||||
},
|
||||
{
|
||||
id: '404fd07b56494676b2dc3aaee7a3b30f',
|
||||
item: 'Send Email',
|
||||
complete: false,
|
||||
dueDate: '2023-07-23',
|
||||
dateCompleted: null,
|
||||
relativeDueDate: {
|
||||
duration: null,
|
||||
timeUnit: null,
|
||||
},
|
||||
},
|
||||
],
|
||||
comments: [
|
||||
{
|
||||
id: null,
|
||||
author: 'System',
|
||||
authorId: '0',
|
||||
comment: 'Auto created from form: Fancy New Form V2',
|
||||
clientComment: false,
|
||||
edited: false,
|
||||
privateComment: false,
|
||||
sendEmail: false,
|
||||
timestamp: '2023-04-05T23:02:00.618Z',
|
||||
},
|
||||
],
|
||||
files: [
|
||||
{
|
||||
fileName: 'Screenshot 2023-07-19 at 6.11.40 PM.png',
|
||||
fileType: 'PNG',
|
||||
timestamp: '2023-07-20T10:54:30.759Z',
|
||||
fileIconUrl:
|
||||
'https://struxture-www-assets.s3.us-east-2.amazonaws.com/file-icons/png.png',
|
||||
},
|
||||
{
|
||||
fileName: 'Screenshot 2023-07-19 at 1.50.59 PM.png',
|
||||
fileType: 'PNG',
|
||||
timestamp: '2023-07-20T10:54:30.991Z',
|
||||
fileIconUrl:
|
||||
'https://struxture-www-assets.s3.us-east-2.amazonaws.com/file-icons/png.png',
|
||||
},
|
||||
],
|
||||
workflow: [
|
||||
{
|
||||
id: 'c595dc6c-b7ea-4dfd-ac10-0883320e1eb8',
|
||||
itemId: '642dfde2fd537145d22edba5',
|
||||
itemType: 'Form',
|
||||
properties: {},
|
||||
timestamp: '2023-04-05T23:01:54.206Z',
|
||||
},
|
||||
],
|
||||
customValues: [
|
||||
{
|
||||
fieldId: '5e9d7171-1988-431d-a1c8-491e4ae71613',
|
||||
fieldName: 'Custom Field',
|
||||
value: 'Custom Field Value',
|
||||
},
|
||||
],
|
||||
history: [],
|
||||
statusLabel: 'Contract',
|
||||
},
|
||||
INVOICE_EVENT_SAMPLE_DATA: {
|
||||
id: '64ae5aea99f38e74fc78ae46',
|
||||
invoiceNumber: 74,
|
||||
invoiceNumberFormatted: 'E-2023-74',
|
||||
accountId: 10016,
|
||||
clientId: '6490580de30ecf51c2c22ffa',
|
||||
dateCreated: '2023-07-16',
|
||||
dateSent: '2023-07-12',
|
||||
dateDue: '2023-08-11',
|
||||
dateDueCalculated: null,
|
||||
datePaid: '2023-07-12',
|
||||
clientInfo: {
|
||||
id: '6490580de30ecf51c2c22ffa',
|
||||
name: 'E164',
|
||||
initials: null,
|
||||
address1: '123 Any Street',
|
||||
address2: null,
|
||||
city: 'Anytown',
|
||||
locality: 'NY',
|
||||
postal: '12020',
|
||||
country: 'US',
|
||||
phone: '+15555551212',
|
||||
color: '#8EA3B8',
|
||||
taxId: null,
|
||||
website: null,
|
||||
contact: {
|
||||
id: '6490580de30ecf51c2c22ffb',
|
||||
accountId: 10016,
|
||||
clientId: '6490580de30ecf51c2c22ffa',
|
||||
clientPortalUserId: -79,
|
||||
firstName: 'Geoffrey',
|
||||
lastName: 'Mina',
|
||||
role: null,
|
||||
phone: '+12224445234',
|
||||
email: 'user@email.com',
|
||||
mobile: null,
|
||||
notes: null,
|
||||
defaultContact: true,
|
||||
invoiceContact: false,
|
||||
portalAccess: true,
|
||||
importRecordId: null,
|
||||
sampleData: null,
|
||||
},
|
||||
roundingIncrement: 1,
|
||||
customInfo: false,
|
||||
},
|
||||
status: 'PARTIAL',
|
||||
invoiceType: 'STANDARD',
|
||||
subTotal: 14950,
|
||||
convenienceFee: 0,
|
||||
lateFee: 0,
|
||||
discountAmount: 0,
|
||||
creditApplied: 0,
|
||||
tax: 225,
|
||||
total: 15175,
|
||||
localTotal: 15175,
|
||||
paymentTotal: 78.75,
|
||||
localPaymentTotal: 78.75,
|
||||
amountDue: 15096.25,
|
||||
localAmountDue: 15096.25,
|
||||
currency: 'USD',
|
||||
integrationKeys: {
|
||||
quickbooksId: null,
|
||||
xeroId: null,
|
||||
},
|
||||
viewOnlineUrl: 'https://clients.domain.com/invoice?token=',
|
||||
payments: [
|
||||
{
|
||||
id: '29e34d7b-ef69-4059-bbe9-7b214c38a011',
|
||||
amount: 78.75,
|
||||
pending: false,
|
||||
paidBy: 'G. Mina',
|
||||
paymentProvider: 'CHECK',
|
||||
currency: 'USD',
|
||||
referenceNumber: null,
|
||||
memo: null,
|
||||
datePaid: '2023-07-12',
|
||||
timestamp: '2023-07-12T06:00:00.000Z',
|
||||
integratedPayment: false,
|
||||
forcePaidInFull: false,
|
||||
integrationKeys: {
|
||||
quickbooksId: null,
|
||||
xeroId: null,
|
||||
},
|
||||
isFailedPayment: false,
|
||||
localAmount: 78.75,
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
export const moxieCRMTriggers = [
|
||||
{
|
||||
name: 'client_created',
|
||||
displayName: 'Client Created',
|
||||
description: 'Triggered when a new client is created.',
|
||||
eventType: MoxieCRMEventType.CLIENT_CREATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.CLIENT_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'client_updated',
|
||||
displayName: 'Client Updated',
|
||||
description: 'Triggered when an existing client is updated.',
|
||||
eventType: MoxieCRMEventType.CLIENT_UPDATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.CLIENT_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'client_deleted',
|
||||
displayName: 'Client Deleted',
|
||||
description: 'Triggered when an existing client is deleted.',
|
||||
eventType: MoxieCRMEventType.CLIENT_DELETED,
|
||||
sampleData: MoxieCRMWebhookSampleData.CLIENT_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'project_created',
|
||||
displayName: 'Project Created',
|
||||
description: 'Triggered when a new project is created.',
|
||||
eventType: MoxieCRMEventType.PROJECT_CREATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.PROJECT_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'project_updated',
|
||||
displayName: 'Project Updated',
|
||||
description: 'Triggered when an existing project is updated.',
|
||||
eventType: MoxieCRMEventType.PROJECT_UPDATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.PROJECT_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'project_completed',
|
||||
displayName: 'Project Completed',
|
||||
description: 'Triggered when an existing project is completed.',
|
||||
eventType: MoxieCRMEventType.PROJECT_COMPLETED,
|
||||
sampleData: MoxieCRMWebhookSampleData.PROJECT_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'task_created',
|
||||
displayName: 'Task Created',
|
||||
description: 'Triggered when a new task is created.',
|
||||
eventType: MoxieCRMEventType.TASK_CREATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.PROJECT_TASK_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'task_updated',
|
||||
displayName: 'Task Updated',
|
||||
description: 'Triggered when an existing task is updated.',
|
||||
eventType: MoxieCRMEventType.TASK_UPDATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.PROJECT_TASK_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'task_deleted',
|
||||
displayName: 'Task Deleted',
|
||||
description: 'Triggered when an existing task is deleted.',
|
||||
eventType: MoxieCRMEventType.TASK_DELETED,
|
||||
sampleData: MoxieCRMWebhookSampleData.PROJECT_TASK_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'client_task_approval',
|
||||
displayName: 'Client Task Approval',
|
||||
description: 'Triggered when a task is moved to client approval.',
|
||||
eventType: MoxieCRMEventType.TASK_APPROVAL,
|
||||
sampleData: MoxieCRMWebhookSampleData.PROJECT_TASK_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'form_submitted',
|
||||
displayName: 'Form Submitted',
|
||||
description: 'Triggered when a new form is submitted.',
|
||||
eventType: MoxieCRMEventType.FORM_SUBMITTED,
|
||||
sampleData: MoxieCRMWebhookSampleData.FORM_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'time_entry_created',
|
||||
displayName: 'Time Entry Created',
|
||||
description: 'Triggered when a new time entry is created.',
|
||||
eventType: MoxieCRMEventType.TIME_ENTRY_CREATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.TIME_ENTRY_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'time_entry_updated',
|
||||
displayName: 'Time Entry Updated',
|
||||
description: 'Triggered when an existing time entry is updated.',
|
||||
eventType: MoxieCRMEventType.TIME_ENTRY_UPDATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.TIME_ENTRY_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'time_entry_deleted',
|
||||
displayName: 'Time Entry Deleted',
|
||||
description: 'Triggered when an existing time entry is deleted.',
|
||||
eventType: MoxieCRMEventType.TIME_ENTRY_DELETED,
|
||||
sampleData: MoxieCRMWebhookSampleData.TIME_ENTRY_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'meeting_scheduled',
|
||||
displayName: 'Meeting Scheduled',
|
||||
description: 'Triggered when a new meeting is scheduled.',
|
||||
eventType: MoxieCRMEventType.MEETING_SCHEDULED,
|
||||
sampleData: MoxieCRMWebhookSampleData.MEETING_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'meeting_updated',
|
||||
displayName: 'Meeting Updated',
|
||||
description: 'Triggered when an existing meeting is updated.',
|
||||
eventType: MoxieCRMEventType.MEETING_UPDATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.MEETING_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'meeting_cancelled',
|
||||
displayName: 'Meeting Cancelled',
|
||||
description: 'Triggered when a meeting is cancelled.',
|
||||
eventType: MoxieCRMEventType.MEETING_CANCELLED,
|
||||
sampleData: MoxieCRMWebhookSampleData.MEETING_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'opportunity_created',
|
||||
displayName: 'Opportunity Created',
|
||||
description: 'Triggered when a new pipeline opportunity is created.',
|
||||
eventType: MoxieCRMEventType.OPPORTUNITY_CREATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.OPPORTUNITY_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'opportunity_updated',
|
||||
displayName: 'Opportunity Updated',
|
||||
description: 'Triggered when an existing opportunity is updated.',
|
||||
eventType: MoxieCRMEventType.OPPORTUNITY_UPDATED,
|
||||
sampleData: MoxieCRMWebhookSampleData.OPPORTUNITY_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'opportunity_deleted',
|
||||
displayName: 'Opportunity Deleted',
|
||||
description: 'Triggered when an existing pipeline opportunity is deleted.',
|
||||
eventType: MoxieCRMEventType.OPPORTUNITY_DELETED,
|
||||
sampleData: MoxieCRMWebhookSampleData.OPPORTUNITY_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'invoice_sent',
|
||||
displayName: 'Invoice Sent',
|
||||
description: 'Triggered when an invoice is sent.',
|
||||
eventType: MoxieCRMEventType.INVOICE_SENT,
|
||||
sampleData: MoxieCRMWebhookSampleData.INVOICE_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
{
|
||||
name: 'payment_received',
|
||||
displayName: 'Payment Received',
|
||||
description: 'Triggered when a payment is received.',
|
||||
eventType: MoxieCRMEventType.PAYMENT_RECEIVED,
|
||||
sampleData: MoxieCRMWebhookSampleData.INVOICE_EVENT_SAMPLE_DATA,
|
||||
},
|
||||
].map((props) => moxieCRMRegisterTrigger(props));
|
||||
@@ -0,0 +1,52 @@
|
||||
import {
|
||||
TriggerStrategy,
|
||||
createTrigger,
|
||||
Property,
|
||||
} from '@activepieces/pieces-framework';
|
||||
import { MoxieCRMEventType } from '.';
|
||||
import { moxieCRMAuth } from '../../';
|
||||
export const moxieCRMRegisterTrigger = ({
|
||||
name,
|
||||
displayName,
|
||||
description,
|
||||
eventType,
|
||||
sampleData,
|
||||
}: {
|
||||
name: string;
|
||||
displayName: string;
|
||||
description: string;
|
||||
eventType: MoxieCRMEventType;
|
||||
sampleData: unknown;
|
||||
}) =>
|
||||
createTrigger({
|
||||
auth: moxieCRMAuth,
|
||||
name: `moxie_trigger_${name}`,
|
||||
displayName,
|
||||
description,
|
||||
props: {
|
||||
md: Property.MarkDown({
|
||||
value: `
|
||||
- Go to the **Workspace Settngs -> Connected Apps -> Integration** section.
|
||||
- Under **Custom Integration** , click on **Add Rest Hook**.
|
||||
- Click on **Integrations** section.
|
||||
- In the endpoint field, paste the following URL:
|
||||
\`\`\`text
|
||||
{{webhookUrl}}
|
||||
\`\`\`
|
||||
|
||||
- Select the event as **\`${displayName}\`** and click on **Save**.
|
||||
`,
|
||||
}),
|
||||
},
|
||||
type: TriggerStrategy.WEBHOOK,
|
||||
sampleData: sampleData,
|
||||
async onEnable(context) {
|
||||
// Empty
|
||||
},
|
||||
async onDisable(context) {
|
||||
// Empty
|
||||
},
|
||||
async run(context) {
|
||||
return [context.payload.body];
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user