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,47 @@
|
||||
import { HttpMethod } from '@activepieces/pieces-common';
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { memAuth } from '../../index';
|
||||
import { makeRequest } from '../common';
|
||||
|
||||
export const createMemAction = createAction({
|
||||
auth: memAuth,
|
||||
name: 'create_mem',
|
||||
displayName: 'Create Mem',
|
||||
description: 'Save any content to Mem.ai for intelligent processing and future reference.',
|
||||
props: {
|
||||
input: Property.LongText({
|
||||
displayName: 'Input',
|
||||
required: true,
|
||||
description: 'Raw content you want to remember - HTML, emails, transcripts, or simple notes.',
|
||||
}),
|
||||
instructions: Property.LongText({
|
||||
displayName: 'Instructions',
|
||||
required: false,
|
||||
description: 'Optional guidance on how you want this content processed or remembered.',
|
||||
}),
|
||||
context: Property.LongText({
|
||||
displayName: 'Context',
|
||||
required: false,
|
||||
description: 'Additional background information to relate this to your existing knowledge.',
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { input, instructions, context: contextInfo } = context.propsValue;
|
||||
const apiKey = context.auth.secret_text;
|
||||
|
||||
const body = {
|
||||
input,
|
||||
...(instructions ? { instructions } : {}),
|
||||
...(contextInfo ? { context: contextInfo } : {}),
|
||||
};
|
||||
|
||||
const result = await makeRequest(
|
||||
apiKey,
|
||||
HttpMethod.POST,
|
||||
`/mem-it`,
|
||||
body
|
||||
);
|
||||
|
||||
return result;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,52 @@
|
||||
import { HttpMethod } from '@activepieces/pieces-common';
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { memAuth } from '../../index';
|
||||
import { makeRequest } from '../common';
|
||||
|
||||
export const createNoteAction = createAction({
|
||||
auth: memAuth,
|
||||
name: 'create_note',
|
||||
displayName: 'Create Note',
|
||||
description: 'Log a plain-text Markdown note into Mem, optionally with formatting, templates, collections, and timestamps.',
|
||||
props: {
|
||||
content: Property.LongText({
|
||||
displayName: 'Content',
|
||||
required: true,
|
||||
description: 'Markdown-formatted content. First line is treated as the note title.',
|
||||
}),
|
||||
id: Property.ShortText({
|
||||
displayName: 'Note ID',
|
||||
required: false,
|
||||
description: 'Optional UUID to assign to the note.',
|
||||
}),
|
||||
add_to_collections: Property.Array({
|
||||
displayName: 'Add to Collections',
|
||||
required: false,
|
||||
description: 'Collection titles or IDs to assign this note to. New collections will be created if they don’t exist.',
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const {
|
||||
content,
|
||||
id,
|
||||
add_to_collections,
|
||||
} = context.propsValue;
|
||||
|
||||
const apiKey = context.auth.secret_text;
|
||||
|
||||
const body: Record<string, unknown> = {
|
||||
content,
|
||||
...(id ? { id } : {}),
|
||||
...(add_to_collections ? { add_to_collections } : {}),
|
||||
};
|
||||
|
||||
const result = await makeRequest(
|
||||
apiKey,
|
||||
HttpMethod.POST,
|
||||
'/notes',
|
||||
body
|
||||
);
|
||||
|
||||
return result;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,30 @@
|
||||
import { createAction, Property } from '@activepieces/pieces-framework';
|
||||
import { HttpMethod } from '@activepieces/pieces-common';
|
||||
import { makeRequest } from '../common';
|
||||
import { memAuth } from '../../index';
|
||||
|
||||
export const deleteNoteAction = createAction({
|
||||
auth: memAuth,
|
||||
name: 'delete_note',
|
||||
displayName: 'Delete Note',
|
||||
description: 'Delete a note in Mem by its ID.',
|
||||
props: {
|
||||
note_id: Property.ShortText({
|
||||
displayName: 'Note ID',
|
||||
required: true,
|
||||
description: 'The ID of the note to delete.',
|
||||
}),
|
||||
},
|
||||
async run(context) {
|
||||
const { note_id } = context.propsValue;
|
||||
const apiKey = context.auth.secret_text;
|
||||
|
||||
const result = await makeRequest(
|
||||
apiKey,
|
||||
HttpMethod.DELETE,
|
||||
`/notes/${note_id}`
|
||||
);
|
||||
|
||||
return result;
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
import { HttpMethod, httpClient } from '@activepieces/pieces-common';
|
||||
|
||||
export async function makeRequest(
|
||||
apiKey: string,
|
||||
method: HttpMethod,
|
||||
path: string,
|
||||
body?: unknown
|
||||
) {
|
||||
const url = `https://api.mem.ai/v2${path}`;
|
||||
|
||||
const response = await httpClient.sendRequest({
|
||||
method,
|
||||
url,
|
||||
headers: {
|
||||
Authorization: `Bearer ${apiKey}`,
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body,
|
||||
});
|
||||
|
||||
return response.body;
|
||||
}
|
||||
Reference in New Issue
Block a user